Doc($docArr); $this->_initUserAuth($docArr); if ($error = Session::getData(CURR_PAGE, 'error')) { Session::clearData(CURR_PAGE, 'error'); $this->addContent(array('tpl' => 'msg_error.tpl', 'text' => $error)); } if ($msg = Session::getData(CURR_PAGE, 'msg')) { Session::clearData(CURR_PAGE, 'msg'); $this->addContent(array('tpl' => 'msg.tpl', 'text' => $msg)); } } function display() { $this->_initMenu($docArr['lang']); $this->_initFooter(); parent::display(); } function _initMenu($lang) { $DocObj = SiteMap::getObj('CMS/Doc/DocObj.php'); $docItems = $DocObj->getItems4SiteMap(); //$deniedPages = $this->getDeniedPages($docItems); $siteMap = $DocObj->getUserendSiteMap($deniedPages); $this->prepareMainMenu($siteMap); $cur_page = (CURR_PAGE == '')?'home.html':CURR_PAGE; $cur_page = split('/', $cur_page); $DocObj->markCurrPage($siteMap, $cur_page); $this->addItemProp('CSSs', 'css/superfish.css'); $this->addItemProp('JSs', 'js/superfish.js'); $this->addItemProp('JSs', 'js/supersubs.js'); $this->assign('menu', $siteMap); } function _initUserAuth($docAdd) { $User = SiteMap::getObj('User/User.php', &$this); $this->UserAuth = SiteMap::getObj('User/UserAuth.php', $docAdd, $User); } function prepareMainMenu(&$menu) { if (is_array($menu) && !empty($menu)) { foreach ($menu as $k=>&$menuItem) { if (empty($menuItem['url'])) { if ($menuItem['handler'] == 'RedirectDoc' && strpos($menuItem['redirect_url'], BASE_URL) === false) { $menuItem['target'] = '_blank'; } $menuItem['url'] = BASE_URL.'/'.$menuItem['alias']; } if (isset($menuItem['sub']) && is_array($menuItem['sub']) && !empty($menuItem['sub'])) { $this->prepareMainMenu($menuItem['sub']); } } } } function _initFooter() { require_once('app/Settings/Settings.php'); $this->assign('_footer', Settings::get('site_footer')); } }