Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/legalpad/controller/LegalpadDocumentListController.php
13452 views
1
<?php
2
3
final class LegalpadDocumentListController extends LegalpadController {
4
5
public function shouldAllowPublic() {
6
return true;
7
}
8
9
public function handleRequest(AphrontRequest $request) {
10
$querykey = $request->getURIData('queryKey');
11
12
$controller = id(new PhabricatorApplicationSearchController())
13
->setQueryKey($querykey)
14
->setSearchEngine(new LegalpadDocumentSearchEngine())
15
->setNavigation($this->buildSideNav());
16
17
return $this->delegateToController($controller);
18
}
19
20
protected function buildApplicationCrumbs() {
21
$crumbs = parent::buildApplicationCrumbs();
22
23
$can_create = $this->hasApplicationCapability(
24
LegalpadCreateDocumentsCapability::CAPABILITY);
25
26
$crumbs->addAction(
27
id(new PHUIListItemView())
28
->setName(pht('Create Document'))
29
->setHref($this->getApplicationURI('edit/'))
30
->setIcon('fa-plus-square')
31
->setDisabled(!$can_create)
32
->setWorkflow(!$can_create));
33
34
35
return $crumbs;
36
}
37
38
}
39
40