Use ApplicationSearch in Feed

Summary: Ref T2625. This doesn't do anything fancy, but gives feed a little more flexibility.

Test Plan: Viewed `/feed/`.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6681
This commit is contained in:
epriestley
2013-08-05 14:10:41 -07:00
parent b20a0eed13
commit 42af0d66d9
7 changed files with 184 additions and 96 deletions

View File

@@ -0,0 +1,39 @@
<?php
final class PhabricatorFeedListController extends PhabricatorFeedController
implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->queryKey = idx($data, 'queryKey');
}
public function processRequest() {
$request = $this->getRequest();
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new PhabricatorFeedSearchEngine())
->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
public function renderResultsList(
array $feed,
PhabricatorSavedQuery $query) {
$builder = new PhabricatorFeedBuilder($feed);
$builder->setUser($this->getRequest()->getUser());
$view = $builder->buildView();
return hsprintf(
'<div class="phabricator-feed-frame">%s</div>',
$view);
}
}