blob: cf2166bc20948612b52e62019e493ff40eed6fe7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?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.
*/
$HANDLER['grep_permissions'] = function (Module $module): array {
$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;
};
}
|