2011-07-08 20:13:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorSlowvoteController extends PhabricatorController {
|
|
|
|
|
2013-07-13 19:41:49 +02:00
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
2013-02-14 01:47:24 +01:00
|
|
|
|
2013-07-13 19:41:49 +02:00
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
2013-02-14 01:47:24 +01:00
|
|
|
|
|
|
|
if ($for_app) {
|
2013-07-13 19:41:49 +02:00
|
|
|
$nav->addFilter('', pht('Create Poll'),
|
2013-02-14 01:47:24 +01:00
|
|
|
$this->getApplicationURI('create/'));
|
|
|
|
}
|
|
|
|
|
2013-07-13 19:41:49 +02:00
|
|
|
id(new PhabricatorSlowvoteSearchEngine())
|
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
2013-02-14 01:47:24 +01:00
|
|
|
}
|
|
|
|
|
2015-01-06 21:34:58 +01:00
|
|
|
protected function buildApplicationMenu() {
|
2013-07-13 19:41:49 +02:00
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
2013-02-14 01:47:24 +01:00
|
|
|
}
|
|
|
|
|
2015-01-06 21:34:58 +01:00
|
|
|
protected function buildApplicationCrumbs() {
|
2013-02-14 01:47:24 +01:00
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
|
|
|
$crumbs->addAction(
|
2013-06-05 17:41:43 +02:00
|
|
|
id(new PHUIListItemView())
|
2013-07-13 19:41:49 +02:00
|
|
|
->setName(pht('Create Poll'))
|
2013-02-14 01:47:24 +01:00
|
|
|
->setHref($this->getApplicationURI('create/'))
|
2014-05-12 19:08:32 +02:00
|
|
|
->setIcon('fa-plus-square'));
|
2013-02-14 01:47:24 +01:00
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
2011-07-08 20:13:11 +02:00
|
|
|
}
|