Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionLintController.php
| Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | if (!$drequest) { | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Filter'))); | ->setValue(pht('Filter'))); | ||||
| $content[] = id(new AphrontListFilterView())->appendChild($form); | $content[] = id(new AphrontListFilterView())->appendChild($form); | ||||
| } | } | ||||
| $content[] = id(new PHUIObjectBoxView()) | $content[] = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Lint')) | ->setHeaderText(pht('Lint')) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setTable($table); | ->setTable($table); | ||||
| $title = array('Lint'); | $title = array('Lint'); | ||||
| $crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
| array( | array( | ||||
| 'branch' => true, | 'branch' => true, | ||||
| 'path' => true, | 'path' => true, | ||||
| 'view' => 'lint', | 'view' => 'lint', | ||||
| )); | )); | ||||
| if ($drequest) { | if ($drequest) { | ||||
| $title[] = $drequest->getRepository()->getDisplayName(); | $title[] = $drequest->getRepository()->getDisplayName(); | ||||
| } else { | } else { | ||||
| $crumbs->addTextCrumb(pht('All Lint')); | $crumbs->addTextCrumb(pht('All Lint')); | ||||
| } | } | ||||
| if ($drequest) { | if ($drequest) { | ||||
| $branch = $drequest->loadBranch(); | $branch = $drequest->loadBranch(); | ||||
| $header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
| ->setHeader($this->renderPathLinks($drequest, 'lint')) | ->setHeader($this->renderPathLinks($drequest, 'lint')) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->setPolicyObject($drequest->getRepository()); | ->setHeaderIcon('fa-code'); | ||||
| $actions = $this->buildActionView($drequest); | $actions = $this->buildActionView($drequest); | ||||
| $properties = $this->buildPropertyView( | $properties = $this->buildPropertyView( | ||||
| $drequest, | $drequest, | ||||
| $branch, | $branch, | ||||
| $total, | $total, | ||||
| $actions); | $actions); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $object_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->addPropertyList($properties); | ->addPropertyList($properties); | ||||
| } else { | } else { | ||||
| $object_box = null; | $object_box = null; | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader(pht('All Lint')) | |||||
| ->setHeaderIcon('fa-code'); | |||||
| } | } | ||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $object_box, | |||||
| $content, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle($title) | ->setTitle($title) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild( | ->appendChild( | ||||
| array( | array( | ||||
| $object_box, | $view, | ||||
| $content, | |||||
| )); | )); | ||||
| } | } | ||||
| private function loadLintCodes($drequest, array $owner_phids) { | private function loadLintCodes($drequest, array $owner_phids) { | ||||
| $conn = id(new PhabricatorRepository())->establishConnection('r'); | $conn = id(new PhabricatorRepository())->establishConnection('r'); | ||||
| $where = array('1 = 1'); | $where = array('1 = 1'); | ||||
| if ($drequest) { | if ($drequest) { | ||||
| ▲ Show 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | $table = id(new AphrontTableView($rows)) | ||||
| )) | )) | ||||
| ->setColumnClasses(array('', 'n')) | ->setColumnClasses(array('', 'n')) | ||||
| ->setColumnVisibility(array($is_dir)); | ->setColumnVisibility(array($is_dir)); | ||||
| $content = array(); | $content = array(); | ||||
| $content[] = id(new PHUIObjectBoxView()) | $content[] = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Lint Details')) | ->setHeaderText(pht('Lint Details')) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setTable($table); | ->setTable($table); | ||||
| $crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
| array( | array( | ||||
| 'branch' => true, | 'branch' => true, | ||||
| 'path' => true, | 'path' => true, | ||||
| 'view' => 'lint', | 'view' => 'lint', | ||||
| )); | )); | ||||
| $pager_box = $this->renderTablePagerBox($pager); | $pager_box = $this->renderTablePagerBox($pager); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader(pht('Lint: %s', $drequest->getRepository()->getDisplayName())) | |||||
| ->setHeaderIcon('fa-code'); | |||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $content, | |||||
| $pager_box, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle( | ->setTitle( | ||||
| array( | array( | ||||
| pht('Lint'), | pht('Lint'), | ||||
| $drequest->getRepository()->getDisplayName(), | $drequest->getRepository()->getDisplayName(), | ||||
| )) | )) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild( | ->appendChild( | ||||
| array( | array( | ||||
| $content, | $view, | ||||
| $pager_box, | |||||
| )); | )); | ||||
| } | } | ||||
| private function loadLintMessages( | private function loadLintMessages( | ||||
| PhabricatorRepositoryBranch $branch, | PhabricatorRepositoryBranch $branch, | ||||
| $limit, | $limit, | ||||
| $offset) { | $offset) { | ||||
| Show All 38 Lines | |||||