function get_notification_select($pgid = null) { static $done; if (!$this->root->userinfo['uid'] || isset($done[$this->root->mydirname])) { return ''; } $done[$this->root->mydirname] = true; require_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); if (function_exists('LegacyRender_smartyfunction_notifications_select')) { $xoopsTpl->register_function("legacy_notifications_select", "LegacyRender_smartyfunction_notifications_select"); } else { $member_handler =& xoops_gethandler('member'); $xoopsUser =& $member_handler->getUser($this->root->userinfo['uid']); $module_handler =& xoops_gethandler('module'); $xoopsModule =& $module_handler->getByDirname($this->root->mydirname); $config_handler =& xoops_gethandler('config'); $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF); $xoopsTpl->assign('xoops_url', XOOPS_URL); include XOOPS_ROOT_PATH . '/include/notification_select.php'; } $ret = $xoopsTpl->fetch('db:system_notification_select.html'); $page = is_null($pgid) ? $this->root->vars['page'] : $this->get_name_by_pgid($pgid); $pages = array_pad(explode('/', $page), 2, ''); $from = array(constant('_MI_' . strtoupper($this->root->mydirname) . '_NOTCAT_REPLASE2MODULENAME'), constant('_MI_' . strtoupper($this->root->mydirname) . '_NOTCAT_REPLASE2FIRSTLEV'), constant('_MI_' . strtoupper($this->root->mydirname) . '_NOTCAT_REPLASE2SECONDLEV')); $to = array($this->root->module['title'], $pages[0], $pages[0] . ' / ' . $pages[1]); return empty($ret) ? '' : str_replace($from, $to, $ret); }