mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 18:32:41 +01:00
f1bf27959f
Summary: This diff covers a bit of ground. - PHUIDocumentExample has been added - PHUIDocument has been extended with new features - PhabricatorMenuView is now PHUIListView - PhabricatorMenuItemView is now PHUIItemListView Overall - I think I've gotten all the edges covered here. There is some derpi-ness that we can talk about, comments in the code. Responsive design is missing from the new features on PHUIDocument, will follow up later. Test Plan: Tested mobile and desktop menus, old phriction layout, new document views, new lists, and object lists. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6130
71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorOwnersController extends PhabricatorController {
|
|
|
|
private $filter;
|
|
|
|
private function getSideNavFilter() {
|
|
return $this->filter;
|
|
}
|
|
protected function setSideNavFilter($filter) {
|
|
$this->filter = $filter;
|
|
return $this;
|
|
}
|
|
|
|
public function buildSideNavView() {
|
|
$nav = new AphrontSideNavFilterView();
|
|
$base_uri = new PhutilURI('/owners/');
|
|
$nav->setBaseURI($base_uri);
|
|
|
|
$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'));
|
|
|
|
$nav->selectFilter($this->getSideNavFilter(), 'view/owned');
|
|
|
|
$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 PHUIListItemView())
|
|
->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;
|
|
}
|
|
|
|
}
|