setSuModeOff(); } $this->setSuModeOn(); } if ($this->getAuth()->getSuMode()) { $this->setBodyAttrib('class', 'su'); } return $this; } public function setSuModeOn() { $this->getAuth()->setSuMode(); $this->setRedirectMessage('Su Mode Enabled'); $url = Qs_Request::getUrlExclude('su'); Qs_Http::redirect($url); return $this; } public function setRedirectMessage($text) { $session = new Qs_Session_Namespace(Qs_Constant::get('CURRENT_PAGE'), true); $session->message = $text; $session->setExpirationHops(1, 'message'); return $this; } public function setSuModeOff() { $this->getAuth()->setSuMode(false); $this->setRedirectMessage('Su Mode Disabled'); $url = Qs_Request::getUrlExclude('su'); Qs_Http::redirect($url); return $this; } protected function _beforeDisplay() { \App\BrowserCheck\View::initAlert(); parent::_beforeDisplay(); $this->_initSTSAuthLink(); $this->_initKeepSession(); return $this; } public function getMenu() { if (null === $this->_content['menu']) { $this->_content['menu'] = Qs_SiteMap::getBackendMenu(); } return $this->_content['menu']; } protected function _initKeepSession() { $interval = (int) Qs_Constant::get('SESSION_REFRESH_INTERVAL'); if ($interval) { $this->addScript('js/lib/keep-session.js') ->addInlineScript( 'keepSession', '$(document).ready(function(){ keepSession = new Qs_KeepSession(); keepSession.setInterval(' . $interval . '); keepSession.setUrl("' . BASE_URL_LANGUAGE . '/admin/__keep-session"); keepSession.start(); }); '); } return $this; } protected function _initSTSAuthLink() { if (class_exists('App_Admin_StsAuth_View') && class_exists('App_Admin_StsAuth_Obj') && (null != ($alias = Qs_SiteMap::getAliasByItem('Admin_StsAuth_'))) ) { $textLink = App_Settings_Obj::get('stsAuthLink'); $stsObj = new App_Admin_StsAuth_Obj(); if ($alias && $textLink && ($stsObj->getStsLoginEnabled() == 'y')) { $this->assign('STS_AUTH_LINK', str_replace('{url}', BASE_URL_LANGUAGE . '/' . $alias, $textLink)); } } return $this; } }