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$iconsSet = xoops_getModuleOption('typeicons', 'system');
41if ($iconsSet == '') {
42    $iconsSet = 'transition';
43}
44
45$admin_dir = $GLOBALS['xoops']->path('/modules/system/admin');
46$dirlist   = XoopsLists::getDirListAsArray($admin_dir);
47$index     = 0;
48foreach ($dirlist as $file) {
49    if (file_exists($admin_dir . '/' . $file . '/xoops_version.php')) {
50        include $admin_dir . '/' . $file . '/xoops_version.php';
51        if ($modversion['hasAdmin']) {
52            if (xoops_getModuleOption('active_' . $file, 'system')) {
53                $category = isset($modversion['category']) ? (int)$modversion['category'] : 0;
54                if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
55                    $adminmenu[$index]['title'] = trim($modversion['name']);
56                    $adminmenu[$index]['desc']  = trim($modversion['description']);
57                    $adminmenu[$index]['link']  = 'admin.php?fct=' . $file;
58                    $adminmenu[$index]['icon']  = 'icons/' . $iconsSet . '/' . $modversion['image'];
59                }
60            }
61        }
62        unset($modversion);
63    }
64    ++$index;
65}
66unset($dirlist);
67