1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/owners/controller/PhabricatorOwnersController.php

72 lines
1.7 KiB
PHP
Raw Normal View History

2011-04-03 23:48:36 +02:00
<?php
abstract class PhabricatorOwnersController extends PhabricatorController {
private $filter;
private function getSideNavFilter() {
return $this->filter;
}
protected function setSideNavFilter($filter) {
$this->filter = $filter;
return $this;
}
2013-04-23 18:41:46 +02:00
public function buildSideNavView() {
$nav = new AphrontSideNavFilterView();
$base_uri = new PhutilURI('/owners/');
$nav->setBaseURI($base_uri);
2011-04-03 23:48:36 +02:00
$nav->addLabel(pht('Packages'));
$this->getExtraPackageViews($nav);
$nav->addFilter('view/owned', pht('Owned'));
$nav->addFilter('view/projects', pht('Projects'));
$nav->addFilter('view/all', pht('All'));
2011-04-03 23:48:36 +02:00
$nav->selectFilter($this->getSideNavFilter(), 'view/owned');
2011-04-03 23:48:36 +02:00
$filter = $nav->getSelectedFilter();
switch ($filter) {
case 'view/owned':
$title = pht('Owned Packages');
break;
case 'view/all':
$title = pht('All Packages');
break;
case 'view/projects':
$title = pht('Projects');
break;
case 'new':
$title = pht('New Package');
break;
default:
$title = pht('Package');
break;
}
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName($title));
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create Package'))
->setHref('/owners/new/')
->setIcon('create'));
$nav->setCrumbs($crumbs);
return $nav;
}
public function buildApplicationMenu() {
return $this->buildSideNavView()->getMenu();
}
protected function getExtraPackageViews(AphrontSideNavFilterView $view) {
return;
}
2011-04-03 23:48:36 +02:00
}