public function executeEmbed() { $culture = $this->getCulture(); if ($this->getRequestParameter('edit') == 'true') { if (!$this->checkEditorCredential()) { $this->CMS_error_msg = 'You need the editor credential to edit this content'; return; } $page = sfSimpleCMSPagePeer::retrieveBySlug($this->slug, $culture); } else { $page = sfSimpleCMSPagePeer::retrievePublicBySlug($this->slug, $culture); } if (!$page) { $this->CMS_error_msg = sprintf('The page %s does not exist in culture %c', $this->slug, $culture); return; } $this->page = $page; $this->culture = $culture; $this->getRequest()->setAttribute('culture', $culture); $this->templatePath = sfLoader::getTemplatePath('sfSimpleCMS', $this->page->getTemplate() . 'Template.php'); sfConfig::set('app_sfSimpleCMS_disable_editor_toolbar', true); }
public function executeShow() { $culture = $this->getCulture(); $editor_credentials = sfConfig::get('app_sfSimpleCMS_editor_credential', false); if ($this->getRequestParameter('edit') == 'true') { $this->checkEditorCredential(); $page = sfSimpleCMSPagePeer::retrieveBySlug($this->getRequestParameter('slug', sfConfig::get('app_sfSimpleCMS_default_page', 'home')), $culture); } else { $page = sfSimpleCMSPagePeer::retrievePublicBySlug($this->getRequestParameter('slug', sfConfig::get('app_sfSimpleCMS_default_page', 'home')), $culture); } $this->forward404Unless($page); $this->page = $page; $this->culture = $culture; $this->getRequest()->setAttribute('culture', $culture); $this->setTemplate($this->page->getTemplate()); $this->getResponse()->setTitle($this->page->getTitle()); if (sfConfig::get('app_sfSimpleCMS_use_bundled_layout', true)) { $this->setLayout(sfLoader::getTemplateDir('sfSimpleCMS', 'layout.php') . '/layout'); if (sfConfig::get('app_sfSimpleCMS_use_bundled_stylesheet', true)) { $this->getResponse()->addStylesheet('/sfSimpleCMSPlugin/css/CMSTemplates.css', 'last'); } } return 'Template'; }