Passed
Push — master ( d35171...b3de3c )
by Michael
02:47
created

admin/menu.php (1 issue)

Labels
Severity
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
 * Contact module
14
 *
15
 * @copyright   XOOPS Project (https://xoops.org)
16
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
17
 * @author      Kazumi Ono (aka Onokazu)
18
 * @author      Trabis <[email protected]>
19
 * @author      Hossein Azizabadi (AKA Voltan)
20
 */
21
22
use Xmf\Module\Admin;
23
use XoopsModules\Contact\{
24
    Helper
25
};
26
/** @var Helper $helper */
27
28
$moduleDirName = basename(dirname(__DIR__));
29
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
30
31
$helper = Helper::getInstance();
32
$helper->loadLanguage('common');
33
$helper->loadLanguage('feedback');
34
35
$pathIcon32 = Admin::menuIconPath('');
36
$pathModIcon32 = XOOPS_URL .   '/modules/' . $moduleDirName . '/assets/images/icons/32/';
37
if (is_object($helper->getModule()) && false !== $helper->getModule()->getInfo('modicons32')) {
38
    $pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32'));
0 ignored issues
show
It seems like $helper->getModule()->getInfo('modicons32') can also be of type array; however, parameter $url of Xmf\Module\Helper\GenericHelper::url() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

38
    $pathModIcon32 = $helper->url(/** @scrutinizer ignore-type */ $helper->getModule()->getInfo('modicons32'));
Loading history...
39
}
40
41
$adminmenu[] = [
42
    'title' => _MI_CONTACT_MENU_HOME,
43
    'desc'  => _MI_CONTACT_MENU_HOME_DESC,
44
    'icon'  => $pathIcon32 . '/home.png',
45
    'link'  => 'admin/index.php',
46
];
47
48
$adminmenu[] = [
49
    'title' => _MI_CONTACT_MENU_CONTACT,
50
    'desc'  => _MI_CONTACT_MENU_CONTACT_DESC,
51
    'icon'  => $pathIcon32 . '/content.png',
52
    'link'  => 'admin/main.php',
53
];
54
55
$adminmenu[] = [
56
    'title' => _MI_CONTACT_MENU_LOGS,
57
    'desc'  => _MI_CONTACT_MENU_LOGS_DESC,
58
    'icon'  => $pathIcon32 . '/identity.png',
59
    'link'  => 'admin/log.php',
60
];
61
62
$adminmenu[] = [
63
    'title' => _MI_CONTACT_MENU_TOOLS,
64
    'desc'  => _MI_CONTACT_MENU_TOOLS_DESC,
65
    'icon'  => $pathIcon32 . '/delete.png',
66
    'link'  => 'admin/tools.php',
67
];
68
69
// Blocks Admin
70
$adminmenu[] = [
71
    'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS'),
72
    'link' => 'admin/blocksadmin.php',
73
    'icon' => $pathIcon32 . '/block.png',
74
];
75
76
$adminmenu[] = [
77
    'title' => _MI_CONTACT_MENU_ABOUT,
78
    'desc'  => _MI_CONTACT_MENU_ABOUT_DESC,
79
    'icon'  => $pathIcon32 . '/about.png',
80
    'link'  => 'admin/about.php',
81
];
82