2011-02-20 18:41:23 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorProjectController extends PhabricatorController {
|
|
|
|
|
2013-02-13 09:22:14 -08:00
|
|
|
public function buildSideNavView($filter = null, $for_app = false) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav
|
|
|
|
->setBaseURI(new PhutilURI('/project/filter/'))
|
|
|
|
->addLabel(pht('User'))
|
|
|
|
->addFilter('active', pht('Active'))
|
|
|
|
->addLabel(pht('All'))
|
|
|
|
->addFilter('all', pht('All Projects'))
|
|
|
|
->addFilter('allactive', pht('Active Projects'))
|
|
|
|
->selectFilter($filter, 'active');
|
|
|
|
|
|
|
|
if ($for_app) {
|
|
|
|
$nav->addFilter('create/', pht('Create Project'));
|
|
|
|
}
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildApplicationCrumbs() {
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
|
|
|
$crumbs->addAction(
|
2013-06-05 08:41:43 -07:00
|
|
|
id(new PHUIListItemView())
|
2013-02-13 09:22:14 -08:00
|
|
|
->setName(pht('Create Project'))
|
|
|
|
->setHref($this->getApplicationURI('create/'))
|
|
|
|
->setIcon('create'));
|
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
2011-02-20 18:41:23 -08:00
|
|
|
}
|