20 if(!is_a($xoopsModule,
'XoopsModule')){
26 if(!is_a($xoopsUser,
'XoopsUser'))
return false;
28 if(!$xoopsUser->isAdmin(
$mod->mid()))
return false;
30 $amenu =
$mod->getAdminMenu();
31 $amenu =
RMEvents::get()->run_event(
'rmcommon.current.module.menu', $amenu);
33 foreach ($amenu as $menu){
36 strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'],
37 isset($menu[
'icon']) ? $menu[
'icon'] :
'', isset($menu[
'location']) ? $menu[
'location'] :
'',
38 isset($menu[
'options']) ? $menu[
'options'] : null
44 if(
$mod->hasconfig()){
45 RMTemplate::get()->add_menu(
__(
'Settings',
'rmcommon'), XOOPS_URL.
'/modules/system/admin.php?fct=preferences&op=showmod&mod='.
$mod->mid(),
RMTHEMEURL.
'/images/settings.png',
'');
57 if(!is_a($xoopsModule,
'XoopsModule')){
60 if($xoopsModule->dirname()==$m)
66 if(!is_a(
$mod,
'XoopsModule'))
return false;
69 if(!is_a($xoopsUser,
'XoopsUser'))
return false;
71 if(!$xoopsUser->isAdmin(
$mod->mid()))
return false;
73 $amenu =
$mod->getAdminMenu();
75 if(empty($amenu))
return false;
77 $return_menu = array();
79 foreach ($amenu as $menu){
80 $return_menu[] = array(
81 'title' => $menu[
'title'],
82 'link' => strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'],
83 'icon' => isset($menu[
'icon']) ? (strpos($menu[
'icon'],
'http://')!==FALSE ? $menu[
'icon'] : XOOPS_URL.
'/modules/'.
$mod->dirname().
'/'.$menu[
'icon']) :
'',
84 'location' => isset($menu[
'location']) ? $menu[
'location'] :
'',
85 'options' => isset($menu[
'options']) ? self::moduleSubmenu($menu[
'options'],
$mod) : null
89 if(
$mod->hasconfig()){
90 $return_menu[] = array(
91 'title' =>
__(
'Options',
'rmcommon'),
92 'link' => XOOPS_URL.
'/modules/system/admin.php?fct=preferences&op=showmod&mod='.
$mod->mid(),
106 if(!is_array($submenu))
return array();
108 foreach($submenu as
$i => $menu){
109 $submenu[
$i][
'link'] = strpos($menu[
'link'],
'http://')!==FALSE && strpos($menu[
'link'],
'ftp://')!==FALSE ? $menu[
'link'] : XOOPS_URL.
'/modules/'.
$mod->getVar(
'dirname',
'n').
'/'.$menu[
'link'];
124 if(!is_a($xoopsModule,
'XoopsModule'))
return false;
126 if($xoopsModule->dirname()!=$module){
132 $icon =
$mod->getInfo(
'icon'.$size);
133 $path = XOOPS_ROOT_PATH.
'/modules/'.
$mod->dirname().
'/'.$icon;
137 return str_replace(XOOPS_ROOT_PATH, XOOPS_URL,
$path);
148 if($xoopsModule->dirname()==
'rmcommon'