/**
  * Load your component.
  * 
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CORELANG, $subMenuTitle, $objTemplate;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             define('CALENDAR_MANDATE', MODULE_INDEX);
             $objCalendar = new \Cx\Modules\Calendar\Controller\Calendar($page->getContent(), MODULE_INDEX);
             $page->setContent($objCalendar->getCalendarPage());
             if ($objCalendar->pageTitle) {
                 $page->setTitle($objCalendar->pageTitle);
                 $page->setContentTitle($objCalendar->pageTitle);
                 $page->setMetaTitle($objCalendar->pageTitle);
             }
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             \Permission::checkAccess(16, 'static');
             $subMenuTitle = $_CORELANG['TXT_CALENDAR'];
             $objCalendarManager = new \Cx\Modules\Calendar\Controller\CalendarManager();
             $objCalendarManager->getCalendarPage();
             break;
         default:
             break;
     }
 }
 /**
  * Load your component.
  * 
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CORELANG, $objTemplate, $subMenuTitle;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             $newsObj = new News($page->getContent());
             $page->setContent($newsObj->getNewsPage());
             $newsObj->getPageTitle($page->getTitle());
             if (substr($page->getCmd(), 0, 7) == 'details') {
                 $page->setTitle($newsObj->newsTitle);
                 $page->setContentTitle($newsObj->newsTitle);
                 $page->setMetaTitle($newsObj->newsTitle);
                 // Set the meta page description to the teaser text if displaying news details
                 $teaser = $newsObj->getTeaser();
                 if ($teaser !== null) {
                     $page->setMetadesc(contrexx_raw2xhtml(contrexx_strip_tags(html_entity_decode($teaser, ENT_QUOTES, CONTREXX_CHARSET))));
                 }
             }
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             \Permission::checkAccess(10, 'static');
             $subMenuTitle = $_CORELANG['TXT_NEWS_MANAGER'];
             $objNews = new NewsManager();
             $objNews->getPage();
             break;
         default:
             break;
     }
 }
 /**
  * Add the necessary divs for the inline editing around the content and around the title
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page
  */
 public function preContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     // Is frontend editing active?
     if (!$this->frontendEditingIsActive() || !$this->userHasPermissionToEditPage()) {
         return;
     }
     $componentTemplate = new \Cx\Core\Html\Sigma(ASCMS_CORE_MODULE_PATH . '/' . $this->getName() . '/View/Template/Generic');
     $componentTemplate->setErrorHandling(PEAR_ERROR_DIE);
     // add div around content
     // not used at the moment, because we have no proper way to "not parse" blocks in content and
     // it should only print a div around the content without parsing the content at this time
     //        $componentTemplate->loadTemplateFile('ContentDiv.html');
     //        $componentTemplate->setVariable('CONTENT', $page->getContent());
     //        $page->setContent($componentTemplate->get());
     $page->setContent('<div id="fe_content">' . $page->getContent() . '</div>');
     // add div around the title
     $componentTemplate->loadTemplateFile('TitleDiv.html');
     $componentTemplate->setVariable('TITLE', $page->getContentTitle());
     $page->setContentTitle($componentTemplate->get());
 }
 public function setContentTitle($contentTitle)
 {
     $this->_load();
     return parent::setContentTitle($contentTitle);
 }