2012-10-01 23:04:03 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorMacroController
|
|
|
|
extends PhabricatorController {
|
|
|
|
|
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
|
|
|
protected function buildSideNavView($for_app = false, $has_search = 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-01-24 04:36:23 +01:00
|
|
|
$nav->addLabel(pht('Macros'));
|
Adding some filters and queries to Macro application
Summary:
Fixes T2778
Introduces `PhabricatorMacroQuery`, which should consolidate all queries regarding macros
Adds `PolicyInterface` to `PhabricatorImageMacro`, as else the query would fail (we should consider adding it to the ApplicationTransaction instead, if that was ever planned)
Adds `Active Macros` filter, making it the default
Adds `My Macros` filter. You may ask why it overwrites `$authors`. Well, I did not want the page jump to the conclusion that it is a search result. It //is// one more or less, but the filter would jump to `seach` instead of `my`. If you want `My Macros` removed, tell me. It is useful only to heavy-macro-uploaders-and-users though. Five or six people in `http://secure.phabricator.(org|com)`, and an estimated dozen and a half at bigger installs.
Test Plan: created multiple macros from multiple authors, disabled them at will. browsed around, verified that Macros only appeared in the right filters and that nothing else broke.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T2778
Differential Revision: https://secure.phabricator.com/D5409
2013-03-22 17:46:21 +01:00
|
|
|
$nav->addFilter('active', pht('Active Macros'));
|
|
|
|
$nav->addFilter('all', pht('All Macros'));
|
|
|
|
$nav->addFilter('my', pht('My Macros'));
|
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 ($has_search) {
|
2013-01-24 04:36:23 +01:00
|
|
|
$nav->addFilter('search',
|
|
|
|
pht('Search'),
|
|
|
|
$this->getRequest()->getRequestURI());
|
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
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
$crumbs->addAction(
|
|
|
|
id(new PhabricatorMenuItemView())
|
|
|
|
->setName(pht('Create Macro'))
|
|
|
|
->setHref($this->getApplicationURI('/create/'))
|
|
|
|
->setIcon('create'));
|
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
2012-10-01 23:04:03 +02:00
|
|
|
}
|