|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
use Xmf\Module\Admin; |
|
4
|
|
|
use XoopsModules\Songlist\Helper; |
|
5
|
|
|
|
|
6
|
|
|
require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
7
|
|
|
|
|
8
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
|
9
|
|
|
$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
10
|
|
|
|
|
11
|
|
|
$helper = Helper::getInstance(); |
|
12
|
|
|
$helper->loadLanguage('common'); |
|
13
|
|
|
$helper->loadLanguage('feedback'); |
|
14
|
|
|
|
|
15
|
|
|
$pathIcon32 = Admin::menuIconPath(''); |
|
16
|
|
|
$pathModIcon32 = XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icons/32/'; |
|
17
|
|
|
if (is_object($helper->getModule()) && false !== $helper->getModule()->getInfo('modicons32')) { |
|
18
|
|
|
$pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32')); |
|
|
|
|
|
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
/** @var \XoopsModuleHandler $moduleHandler */ |
|
22
|
|
|
$moduleHandler = xoops_getHandler('module'); |
|
23
|
|
|
/** @var \XoopsConfigHandler $configHandler */ |
|
24
|
|
|
$configHandler = xoops_getHandler('config'); |
|
25
|
|
|
$GLOBALS['songlistModule'] = $moduleHandler->getByDirname('songlist'); |
|
26
|
|
|
$GLOBALS['songlistModuleConfig'] = $configHandler->getConfigList($GLOBALS['songlistModule']->getVar('mid')); |
|
27
|
|
|
|
|
28
|
|
|
$adminmenu[] = [ |
|
29
|
|
|
'title' => _MI_SONGLIST_ADMENU_DASHBOARD, |
|
30
|
|
|
'icon' => $pathIcon32 . '/home.png', |
|
31
|
|
|
'image' => $pathIcon32 . '/home.png', |
|
32
|
|
|
'link' => 'admin/index.php', |
|
33
|
|
|
]; |
|
34
|
|
|
|
|
35
|
|
|
$adminmenu[] = [ |
|
36
|
|
|
'title' => _MI_SONGLIST_ADMENU_CATEGORY, |
|
37
|
|
|
'icon' => 'assets/images/icons/32/songlist.category.png', |
|
38
|
|
|
'image' => 'assets/images/icons/32/songlist.category.png', |
|
39
|
|
|
'link' => 'admin/category.php', |
|
40
|
|
|
]; |
|
41
|
|
|
|
|
42
|
|
|
if ($GLOBALS['songlistModuleConfig']['voice']) { |
|
43
|
|
|
$adminmenu[] = [ |
|
44
|
|
|
'title' => _MI_SONGLIST_ADMENU_VOICE, |
|
45
|
|
|
'icon' => 'assets/images/icons/32/songlist.voice.png', |
|
46
|
|
|
'image' => 'assets/images/icons/32/songlist.voice.png', |
|
47
|
|
|
'link' => 'admin/voice.php', |
|
48
|
|
|
]; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
if ($GLOBALS['songlistModuleConfig']['album']) { |
|
52
|
|
|
$adminmenu[] = [ |
|
53
|
|
|
'title' => _MI_SONGLIST_ADMENU_ALBUMS, |
|
54
|
|
|
'icon' => 'assets/images/icons/32/songlist.albums.png', |
|
55
|
|
|
'image' => 'assets/images/icons/32/songlist.albums.png', |
|
56
|
|
|
'link' => 'admin/albums.php', |
|
57
|
|
|
]; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
if ($GLOBALS['songlistModuleConfig']['genre']) { |
|
61
|
|
|
$adminmenu[] = [ |
|
62
|
|
|
'title' => _MI_SONGLIST_ADMENU_GENRE, |
|
63
|
|
|
'icon' => 'assets/images/icons/32/songlist.genre.png', |
|
64
|
|
|
'image' => 'assets/images/icons/32/songlist.genre.png', |
|
65
|
|
|
'link' => 'admin/genre.php', |
|
66
|
|
|
]; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
$adminmenu[] = [ |
|
70
|
|
|
'title' => _MI_SONGLIST_ADMENU_ARTISTS, |
|
71
|
|
|
'icon' => 'assets/images/icons/32/songlist.artists.png', |
|
72
|
|
|
'image' => 'assets/images/icons/32/songlist.artists.png', |
|
73
|
|
|
'link' => 'admin/artists.php', |
|
74
|
|
|
]; |
|
75
|
|
|
|
|
76
|
|
|
$adminmenu[] = [ |
|
77
|
|
|
'title' => _MI_SONGLIST_ADMENU_SONGS, |
|
78
|
|
|
'icon' => 'assets/images/icons/32/songlist.songs.png', |
|
79
|
|
|
'image' => 'assets/images/icons/32/songlist.songs.png', |
|
80
|
|
|
'link' => 'admin/songs.php', |
|
81
|
|
|
]; |
|
82
|
|
|
|
|
83
|
|
|
$adminmenu[] = [ |
|
84
|
|
|
'title' => _MI_SONGLIST_ADMENU_VOTE, |
|
85
|
|
|
'icon' => 'assets/images/icons/32/songlist.votes.png', |
|
86
|
|
|
'image' => 'assets/images/icons/32/songlist.votes.png', |
|
87
|
|
|
'link' => 'admin/votes.php', |
|
88
|
|
|
]; |
|
89
|
|
|
|
|
90
|
|
|
//$adminmenu[] = [ |
|
91
|
|
|
//'title' => _MI_SONGLIST_ADMENU_PERMISSIONS, |
|
92
|
|
|
//'icon' => 'images/icons/32/songlist.permissions.png', |
|
93
|
|
|
//'image' => 'images/icons/32/songlist.permissions.png', |
|
94
|
|
|
//'link' => "admin/permissions.php", |
|
95
|
|
|
//]; |
|
96
|
|
|
|
|
97
|
|
|
$adminmenu[] = [ |
|
98
|
|
|
'title' => _MI_SONGLIST_ADMENU_REQUESTS, |
|
99
|
|
|
'icon' => 'assets/images/icons/32/songlist.requests.png', |
|
100
|
|
|
'image' => 'assets/images/icons/32/songlist.requests.png', |
|
101
|
|
|
'link' => 'admin/requests.php', |
|
102
|
|
|
]; |
|
103
|
|
|
|
|
104
|
|
|
$adminmenu[] = [ |
|
105
|
|
|
'title' => _MI_SONGLIST_ADMENU_UTF8MAP, |
|
106
|
|
|
'icon' => 'assets/images/icons/32/songlist.utf8map.png', |
|
107
|
|
|
'image' => 'assets/images/icons/32/songlist.utf8map.png', |
|
108
|
|
|
'link' => 'admin/utf8map.php', |
|
109
|
|
|
]; |
|
110
|
|
|
|
|
111
|
|
|
$adminmenu[] = [ |
|
112
|
|
|
'title' => _MI_SONGLIST_ADMENU_IMPORT, |
|
113
|
|
|
'icon' => 'assets/images/icons/32/songlist.import.png', |
|
114
|
|
|
'image' => 'assets/images/icons/32/songlist.import.png', |
|
115
|
|
|
'link' => 'admin/import.php', |
|
116
|
|
|
]; |
|
117
|
|
|
|
|
118
|
|
|
$adminmenu[] = [ |
|
119
|
|
|
'title' => _MI_SONGLIST_ADMENU_FIELDS, |
|
120
|
|
|
'icon' => 'assets/images/icons/32/songlist.fields.png', |
|
121
|
|
|
'image' => 'assets/images/icons/32/songlist.fields.png', |
|
122
|
|
|
'link' => 'admin/field.php', |
|
123
|
|
|
]; |
|
124
|
|
|
|
|
125
|
|
|
$adminmenu[] = [ |
|
126
|
|
|
'title' => _MI_SONGLIST_ADMENU_FIELDSPERMS, |
|
127
|
|
|
'icon' => 'assets/images/icons/32/songlist.field.permissions.png', |
|
128
|
|
|
'image' => 'assets/images/icons/32/songlist.field.permissions.png', |
|
129
|
|
|
'link' => 'admin/field_permissions.php', |
|
130
|
|
|
]; |
|
131
|
|
|
|
|
132
|
|
|
// Blocks Admin |
|
133
|
|
|
$adminmenu[] = [ |
|
134
|
|
|
'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS'), |
|
135
|
|
|
'link' => 'admin/blocksadmin.php', |
|
136
|
|
|
'icon' => $pathIcon32 . '/block.png', |
|
137
|
|
|
]; |
|
138
|
|
|
|
|
139
|
|
|
//Clone |
|
140
|
|
|
$adminmenu[] = [ |
|
141
|
|
|
'title' => _CLONE, |
|
142
|
|
|
'link' => 'admin/clone.php', |
|
143
|
|
|
'icon' => $pathIcon32 . '/page_copy.png', |
|
144
|
|
|
]; |
|
145
|
|
|
|
|
146
|
|
|
$adminmenu[] = [ |
|
147
|
|
|
'title' => _MI_SONGLIST_ADMENU_ABOUT, |
|
148
|
|
|
'icon' => $pathIcon32 . '/about.png', |
|
149
|
|
|
'image' => $pathIcon32 . '/about.png', |
|
150
|
|
|
'link' => 'admin/about.php', |
|
151
|
|
|
]; |
|
152
|
|
|
|