showSideNav = (bool) $value; return $this; } private function showSideNav() { return $this->showSideNav; } public function buildStandardPageResponse($view, array $data) { $page = $this->buildStandardPageView(); $page->setApplicationName('Phame'); $page->setBaseURI('/phame/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xe2\x9c\xa9"); $tabs = array( 'help' => array( 'name' => 'Help', 'href' => PhabricatorEnv::getDoclink('article/Phame_User_Guide.html'), ), ); $page->setTabs($tabs, idx($data, 'tab')); if ($this->showSideNav()) { $nav = $this->renderSideNavFilterView($this->getSideNavFilter()); $nav->appendChild($view); $page->appendChild($nav); } else { $page->appendChild($view); } $response = new AphrontWebpageResponse(); return $response->setContent($page->render()); } private function renderSideNavFilterView($filter) { $base_uri = new PhutilURI('/phame/'); $nav = new AphrontSideNavFilterView(); $nav->setBaseURI($base_uri); $nav->addLabel('Drafts'); $nav->addFilter('post/new', 'New Draft'); $nav->addFilter('draft', 'My Drafts'); $nav->addSpacer(); $nav->addLabel('Posts'); $nav->addFilter('post', 'My Posts'); $nav->addFilter('everyone', 'Everyone', $base_uri); foreach ($this->getSideNavExtraPostFilters() as $post_filter) { $nav->addFilter($post_filter['key'], $post_filter['name'], idx($post_filter, 'uri')); } $nav->selectFilter($filter); return $nav; } protected function getSideNavExtraPostFilters() { return array(); } protected function getSideNavFilter() { return 'post'; } }