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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user