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

45 lines
1.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 PhabricatorMenuItemView())
->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 PhabricatorMenuView();
if ($for_devices) {
$menu->newLink(pht('Upload File'), $this->getApplicationURI('/upload/'));
}
$menu->newLabel(pht('Filters'));
$menu->newLink(pht('My Files'), $this->getApplicationURI('filter/my/'))
->setKey('my');
$menu->newLink(pht('All Files'), $this->getApplicationURI('filter/all/'))
->setKey('all');
return $menu;
}
2011-01-23 03:33:00 +01:00
}