Issues (3083)

htdocs/modules/system/themes/dark/menu.php (2 issues)

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.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
17
 * @package     system
18
 * @usbpackage  GUI
19
 * @since       2.4
20
 * @author      Mamba       <[email protected]>
21
 * @author      Mojtabajml  <[email protected]>
22
 * @author      Voltan      <[email protected]>
23
 * @author      BitC3R0     <[email protected]>
24
 * @author      trabis      <[email protected]>
25
 */
26
27
$groups = $GLOBALS['xoopsUser']->getGroups();
28
$all_ok = false;
29
if (!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
}
36
require_once $GLOBALS['xoops']->path('/class/xoopslists.php');
37
// include system category definitions
38
include_once $GLOBALS['xoops']->path('/modules/system/constants.php');
39
40
$iconsSet = xoops_getModuleOption('typeicons', 'system');
0 ignored issues
show
Deprecated Code introduced by
The function xoops_getModuleOption() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

40
$iconsSet = /** @scrutinizer ignore-deprecated */ xoops_getModuleOption('typeicons', 'system');
Loading history...
41
if ($iconsSet == '') {
42
    $iconsSet = 'transition';
43
}
44
45
$admin_dir = $GLOBALS['xoops']->path('/modules/system/admin');
46
$dirlist   = XoopsLists::getDirListAsArray($admin_dir);
47
$index     = 0;
48
foreach ($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')) {
0 ignored issues
show
Deprecated Code introduced by
The function xoops_getModuleOption() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

52
            if (/** @scrutinizer ignore-deprecated */ xoops_getModuleOption('active_' . $file, 'system')) {
Loading history...
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
}
66
unset($dirlist);
67