Summary: Updates Projects to use handleRequest Test Plan: New Project, Edit Project, Archive, Watch, Create Workboards, Import Workboards, Edit Column, New Column, Change Icon, Add/Remove Members Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13829
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorProjectListController
|
|
extends PhabricatorProjectController {
|
|
|
|
public function shouldAllowPublic() {
|
|
return true;
|
|
}
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $request->getViewer();
|
|
$query_key = $request->getURIData('queryKey');
|
|
|
|
$controller = id(new PhabricatorApplicationSearchController())
|
|
->setQueryKey($query_key)
|
|
->setSearchEngine(new PhabricatorProjectSearchEngine())
|
|
->setNavigation($this->buildSideNavView());
|
|
|
|
return $this->delegateToController($controller);
|
|
}
|
|
|
|
public function buildApplicationMenu() {
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
}
|
|
|
|
protected function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$can_create = $this->hasApplicationCapability(
|
|
ProjectCreateProjectsCapability::CAPABILITY);
|
|
|
|
$crumbs->addAction(
|
|
id(new PHUIListItemView())
|
|
->setName(pht('Create Project'))
|
|
->setHref($this->getApplicationURI('create/'))
|
|
->setIcon('fa-plus-square')
|
|
->setWorkflow(!$can_create)
|
|
->setDisabled(!$can_create));
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
}
|