1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 18:32:41 +01:00
phorge-phorge/src/applications/macro/controller/PhabricatorMacroController.php

48 lines
1.2 KiB
PHP
Raw Normal View History

<?php
abstract class PhabricatorMacroController
extends PhabricatorController {
protected function buildSideNavView($for_app = false, $has_search = false) {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
$nav->addLabel(pht('Create'));
$nav->addFilter('',
pht('Create Macro'),
$this->getApplicationURI('/create/'));
}
$nav->addLabel(pht('Macros'));
$nav->addFilter('active', pht('Active Macros'));
$nav->addFilter('all', pht('All Macros'));
$nav->addFilter('my', pht('My Macros'));
if ($has_search) {
$nav->addFilter('search',
pht('Search'),
$this->getRequest()->getRequestURI());
}
return $nav;
}
public function buildApplicationMenu() {
return $this->buildSideNavView($for_app = true)->getMenu();
}
protected function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create Macro'))
->setHref($this->getApplicationURI('/create/'))
->setIcon('create'));
return $crumbs;
}
}