_initMemberAuth($docArr); $this->_initSupportAccountAuth($docArr); $this->MemberAuth->checkAutoLogin(); $this->SupportAccountAuth->checkAutoLogin(); if ($docArr['member_page'] == 'y') { $member_support = Session::getData('individual_user_support', 'individual_user_support'); if (($docArr['CURR_PAGE']=='event/registration' || $docArr['CURR_PAGE']=='event/vcs') && !is_null($member_support)) { $this->SupportAccountAuth->checkLogin(); } else { $this->MemberAuth->checkLogin(); } } if ($docArr['support_account_page'] == 'y') { $this->SupportAccountAuth->checkLogin(); } if ($this->MemberAuth->getData('email')) { $this->assign('member', $this->MemberAuth->getData()); } $supportAccount = $this->SupportAccountAuth->getData(); if (is_array($supportAccount) && !empty($supportAccount)) { $this->assign('supportAccount', $supportAccount); } $docArr['tpl'] = SiteMap::getPath('Doc/tpl/site_page.tpl'); $this->Doc($docArr, $options); if ($docArr['docHandler'] == 'SiteDoc') { $homePage = SiteMap::getObj('Home/HomeView.php', $docArr); $homePage->exec($this); } require_once 'class/Session.php'; 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)); } $this->assign('my_account_tip', $this->MemberAuth->getSessionData('my_account_tip')); } function _initMenu($lang) { $DocObj = SiteMap::getObj('CMS/Doc/DocObj.php'); $docItems = $DocObj->getItems4SiteMap(); $deniedPages = $this->getDeniedPages($docItems); $siteMap = $DocObj->getUserendSiteMap($deniedPages); $this->prepareMainMenu($siteMap); $this->assign('menu', $siteMap); // vdie($siteMap); } 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 && empty($menuItem['target'])) { $menuItem['target'] = '_blank'; } if ($menuItem['handler'] == 'RedirectDoc') { $menuItem['url'] = $menuItem['redirect_url']; } else { $menuItem['url'] = BASE_URL.'/'.($menuItem['alias'] != 'home.htm'?$menuItem['alias']:''); } } if (is_array($menuItem['sub']) && !empty($menuItem['sub'])) { $this->prepareMainMenu($menuItem['sub']); } } } } function _initMemberAuth($docAdd) { $DBObj = SiteMap::getObj('Member/Member.php', &$this); $this->MemberAuth = SiteMap::getObj('Member/MemberAuth.php', $docAdd, $DBObj); } function _initSupportAccountAuth($docAdd) { $DBObj = SiteMap::getObj('SupportAccount/Profile/Profile.php'); $this->SupportAccountAuth = SiteMap::getObj('SupportAccount/SupportAccountAuth.php', $docAdd, $DBObj); } function _initAnnouncements() { if (CURR_PAGE != '' && CURR_PAGE !='home.htm') { return false; } $anc = SiteMap::getObj('Announcement/Announcement.php'); $list = $anc->getHome(); $this->addContent(array('tpl' => 'Announcement/block.tpl', 'list' => $list), '_announcements'); } function _initFeaturedProperties() { if (CURR_PAGE != '' && CURR_PAGE !='home.htm') { return false; } $properties = SiteMap::getObj('FeaturedProperty/Show/ShowView.php'); $properties->exec($this); } function _initSearchForm() { $search = SiteMap::getObj('Search/Search.php', null, $this); $searchShow = SiteMap::getObj('Search/Show/Show.php', $this, $search); $form = $searchShow->getSearchForm(); $this->assign('_search_form', $form->exec()); return false; } function _initFooter() { $footer = SiteMap::getObj('SiteFooter/SiteFooter.php'); $this->assign('_footer', $footer->get()); } function display() { $this->_initMenu($docArr['lang']); $this->_initAnnouncements(); $this->_initFeaturedProperties(); $this->_initSearchForm(); $this->_initFooter(); parent::display(); } }