XOOPS  2.6.0
menu.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
24 $groups = array();
25 if (is_object($xoops->user)) {
26  $groups = $xoops->user->getGroups();
27 }
28 
29 $all_ok = false;
30 if (!in_array(FixedGroups::ADMIN, $groups)) {
31  $sysperm_handler = $xoops->getHandlerGroupperm();
32  $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
33 } else {
34  $all_ok = true;
35 }
36 // include system category definitions
37 include_once $xoops->path('/modules/system/constants.php');
38 
39 $admin_dir = $xoops->path('/modules/system/admin');
40 $dirlist = XoopsLists::getDirListAsArray($admin_dir);
41 $index = 0;
42 foreach ($dirlist as $file) {
43  if (XoopsLoad::fileExists($fileinc = $admin_dir . '/' . $file . '/xoops_version.php')) {
44  include $fileinc;
45  unset($fileinc);
46  if ($modversion['hasAdmin']) {
47  if ($xoops->getModuleConfig('active_' . $file, 'system')) {
48  $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
49  if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
50  $adminmenu[$index]['title'] = trim($modversion['name']);
51  $adminmenu[$index]['link'] = 'admin.php?fct=' . $file;
52  $adminmenu[$index]['image'] = $modversion['image'];
53  }
54  }
55  }
56  unset($modversion);
57  }
58  ++$index;
59 }
60 unset($dirlist);
$groups
Definition: menu.php:24
static getInstance()
Definition: Xoops.php:160
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
Definition: browse.php:55
$admin_dir
Definition: menu.php:39
$index
Definition: menu.php:41
if(is_object($xoops->user)) $all_ok
Definition: menu.php:29
$dirlist
Definition: menu.php:40
static fileExists($file)
Definition: xoopsload.php:506
$modversion
$adminmenu
Definition: menu.php:23
$xoops
Definition: menu.php:23