Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/skins/PhameBasicTemplateBlogSkin.php
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
| return $response; | return $response; | ||||
| } | } | ||||
| public function getCSSResources() { | public function getCSSResources() { | ||||
| return $this->cssResources; | return $this->cssResources; | ||||
| } | } | ||||
| public function remarkup($corpus) { | |||||
| $view = id(new PHUIRemarkupView($this->getViewer(), $corpus)); | |||||
| return hsprintf('%s', $view); | |||||
| } | |||||
| public function getName() { | public function getName() { | ||||
| return $this->getSpecification()->getName(); | return $this->getSpecification()->getName(); | ||||
| } | } | ||||
| public function getPath($to_file = null) { | public function getPath($to_file = null) { | ||||
| $path = $this->getSpecification()->getRootDirectory(); | $path = $this->getSpecification()->getRootDirectory(); | ||||
| if ($to_file) { | if ($to_file) { | ||||
| $path = $path.DIRECTORY_SEPARATOR.$to_file; | $path = $path.DIRECTORY_SEPARATOR.$to_file; | ||||
| Show All 12 Lines | if (Filesystem::pathExists($this->getPath($__template__))) { | ||||
| require $this->getPath($__template__); | require $this->getPath($__template__); | ||||
| } | } | ||||
| return phutil_safe_html(ob_get_clean()); | return phutil_safe_html(ob_get_clean()); | ||||
| } | } | ||||
| private function getDefaultScope() { | private function getDefaultScope() { | ||||
| return array( | return array( | ||||
| 'skin' => $this, | 'skin' => $this, | ||||
| 'blog' => $this->getBlog(), | 'blog' => $this->getBlog(), | ||||
| 'uri' => $this->getURI($this->getURIPath()), | 'uri' => $this->getURI($this->getURIPath()), | ||||
| 'home_uri' => $this->getURI(''), | 'home_uri' => $this->getURI(''), | ||||
| 'title' => $this->getTitle(), | |||||
| // TODO: This is wrong for detail pages, which should show the post | |||||
| // title, but getting it right is a pain and this is better than nothing. | |||||
| 'title' => $this->getBlog()->getName(), | |||||
| 'description' => $this->getDescription(), | 'description' => $this->getDescription(), | ||||
| 'og_type' => $this->getOGType(), | 'og_type' => $this->getOGType(), | ||||
| ); | ); | ||||
| } | } | ||||
| protected function renderHeader() { | protected function renderHeader() { | ||||
| return $this->renderTemplate( | return $this->renderTemplate( | ||||
| 'header.php', | 'header.php', | ||||
| array()); | array()); | ||||
| } | } | ||||
| protected function renderFooter() { | protected function renderFooter() { | ||||
| return $this->renderTemplate('footer.php', array()); | return $this->renderTemplate('footer.php', array()); | ||||
| } | } | ||||
| protected function render404Page() { | protected function render404Page() { | ||||
| return $this->renderTemplate('404.php', array()); | return $this->renderTemplate('404.php', array()); | ||||
| } | } | ||||
| protected function renderPostDetail(PhamePostView $post) { | protected function renderPostDetail(PhamePostView $post) { | ||||
| return $this->renderTemplate( | return $this->renderTemplate( | ||||
| 'post-detail.php', | 'post-detail.php', | ||||
| array( | array( | ||||
| 'post' => $post, | 'post' => $post, | ||||
| )); | )); | ||||
| } | } | ||||
| protected function renderPostList(array $posts) { | protected function renderPostList(array $posts) { | ||||
| return $this->renderTemplate( | return $this->renderTemplate( | ||||
| 'post-list.php', | 'post-list.php', | ||||
| array( | array( | ||||
| 'posts' => $posts, | 'posts' => $posts, | ||||
| 'older' => $this->renderOlderPageLink(), | 'older' => $this->renderOlderPageLink(), | ||||
| 'newer' => $this->renderNewerPageLink(), | 'newer' => $this->renderNewerPageLink(), | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||