Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / harbormaster / controller / HarbormasterLintMessagesController.php
blob8fe1edbcaf614d406508a00070e87296d47a13fc
1 <?php
3 final class HarbormasterLintMessagesController
4 extends HarbormasterController {
6 public function shouldAllowPublic() {
7 return true;
10 public function handleRequest(AphrontRequest $request) {
11 $viewer = $this->getViewer();
13 $buildable = id(new HarbormasterBuildableQuery())
14 ->setViewer($viewer)
15 ->withIDs(array($request->getURIData('id')))
16 ->needBuilds(true)
17 ->needTargets(true)
18 ->executeOne();
19 if (!$buildable) {
20 return new Aphront404Response();
23 $id = $buildable->getID();
25 $target_phids = array();
26 foreach ($buildable->getBuilds() as $build) {
27 foreach ($build->getBuildTargets() as $target) {
28 $target_phids[] = $target->getPHID();
32 $lint_data = array();
33 if ($target_phids) {
34 $lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere(
35 'buildTargetPHID IN (%Ls)',
36 $target_phids);
37 } else {
38 $lint_data = array();
41 $lint_table = id(new HarbormasterLintPropertyView())
42 ->setUser($viewer)
43 ->setLintMessages($lint_data);
45 $lint = id(new PHUIObjectBoxView())
46 ->setHeaderText(pht('Lint Messages'))
47 ->appendChild($lint_table);
49 $crumbs = $this->buildApplicationCrumbs();
50 $this->addBuildableCrumb($crumbs, $buildable);
51 $crumbs->addTextCrumb(pht('Lint'));
52 $crumbs->setBorder(true);
54 $title = array(
55 $buildable->getMonogram(),
56 pht('Lint'),
59 $header = id(new PHUIHeaderView())
60 ->setHeader($title);
62 $view = id(new PHUITwoColumnView())
63 ->setHeader($header)
64 ->setFooter(array(
65 $lint,
66 ));
68 return $this->newPage()
69 ->setTitle($title)
70 ->setCrumbs($crumbs)
71 ->appendChild($view);