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 (c) 2000-2016 XOOPS Project (www.xoops.org) 16 * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) 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 */ 26 27$groups = $GLOBALS['xoopsUser']->getGroups(); 28$all_ok = false; 29if (!in_array(XOOPS_GROUP_ADMIN, $groups)) { 30 /* @var XoopsGroupPermHandler $sysperm_handler */ 31 $sysperm_handler = xoops_getHandler('groupperm'); 32 $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups); 33} else { 34 $all_ok = true; 35} 36require_once $GLOBALS['xoops']->path('/class/xoopslists.php'); 37// include system category definitions 38include_once $GLOBALS['xoops']->path('/modules/system/constants.php'); 39 40$admin_dir = $GLOBALS['xoops']->path('/modules/system/admin'); 41$dirlist = XoopsLists::getDirListAsArray($admin_dir); 42$index = 0; 43foreach ($dirlist as $file) { 44 if (file_exists($admin_dir . '/' . $file . '/xoops_version.php')) { 45 include $admin_dir . '/' . $file . '/xoops_version.php'; 46 if ($modversion['hasAdmin']) { 47 if (xoops_getModuleOption('active_' . $file, 'system')) { 48 $category = isset($modversion['category']) ? (int)$modversion['category'] : 0; 49 if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) { 50 $adminmenu[$index]['title'] = trim($modversion['name']); 51 $adminmenu[$index]['desc'] = trim($modversion['description']); 52 $adminmenu[$index]['link'] = 'admin.php?fct=' . $file; 53 $adminmenu[$index]['icon'] = 'icons/' . $modversion['image']; 54 } 55 } 56 } 57 unset($modversion); 58 } 59 ++$index; 60} 61unset($dirlist); 62