Skip to content

Commit

Permalink
Namespaces updates
Browse files Browse the repository at this point in the history
Small tweaks and carry through of methods used in other core object classes to identify protected data keys
  • Loading branch information
smg6511 committed Sep 9, 2024
1 parent 239a57c commit ad0a372
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/lexicon/en/namespace.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$_lang['namespace_name_desc'] = 'Specify a name for the Namespace here.';
$_lang['namespace_path'] = 'Core Path';
$_lang['namespace_path_desc'] = 'Specify an absolute path to the core for this Namespace here. You may use placeholders like {core_path}. Example: {core_path}components/democomponent/';
$_lang['namespace_remove_confirm'] = 'Are you sure you want to delete "[[+name]]" namespace and all related content?';
$_lang['namespace_remove_confirm'] = 'Are you sure you want to delete the "[[+name]]" namespace and all related content?';
$_lang['namespace_remove_multiple_confirm'] = 'Are you sure you want to delete these namespaces and all their related content?';
$_lang['namespaces'] = 'Namespaces';
$_lang['namespaces_desc'] = 'Namespaces are global identifiers for packages and components, registering their vehicles, lexicon entries and resources all together.';
24 changes: 24 additions & 0 deletions core/src/Revolution/modNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
class modNamespace extends modAccessibleObject
{
public const NAMESPACE_CORE = 'core';

public function save($cacheFlag = null)
{
$saved = parent::save();
Expand Down Expand Up @@ -157,4 +159,26 @@ public function findPolicy($context = '')

return $policy;
}

/**
* Returns a list of core Namespaces
*
* @return array
*/
public static function getCoreNamespaces()
{
return [
self::NAMESPACE_CORE
];
}

/**
* @param string $key The key of the Context
*
* @return bool
*/
public function isCoreNamespace($key)
{
return in_array($key, static::getCoreNamespaces(), true);
}
}

0 comments on commit ad0a372

Please sign in to comment.