19 if(!is_a($xoopsModule,
'XoopsModule')){
25 if(!is_a($xoopsUser,
'XoopsUser'))
return false;
27 if(!$xoopsUser->isAdmin(
$mod->mid()))
return false;
29 $amenu =
$mod->getAdminMenu();
30 $amenu =
RMEvents::get()->run_event(
'rmcommon.current.module.menu', $amenu);
32 foreach ($amenu as $menu){
33 if(isset($menu[
'icon']) && $menu[
'icon']!=
''){
34 if(preg_match(
"/^http.*/", $menu[
'icon']))
35 $icon = $menu[
'icon'];
39 $icon = XOOPS_URL.
'/modules/'.$xoopsModule->dirname().
'/'.(preg_match(
"/^(\.\.\/){2,}/", $menu[
'icon']) ? $menu[
'icon'] : preg_replace(
"/^\.\.\/{1}/",
'', $menu[
'icon']));
47 strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'],
49 !empty($menu[
'class']) ? $menu[
'class'] :
'',
50 isset($menu[
'location']) ? $menu[
'location'] :
'',
51 isset($menu[
'options']) ? $menu[
'options'] : array()
57 if(
$mod->hasconfig()){
58 $rmTpl->add_menu(
__(
'Settings',
'rmcommon'), XOOPS_URL.
'/modules/system/admin.php?fct=preferences&op=showmod&mod='.
$mod->mid(),
'option',
'');
70 if(!is_a($xoopsModule,
'XoopsModule')){
73 if($xoopsModule->dirname()==$m)
79 if(!is_a(
$mod,
'XoopsModule'))
return false;
82 if(!is_a($xoopsUser,
'XoopsUser'))
return false;
84 if(!$xoopsUser->isAdmin(
$mod->mid()))
return false;
86 $amenu =
$mod->getAdminMenu();
88 if(empty($amenu))
return false;
90 $return_menu = array();
92 foreach ($amenu as $menu){
93 $return_menu[] = array(
94 'title' => $menu[
'title'],
95 'link' => strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'],
96 'icon' => isset($menu[
'icon']) ? (strpos($menu[
'icon'],
'http://')!==FALSE ? $menu[
'icon'] : XOOPS_URL.
'/modules/'.
$mod->dirname().
'/'.$menu[
'icon']) :
'',
97 'location' => isset($menu[
'location']) ? $menu[
'location'] :
'',
98 'options' => isset($menu[
'options']) ? self::moduleSubmenu($menu[
'options'],
$mod) : null
102 if(
$mod->hasconfig()){
103 $return_menu[] = array(
104 'title' =>
__(
'Settings',
'rmcommon'),
105 'link' => XOOPS_URL.
'/modules/system/admin.php?fct=preferences&op=showmod&mod='.
$mod->mid(),
120 if(!is_array($submenu))
return array();
122 foreach($submenu as
$i => $menu){
123 $submenu[
$i][
'link'] = strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'];
139 'mylinks' =>
'xicon-link',
140 'news' =>
'xicon-consulting',
141 'contact' =>
'xicon-email',
142 'extgallery' =>
'xicon-picture',
143 'date' =>
'xicon-date',
144 'fmcontent' =>
'xicon-library',
145 'marquee' =>
'xicon-advertising',
146 'mastop_go2' =>
'xicon-cloud',
147 'moduleinstaller' =>
'xicon-download',
148 'pm' =>
'xicon-comment',
149 'profile' =>
'xicon-profile',
150 'protector' =>
'xicon-shield',
151 'tag' =>
'xicon-tag',
152 'xforms' =>
'xicon-form',
153 'xlanguage' =>
'xicon-comment',
154 'xoopsfaq' =>
'xicon-faq',
155 'xoopspartners' =>
'xicon-me',
156 'system' =>
'xicon-gear'
159 if(!is_a($xoopsModule,
'XoopsModule'))
return false;
161 if($xoopsModule->dirname()!=$module){
167 if(isset($available[
$mod->dirname()]))
168 return '<i class="xo-icon '.$available[
$mod->dirname()].
'"></i> ';
170 $icon =
$mod->getInfo(
'icon'.$size);
171 $path = XOOPS_ROOT_PATH.
'/modules/'.
$mod->dirname().
'/'.$icon;
180 $icon = str_replace(XOOPS_ROOT_PATH, XOOPS_URL,
$path);
182 return '<i class="xo-icon" style="background-image: url('.$icon.
');"></i> ';
192 if($xoopsModule->dirname()==
'rmcommon'
209 'dashboard' =>
'xicon-home',
210 'modules' =>
'xicon-plus',
211 'blocks' =>
'xicon-block',
212 'users' =>
'xicon-user',
213 'imgmanager' =>
'xicon-picture',
214 'comments' =>
'xicon-comment',
215 'plugins' =>
'xicon-plugin',
216 'avatars' =>
'xicon-account',
217 'banners' =>
'xicon-offer',
218 'blocksadmin' =>
'xicon-block',
219 'groups' =>
'xicon-users',
220 'images' =>
'xicon-picture',
221 'mailusers' =>
'xicon-email',
222 'modulesadmin' =>
'xicon-plus',
223 'maintenance' =>
'xicon-publish',
224 'preferences' =>
'xicon-settings',
225 'smilies' =>
'xicon-smile',
226 'tplsets' =>
'xicon-invoice',
227 'userrank' =>
'xicon-star',
228 'allusers' =>
'xicon-users',
229 'newuser' =>
'xicon-plus',
230 'rmc_imgcats' =>
'xicon-category',
231 'rmc_imgnewcat' =>
'xicon-addfolder',
232 'rmc_images' =>
'xicon-picture',
233 'rmc_newimages' =>
'xicon-addpicture',
234 'updates' =>
'xicon-refresh',
237 if(isset($menu[
'type']))
238 return '<i class="xo-icon xicon-settings"></i> ';
240 if (isset($menu[
'location']) && isset($accepted[$menu[
'location']]))
241 return '<i class="xo-icon '.$accepted[$menu[
'location']].
'"></i> ';
243 if(isset($menu[
'selected']) && isset($accepted[$menu[
'selected']]))
244 return '<i class="xo-icon '.$accepted[$menu[
'selected']].
'"></i> ';
246 $modurl = XOOPS_URL.
'/modules/'.$xoopsModule->dirname().
'/';
248 if(isset($menu[
'icon']) && $menu[
'icon']!=
'')
249 return '<i class="xo-icon" style="background-image: url('.preg_replace(
"/^[\.]+/",
'',$menu[
'icon']).
'); background-size: 16px 16px;"></i> ';
253 preg_match(
"/.*admin\.php\?fct=(.*)/", $menu[
'link'], $matches);
255 if (!empty($matches) && isset($accepted[$matches[1]]))
256 return '<i class="xo-icon '.$accepted[$matches[1]].
'"></i> ';