Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F94203
D7833.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
24 KB
Referenced Files
None
Subscribers
None
D7833.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -636,6 +636,7 @@
'DrydockAllocatorWorker' => 'applications/drydock/worker/DrydockAllocatorWorker.php',
'DrydockApacheWebrootInterface' => 'applications/drydock/interface/webroot/DrydockApacheWebrootInterface.php',
'DrydockBlueprint' => 'applications/drydock/storage/DrydockBlueprint.php',
+ 'DrydockBlueprintController' => 'applications/drydock/controller/DrydockBlueprintController.php',
'DrydockBlueprintCreateController' => 'applications/drydock/controller/DrydockBlueprintCreateController.php',
'DrydockBlueprintEditController' => 'applications/drydock/controller/DrydockBlueprintEditController.php',
'DrydockBlueprintImplementation' => 'applications/drydock/blueprint/DrydockBlueprintImplementation.php',
@@ -645,12 +646,14 @@
'DrydockBlueprintSearchEngine' => 'applications/drydock/query/DrydockBlueprintSearchEngine.php',
'DrydockBlueprintViewController' => 'applications/drydock/controller/DrydockBlueprintViewController.php',
'DrydockCommandInterface' => 'applications/drydock/interface/command/DrydockCommandInterface.php',
+ 'DrydockConsoleController' => 'applications/drydock/controller/DrydockConsoleController.php',
'DrydockConstants' => 'applications/drydock/constants/DrydockConstants.php',
'DrydockController' => 'applications/drydock/controller/DrydockController.php',
'DrydockDAO' => 'applications/drydock/storage/DrydockDAO.php',
'DrydockFilesystemInterface' => 'applications/drydock/interface/filesystem/DrydockFilesystemInterface.php',
'DrydockInterface' => 'applications/drydock/interface/DrydockInterface.php',
'DrydockLease' => 'applications/drydock/storage/DrydockLease.php',
+ 'DrydockLeaseController' => 'applications/drydock/controller/DrydockLeaseController.php',
'DrydockLeaseListController' => 'applications/drydock/controller/DrydockLeaseListController.php',
'DrydockLeaseQuery' => 'applications/drydock/query/DrydockLeaseQuery.php',
'DrydockLeaseReleaseController' => 'applications/drydock/controller/DrydockLeaseReleaseController.php',
@@ -660,6 +663,7 @@
'DrydockLocalCommandInterface' => 'applications/drydock/interface/command/DrydockLocalCommandInterface.php',
'DrydockLocalHostBlueprintImplementation' => 'applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php',
'DrydockLog' => 'applications/drydock/storage/DrydockLog.php',
+ 'DrydockLogController' => 'applications/drydock/controller/DrydockLogController.php',
'DrydockLogListController' => 'applications/drydock/controller/DrydockLogListController.php',
'DrydockLogQuery' => 'applications/drydock/query/DrydockLogQuery.php',
'DrydockLogSearchEngine' => 'applications/drydock/query/DrydockLogSearchEngine.php',
@@ -675,6 +679,7 @@
'DrydockPreallocatedHostBlueprintImplementation' => 'applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php',
'DrydockResource' => 'applications/drydock/storage/DrydockResource.php',
'DrydockResourceCloseController' => 'applications/drydock/controller/DrydockResourceCloseController.php',
+ 'DrydockResourceController' => 'applications/drydock/controller/DrydockResourceController.php',
'DrydockResourceListController' => 'applications/drydock/controller/DrydockResourceListController.php',
'DrydockResourceQuery' => 'applications/drydock/query/DrydockResourceQuery.php',
'DrydockResourceSearchEngine' => 'applications/drydock/query/DrydockResourceSearchEngine.php',
@@ -3043,45 +3048,49 @@
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
- 'DrydockBlueprintCreateController' => 'DrydockController',
- 'DrydockBlueprintEditController' => 'DrydockController',
+ 'DrydockBlueprintController' => 'DrydockController',
+ 'DrydockBlueprintCreateController' => 'DrydockBlueprintController',
+ 'DrydockBlueprintEditController' => 'DrydockBlueprintController',
'DrydockBlueprintListController' =>
array(
- 0 => 'DrydockController',
+ 0 => 'DrydockBlueprintController',
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'DrydockBlueprintQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'DrydockBlueprintSearchEngine' => 'PhabricatorApplicationSearchEngine',
- 'DrydockBlueprintViewController' => 'DrydockController',
+ 'DrydockBlueprintViewController' => 'DrydockBlueprintController',
'DrydockCommandInterface' => 'DrydockInterface',
+ 'DrydockConsoleController' => 'DrydockController',
'DrydockController' => 'PhabricatorController',
'DrydockDAO' => 'PhabricatorLiskDAO',
'DrydockFilesystemInterface' => 'DrydockInterface',
'DrydockLease' =>
array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
+ 'DrydockLeaseController' => 'DrydockController',
'DrydockLeaseListController' =>
array(
- 0 => 'DrydockController',
+ 0 => 'DrydockLeaseController',
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'DrydockLeaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'DrydockLeaseReleaseController' => 'DrydockController',
+ 'DrydockLeaseReleaseController' => 'DrydockLeaseController',
'DrydockLeaseSearchEngine' => 'PhabricatorApplicationSearchEngine',
'DrydockLeaseStatus' => 'DrydockConstants',
- 'DrydockLeaseViewController' => 'DrydockController',
+ 'DrydockLeaseViewController' => 'DrydockLeaseController',
'DrydockLocalCommandInterface' => 'DrydockCommandInterface',
'DrydockLocalHostBlueprintImplementation' => 'DrydockBlueprintImplementation',
'DrydockLog' =>
array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
+ 'DrydockLogController' => 'DrydockController',
'DrydockLogListController' =>
array(
- 0 => 'DrydockController',
+ 0 => 'DrydockLogController',
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'DrydockLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
@@ -3101,16 +3110,17 @@
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
- 'DrydockResourceCloseController' => 'DrydockController',
+ 'DrydockResourceCloseController' => 'DrydockResourceController',
+ 'DrydockResourceController' => 'DrydockController',
'DrydockResourceListController' =>
array(
- 0 => 'DrydockController',
+ 0 => 'DrydockResourceController',
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'DrydockResourceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'DrydockResourceSearchEngine' => 'PhabricatorApplicationSearchEngine',
'DrydockResourceStatus' => 'DrydockConstants',
- 'DrydockResourceViewController' => 'DrydockController',
+ 'DrydockResourceViewController' => 'DrydockResourceController',
'DrydockSFTPFilesystemInterface' => 'DrydockFilesystemInterface',
'DrydockSSHCommandInterface' => 'DrydockCommandInterface',
'DrydockWebrootInterface' => 'DrydockInterface',
diff --git a/src/applications/drydock/application/PhabricatorApplicationDrydock.php b/src/applications/drydock/application/PhabricatorApplicationDrydock.php
--- a/src/applications/drydock/application/PhabricatorApplicationDrydock.php
+++ b/src/applications/drydock/application/PhabricatorApplicationDrydock.php
@@ -33,7 +33,7 @@
public function getRoutes() {
return array(
'/drydock/' => array(
- '' => 'DrydockResourceListController',
+ '' => 'DrydockConsoleController',
'blueprint/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockBlueprintListController',
'(?P<id>[1-9]\d*)/' => 'DrydockBlueprintViewController',
diff --git a/src/applications/drydock/controller/DrydockBlueprintController.php b/src/applications/drydock/controller/DrydockBlueprintController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/controller/DrydockBlueprintController.php
@@ -0,0 +1,27 @@
+<?php
+
+abstract class DrydockBlueprintController
+ extends DrydockController {
+
+ public function buildSideNavView() {
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+
+ id(new DrydockBlueprintSearchEngine())
+ ->setViewer($this->getRequest()->getUser())
+ ->addNavigationItems($nav->getMenu());
+
+ $nav->selectFilter(null);
+
+ return $nav;
+ }
+
+ public function buildApplicationCrumbs() {
+ $crumbs = parent::buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ pht('Blueprints'),
+ $this->getApplicationURI('blueprint/'));
+ return $crumbs;
+ }
+
+}
diff --git a/src/applications/drydock/controller/DrydockBlueprintCreateController.php b/src/applications/drydock/controller/DrydockBlueprintCreateController.php
--- a/src/applications/drydock/controller/DrydockBlueprintCreateController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintCreateController.php
@@ -1,10 +1,7 @@
<?php
final class DrydockBlueprintCreateController
- extends DrydockController {
-
- public function willProcessRequest(array $data) {
- }
+ extends DrydockBlueprintController {
public function processRequest() {
$request = $this->getRequest();
diff --git a/src/applications/drydock/controller/DrydockBlueprintEditController.php b/src/applications/drydock/controller/DrydockBlueprintEditController.php
--- a/src/applications/drydock/controller/DrydockBlueprintEditController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintEditController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockBlueprintEditController extends DrydockController {
+final class DrydockBlueprintEditController extends DrydockBlueprintController {
private $id;
diff --git a/src/applications/drydock/controller/DrydockBlueprintListController.php b/src/applications/drydock/controller/DrydockBlueprintListController.php
--- a/src/applications/drydock/controller/DrydockBlueprintListController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintListController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockBlueprintListController extends DrydockController
+final class DrydockBlueprintListController extends DrydockBlueprintController
implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
@@ -18,7 +18,7 @@
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new DrydockBlueprintSearchEngine())
- ->setNavigation($this->buildSideNav());
+ ->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
diff --git a/src/applications/drydock/controller/DrydockBlueprintViewController.php b/src/applications/drydock/controller/DrydockBlueprintViewController.php
--- a/src/applications/drydock/controller/DrydockBlueprintViewController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintViewController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockBlueprintViewController extends DrydockController {
+final class DrydockBlueprintViewController extends DrydockBlueprintController {
private $id;
diff --git a/src/applications/drydock/controller/DrydockConsoleController.php b/src/applications/drydock/controller/DrydockConsoleController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/controller/DrydockConsoleController.php
@@ -0,0 +1,80 @@
+<?php
+
+final class DrydockConsoleController extends DrydockController {
+
+ public function shouldAllowPublic() {
+ return true;
+ }
+
+ public function buildSideNavView() {
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+
+ // These are only used on mobile.
+
+ $nav->addFilter('blueprint', pht('Blueprints'));
+ $nav->addFilter('resource', pht('Resources'));
+ $nav->addFilter('lease', pht('Leases'));
+ $nav->addFilter('log', pht('Logs'));
+
+ $nav->selectFilter(null);
+
+ return $nav;
+ }
+
+ public function processRequest() {
+ $request = $this->getRequest();
+ $viewer = $request->getUser();
+
+ $menu = id(new PHUIObjectItemListView())
+ ->setUser($viewer);
+
+ $menu->addItem(
+ id(new PHUIObjectItemView())
+ ->setHeader(pht('Blueprints'))
+ ->setHref($this->getApplicationURI('blueprint/'))
+ ->addAttribute(
+ pht(
+ 'Configure blueprints so Drydock can build resources, like '.
+ 'hosts and working copies.')));
+
+ $menu->addItem(
+ id(new PHUIObjectItemView())
+ ->setHeader(pht('Resources'))
+ ->setHref($this->getApplicationURI('resource/'))
+ ->addAttribute(
+ pht(
+ 'View and manage resources Drydock has built, like hosts.')));
+
+ $menu->addItem(
+ id(new PHUIObjectItemView())
+ ->setHeader(pht('Leases'))
+ ->setHref($this->getApplicationURI('lease/'))
+ ->addAttribute(
+ pht(
+ 'Manage leases on resources.')));
+
+ $menu->addItem(
+ id(new PHUIObjectItemView())
+ ->setHeader(pht('Logs'))
+ ->setHref($this->getApplicationURI('log/'))
+ ->addAttribute(
+ pht(
+ 'View logs.')));
+
+
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addTextCrumb(pht('Console'));
+
+ return $this->buildApplicationPage(
+ array(
+ $crumbs,
+ $menu,
+ ),
+ array(
+ 'title' => pht('Drydock Console'),
+ 'device' => true,
+ ));
+ }
+
+}
diff --git a/src/applications/drydock/controller/DrydockController.php b/src/applications/drydock/controller/DrydockController.php
--- a/src/applications/drydock/controller/DrydockController.php
+++ b/src/applications/drydock/controller/DrydockController.php
@@ -2,33 +2,10 @@
abstract class DrydockController extends PhabricatorController {
- final protected function buildSideNav($selected = null) {
- $nav = new AphrontSideNavFilterView();
- $nav->setBaseURI(new PhutilURI('/drydock/'));
-
- id(new DrydockBlueprintSearchEngine())
- ->setViewer($this->getRequest()->getUser())
- ->addNavigationItems($nav->getMenu(), pht('Blueprints'));
-
- id(new DrydockLeaseSearchEngine())
- ->setViewer($this->getRequest()->getUser())
- ->addNavigationItems($nav->getMenu(), pht('Leases'));
-
- id(new DrydockResourceSearchEngine())
- ->setViewer($this->getRequest()->getUser())
- ->addNavigationItems($nav->getMenu(), pht('Resources'));
-
- id(new DrydockLogSearchEngine())
- ->setViewer($this->getRequest()->getUser())
- ->addNavigationItems($nav->getMenu(), pht('Logs'));
-
- $nav->selectFilter($selected, 'resource');
-
- return $nav;
- }
+ abstract function buildSideNavView();
public function buildApplicationMenu() {
- return $this->buildSideNav(null)->getMenu();
+ return $this->buildSideNavView()->getMenu();
}
protected function buildLogTableView(array $logs) {
diff --git a/src/applications/drydock/controller/DrydockLeaseController.php b/src/applications/drydock/controller/DrydockLeaseController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/controller/DrydockLeaseController.php
@@ -0,0 +1,27 @@
+<?php
+
+abstract class DrydockLeaseController
+ extends DrydockController {
+
+ public function buildSideNavView() {
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+
+ id(new DrydockLeaseSearchEngine())
+ ->setViewer($this->getRequest()->getUser())
+ ->addNavigationItems($nav->getMenu());
+
+ $nav->selectFilter(null);
+
+ return $nav;
+ }
+
+ public function buildApplicationCrumbs() {
+ $crumbs = parent::buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ pht('Leases'),
+ $this->getApplicationURI('lease/'));
+ return $crumbs;
+ }
+
+}
diff --git a/src/applications/drydock/controller/DrydockLeaseListController.php b/src/applications/drydock/controller/DrydockLeaseListController.php
--- a/src/applications/drydock/controller/DrydockLeaseListController.php
+++ b/src/applications/drydock/controller/DrydockLeaseListController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockLeaseListController extends DrydockController
+final class DrydockLeaseListController extends DrydockLeaseController
implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
@@ -18,7 +18,7 @@
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new DrydockLeaseSearchEngine())
- ->setNavigation($this->buildSideNav());
+ ->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
diff --git a/src/applications/drydock/controller/DrydockLeaseReleaseController.php b/src/applications/drydock/controller/DrydockLeaseReleaseController.php
--- a/src/applications/drydock/controller/DrydockLeaseReleaseController.php
+++ b/src/applications/drydock/controller/DrydockLeaseReleaseController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockLeaseReleaseController extends DrydockController {
+final class DrydockLeaseReleaseController extends DrydockLeaseController {
private $id;
diff --git a/src/applications/drydock/controller/DrydockLeaseViewController.php b/src/applications/drydock/controller/DrydockLeaseViewController.php
--- a/src/applications/drydock/controller/DrydockLeaseViewController.php
+++ b/src/applications/drydock/controller/DrydockLeaseViewController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockLeaseViewController extends DrydockController {
+final class DrydockLeaseViewController extends DrydockLeaseController {
private $id;
diff --git a/src/applications/drydock/controller/DrydockLogController.php b/src/applications/drydock/controller/DrydockLogController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/controller/DrydockLogController.php
@@ -0,0 +1,27 @@
+<?php
+
+abstract class DrydockLogController
+ extends DrydockController {
+
+ public function buildSideNavView() {
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+
+ id(new DrydockLogSearchEngine())
+ ->setViewer($this->getRequest()->getUser())
+ ->addNavigationItems($nav->getMenu());
+
+ $nav->selectFilter(null);
+
+ return $nav;
+ }
+
+ public function buildApplicationCrumbs() {
+ $crumbs = parent::buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ pht('Logs'),
+ $this->getApplicationURI('log/'));
+ return $crumbs;
+ }
+
+}
diff --git a/src/applications/drydock/controller/DrydockLogListController.php b/src/applications/drydock/controller/DrydockLogListController.php
--- a/src/applications/drydock/controller/DrydockLogListController.php
+++ b/src/applications/drydock/controller/DrydockLogListController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockLogListController extends DrydockController
+final class DrydockLogListController extends DrydockLogController
implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
@@ -18,7 +18,7 @@
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new DrydockLogSearchEngine())
- ->setNavigation($this->buildSideNav());
+ ->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
diff --git a/src/applications/drydock/controller/DrydockResourceCloseController.php b/src/applications/drydock/controller/DrydockResourceCloseController.php
--- a/src/applications/drydock/controller/DrydockResourceCloseController.php
+++ b/src/applications/drydock/controller/DrydockResourceCloseController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockResourceCloseController extends DrydockController {
+final class DrydockResourceCloseController extends DrydockResourceController {
private $id;
diff --git a/src/applications/drydock/controller/DrydockResourceController.php b/src/applications/drydock/controller/DrydockResourceController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/controller/DrydockResourceController.php
@@ -0,0 +1,27 @@
+<?php
+
+abstract class DrydockResourceController
+ extends DrydockController {
+
+ public function buildSideNavView() {
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+
+ id(new DrydockResourceSearchEngine())
+ ->setViewer($this->getRequest()->getUser())
+ ->addNavigationItems($nav->getMenu());
+
+ $nav->selectFilter(null);
+
+ return $nav;
+ }
+
+ public function buildApplicationCrumbs() {
+ $crumbs = parent::buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ pht('Resources'),
+ $this->getApplicationURI('resource/'));
+ return $crumbs;
+ }
+
+}
diff --git a/src/applications/drydock/controller/DrydockResourceListController.php b/src/applications/drydock/controller/DrydockResourceListController.php
--- a/src/applications/drydock/controller/DrydockResourceListController.php
+++ b/src/applications/drydock/controller/DrydockResourceListController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockResourceListController extends DrydockController
+final class DrydockResourceListController extends DrydockResourceController
implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
@@ -18,7 +18,7 @@
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new DrydockResourceSearchEngine())
- ->setNavigation($this->buildSideNav());
+ ->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
diff --git a/src/applications/drydock/controller/DrydockResourceViewController.php b/src/applications/drydock/controller/DrydockResourceViewController.php
--- a/src/applications/drydock/controller/DrydockResourceViewController.php
+++ b/src/applications/drydock/controller/DrydockResourceViewController.php
@@ -1,6 +1,6 @@
<?php
-final class DrydockResourceViewController extends DrydockController {
+final class DrydockResourceViewController extends DrydockResourceController {
private $id;
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -154,8 +154,8 @@
}
$nav->selectFilter(
- $engine->getNavPrefix().'query/'.$saved_query->getQueryKey(),
- $engine->getNavPrefix().'query/advanced');
+ 'query/'.$saved_query->getQueryKey(),
+ 'query/advanced');
$form = id(new AphrontFormView())
->setUser($user);
diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
--- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
@@ -107,40 +107,27 @@
->setEngineClassName(get_class($this));
}
- public function getNavPrefix() {
- return get_class($this).':';
- }
-
- public function addNavigationItems(PHUIListView $menu, $label = null) {
+ public function addNavigationItems(PHUIListView $menu) {
$viewer = $this->requireViewer();
- $menu->newLabel(coalesce($label, pht('Queries')));
+ $menu->newLabel(pht('Queries'));
$named_queries = $this->loadEnabledNamedQueries();
- $prefix = $this->getNavPrefix();
foreach ($named_queries as $query) {
$key = $query->getQueryKey();
$uri = $this->getQueryResultsPageURI($key);
- $menu->newLink(
- $query->getQueryName(),
- $uri,
- $prefix.'query/'.$key);
+ $menu->newLink($query->getQueryName(), $uri, 'query/'.$key);
}
if ($viewer->isLoggedIn()) {
$manage_uri = $this->getQueryManagementURI();
- $menu->newLink(
- pht('Edit Queries...'),
- $manage_uri,
- $prefix.'query/edit');
+ $menu->newLink(pht('Edit Queries...'), $manage_uri, 'query/edit');
}
$menu->newLabel(pht('Search'));
$advanced_uri = $this->getQueryResultsPageURI('advanced');
- $menu->newLink(
- pht('Advanced Search'),
- $advanced_uri, $prefix.'query/advanced');
+ $menu->newLink(pht('Advanced Search'), $advanced_uri, 'query/advanced');
return $this;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/yi/in/j7tsyjbd2b6ygy7w
Default Alt Text
D7833.diff (24 KB)
Attached To
Mode
D7833: Provide a Drydock "Console" controller
Attached
Detach File
Event Timeline
Log In to Comment