[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/legalpad/controller/ -> LegalpadDocumentListController.php (source)

   1  <?php
   2  
   3  final class LegalpadDocumentListController extends LegalpadController {
   4  
   5    private $queryKey;
   6  
   7    public function shouldAllowPublic() {
   8      return true;
   9    }
  10  
  11    public function willProcessRequest(array $data) {
  12      $this->queryKey = idx($data, 'queryKey');
  13    }
  14  
  15    public function processRequest() {
  16      $controller = id(new PhabricatorApplicationSearchController())
  17        ->setQueryKey($this->queryKey)
  18        ->setSearchEngine(new LegalpadDocumentSearchEngine())
  19        ->setNavigation($this->buildSideNav());
  20  
  21      return $this->delegateToController($controller);
  22    }
  23  
  24    public function buildApplicationCrumbs() {
  25      $crumbs = parent::buildApplicationCrumbs();
  26  
  27      $can_create = $this->hasApplicationCapability(
  28        LegalpadCreateDocumentsCapability::CAPABILITY);
  29  
  30      $crumbs->addAction(
  31        id(new PHUIListItemView())
  32          ->setName(pht('Create Document'))
  33          ->setHref($this->getApplicationURI('create/'))
  34          ->setIcon('fa-plus-square')
  35          ->setDisabled(!$can_create)
  36          ->setWorkflow(!$can_create));
  37  
  38  
  39      return $crumbs;
  40    }
  41  
  42  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1