From 23e18b1ca5c410c3c1f6bd8132328089c9d5b8d2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 3 Jul 2013 05:46:04 -0700 Subject: [PATCH] Provide PhabricatorSavedQuery to renderResultsList() Summary: This allows the SavedQuery to modify what the result list looks like (e.g., include display flags and similar). Test Plan: Looked at some ApplicationSearch apps. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2625 Differential Revision: https://secure.phabricator.com/D6346 --- .../conduit/controller/PhabricatorConduitListController.php | 4 +++- .../diviner/controller/DivinerAtomListController.php | 4 +++- .../files/controller/PhabricatorFileListController.php | 5 ++++- .../macro/controller/PhabricatorMacroListController.php | 5 ++++- .../paste/controller/PhabricatorPasteListController.php | 4 +++- .../people/controller/PhabricatorPeopleListController.php | 5 ++++- .../controller/PhabricatorApplicationSearchController.php | 2 +- ...habricatorApplicationSearchResultsControllerInterface.php | 4 +++- 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/applications/conduit/controller/PhabricatorConduitListController.php b/src/applications/conduit/controller/PhabricatorConduitListController.php index b94b36a490..e2d1eb5f79 100644 --- a/src/applications/conduit/controller/PhabricatorConduitListController.php +++ b/src/applications/conduit/controller/PhabricatorConduitListController.php @@ -22,7 +22,9 @@ final class PhabricatorConduitListController return $this->delegateToController($controller); } - public function renderResultsList(array $methods) { + public function renderResultsList( + array $methods, + PhabricatorSavedQuery $query) { assert_instances_of($methods, 'ConduitAPIMethod'); $viewer = $this->getRequest()->getUser(); diff --git a/src/applications/diviner/controller/DivinerAtomListController.php b/src/applications/diviner/controller/DivinerAtomListController.php index 854f29c4e3..0da8842e56 100644 --- a/src/applications/diviner/controller/DivinerAtomListController.php +++ b/src/applications/diviner/controller/DivinerAtomListController.php @@ -23,7 +23,9 @@ final class DivinerAtomListController extends DivinerController return $this->delegateToController($controller); } - public function renderResultsList(array $symbols) { + public function renderResultsList( + array $symbols, + PhabricatorSavedQuery $query) { return $this->renderAtomList($symbols); } diff --git a/src/applications/files/controller/PhabricatorFileListController.php b/src/applications/files/controller/PhabricatorFileListController.php index 3f307569b8..4943e3cc7e 100644 --- a/src/applications/files/controller/PhabricatorFileListController.php +++ b/src/applications/files/controller/PhabricatorFileListController.php @@ -23,7 +23,10 @@ final class PhabricatorFileListController extends PhabricatorFileController return $this->delegateToController($controller); } - public function renderResultsList(array $files) { + public function renderResultsList( + array $files, + PhabricatorSavedQuery $query) { + assert_instances_of($files, 'PhabricatorFile'); $request = $this->getRequest(); diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php index e1f03fd574..cd8c411d89 100644 --- a/src/applications/macro/controller/PhabricatorMacroListController.php +++ b/src/applications/macro/controller/PhabricatorMacroListController.php @@ -23,7 +23,10 @@ final class PhabricatorMacroListController extends PhabricatorMacroController return $this->delegateToController($controller); } - public function renderResultsList(array $macros) { + public function renderResultsList( + array $macros, + PhabricatorSavedQuery $query) { + assert_instances_of($macros, 'PhabricatorFileImageMacro'); $viewer = $this->getRequest()->getUser(); diff --git a/src/applications/paste/controller/PhabricatorPasteListController.php b/src/applications/paste/controller/PhabricatorPasteListController.php index 7e4f972490..14c53a42fb 100644 --- a/src/applications/paste/controller/PhabricatorPasteListController.php +++ b/src/applications/paste/controller/PhabricatorPasteListController.php @@ -23,7 +23,9 @@ final class PhabricatorPasteListController extends PhabricatorPasteController return $this->delegateToController($controller); } - public function renderResultsList(array $pastes) { + public function renderResultsList( + array $pastes, + PhabricatorSavedQuery $query) { assert_instances_of($pastes, 'PhabricatorPaste'); $user = $this->getRequest()->getUser(); diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php index b81397003c..fbc22cbd16 100644 --- a/src/applications/people/controller/PhabricatorPeopleListController.php +++ b/src/applications/people/controller/PhabricatorPeopleListController.php @@ -27,7 +27,10 @@ final class PhabricatorPeopleListController extends PhabricatorPeopleController return $this->delegateToController($controller); } - public function renderResultsList(array $users) { + public function renderResultsList( + array $users, + PhabricatorSavedQuery $query) { + assert_instances_of($users, 'PhabricatorUser'); $request = $this->getRequest(); diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index c554ae5536..b6199e6825 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -177,7 +177,7 @@ final class PhabricatorApplicationSearchController $objects = $query->setViewer($request->getUser()) ->executeWithCursorPager($pager); - $list = $parent->renderResultsList($objects); + $list = $parent->renderResultsList($objects, $saved_query); $nav->appendChild($list); diff --git a/src/applications/search/interface/PhabricatorApplicationSearchResultsControllerInterface.php b/src/applications/search/interface/PhabricatorApplicationSearchResultsControllerInterface.php index 378a308353..d9de0acb9c 100644 --- a/src/applications/search/interface/PhabricatorApplicationSearchResultsControllerInterface.php +++ b/src/applications/search/interface/PhabricatorApplicationSearchResultsControllerInterface.php @@ -2,6 +2,8 @@ interface PhabricatorApplicationSearchResultsControllerInterface { - public function renderResultsList(array $items); + public function renderResultsList( + array $items, + PhabricatorSavedQuery $query); }