2011-06-13 01:06:17 +02:00
|
|
|
<?php
|
|
|
|
|
2013-05-23 15:47:54 +02:00
|
|
|
/**
|
|
|
|
* @group countdown
|
|
|
|
*/
|
2011-06-13 01:06:17 +02:00
|
|
|
abstract class PhabricatorCountdownController extends PhabricatorController {
|
|
|
|
|
2013-07-23 15:16:19 +02:00
|
|
|
public function buildSideNavView($for_app = false) {
|
2013-02-25 21:48:55 +01:00
|
|
|
$user = $this->getRequest()->getUser();
|
2011-06-13 01:06:17 +02:00
|
|
|
|
2013-02-25 21:48:55 +01:00
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
2011-06-13 01:06:17 +02:00
|
|
|
|
2013-07-23 15:16:19 +02:00
|
|
|
if ($for_app) {
|
|
|
|
$nav->addFilter('create', pht('Create Countdown'));
|
|
|
|
}
|
|
|
|
|
|
|
|
id(new PhabricatorCountdownSearchEngine())
|
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
2011-06-13 01:06:17 +02:00
|
|
|
|
2013-02-25 21:48:55 +01:00
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildApplicationMenu() {
|
2013-07-23 15:16:19 +02:00
|
|
|
return $this->buildSideNavView($for_app = true)->getMenu();
|
2013-02-25 21:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function buildApplicationCrumbs() {
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
2011-06-13 01:06:17 +02:00
|
|
|
|
2013-02-25 21:48:55 +01:00
|
|
|
$crumbs->addAction(
|
2013-06-05 17:41:43 +02:00
|
|
|
id(new PHUIListItemView())
|
2013-05-04 00:49:29 +02:00
|
|
|
->setName(pht('Create Countdown'))
|
2013-02-25 21:48:55 +01:00
|
|
|
->setHref($this->getApplicationURI('edit/'))
|
|
|
|
->setIcon('create'));
|
2011-06-13 01:06:17 +02:00
|
|
|
|
2013-02-25 21:48:55 +01:00
|
|
|
return $crumbs;
|
2011-06-13 01:06:17 +02:00
|
|
|
}
|
|
|
|
}
|