Example #1
0
 /**
  * Renders the complete page by requiring the page layout
  * @return string Returns the page contents
  */
 function Render()
 {
     self::$currentPage = $this->page;
     self::$Title = self::$currentPage->GetTitle();
     self::$Description = self::$currentPage->GetDescription();
     self::$Keywords = self::$currentPage->GetKeywords();
     if ($this->page->GetType() == (string) PageType::NotFound()) {
         header('HTTP/1.0 404 Not Found');
     } else {
         if ($this->page->GetType() !== (string) PageType::Normal()) {
             throw new \Exception('Internal phine error: not normal page called');
         }
     }
     ob_start();
     require PathUtil::LayoutTemplate($this->layout);
     $result = ob_get_clean();
     $replacer = new Replacer();
     return $replacer->RealizeVariables($result);
 }
Example #2
0
 /**
  * Adds the keywords field to the form
  */
 private function AddKeywordsField()
 {
     $name = 'Keywords';
     $this->AddField(Input::Text($name, $this->page->GetKeywords()));
 }
Example #3
0
 private function ReplacePageKeywords(Page $page, Token $token, $startPos, &$endPos)
 {
     $value = $page->GetKeywords();
     if ($page->Equals(PageRenderer::Page())) {
         $value = PageRenderer::$Keywords;
     }
     $this->InsertValue($value, $token, $startPos, $endPos);
 }