/** * Load default view screen of template controller. * * @access public * @param string $editfile * @param string $screenname * @param string $templatename * @return void */ public function index($editfile = 'startpage.pstpl', $screenname = 'welcome', $templatename = '', $useindex = false) { if (!$templatename) { $templatename = Yii::app()->getConfig("defaulttemplate"); } // This can happen if the global default template is deleted if (!Template::checkIfTemplateExists($templatename)) { $templatename = 'default'; } $aViewUrls = $this->_initialise($templatename, $screenname, $editfile, true, $useindex); App()->getClientScript()->reset(); // After reseting, we need register again the script : maybe move it to endScripts_view for allways needed scripts ? App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(ADMIN_SCRIPT_PATH . "admin_core.js")); App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(ADMIN_SCRIPT_PATH . 'templates.js')); App()->getClientScript()->registerPackage('ace'); $aData['fullpagebar']['returnbutton'] = true; $this->_renderWrappedTemplate('templates', $aViewUrls, $aData); if ($screenname != 'welcome') { Yii::app()->session['step'] = 1; } else { unset(Yii::app()->session['step']); } }
/** * Load default view screen of template controller. * * @access public * @param string $editfile * @param string $screenname * @param string $templatename * @return void */ public function index($editfile = 'startpage.pstpl', $screenname = 'welcome', $templatename = '') { if ($templatename == '') { $templatename = Yii::app()->getConfig("defaulttemplate"); } // This can happen if the global default template is deleted if (!Template::checkIfTemplateExists($templatename)) { // Redirect to the default template Yii::app()->setFlashMessage(sprintf(gT('Template %s does not exist.'), htmlspecialchars($templatename, ENT_QUOTES)), 'error'); $this->getController()->redirect(array('admin/templates/sa/view/', 'templatename' => 'default')); } $aViewUrls = $this->_initialise($templatename, $screenname, $editfile, true, true); App()->getClientScript()->reset(); $this->registerScriptFile('ADMIN_SCRIPT_PATH', 'admin_core.js'); $this->registerScriptFile('ADMIN_SCRIPT_PATH', 'templates.js'); App()->getClientScript()->registerPackage('ace'); App()->getClientScript()->registerPackage('jsuri'); $aData['fullpagebar']['returnbutton'] = true; $this->_renderWrappedTemplate('templates', $aViewUrls, $aData); // This helps handle the load/save buttons) if ($screenname != 'welcome') { Yii::app()->session['step'] = 1; } else { unset(Yii::app()->session['step']); } }