XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
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 
12 /*
13  * Xoops Cpanel oxygen menu
14  *
15  * @copyright The XOOPS project http://sf.net/projects/xoops/
16  * @license http://www.fsf.org/copyleft/gpl.html GNU public license
17  * @package system
18  * @usbpackage GUI
19  * @since 2.4
20  * @author Mamba <mambax7@gmail.com>
21  * @author Mojtabajml <jamali.mojtaba@gmail.com>
22  * @author Voltan <djvoltan@gmail.com>
23  * @author BitC3R0 <BitC3R0@gmail.com>
24  * @author trabis <lusopoemas@gmail.com>
25  * @version 1.2
26  * @version $Id: menu.php 8066 2011-11-06 05:09:33Z beckmi $
27  */
28 
29 $groups = $GLOBALS['xoopsUser']->getGroups();
30 $all_ok = false;
31 if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
32  $sysperm_handler =& xoops_gethandler('groupperm');
33  $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
34 } else {
35  $all_ok = true;
36 }
37 require_once $GLOBALS['xoops']->path( '/class/xoopslists.php' );
38 // include system category definitions
39 include_once $GLOBALS['xoops']->path( '/modules/system/constants.php' );
40 
41 $admin_dir = $GLOBALS['xoops']->path( '/modules/system/admin' );
42 $dirlist = XoopsLists::getDirListAsArray($admin_dir);
43 $index = 0;
44 foreach($dirlist as $file){
45  if ( file_exists($admin_dir.'/'.$file.'/xoops_version.php') ) {
46  include $admin_dir.'/'.$file.'/xoops_version.php';
47  if ($modversion['hasAdmin']) {
48  if ( xoops_getModuleOption('active_' . $file, 'system' ) ) {
49  $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
50  if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
51  $adminmenu[$index]['title'] = trim($modversion['name']);
52  $adminmenu[$index]['desc'] = trim($modversion['description']);
53  $adminmenu[$index]['link'] = 'admin.php?fct=' . $file;
54  $adminmenu[$index]['icon'] = 'icons/' . $modversion['image'];
55  }
56  }
57  }
58  unset($modversion);
59  }
60  $index++;
61 }
62 unset($dirlist);
63 ?>