2011-03-25 05:32:26 +01:00
|
|
|
<?php
|
|
|
|
|
2014-05-09 21:25:52 +02:00
|
|
|
final class HeraldTranscriptListController extends HeraldController {
|
2011-03-25 05:32:26 +01:00
|
|
|
|
2014-02-21 21:51:25 +01:00
|
|
|
private $queryKey;
|
2011-03-25 05:32:26 +01:00
|
|
|
|
2014-02-21 21:51:25 +01:00
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
2011-03-25 05:32:26 +01:00
|
|
|
|
2014-02-21 21:51:25 +01:00
|
|
|
if ($for_app) {
|
|
|
|
$nav->addFilter('new', pht('Create Rule'));
|
|
|
|
}
|
2011-04-07 23:24:54 +02:00
|
|
|
|
2014-02-21 21:51:25 +01:00
|
|
|
id(new HeraldTranscriptSearchEngine())
|
2013-10-05 00:17:18 +02:00
|
|
|
->setViewer($user)
|
2014-02-21 21:51:25 +01:00
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildApplicationCrumbs() {
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
|
|
|
$crumbs->addTextCrumb(
|
|
|
|
pht('Transcripts'),
|
|
|
|
$this->getApplicationURI('transcript/'));
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 HeraldTranscriptSearchEngine())
|
|
|
|
->setNavigation($this->buildSideNavView());
|
|
|
|
|
|
|
|
return $this->delegateToController($controller);
|
|
|
|
}
|
|
|
|
|
2011-03-25 05:32:26 +01:00
|
|
|
}
|