mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 03:12:41 +01:00
3aae972406
Summary: Ref T2625. Ref T1163. A couple of small generalization nudges, but this is almost entirely straightforward. Test Plan: Executed various File queries. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1163, T2625 Differential Revision: https://secure.phabricator.com/D6091
40 lines
1 KiB
PHP
40 lines
1 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorFileController extends PhabricatorController {
|
|
|
|
public function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
$crumbs->addAction(
|
|
id(new PhabricatorMenuItemView())
|
|
->setName(pht('Upload File'))
|
|
->setIcon('create') // TODO: Get @chad to build an "upload" icon.
|
|
->setHref($this->getApplicationURI('/upload/')));
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
protected function buildSideNavView() {
|
|
$menu = $this->buildMenu($for_devices = false);
|
|
return AphrontSideNavFilterView::newFromMenu($menu);
|
|
}
|
|
|
|
protected function buildApplicationMenu() {
|
|
return $this->buildMenu($for_devices = true);
|
|
}
|
|
|
|
private function buildMenu($for_devices) {
|
|
$menu = new PhabricatorMenuView();
|
|
|
|
if ($for_devices) {
|
|
$menu->newLink(pht('Upload File'), $this->getApplicationURI('/upload/'));
|
|
}
|
|
|
|
id(new PhabricatorFileSearchEngine())
|
|
->setViewer($this->getRequest()->getUser())
|
|
->addNavigationItems($menu);
|
|
|
|
return $menu;
|
|
}
|
|
|
|
|
|
}
|