1
|
|
|
<?php declare(strict_types=1); |
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
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
15
|
|
|
* @author XOOPS Development Team |
16
|
|
|
*/ |
17
|
|
|
defined('XOOPS_ROOT_PATH') || exit('Restricted access'); |
18
|
|
|
|
19
|
|
|
use Xmf\Module\Admin; |
20
|
|
|
use XoopsModules\Xoopsheadline\Helper; |
21
|
|
|
|
22
|
|
|
/** @var Helper $helper */ |
23
|
|
|
include \dirname(__DIR__) . '/preloads/autoloader.php'; |
24
|
|
|
|
25
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
26
|
|
|
$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
27
|
|
|
|
28
|
|
|
$helper = Helper::getInstance(); |
29
|
|
|
$helper->loadLanguage('common'); |
30
|
|
|
$helper->loadLanguage('feedback'); |
31
|
|
|
|
32
|
|
|
$pathIcon32 = Admin::menuIconPath(''); |
33
|
|
|
$pathModIcon32 = XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icons/32/'; |
34
|
|
|
if (is_object($helper->getModule()) && false !== $helper->getModule()->getInfo('modicons32')) { |
35
|
|
|
$pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32')); |
|
|
|
|
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
$adminmenu[] = [ |
39
|
|
|
'title' => _MI_XOOPSHEADLINE_MENU_ADMININDEX, |
40
|
|
|
'link' => 'admin/index.php', |
41
|
|
|
'desc' => _MI_XOOPSHEADLINE_MENU_ADMININDEX_DESC, |
42
|
|
|
'icon' => $pathIcon32 . '/home.png', |
43
|
|
|
]; |
44
|
|
|
|
45
|
|
|
$adminmenu[] = [ |
46
|
|
|
'title' => _MI_XOOPSHEADLINE_MENU_ADMINHL, |
47
|
|
|
'link' => 'admin/main.php', |
48
|
|
|
'desc' => _MI_XOOPSHEADLINE_MENU_ADMINHL_DESC, |
49
|
|
|
'icon' => $pathIcon32 . '/content.png', |
50
|
|
|
]; |
51
|
|
|
|
52
|
|
|
// Blocks Admin |
53
|
|
|
$adminmenu[] = [ |
54
|
|
|
'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS'), |
55
|
|
|
'link' => 'admin/blocksadmin.php', |
56
|
|
|
'icon' => $pathIcon32 . '/block.png', |
57
|
|
|
]; |
58
|
|
|
|
59
|
|
|
if (is_object($helper->getModule()) && $helper->getConfig('displayDeveloperTools')) { |
60
|
|
|
$adminmenu[] = [ |
61
|
|
|
'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE'), |
62
|
|
|
'link' => 'admin/migrate.php', |
63
|
|
|
'icon' => $pathIcon32 . '/database_go.png', |
64
|
|
|
]; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
$adminmenu[] = [ |
68
|
|
|
'title' => _MI_XOOPSHEADLINE_MENU_ADMINABOUT, |
69
|
|
|
'link' => 'admin/about.php', |
70
|
|
|
'desc' => _MI_XOOPSHEADLINE_MENU_ADMINABOUT_DESC, |
71
|
|
|
'icon' => $pathIcon32 . '/about.png', |
72
|
|
|
]; |
73
|
|
|
|