-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
82 lines (78 loc) · 2.93 KB
/
menu.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Contains links to admin options and images for those admin options
*
* @copyright http://www.impresscms.org/ The ImpressCMS Project
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @package Administration
* @since 1.3
*/
// Loading System Configuration Links
if (is_object(icms::$user)) {
$groups = icms::$user->getGroups();
} else {
$groups = array();
}
$all_ok = false;
if (!in_array(ICMS_GROUP_ADMIN, $groups)) {
$sysperm_handler = icms::handler('icms_member_groupperm');
$ok_syscats = & $sysperm_handler->getItemIds('system_admin', $groups);
} else {
$all_ok = true;
}
require_once ICMS_ROOT_PATH . '/modules/system/constants.php';
$admin_dir = ICMS_ROOT_PATH . '/modules/system/admin';
$dirlist = icms_core_Filesystem::getDirList($admin_dir);
icms_loadLanguageFile('system', 'admin');
icms_loadLanguageFile('system', 'preferences', true);
$adminmenu = array();
foreach ($dirlist as $file) {
icms_loadLanguageFile('system', $file, true);
$mod_version_file = 'icms_version.php';
include $admin_dir . '/' . $file . '/' . $mod_version_file;
if ($modversion['hasAdmin']) {
$category = isset($modversion['category'])?(int) ($modversion['category']):0;
if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
$adminmenu[$modversion['group']]['title'] = $modversion['group'];
$adminmenu[$modversion['group']]['link'] = "#";
$adminmenu[$modversion['group']]['absolute'] = 1;
$adminmenu[$modversion['group']]['hassubs'] = 1;
if ($modversion['name'] == _MD_AM_PREF) {
//Getting categories of preferences to include in dropdownmenu
icms_loadLanguageFile('system', 'preferences', true);
$confcat_handler = icms::handler('icms_config_category');
$confcats = $confcat_handler->getObjects();
$catcount = count($confcats);
if ($catcount > 0) {
for ($x = 0; $x < $catcount; $x++) {
$subs[$x]['title'] = constant($confcats[$x]->confcat_name);
$subs[$x]['link'] = ICMS_URL . '/modules/system/admin.php?fct=preferences'
. '&op=show&confcat_id=' . $confcats[$x]->confcat_id;
}
$adminmenu[$modversion['group']]['subs'][] = array(
'title' => $modversion['name'],
'link' => ICMS_URL . '/modules/system/admin.php?fct=' . $file,
'icon' => 'admin/' . $file . '/images/' . $file . '.png',
'small' => 'admin/' . $file . '/images/' . $file . '_small.png',
'id' => $modversion['category'],
'hassubs' => 1,
'subs' => $subs
);
}
} else {
$adminmenu[$modversion['group']]['subs'][] = array(
'title' => $modversion['name'],
'link' => ICMS_URL . '/modules/system/admin.php?fct=' . $file,
'icon' => 'admin/' . $file . '/images/' . $file . '.png',
'small' => 'admin/' . $file . '/images/' . $file . '_small.png',
'id' => $modversion['category']
);
}
}
}
unset($modversion);
}
if (count($adminmenu) > 0) {
ksort($adminmenu);
return $adminmenu;
}