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 
13 
14 /*
15  * Xoops Cpanel oxygen menu
16  *
17  * @copyright The XOOPS project http://sf.net/projects/xoops/
18  * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
19  * @package system
20  * @usbpackage GUI
21  * @since 2.4
22  * @author Mamba <mambax7@gmail.com>
23  * @author Mojtabajml <jamali.mojtaba@gmail.com>
24  * @author Voltan <djvoltan@gmail.com>
25  * @author BitC3R0 <BitC3R0@gmail.com>
26  * @author trabis <lusopoemas@gmail.com>
27  * @version 1.2
28  * @version $Id$
29  */
30 
32 $groups = array();
33 if (is_object($xoops->user)) {
34  $groups = $xoops->user->getGroups();
35 }
36 $all_ok = false;
37 if (!in_array(FixedGroups::ADMIN, $groups)) {
38  $sysperm_handler = $xoops->getHandlerGroupperm();
39  $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
40 } else {
41  $all_ok = true;
42 }
43 // include system category definitions
44 include_once $xoops->path('/modules/system/constants.php');
45 
46 $admin_dir = $xoops->path('/modules/system/admin');
47 $dirlist = XoopsLists::getDirListAsArray($admin_dir);
48 $index = 0;
49 foreach ($dirlist as $file) {
50  if (XoopsLoad::fileExists($admin_dir . '/' . $file . '/xoops_version.php')) {
51  include $admin_dir . '/' . $file . '/xoops_version.php';
52  if ($modversion['hasAdmin']) {
53  if ($xoops->getModuleConfig('active_' . $file, 'system')) {
54  $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
55  if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
56  $adminmenu[$index]['title'] = trim($modversion['name']);
57  $adminmenu[$index]['desc'] = trim($modversion['description']);
58  $adminmenu[$index]['link'] = 'admin.php?fct=' . $file;
59  $adminmenu[$index]['icon'] = 'icons/' . $modversion['image'];
60  }
61  }
62  }
63  unset($modversion);
64  }
65  ++$index;
66 }
67 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