1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/applications/files/controller/PhabricatorFileController.php

41 lines
1 KiB
PHP
Raw Normal View History

2011-01-23 03:33:00 +01:00
<?php
abstract class PhabricatorFileController extends PhabricatorController {
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PHUIListItemView())
->setName(pht('Upload File'))
->setIcon('create') // TODO: Get @chad to build an "upload" icon.
->setHref($this->getApplicationURI('/upload/')));
2011-01-23 03:33:00 +01:00
return $crumbs;
}
protected function buildSideNavView() {
$menu = $this->buildMenu($for_devices = false);
return AphrontSideNavFilterView::newFromMenu($menu);
}
2011-01-23 03:33:00 +01:00
protected function buildApplicationMenu() {
return $this->buildMenu($for_devices = true);
2011-01-23 03:33:00 +01:00
}
private function buildMenu($for_devices) {
$menu = new PHUIListView();
if ($for_devices) {
$menu->newLink(pht('Upload File'), $this->getApplicationURI('/upload/'));
}
id(new PhabricatorFileSearchEngine())
->setViewer($this->getRequest()->getUser())
->addNavigationItems($menu);
return $menu;
}
2011-01-23 03:33:00 +01:00
}