[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/config/controller/ -> PhabricatorConfigIssueViewController.php (source)

   1  <?php
   2  
   3  final class PhabricatorConfigIssueViewController
   4    extends PhabricatorConfigController {
   5  
   6    private $issueKey;
   7  
   8    public function willProcessRequest(array $data) {
   9      $this->issueKey = $data['key'];
  10    }
  11  
  12    public function processRequest() {
  13      $request = $this->getRequest();
  14      $user = $request->getUser();
  15  
  16      $issues = PhabricatorSetupCheck::runAllChecks();
  17      PhabricatorSetupCheck::setOpenSetupIssueCount(
  18        PhabricatorSetupCheck::countUnignoredIssues($issues));
  19  
  20      if (empty($issues[$this->issueKey])) {
  21        $content = id(new AphrontErrorView())
  22          ->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
  23          ->setTitle(pht('Issue Resolved'))
  24          ->appendChild(pht('This setup issue has been resolved. '))
  25          ->appendChild(
  26            phutil_tag(
  27              'a',
  28              array(
  29                'href' => $this->getApplicationURI('issue/'),
  30              ),
  31              pht('Return to Open Issue List')));
  32        $title = pht('Resolved Issue');
  33      } else {
  34        $issue = $issues[$this->issueKey];
  35        $content = $this->renderIssue($issue);
  36        $title = $issue->getShortName();
  37      }
  38  
  39      $crumbs = $this
  40        ->buildApplicationCrumbs()
  41        ->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
  42        ->addTextCrumb($title, $request->getRequestURI());
  43  
  44      return $this->buildApplicationPage(
  45        array(
  46          $crumbs,
  47          $content,
  48        ),
  49        array(
  50          'title' => $title,
  51        ));
  52    }
  53  
  54    private function renderIssue(PhabricatorSetupIssue $issue) {
  55      require_celerity_resource('setup-issue-css');
  56  
  57      $view = new PhabricatorSetupIssueView();
  58      $view->setIssue($issue);
  59  
  60      $container = phutil_tag(
  61        'div',
  62        array(
  63          'class' => 'setup-issue-background',
  64        ),
  65        $view->render());
  66  
  67      return $container;
  68    }
  69  
  70  }


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