Restore merge of phutil_tag.

This commit is contained in:
epriestley
2013-02-13 14:50:15 -08:00
parent 73cce6e131
commit ef7f16180c
264 changed files with 1690 additions and 1716 deletions

View File

@@ -14,12 +14,15 @@ final class PhabricatorXHPASTViewFramesetController
$response = new AphrontWebpageResponse();
$response->setFrameable(true);
$response->setContent(
'<frameset cols="33%, 34%, 33%">'.
'<frame src="/xhpast/input/'.$id.'/" />'.
'<frame src="/xhpast/tree/'.$id.'/" />'.
'<frame src="/xhpast/stream/'.$id.'/" />'.
'</frameset>');
$response->setContent(hsprintf(
'<frameset cols="33%%, 34%%, 33%%">'.
'<frame src="/xhpast/input/%s/" />'.
'<frame src="/xhpast/tree/%s/" />'.
'<frame src="/xhpast/stream/%s/" />'.
'</frameset>',
$id,
$id,
$id));
return $response;
}

View File

@@ -5,7 +5,6 @@ final class PhabricatorXHPASTViewInputController
public function processRequest() {
$input = $this->getStorageTree()->getInput();
return $this->buildXHPASTViewPanelResponse(
phutil_escape_html($input));
return $this->buildXHPASTViewPanelResponse($input);
}
}

View File

@@ -20,7 +20,7 @@ abstract class PhabricatorXHPASTViewPanelController
}
protected function buildXHPASTViewPanelResponse($content) {
$content =
$content = hsprintf(
'<!DOCTYPE html>'.
'<html>'.
'<head>'.
@@ -57,10 +57,9 @@ li span {
</style>'.
'</head>'.
'<body>'.
$content.
'</body>'.
'</html>';
'<body>%s</body>'.
'</html>',
$content);
$response = new AphrontWebpageResponse();
$response->setFrameable(true);

View File

@@ -27,6 +27,7 @@ final class PhabricatorXHPASTViewStreamController
$token->getValue());
}
return $this->buildXHPASTViewPanelResponse(implode('', $tokens));
return $this->buildXHPASTViewPanelResponse(
phutil_implode_html('', $tokens));
}
}

View File

@@ -12,7 +12,7 @@ final class PhabricatorXHPASTViewTreeController
$input,
array(0, $stdout, ''));
$tree = '<ul>'.$this->buildTree($tree->getRootNode()).'</ul>';
$tree = phutil_tag('ul', array(), $this->buildTree($tree->getRootNode()));
return $this->buildXHPASTViewPanelResponse($tree);
}
@@ -27,19 +27,19 @@ final class PhabricatorXHPASTViewTreeController
}
$tree = array();
$tree[] =
'<li>'.
phutil_tag(
'span',
array(
'title' => $title,
),
$name).
'</li>';
$tree[] = phutil_tag(
'li',
array(),
phutil_tag(
'span',
array(
'title' => $title,
),
$name));
foreach ($root->getChildren() as $child) {
$tree[] = '<ul>'.$this->buildTree($child).'</ul>';
$tree[] = phutil_tag('ul', array(), $this->buildTree($child));
}
return implode("\n", $tree);
return phutil_implode_html("\n", $tree);
}
}