/** * 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); }
/** * Adds the description field to the form */ private function AddDescriptionField() { $name = 'Description'; $this->AddField(Input::Text($name, $this->page->GetDescription())); }
private function ReplacePageDescription(Page $page, Token $token, $startPos, &$endPos) { $value = $page->GetDescription(); if ($page->Equals(PageRenderer::Page())) { $value = PageRenderer::$Description; } $this->InsertValue($value, $token, $startPos, $endPos); }