2012-10-01 23:04:03 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorMacroController
|
|
|
|
extends PhabricatorController {
|
|
|
|
|
2013-05-30 23:09:37 +02:00
|
|
|
protected function buildSideNavView($for_app = false) {
|
2012-10-01 23:04:03 +02:00
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
if ($for_app) {
|
2013-01-24 04:36:23 +01:00
|
|
|
$nav->addLabel(pht('Create'));
|
|
|
|
$nav->addFilter('',
|
|
|
|
pht('Create Macro'),
|
|
|
|
$this->getApplicationURI('/create/'));
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
}
|
2012-10-01 23:04:03 +02:00
|
|
|
|
2013-05-30 23:09:37 +02:00
|
|
|
id(new PhabricatorMacroSearchEngine())
|
|
|
|
->setViewer($this->getRequest()->getUser())
|
2013-05-31 19:51:05 +02:00
|
|
|
->addNavigationItems($nav->getMenu());
|
2012-10-01 23:04:03 +02:00
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
public function buildApplicationMenu() {
|
|
|
|
return $this->buildSideNavView($for_app = true)->getMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildApplicationCrumbs() {
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
2013-10-16 19:35:52 +02:00
|
|
|
$can_manage = $this->hasApplicationCapability(
|
|
|
|
PhabricatorMacroCapabilityManage::CAPABILITY);
|
|
|
|
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
$crumbs->addAction(
|
2013-06-05 17:41:43 +02:00
|
|
|
id(new PHUIListItemView())
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
->setName(pht('Create Macro'))
|
|
|
|
->setHref($this->getApplicationURI('/create/'))
|
2013-10-16 19:35:52 +02:00
|
|
|
->setIcon('create')
|
|
|
|
->setDisabled(!$can_manage)
|
|
|
|
->setWorkflow(!$can_manage));
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
2012-10-01 23:04:03 +02:00
|
|
|
}
|