1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 03:02:43 +01:00
phorge-phorge/src/applications/legalpad/controller/LegalpadDocumentListController.php

44 lines
1.1 KiB
PHP
Raw Normal View History

<?php
final class LegalpadDocumentListController extends LegalpadController {
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 LegalpadDocumentSearchEngine())
->setNavigation($this->buildSideNav());
return $this->delegateToController($controller);
}
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$can_create = $this->hasApplicationCapability(
LegalpadCapabilityCreateDocuments::CAPABILITY);
$crumbs->addAction(
id(new PHUIListItemView())
->setName(pht('Create Document'))
->setHref($this->getApplicationURI('create/'))
->setIcon('fa-plus-square')
->setDisabled(!$can_create)
->setWorkflow(!$can_create));
return $crumbs;
}
}