1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/* |
3
|
|
|
XOOPS - PHP Content Management System |
4
|
|
|
Copyright (c) 2000-2020 XOOPS.org |
5
|
|
|
<https://xoops.org> |
6
|
|
|
This program is free software; you can redistribute it and/or modify |
7
|
|
|
it under the terms of the GNU General Public License as published by |
8
|
|
|
the Free Software Foundation; either version 2 of the License, or |
9
|
|
|
(at your option) any later version. |
10
|
|
|
|
11
|
|
|
You may not change or alter any portion of this comment or credits |
12
|
|
|
of supporting developers from this source code or any supporting |
13
|
|
|
source code which is considered copyrighted (c) material of the |
14
|
|
|
original comment or credit authors. |
15
|
|
|
|
16
|
|
|
This program is distributed in the hope that it will be useful, |
17
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
18
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19
|
|
|
GNU General Public License for more details. |
20
|
|
|
|
21
|
|
|
You should have received a copy of the GNU General Public License |
22
|
|
|
along with this program; if not, write to the Free Software |
23
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Administration menu for the XoopsPoll Module |
28
|
|
|
* |
29
|
|
|
* @copyright :: {@link https://xoops.org/ XOOPS Project} |
30
|
|
|
* @license :: {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2.0 or later} |
31
|
|
|
* @subpackage:: admin |
32
|
|
|
* @since :: 2.5.0 |
33
|
|
|
* @author :: XOOPS Module Team |
34
|
|
|
*/ |
35
|
|
|
|
36
|
|
|
use Xmf\Module\Admin; |
37
|
|
|
use XoopsModules\Xoopspoll\{ |
38
|
|
|
Common, |
39
|
|
|
Helper |
40
|
|
|
}; |
41
|
|
|
|
42
|
|
|
include \dirname(__DIR__) . '/preloads/autoloader.php'; |
43
|
|
|
|
44
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
45
|
|
|
$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
46
|
|
|
|
47
|
|
|
$helper = Helper::getInstance(); |
48
|
|
|
$helper->loadLanguage('common'); |
49
|
|
|
$helper->loadLanguage('feedback'); |
50
|
|
|
|
51
|
|
|
$pathIcon32 = Admin::menuIconPath(''); |
52
|
|
|
$pathModIcon32 = XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icons/32/'; |
53
|
|
|
if (is_object($helper->getModule()) && false !== $helper->getModule()->getInfo('modicons32')) { |
54
|
|
|
$pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32')); |
|
|
|
|
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Admin Menu |
59
|
|
|
*/ |
60
|
|
|
$adminmenu[] = [ |
61
|
|
|
'title' => _MI_XOOPSPOLL_HOME, |
62
|
|
|
'link' => 'admin/index.php', |
63
|
|
|
'desc' => _MI_XOOPSPOLL_HOMEDSC, |
64
|
|
|
'icon' => $pathIcon32 . '/home.png', |
65
|
|
|
]; |
66
|
|
|
|
67
|
|
|
$adminmenu[] = [ |
68
|
|
|
'title' => _MI_XOOPSPOLL_ADMENU1, |
69
|
|
|
'link' => 'admin/main.php', |
70
|
|
|
'desc' => _MI_XOOPSPOLL_ADMENU1DSC, |
71
|
|
|
'icon' => $pathIcon32 . '/poll.png', |
72
|
|
|
]; |
73
|
|
|
|
74
|
|
|
//$adminmenu[] = [ |
75
|
|
|
// 'title' => _MI_XOOPSPOLL_ADMENU2, |
76
|
|
|
// 'link' => 'admin/utility.php', |
77
|
|
|
// 'desc' => _MI_XOOPSPOLL_ADMENU2DSC, |
78
|
|
|
// 'icon' => $pathIcon32 . '/wizard.png', |
79
|
|
|
//]; |
80
|
|
|
|
81
|
|
|
// Blocks Admin |
82
|
|
|
$adminmenu[] = [ |
83
|
|
|
'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS'), |
84
|
|
|
'link' => 'admin/blocksadmin.php', |
85
|
|
|
'icon' => $pathIcon32 . '/block.png', |
86
|
|
|
]; |
87
|
|
|
|
88
|
|
|
if (is_object($helper->getModule()) && $helper->getConfig('displayDeveloperTools')) { |
89
|
|
|
$adminmenu[] = [ |
90
|
|
|
'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE'), |
91
|
|
|
'link' => 'admin/migrate.php', |
92
|
|
|
'icon' => $pathIcon32 . '/database_go.png', |
93
|
|
|
]; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
$adminmenu[] = [ |
97
|
|
|
'title' => _MI_XOOPSPOLL_ADABOUT, |
98
|
|
|
'link' => 'admin/about.php', |
99
|
|
|
'desc' => _MI_XOOPSPOLL_ADABOUTDSC, |
100
|
|
|
'icon' => $pathIcon32 . '/about.png', |
101
|
|
|
]; |
102
|
|
|
|