2013-12-05 20:56:14 +01:00
|
|
|
<?php
|
|
|
|
|
2014-03-26 15:42:30 +01:00
|
|
|
final class DiffusionPushLogListController extends DiffusionPushLogController
|
2013-12-05 20:56:14 +01:00
|
|
|
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 PhabricatorRepositoryPushLogSearchEngine())
|
|
|
|
->setNavigation($this->buildSideNavView());
|
|
|
|
|
|
|
|
return $this->delegateToController($controller);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderResultsList(
|
|
|
|
array $logs,
|
|
|
|
PhabricatorSavedQuery $query) {
|
|
|
|
|
2014-03-26 15:42:30 +01:00
|
|
|
$table = $this->renderPushLogTable($logs);
|
2013-12-05 20:56:14 +01:00
|
|
|
|
|
|
|
$box = id(new PHUIBoxView())
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE)
|
|
|
|
->appendChild($table);
|
|
|
|
|
|
|
|
return $box;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$viewer = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
id(new PhabricatorRepositoryPushLogSearchEngine())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|