function __construct(XoopsModule $module) { parent::__construct($this); $this->module = $module; $module->loadAdminMenu(); $this->adminmenu = $this->module->adminmenu; foreach ($this->adminmenu as $menu) { if (stripos($_SERVER['REQUEST_URI'], $menu['link']) !== false) { $this->title = $menu['title']; $this->icon = $menu['link']; $this->icon = $menu['icon']; } } }
/** * Render navigation to admin page * * @param string $menu current menu * * @return array */ public function renderNavigation($menu = '') { $xoops = \Xoops::getInstance(); $ret = array(); $this->module->loadAdminMenu(); foreach (array_keys($this->module->adminmenu) as $i) { if ($this->module->adminmenu[$i]['link'] == "admin/" . $menu) { if (\XoopsLoad::fileExists($xoops->path("/media/xoops/images/icons/32/" . $this->module->adminmenu[$i]['icon']))) { $this->module->adminmenu[$i]['icon'] = $xoops->url("/media/xoops/images/icons/32/" . $this->module->adminmenu[$i]['icon']); } else { $this->module->adminmenu[$i]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $this->module->adminmenu[$i]['icon']); } $xoops->tpl()->assign('xo_sys_navigation', $this->module->adminmenu[$i]); $ret[] = $xoops->tpl()->fetch($this->getTplPath('nav')); } } return $ret; }
function __construct(XoopsModule $module) { parent::__construct($this); $this->setTemplate(XMF_ROOT_PATH . '/templates/xmf_adminmenu.html'); $this->module =& $module; $this->currentoption = -1; $this->breadcrumb = ''; $this->submenus = false; $this->currentsub = -1; $this->headermenu = array(); $this->adminmenu = $module->loadAdminMenu(); foreach ($this->module->adminmenu as $i => $menu) { if (stripos($_SERVER['REQUEST_URI'], $menu['link']) !== false) { $this->currentoption = $i; $this->breadcrumb = $menu['title']; } } }
/** * @param string $menu * * @return string */ public function addNavigation($menu = '') { $ret = ''; $navigation = ''; $path = XOOPS_URL . '/modules/' . $this->_obj->getVar('dirname') . '/'; $this->_obj->loadAdminMenu(); foreach (array_keys($this->_obj->adminmenu) as $i) { if ($this->_obj->adminmenu[$i]['link'] == 'admin/' . $menu) { $navigation .= $this->_obj->adminmenu[$i]['title'] . ' | '; $ret = "<div class=\"CPbigTitle\" style=\"background-image: url(" . $path . $this->_obj->adminmenu[$i]['icon'] . "); background-repeat: no-repeat; background-position: left; padding-left: 50px;\">\n <strong>" . $this->_obj->adminmenu[$i]['title'] . '</strong></div><br>'; } else { $navigation .= "<a href = '../" . $this->_obj->adminmenu[$i]['link'] . "'>" . $this->_obj->adminmenu[$i]['title'] . '</a> | '; } } if (substr(XOOPS_VERSION, 0, 9) < 'XOOPS 2.5') { $navigation .= "<a href = '../../system/admin.php?fct=preferences&op=showmod&mod=" . $this->_obj->getVar('mid') . "'>" . _MI_SYSTEM_ADMENU6 . '</a>'; $ret = $navigation . '<br><br>' . $ret; } return $ret; }