diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /modules-available/permissionmanager/hooks/translation-global.inc.php | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-usb-lock-off.tar.gz slx-admin-usb-lock-off.tar.xz slx-admin-usb-lock-off.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'modules-available/permissionmanager/hooks/translation-global.inc.php')
-rw-r--r-- | modules-available/permissionmanager/hooks/translation-global.inc.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/modules-available/permissionmanager/hooks/translation-global.inc.php b/modules-available/permissionmanager/hooks/translation-global.inc.php new file mode 100644 index 00000000..4810a719 --- /dev/null +++ b/modules-available/permissionmanager/hooks/translation-global.inc.php @@ -0,0 +1,38 @@ +<?php + +$HANDLER = array(); + +if (file_exists('modules/' . $moduleName . '/permissions/permissions.json')) { + + /** + * List of valid subsections + */ + $HANDLER['subsections'] = array( + 'permissions' + ); + + /* + * Handlers for the subsections that will return an array of expected tags. + * This is optional, if you don't want to define expected tags, don't create a function. + */ + + /** + * Configuration categories. + * + * @param \Module $module + * @return array + */ + $HANDLER['grep_permissions'] = function ($module) { + $file = 'modules/' . $module->getIdentifier() . '/permissions/permissions.json'; + if (!file_exists($file)) + return []; + $array = json_decode(file_get_contents($file), true); + if (!is_array($array)) + return []; + foreach ($array as &$entry) { + $entry = true; + } + return $array; + }; + +} |