예제 #1
0
파일: Render.php 프로젝트: rukzuk/rukzuk
 /**
  * @param mixed              $content
  * @param string             $websiteId
  * @param string             $templateId
  * @param string             $mode
  * @param array              $globalContent
  * @param \Cms\Data\Template $template
  * @param null               $codeType
  */
 public function renderTemplateContent($content, $websiteId, $templateId, $mode, $globalContent, $template, $codeType = null)
 {
     // Check page content and stop/break nicely
     $content = $this->convertContentToArray($content);
     if (empty($content)) {
         return;
     }
     // create item meta data simulation
     $currentItemInfo = array('id' => $templateId, 'websiteId' => $websiteId, 'name' => $template->getName(), 'pageType' => $template->getPageType(), 'globalContent' => $globalContent);
     $this->renderWithNewRenderer($content, $websiteId, $templateId, $mode, $currentItemInfo, $codeType, true);
 }
예제 #2
0
 /**
  * Page reparsen und updaten
  *
  * @param Cms\Data\Page     $page
  * @param Cms\Data\Template $template
  * @param string            $reparseType
  */
 public static function reparseAndUpdatePage(Page &$page, Template $template, $reparseType = self::TYPE_REPARSE)
 {
     // Content reparsen
     $newPageContent = array();
     $newPageContent = self::reparseContent($page->getWebsiteid(), $page->getContent(), $page->getTemplatecontent(), $template->getContent(), $reparseType);
     // Page mit den neuen Werten updaten
     $page->setContent(\Zend_Json::encode($newPageContent));
     $page->setTemplatecontent($template->getContent());
     $page->setTemplatecontentchecksum($template->getContentchecksum());
     // Page speichern
     $pageBusiness = new \Cms\Business\Page('Page');
     $pageBusiness->update($page->getId(), $page->getWebsiteId(), array('content' => \Zend_Json::encode($newPageContent), 'templatecontent' => $template->getContent(), 'templatecontentchecksum' => $template->getContentchecksum()));
     return true;
 }
예제 #3
0
파일: Template.php 프로젝트: rukzuk/rukzuk
 /**
  * @param \Cms\Data\Template $data
  */
 protected function setValuesFromData(TemplateData $data)
 {
     $this->setId($data->getId());
     $this->setWebsiteId($data->getWebsiteId());
     $this->setName($data->getName());
     $this->setContent($data->getContent());
     $this->setPageType($data->getPageType());
     $this->setScreenshot();
 }
예제 #4
0
파일: Export.php 프로젝트: rukzuk/rukzuk
 /**
  * @param  Data\Template $template
  * @return string
  */
 private function getTemplateJson(Data\Template $template)
 {
     $templateColumnsAndValues = $template->getExportColumnsAndValues();
     $templateJson = json_encode($templateColumnsAndValues);
     $this->extendingColorIds($template->getWebsiteid(), $templateJson);
     return $templateJson;
 }
예제 #5
0
파일: Reparse.php 프로젝트: rukzuk/rukzuk
 /**
  * reparsing the page unsing specific template
  *
  * @param \Cms\Data\Page      $page
  * @param \Cms\Data\Template  $template
  * @return boolean
  */
 private function doReparsePage(\Cms\Data\Page $page, \Cms\Data\Template $template)
 {
     if ($page->getTemplatecontentchecksum() != $template->getContentchecksum()) {
         try {
             if (Reparser::reparseAndUpdatePage($page, $template)) {
                 return true;
             }
         } catch (\Exception $e) {
             $data = method_exists($e, 'getData') ? $e->getData() : array();
             $data['pageId'] = $page->getId();
             $data['pageName'] = $page->getName();
             throw new \Cms\Exception(801, __METHOD__, __LINE__, $data, $e);
         }
     }
     return false;
 }