Differential D12661 Diff 30409 src/applications/calendar/controller/PhabricatorCalendarEventListController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/controller/PhabricatorCalendarEventListController.php
<?php | <?php | ||||
final class PhabricatorCalendarEventListController | final class PhabricatorCalendarEventListController | ||||
extends PhabricatorCalendarController { | extends PhabricatorCalendarController { | ||||
private $queryKey; | |||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return true; | return true; | ||||
} | } | ||||
public function willProcessRequest(array $data) { | public function handleRequest(AphrontRequest $request) { | ||||
$this->queryKey = idx($data, 'queryKey'); | $year = $request->getURIData('year'); | ||||
$month = $request->getURIData('month'); | |||||
$engine = new PhabricatorCalendarEventSearchEngine(); | |||||
if ($month && $year) { | |||||
$engine->setCalendarYearAndMonth($year, $month); | |||||
} | } | ||||
public function processRequest() { | |||||
$controller = id(new PhabricatorApplicationSearchController()) | $controller = id(new PhabricatorApplicationSearchController()) | ||||
->setQueryKey($this->queryKey) | ->setQueryKey($request->getURIData('queryKey')) | ||||
->setSearchEngine(new PhabricatorCalendarEventSearchEngine()) | ->setSearchEngine($engine) | ||||
->setNavigation($this->buildSideNav()); | ->setNavigation($this->buildSideNav()); | ||||
return $this->delegateToController($controller); | return $this->delegateToController($controller); | ||||
} | } | ||||
public function buildSideNav() { | public function buildSideNav() { | ||||
$user = $this->getRequest()->getUser(); | $user = $this->getRequest()->getUser(); | ||||
$nav = new AphrontSideNavFilterView(); | $nav = new AphrontSideNavFilterView(); | ||||
Show All 12 Lines |