diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php index 8d6e690205..560d4203a0 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php @@ -1,28 +1,32 @@ id = $data['id']; } public function processRequest() { $id = $this->id; return $this->buildStandardPageResponse( phutil_tag( 'iframe', array( 'src' => '/xhpast/frameset/'.$id.'/', 'frameborder' => '0', 'style' => 'width: 100%; height: 800px;', '', )), array( 'title' => pht('XHPAST View'), )); } } diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php index 2ca3b17e96..a21bb30b68 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php @@ -1,28 +1,32 @@ id = $data['id']; } public function processRequest() { $id = $this->id; $response = new AphrontWebpageResponse(); $response->setFrameable(true); $response->setContent(phutil_tag( 'frameset', array('cols' => '33%, 34%, 33%'), array( phutil_tag('frame', array('src' => "/xhpast/input/{$id}/")), phutil_tag('frame', array('src' => "/xhpast/tree/{$id}/")), phutil_tag('frame', array('src' => "/xhpast/stream/{$id}/")), ))); return $response; } } diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php index ab68948af3..8f824dc03f 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php @@ -1,70 +1,74 @@ id = $data['id']; $this->storageTree = id(new PhabricatorXHPASTViewParseTree()) ->load($this->id); if (!$this->storageTree) { throw new Exception(pht('No such AST!')); } } protected function getStorageTree() { return $this->storageTree; } protected function buildXHPASTViewPanelResponse($content) { $content = hsprintf( ''. ''. ''. ''. ''. '%s'. '', $content); $response = new AphrontWebpageResponse(); $response->setFrameable(true); $response->setContent($content); return $response; } } diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php index b332784e92..7da285f121 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php @@ -1,45 +1,49 @@ getStorageTree(); $input = $storage->getInput(); $stdout = $storage->getStdout(); $tree = XHPASTTree::newFromDataAndResolvedExecFuture( $input, array(0, $stdout, '')); $tree = phutil_tag('ul', array(), $this->buildTree($tree->getRootNode())); return $this->buildXHPASTViewPanelResponse($tree); } protected function buildTree($root) { try { $name = $root->getTypeName(); $title = $root->getDescription(); } catch (Exception $ex) { $name = '???'; $title = '???'; } $tree = array(); $tree[] = phutil_tag( 'li', array(), phutil_tag( 'span', array( 'title' => $title, ), $name)); foreach ($root->getChildren() as $child) { $tree[] = phutil_tag('ul', array(), $this->buildTree($child)); } return phutil_implode_html("\n", $tree); } }