Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phpast / controller / PhabricatorXHPASTViewPanelController.php
blobaf6c1ee761d228d281ce573d2b7b6adc85cfbe60
1 <?php
3 abstract class PhabricatorXHPASTViewPanelController
4 extends PhabricatorXHPASTViewController {
6 private $id;
7 private $storageTree;
9 public function shouldAllowPublic() {
10 return true;
13 public function willProcessRequest(array $data) {
14 $this->id = $data['id'];
15 $this->storageTree = id(new PhabricatorXHPASTParseTree())
16 ->load($this->id);
18 if (!$this->storageTree) {
19 throw new Exception(pht('No such AST!'));
23 protected function getStorageTree() {
24 return $this->storageTree;
27 protected function buildXHPASTViewPanelResponse($content) {
28 $content = hsprintf(
29 '<!DOCTYPE html>'.
30 '<html>'.
31 '<head>'.
32 '<style type="text/css">
33 body {
34 white-space: pre;
35 font: 10px "Monaco";
36 cursor: pointer;
39 .token {
40 padding: 2px 4px;
41 margin: 2px 2px;
42 border: 1px solid #bbbbbb;
43 line-height: 24px;
46 ul {
47 margin: 0 0 0 1em;
48 padding: 0;
49 list-style: none;
50 line-height: 1em;
53 li {
54 margin: 0;
55 padding: 0;
58 li span {
59 background: #dddddd;
60 padding: 3px 6px;
63 </style>'.
64 '</head>'.
65 '<body>%s</body>'.
66 '</html>',
67 $content);
69 return id(new AphrontWebpageResponse())
70 ->setFrameable(true)
71 ->setContent($content);