1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00

Convert simple phutil_render_tag() to phutil_tag()

Summary: Done manually.

Test Plan: Loaded homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4509
This commit is contained in:
vrana 2013-01-18 00:32:58 -08:00
parent 21a5956a35
commit 3c1b8df8ae
51 changed files with 223 additions and 214 deletions

View file

@ -211,13 +211,12 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
$info = wordwrap($info, 128, "\n", true); $info = wordwrap($info, 128, "\n", true);
if (!empty($row['explain'])) { if (!empty($row['explain'])) {
$analysis = phutil_escape_html($row['explain']['reason']); $analysis = phutil_tag(
$analysis = phutil_render_tag(
'span', 'span',
array( array(
'class' => 'explain-sev-'.$row['explain']['sev'], 'class' => 'explain-sev-'.$row['explain']['sev'],
), ),
$analysis); $row['explain']['reason']);
} }
$info = phutil_escape_html($info); $info = phutil_escape_html($info);

View file

@ -42,12 +42,12 @@ class AphrontRedirectResponse extends AphrontResponse {
$error->setSeverity(AphrontErrorView::SEVERITY_NOTICE); $error->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$error->setTitle('Stopped on Redirect'); $error->setTitle('Stopped on Redirect');
$link = phutil_render_tag( $link = phutil_tag(
'a', 'a',
array( array(
'href' => $this->getURI(), 'href' => $this->getURI(),
), ),
'Continue to: '.phutil_escape_html($this->getURI())); 'Continue to: '.$this->getURI());
$error->appendChild( $error->appendChild(
'<p>You were stopped here because <tt>debug.stop-on-redirect</tt> '. '<p>You were stopped here because <tt>debug.stop-on-redirect</tt> '.

View file

@ -98,31 +98,29 @@ final class PhabricatorChatLogChannelLogController
foreach ($blocks as $block) { foreach ($blocks as $block) {
$author = $block['author']; $author = $block['author'];
$author = phutil_utf8_shorten($author, 18); $author = phutil_utf8_shorten($author, 18);
$author = phutil_escape_html($author); $author = phutil_tag('td', array('class' => 'author'), $author);
$author = phutil_render_tag('td', array('class' => 'author'), $author);
$message = mpull($block['logs'], 'getMessage'); $message = mpull($block['logs'], 'getMessage');
$message = implode("\n", $message); $message = implode("\n", $message);
$message = phutil_escape_html($message); $message = phutil_tag('td', array('class' => 'message'), $message);
$message = phutil_render_tag('td', array('class' => 'message'), $message);
$href = $uri->alter('at', $block['id']); $href = $uri->alter('at', $block['id']);
$timestamp = $block['epoch']; $timestamp = $block['epoch'];
$timestamp = phabricator_datetime($timestamp, $user); $timestamp = phabricator_datetime($timestamp, $user);
$timestamp = phutil_render_tag('a', array('href' => $href), $timestamp); $timestamp = phutil_tag('a', array('href' => $href), $timestamp);
$timestamp = phutil_render_tag( $timestamp = phutil_tag(
'td', 'td',
array( array(
'class' => 'timestamp', 'class' => 'timestamp',
), ),
$timestamp); $timestamp);
$out[] = phutil_render_tag( $out[] = phutil_tag(
'tr', 'tr',
array( array(
'class' => $block['class'], 'class' => $block['class'],
), ),
$author.$message.$timestamp); array($author, $message, $timestamp));
} }
$out[] = '</table>'; $out[] = '</table>';

View file

@ -132,7 +132,7 @@ final class PhabricatorConfigEditController
$engine = new PhabricatorMarkupEngine(); $engine = new PhabricatorMarkupEngine();
$engine->addObject($option, 'description'); $engine->addObject($option, 'description');
$engine->process(); $engine->process();
$description = phutil_render_tag( $description = phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-remarkup', 'class' => 'phabricator-remarkup',
@ -440,12 +440,12 @@ final class PhabricatorConfigEditController
require_celerity_resource('config-options-css'); require_celerity_resource('config-options-css');
return phutil_render_tag( return phutil_tag(
'table', 'table',
array( array(
'class' => 'config-option-table', 'class' => 'config-option-table',
), ),
implode("\n", $table)); new PhutilSafeHTML(implode("\n", $table)));
} }
private function renderDefaults(PhabricatorConfigOption $option) { private function renderDefaults(PhabricatorConfigOption $option) {
@ -492,12 +492,12 @@ final class PhabricatorConfigEditController
require_celerity_resource('config-options-css'); require_celerity_resource('config-options-css');
return phutil_render_tag( return phutil_tag(
'table', 'table',
array( array(
'class' => 'config-option-table', 'class' => 'config-option-table',
), ),
implode("\n", $table)); new PhutilSafeHTML(implode("\n", $table)));
} }
} }

View file

@ -84,13 +84,15 @@ final class PhabricatorConfigGroupController
$current_value = PhabricatorEnv::getEnvConfig($option->getKey()); $current_value = PhabricatorEnv::getEnvConfig($option->getKey());
$current_value = PhabricatorConfigJSON::prettyPrintJSON( $current_value = PhabricatorConfigJSON::prettyPrintJSON(
$current_value); $current_value);
$current_value = phutil_render_tag( $current_value = phutil_tag(
'div', 'div',
array( array(
'class' => 'config-options-current-value', 'class' => 'config-options-current-value',
), ),
'<span>'.pht('Current Value:').'</span> '. array(
phutil_escape_html($current_value)); phutil_tag('span', array(), pht('Current Value:')),
' '.$current_value,
));
$item->appendChild($current_value); $item->appendChild($current_value);
} }

View file

@ -16,12 +16,12 @@ final class PhabricatorSetupIssueView extends AphrontView {
public function render() { public function render() {
$issue = $this->getIssue(); $issue = $this->getIssue();
$description = phutil_render_tag( $description = phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-issue-instructions', 'class' => 'setup-issue-instructions',
), ),
nl2br(phutil_escape_html($issue->getMessage()))); new PhutilSafeHTML(nl2br(phutil_escape_html($issue->getMessage()))));
$configs = $issue->getPHPConfig(); $configs = $issue->getPHPConfig();
if ($configs) { if ($configs) {
@ -36,13 +36,15 @@ final class PhabricatorSetupIssueView extends AphrontView {
$commands = $issue->getCommands(); $commands = $issue->getCommands();
if ($commands) { if ($commands) {
$run_these = pht("Run these %d command(s):", count($commands)); $run_these = pht("Run these %d command(s):", count($commands));
$description .= phutil_render_tag( $description .= phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-issue-config', 'class' => 'setup-issue-config',
), ),
phutil_render_tag('p', array(), $run_these). array(
phutil_render_tag('pre', array(), implode("\n", $commands))); phutil_render_tag('p', array(), $run_these),
phutil_render_tag('pre', array(), implode("\n", $commands)),
));
} }
$extensions = $issue->getPHPExtensions(); $extensions = $issue->getPHPExtensions();
@ -74,17 +76,19 @@ final class PhabricatorSetupIssueView extends AphrontView {
"After installing new PHP extensions, <strong>restart your webserver ". "After installing new PHP extensions, <strong>restart your webserver ".
"for the changes to take effect</strong>."); "for the changes to take effect</strong>.");
$description .= phutil_render_tag( $description .= phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-issue-config', 'class' => 'setup-issue-config',
), ),
phutil_render_tag('p', array(), $install_these). array(
phutil_render_tag('pre', array(), implode("\n", $extensions)). phutil_render_tag('p', array(), $install_these),
phutil_render_tag('p', array(), $install_info). phutil_render_tag('pre', array(), implode("\n", $extensions)),
phutil_render_tag('pre', array(), $install_commands). phutil_render_tag('p', array(), $install_info),
phutil_render_tag('p', array(), $fallback_info). phutil_render_tag('pre', array(), $install_commands),
phutil_render_tag('p', array(), $restart_info)); phutil_render_tag('p', array(), $fallback_info),
phutil_render_tag('p', array(), $restart_info),
));
} }
@ -102,18 +106,18 @@ final class PhabricatorSetupIssueView extends AphrontView {
), ),
$issue->getName()); $issue->getName());
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-issue', 'class' => 'setup-issue',
), ),
$name.$description.$next); array($name, $description, $next));
} }
private function renderPhabricatorConfig(array $configs) { private function renderPhabricatorConfig(array $configs) {
$issue = $this->getIssue(); $issue = $this->getIssue();
$table_info = phutil_render_tag( $table_info = phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
@ -141,16 +145,16 @@ final class PhabricatorSetupIssueView extends AphrontView {
$table[] = '</tr>'; $table[] = '</tr>';
} }
$table = phutil_render_tag( $table = phutil_tag(
'table', 'table',
array( array(
), ),
implode("\n", $table)); new PhutilSafeHTML(implode("\n", $table)));
$options = PhabricatorApplicationConfigOptions::loadAllOptions(); $options = PhabricatorApplicationConfigOptions::loadAllOptions();
if ($this->getIssue()->getIsFatal()) { if ($this->getIssue()->getIsFatal()) {
$update_info = phutil_render_tag( $update_info = phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
@ -172,12 +176,12 @@ final class PhabricatorSetupIssueView extends AphrontView {
if (!idx($options, $config) || $options[$config]->getLocked()) { if (!idx($options, $config) || $options[$config]->getLocked()) {
continue; continue;
} }
$link = phutil_render_tag( $link = phutil_tag(
'a', 'a',
array( array(
'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(), 'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(),
), ),
pht('Edit %s', phutil_escape_html($config))); pht('Edit %s', $config));
$update[] = '<li>'.$link.'</li>'; $update[] = '<li>'.$link.'</li>';
} }
if ($update) { if ($update) {
@ -207,7 +211,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
} }
private function renderPHPConfig(array $configs) { private function renderPHPConfig(array $configs) {
$table_info = phutil_render_tag( $table_info = phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
@ -236,12 +240,10 @@ final class PhabricatorSetupIssueView extends AphrontView {
$table[] = '</tr>'; $table[] = '</tr>';
} }
$table = phutil_render_tag( $table = phutil_tag(
'table', 'table',
array( array(),
new PhutilSafeHTML(implode("\n", $table)));
),
implode("\n", $table));
ob_start(); ob_start();
phpinfo(); phpinfo();
@ -269,14 +271,14 @@ final class PhabricatorSetupIssueView extends AphrontView {
} }
if (!$ini_loc) { if (!$ini_loc) {
$info = phutil_render_tag( $info = phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
"To update these %d value(s), edit your PHP configuration file.", "To update these %d value(s), edit your PHP configuration file.",
count($configs))); count($configs)));
} else { } else {
$info = phutil_render_tag( $info = phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
@ -290,7 +292,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
} }
if ($more_loc) { if ($more_loc) {
$info .= phutil_render_tag( $info .= phutil_tag(
'p', 'p',
array(), array(),
pht( pht(
@ -302,32 +304,27 @@ final class PhabricatorSetupIssueView extends AphrontView {
implode("\n", $more_loc)); implode("\n", $more_loc));
} }
$info .= phutil_render_tag( $info .= phutil_tag(
'p', 'p',
array(), array(),
pht( phutil_safe_html(pht(
"You can find more information about PHP configuration values in the ". 'You can find more information about PHP configuration values in the '.
"%s.", '<a href="%s">PHP Documentation</a>.',
phutil_tag( 'http://php.net/manual/ini.list.php')));
'a',
array(
'href' => 'http://php.net/manual/ini.list.php',
),
pht('PHP Documentation'))));
$info .= phutil_render_tag( $info .= phutil_tag(
'p', 'p',
array(), array(),
pht( phutil_safe_html(pht(
"After editing the PHP configuration, <strong>restart your ". "After editing the PHP configuration, <strong>restart your ".
"webserver for the changes to take effect</strong>.")); "webserver for the changes to take effect</strong>.")));
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-issue-config', 'class' => 'setup-issue-config',
), ),
$table_info.$table.$info); array($table_info, $table, $info));
} }
} }

View file

@ -66,7 +66,7 @@ final class PhabricatorDaemonLogListView extends AphrontView {
$symbol = '?'; $symbol = '?';
} }
$running = phutil_render_tag( $running = phutil_tag(
'span', 'span',
array( array(
'style' => $style, 'style' => $style,

View file

@ -87,7 +87,7 @@ final class DifferentialLintFieldSpecification
if ($diff->getID() != $this->getDiff()->getID()) { if ($diff->getID() != $this->getDiff()->getID()) {
$href = '/D'.$diff->getRevisionID().'?id='.$diff->getID().$href; $href = '/D'.$diff->getRevisionID().'?id='.$diff->getID().$href;
} }
$line_link = phutil_render_tag( $line_link = phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,

View file

@ -93,9 +93,9 @@ final class DifferentialUnitFieldSpecification
$hidden[$result]++; $hidden[$result]++;
} }
$value = phutil_escape_html(idx($test, 'name')); $value = idx($test, 'name');
if (!empty($test['link'])) { if (!empty($test['link'])) {
$value = phutil_render_tag( $value = phutil_tag(
'a', 'a',
array( array(
'href' => $test['link'], 'href' => $test['link'],

View file

@ -158,12 +158,12 @@ final class DifferentialChangesetListView extends AphrontView {
'Load'); 'Load');
} }
$detail->appendChild( $detail->appendChild(
phutil_render_tag( phutil_tag(
'div', 'div',
array( array(
'id' => $uniq_id, 'id' => $uniq_id,
), ),
'<div class="differential-loading">'.$load.'</div>')); phutil_tag('div', array('class' => 'differential-loading'), $load)));
$output[] = $detail->render(); $output[] = $detail->render();
} }
@ -217,12 +217,12 @@ final class DifferentialChangesetListView extends AphrontView {
), ),
'Undo'); 'Undo');
$div = phutil_render_tag( $div = phutil_tag(
'div', 'div',
array( array(
'class' => 'differential-inline-undo', 'class' => 'differential-inline-undo',
), ),
'Changes discarded. '.$link); array('Changes discarded. ', $link));
$template = $template =
'<table><tr>'. '<table><tr>'.

View file

@ -137,7 +137,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
if ($cov === null) { if ($cov === null) {
$mcov = $cov = '<em>-</em>'; $mcov = $cov = '<em>-</em>';
} else { } else {
$mcov = phutil_render_tag( $mcov = phutil_tag(
'div', 'div',
array( array(
'id' => 'differential-mcoverage-'.md5($fname), 'id' => 'differential-mcoverage-'.md5($fname),

View file

@ -134,12 +134,12 @@ final class DifferentialRevisionCommentView extends AphrontView {
case DifferentialAction::ACTION_UPDATE: case DifferentialAction::ACTION_UPDATE:
$diff_id = idx($metadata, DifferentialComment::METADATA_DIFF_ID); $diff_id = idx($metadata, DifferentialComment::METADATA_DIFF_ID);
if ($diff_id) { if ($diff_id) {
$diff_link = phutil_render_tag( $diff_link = phutil_tag(
'a', 'a',
array( array(
'href' => '/D'.$comment->getRevisionID().'?id='.$diff_id, 'href' => '/D'.$comment->getRevisionID().'?id='.$diff_id,
), ),
'Diff #'.phutil_escape_html($diff_id)); 'Diff #'.$diff_id);
$actions[] = "{$author_link} updated this revision to {$diff_link}."; $actions[] = "{$author_link} updated this revision to {$diff_link}.";
} else { } else {
$actions[] = "{$author_link} {$verb} this revision."; $actions[] = "{$author_link} {$verb} this revision.";

View file

@ -108,7 +108,7 @@ final class DiffusionBrowseController extends DiffusionController {
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine(); $engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
$text = $engine->markupText($text); $text = $engine->markupText($text);
$text = phutil_render_tag( $text = phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-remarkup', 'class' => 'phabricator-remarkup',

View file

@ -271,7 +271,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
'sigil' => 'diffusion-source', 'sigil' => 'diffusion-source',
), ),
implode("\n", $rows)); implode("\n", $rows));
$corpus = phutil_render_tag( $corpus = phutil_tag(
'div', 'div',
array( array(
'style' => 'padding: 0 2em;', 'style' => 'padding: 0 2em;',
@ -666,7 +666,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
"\xC2\xAB"); "\xC2\xAB");
} }
$blame[] = phutil_render_tag( $blame[] = phutil_tag(
'th', 'th',
array( array(
'class' => 'diffusion-blame-link', 'class' => 'diffusion-blame-link',
@ -674,7 +674,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
), ),
$before_link); $before_link);
$blame[] = phutil_render_tag( $blame[] = phutil_tag(
'th', 'th',
array( array(
'class' => 'diffusion-rev-link', 'class' => 'diffusion-rev-link',
@ -682,7 +682,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
), ),
$commit_link); $commit_link);
$blame[] = phutil_render_tag( $blame[] = phutil_tag(
'th', 'th',
array( array(
'class' => 'diffusion-rev-link', 'class' => 'diffusion-rev-link',
@ -690,7 +690,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
), ),
$revision_link); $revision_link);
$blame[] = phutil_render_tag( $blame[] = phutil_tag(
'th', 'th',
array( array(
'class' => 'diffusion-author-link', 'class' => 'diffusion-author-link',
@ -717,8 +717,6 @@ final class DiffusionBrowseFileController extends DiffusionController {
Javelin::initBehavior('diffusion-line-linker'); Javelin::initBehavior('diffusion-line-linker');
$blame = implode('', $blame);
if ($line['target']) { if ($line['target']) {
Javelin::initBehavior( Javelin::initBehavior(
'diffusion-jump-to', 'diffusion-jump-to',
@ -730,7 +728,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
$anchor_text = null; $anchor_text = null;
} }
$line_text = phutil_render_tag( $blame[] = phutil_render_tag(
'td', 'td',
array( array(
), ),
@ -738,13 +736,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
"\xE2\x80\x8B". // NOTE: See phabricator-oncopy behavior. "\xE2\x80\x8B". // NOTE: See phabricator-oncopy behavior.
$line['data']); $line['data']);
$rows[] = phutil_render_tag( $rows[] = phutil_tag(
'tr', 'tr',
array( array(
'class' => ($line['highlighted'] ? 'highlighted' : null), 'class' => ($line['highlighted'] ? 'highlighted' : null),
), ),
$blame. $blame);
$line_text);
$rows = array_merge($rows, $this->renderInlines( $rows = array_merge($rows, $this->renderInlines(
idx($inlines, $line['line'], array()), idx($inlines, $line['line'], array()),

View file

@ -105,7 +105,7 @@ final class DiffusionHomeController extends DiffusionController {
$branch = $repository->getDefaultArcanistBranch(); $branch = $repository->getDefaultArcanistBranch();
if (isset($lint_branches[$branch])) { if (isset($lint_branches[$branch])) {
$show_lint = true; $show_lint = true;
$lint_count = phutil_render_tag( $lint_count = phutil_tag(
'a', 'a',
array( array(
'href' => DiffusionRequest::generateDiffusionURI(array( 'href' => DiffusionRequest::generateDiffusionURI(array(

View file

@ -137,7 +137,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
$browse_link = '<strong>'.$this->linkBrowse( $browse_link = '<strong>'.$this->linkBrowse(
$base_path.$path->getPath().$dir_slash, $base_path.$path->getPath().$dir_slash,
array( array(
'html' => $this->renderPathIcon( 'text' => $this->renderPathIcon(
'dir', 'dir',
$browse_text), $browse_text),
)).'</strong>'; )).'</strong>';
@ -162,7 +162,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
$browse_link = $this->linkBrowse( $browse_link = $this->linkBrowse(
$base_path.$path->getPath(), $base_path.$path->getPath(),
array( array(
'html' => $this->renderPathIcon($type, $browse_text), 'text' => $this->renderPathIcon($type, $browse_text),
)); ));
} }

View file

@ -32,7 +32,7 @@ abstract class DiffusionView extends AphrontView {
'commit' => $commit_identifier, 'commit' => $commit_identifier,
)); ));
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,
@ -63,15 +63,13 @@ abstract class DiffusionView extends AphrontView {
'path' => $path, 'path' => $path,
)); ));
if (isset($details['html'])) { if (isset($details['text'])) {
$text = $details['html']; $text = $details['text'];
} else if (isset($details['text'])) {
$text = phutil_escape_html($details['text']);
} else { } else {
$text = 'Browse'; $text = 'Browse';
} }
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,
@ -87,7 +85,7 @@ abstract class DiffusionView extends AphrontView {
'id' => $hash, 'id' => $hash,
)); ));
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,
@ -120,7 +118,7 @@ abstract class DiffusionView extends AphrontView {
$commit_name = self::nameCommit($repository, $commit); $commit_name = self::nameCommit($repository, $commit);
$callsign = $repository->getCallsign(); $callsign = $repository->getCallsign();
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => "/r{$callsign}{$commit}", 'href' => "/r{$callsign}{$commit}",
@ -133,7 +131,7 @@ abstract class DiffusionView extends AphrontView {
return null; return null;
} }
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => "/D{$id}", 'href' => "/D{$id}",

View file

@ -310,13 +310,14 @@ final class PhabricatorDirectoryMainController
'id' => $uniq_id, 'id' => $uniq_id,
'value' => $query, 'value' => $query,
)); ));
$jump_caption = phutil_render_tag( $jump_caption = phutil_tag(
'p', 'p',
array( array(
'class' => 'phabricator-jump-nav-caption', 'class' => 'phabricator-jump-nav-caption',
), ),
'Enter the name of an object like <tt>D123</tt> to quickly jump to '. new PhutilSafeHTML(
'it. See '.$doc_link.' or type <tt>help</tt>.'); 'Enter the name of an object like <tt>D123</tt> to quickly jump to '.
'it. See '.$doc_link.' or type <tt>help</tt>.'));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Jump Nav'); $panel->setHeader('Jump Nav');

View file

@ -97,7 +97,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
$foot = ''; $foot = '';
} }
$foot = phutil_render_tag( $foot = phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-feed-story-foot', 'class' => 'phabricator-feed-story-foot',
@ -111,7 +111,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
require_celerity_resource('phabricator-feed-css'); require_celerity_resource('phabricator-feed-css');
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => $this->oneLine 'class' => $this->oneLine
@ -119,7 +119,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
: 'phabricator-feed-story', : 'phabricator-feed-story',
'style' => $image_style, 'style' => $image_style,
), ),
$head.$body.$foot); array($head, $body, $foot));
} }
} }

View file

@ -148,7 +148,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
'class' => 'phabricator-property-list-image', 'class' => 'phabricator-property-list-image',
)); ));
$linked_image = phutil_render_tag( $linked_image = phutil_tag(
'a', 'a',
array( array(
'href' => $file->getViewURI(), 'href' => $file->getViewURI(),

View file

@ -129,7 +129,7 @@ final class PhabricatorMacroListController
} }
$datetime = phabricator_date($file->getDateCreated(), $viewer); $datetime = phabricator_date($file->getDateCreated(), $viewer);
$item->appendChild( $item->appendChild(
phutil_render_tag( phutil_tag(
'div', 'div',
array(), array(),
pht('Created on %s', $datetime))); pht('Created on %s', $datetime)));

View file

@ -28,7 +28,7 @@ final class PhabricatorContentSourceView extends AphrontView {
return; return;
} }
return phutil_render_tag( return phutil_tag(
'span', 'span',
array( array(
'class' => "phabricator-content-source-view", 'class' => "phabricator-content-source-view",

View file

@ -57,7 +57,7 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
), ),
$client->getName() $client->getName()
), ),
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $scope_doc_href, 'href' => $scope_doc_href,

View file

@ -123,26 +123,30 @@ final class PhamePostView extends AphrontView {
} }
public function render() { public function render() {
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'phame-post', 'class' => 'phame-post',
), ),
$this->renderTitle(). array(
$this->renderDatePublished(). $this->renderTitle(),
$this->renderBody(). $this->renderDatePublished(),
$this->renderComments()); $this->renderBody(),
$this->renderComments(),
));
} }
public function renderWithSummary() { public function renderWithSummary() {
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'phame-post', 'class' => 'phame-post',
), ),
$this->renderTitle(). array(
$this->renderDatePublished(). $this->renderTitle(),
$this->renderSummary()); $this->renderDatePublished(),
$this->renderSummary(),
));
} }
private function renderFacebookComments() { private function renderFacebookComments() {

View file

@ -212,13 +212,13 @@ final class PhrictionDiffController
} }
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version, 'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
'class' => 'button', 'class' => 'button',
), ),
'Revert to Version '.phutil_escape_html($version).'...'); 'Revert to Version '.$version.'...');
} }
private function renderComparisonTable(array $content) { private function renderComparisonTable(array $content) {

View file

@ -82,7 +82,7 @@ final class PhrictionHistoryController
$rows[] = array( $rows[] = array(
phabricator_date($content->getDateCreated(), $user), phabricator_date($content->getDateCreated(), $user),
phabricator_time($content->getDateCreated(), $user), phabricator_time($content->getDateCreated(), $user),
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $slug_uri.'?v='.$version, 'href' => $slug_uri.'?v='.$version,

View file

@ -83,12 +83,12 @@ final class PonderCommentListView extends AphrontView {
'<td>'.$addview->render().'</td>'. '<td>'.$addview->render().'</td>'.
'</tr>'; '</tr>';
$comment_markup = phutil_render_tag( $comment_markup = phutil_tag(
'table', 'table',
array( array(
'class' => 'ponder-comments', 'class' => 'ponder-comments',
), ),
implode("\n", $comment_markup) new PhutilSafeHTML(implode("\n", $comment_markup))
); );

View file

@ -79,7 +79,7 @@ final class PonderUserProfileView extends AphrontView {
$item->addAttribute( $item->addAttribute(
pht( pht(
'Answer to %s', 'Answer to %s',
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => '/Q'.$question->getID(), 'href' => '/Q'.$question->getID(),

View file

@ -34,7 +34,7 @@ final class PhabricatorSearchResultView extends AphrontView {
require_celerity_resource('phabricator-search-results-css'); require_celerity_resource('phabricator-search-results-css');
$link = phutil_render_tag( $link = phutil_tag(
'a', 'a',
array( array(
'href' => $handle->getURI(), 'href' => $handle->getURI(),
@ -73,7 +73,7 @@ final class PhabricatorSearchResultView extends AphrontView {
'<div class="phabricator-search-result">'. '<div class="phabricator-search-result">'.
$img. $img.
'<div class="result-desc">'. '<div class="result-desc">'.
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'class' => 'result-name', 'class' => 'result-name',
@ -112,7 +112,7 @@ final class PhabricatorSearchResultView extends AphrontView {
'<strong>\1</strong>', '<strong>\1</strong>',
$str); $str);
} }
return $str; return phutil_safe_html($str);
} }
} }

View file

@ -223,12 +223,12 @@ final class PhabricatorSlowvotePollController
} }
if ($comment_markup) { if ($comment_markup) {
$comment_markup = phutil_render_tag( $comment_markup = phutil_tag(
'table', 'table',
array( array(
'class' => 'phabricator-slowvote-comments', 'class' => 'phabricator-slowvote-comments',
), ),
implode("\n", $comment_markup)); new PhutilSafeHTML(implode("\n", $comment_markup)));
} else { } else {
$comment_markup = null; $comment_markup = null;
} }
@ -301,12 +301,12 @@ final class PhabricatorSlowvotePollController
$checked_class = null; $checked_class = null;
} }
return phutil_render_tag( return phutil_tag(
'label', 'label',
array( array(
'class' => 'phabricator-slowvote-label '.$checked_class, 'class' => 'phabricator-slowvote-label '.$checked_class,
), ),
$input.phutil_escape_html($option->getName())); array($input, $option->getName()));
} }
private function renderVoteCount( private function renderVoteCount(

View file

@ -53,13 +53,13 @@ final class JavelinUIExample extends PhabricatorUIExample {
), ),
'Toggle Blue Background'); 'Toggle Blue Background');
$div = phutil_render_tag( $div = phutil_tag(
'div', 'div',
array( array(
'id' => $container_id, 'id' => $container_id,
'class' => 'jxui-example-container jxui-blue-background', 'class' => 'jxui-example-container jxui-blue-background',
), ),
$button_red.$button_blue); array($button_red, $button_blue));
return array($div); return array($div);
} }

View file

@ -25,7 +25,7 @@ final class PhabricatorXHProfSampleListView extends AphrontView {
$user_phids = mpull($this->samples, 'getUserPHID'); $user_phids = mpull($this->samples, 'getUserPHID');
$users = id(new PhabricatorObjectHandleData($user_phids))->loadObjects(); $users = id(new PhabricatorObjectHandleData($user_phids))->loadObjects();
foreach ($this->samples as $sample) { foreach ($this->samples as $sample) {
$sample_link = phutil_render_tag( $sample_link = phutil_tag(
'a', 'a',
array( array(
'href' => '/xhprof/profile/'.$sample->getFilePHID().'/', 'href' => '/xhprof/profile/'.$sample->getFilePHID().'/',

View file

@ -100,12 +100,12 @@ final class PhabricatorInlineSummaryView extends AphrontView {
} }
} }
return phutil_render_tag( return phutil_tag(
'table', 'table',
array( array(
'class' => 'phabricator-inline-summary-table', 'class' => 'phabricator-inline-summary-table',
), ),
implode("\n", $rows)); new PhutilSafeHTML(implode("\n", $rows)));
} }
} }

View file

@ -46,19 +46,21 @@ final class PhabricatorRemarkupRuleCountdown extends PhutilRemarkupRule {
foreach ($metadata as $id => $info) { foreach ($metadata as $id => $info) {
list($time, $token) = $info; list($time, $token) = $info;
$count = phutil_render_tag( $count = phutil_tag(
'span', 'span',
array( array(
'id' => $id, 'id' => $id,
), ),
javelin_render_tag('span', array(
array('sigil' => 'phabricator-timer-days'), '').'d'. javelin_render_tag('span',
javelin_render_tag('span', array('sigil' => 'phabricator-timer-days'), '').'d',
array('sigil' => 'phabricator-timer-hours'), '').'h'. javelin_render_tag('span',
javelin_render_tag('span', array('sigil' => 'phabricator-timer-hours'), '').'h',
array('sigil' => 'phabricator-timer-minutes'), '').'m'. javelin_render_tag('span',
javelin_render_tag('span', array('sigil' => 'phabricator-timer-minutes'), '').'m',
array('sigil' => 'phabricator-timer-seconds'), '').'s'); javelin_render_tag('span',
array('sigil' => 'phabricator-timer-seconds'), '').'s',
));
Javelin::initBehavior('countdown-timer', array( Javelin::initBehavior('countdown-timer', array(
'timestamp' => $time, 'timestamp' => $time,
'container' => $id, 'container' => $id,

View file

@ -151,7 +151,7 @@ final class PhabricatorRemarkupRuleEmbedFile
} }
if ($layout_class) { if ($layout_class) {
$embed = phutil_render_tag( $embed = phutil_tag(
'div', 'div',
array( array(
'class' => $layout_class, 'class' => $layout_class,

View file

@ -40,7 +40,7 @@ abstract class PhabricatorRemarkupRuleObjectName
} }
return $this->getEngine()->storeText( return $this->getEngine()->storeText(
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,

View file

@ -187,7 +187,7 @@ final class AphrontPagerView extends AphrontView {
list($index, $label, $class) = $link; list($index, $label, $class) = $link;
$display_index = $this->getDisplayIndex($index); $display_index = $this->getDisplayIndex($index);
$link = $base_uri->alter($parameter, $display_index); $link = $base_uri->alter($parameter, $display_index);
$rendered_links[] = phutil_render_tag( $rendered_links[] = phutil_tag(
'a', 'a',
array( array(
'href' => $link, 'href' => $link,

View file

@ -302,7 +302,7 @@ final class AphrontTableView extends AphrontView {
// (alternatively, we could hard-code the line height). This is gross but // (alternatively, we could hard-code the line height). This is gross but
// it's not clear that there's a better appraoch. // it's not clear that there's a better appraoch.
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'single-display-line-bounds', 'class' => 'single-display-line-bounds',

View file

@ -53,15 +53,17 @@ final class AphrontTokenizerTemplateView extends AphrontView {
'type' => 'text', 'type' => 'text',
)); ));
return phutil_render_tag( $content = $tokens;
$content[] = $input;
$content[] = phutil_tag('div', array('style' => 'clear: both;'), '');
return phutil_tag(
'div', 'div',
array( array(
'id' => $id, 'id' => $id,
'class' => 'jx-tokenizer-container', 'class' => 'jx-tokenizer-container',
), ),
implode('', $tokens). $content);
$input.
'<div style="clear: both;"></div>');
} }
private function renderToken($key, $value) { private function renderToken($key, $value) {
@ -69,20 +71,22 @@ final class AphrontTokenizerTemplateView extends AphrontView {
if ($input_name) { if ($input_name) {
$input_name .= '[]'; $input_name .= '[]';
} }
return phutil_render_tag( return phutil_tag(
'a', 'a',
array( array(
'class' => 'jx-tokenizer-token', 'class' => 'jx-tokenizer-token',
), ),
phutil_escape_html($value). array(
phutil_tag( $value,
'input', phutil_tag(
array( 'input',
'type' => 'hidden', array(
'name' => $input_name, 'type' => 'hidden',
'value' => $key, 'name' => $input_name,
)). 'value' => $key,
'<span class="jx-tokenizer-x-placeholder"></span>'); )).
phutil_tag('span', array('class' => 'jx-tokenizer-x-placeholder'), ''),
));
} }
} }

View file

@ -45,12 +45,12 @@ final class AphrontErrorView extends AphrontView {
array(), array(),
$error); $error);
} }
$list = phutil_render_tag( $list = phutil_tag(
'ul', 'ul',
array( array(
'class' => 'aphront-error-view-list', 'class' => 'aphront-error-view-list',
), ),
implode("\n", $list)); $list);
} else { } else {
$list = null; $list = null;
} }
@ -79,13 +79,15 @@ final class AphrontErrorView extends AphrontView {
'id' => $this->id, 'id' => $this->id,
'class' => 'aphront-error-view '.$more_classes, 'class' => 'aphront-error-view '.$more_classes,
), ),
$title. array(
phutil_render_tag( $title,
'div', phutil_render_tag(
array( 'div',
'class' => 'aphront-error-view-body', array(
), 'class' => 'aphront-error-view-body',
$this->renderChildren(). ),
$list)); $this->renderChildren().
$list),
));
} }
} }

View file

@ -45,12 +45,12 @@ final class AphrontFormSelectControl extends AphrontFormControl {
$tags = array(); $tags = array();
foreach ($options as $value => $thing) { foreach ($options as $value => $thing) {
if (is_array($thing)) { if (is_array($thing)) {
$tags[] = phutil_render_tag( $tags[] = phutil_tag(
'optgroup', 'optgroup',
array( array(
'label' => $value, 'label' => $value,
), ),
implode("\n", self::renderOptions($selected, $thing))); self::renderOptions($selected, $thing));
} else { } else {
$tags[] = phutil_tag( $tags[] = phutil_tag(
'option', 'option',

View file

@ -118,12 +118,12 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
'')); ''));
} }
$buttons = phutil_render_tag( $buttons = phutil_tag(
'div', 'div',
array( array(
'class' => 'remarkup-assist-bar', 'class' => 'remarkup-assist-bar',
), ),
implode('', $buttons)); $buttons);
$monospaced_textareas = null; $monospaced_textareas = null;
$monospaced_textareas_class = null; $monospaced_textareas_class = null;

View file

@ -106,12 +106,12 @@ final class PhabricatorActionView extends AphrontView {
$classes[] = 'phabricator-action-view-disabled'; $classes[] = 'phabricator-action-view-disabled';
} }
return phutil_render_tag( return phutil_tag(
'li', 'li',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
), ),
$icon.$item); array($icon, $item));
} }
public static function getAvailableIcons() { public static function getAvailableIcons() {

View file

@ -80,13 +80,13 @@ final class PhabricatorCrumbView extends AphrontView {
''); '');
} }
return phutil_render_tag( return phutil_tag(
$this->href ? 'a' : 'span', $this->href ? 'a' : 'span',
array( array(
'href' => $this->href, 'href' => $this->href,
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
), ),
$icon.$name.$divider); array($icon, $name, $divider));
} }

View file

@ -24,19 +24,22 @@ final class PhabricatorHeaderView extends AphrontView {
public function render() { public function render() {
require_celerity_resource('phabricator-header-view-css'); require_celerity_resource('phabricator-header-view-css');
$header = phutil_escape_html($this->header); $header = array($this->header);
if ($this->objectName) { if ($this->objectName) {
$header = phutil_tag( array_unshift(
'a', $header,
array( phutil_tag(
'href' => '/'.$this->objectName, 'a',
), array(
$this->objectName).' '.$header; 'href' => '/'.$this->objectName,
),
$this->objectName),
' ');
} }
if ($this->tags) { if ($this->tags) {
$header .= phutil_render_tag( $header[] = phutil_render_tag(
'span', 'span',
array( array(
'class' => 'phabricator-header-tags', 'class' => 'phabricator-header-tags',
@ -49,7 +52,7 @@ final class PhabricatorHeaderView extends AphrontView {
array( array(
'class' => 'phabricator-header-shell', 'class' => 'phabricator-header-shell',
), ),
phutil_render_tag( phutil_tag(
'h1', 'h1',
array( array(
'class' => 'phabricator-header-view', 'class' => 'phabricator-header-view',

View file

@ -100,20 +100,20 @@ final class PhabricatorObjectItemView extends AphrontView {
), ),
$spec['label']); $spec['label']);
$icon_list[] = phutil_render_tag( $icon_list[] = phutil_tag(
'li', 'li',
array( array(
'class' => 'phabricator-object-item-icon', 'class' => 'phabricator-object-item-icon',
), ),
$label.$icon); array($label, $icon));
} }
$icons = phutil_render_tag( $icons = phutil_tag(
'ul', 'ul',
array( array(
'class' => 'phabricator-object-item-icons', 'class' => 'phabricator-object-item-icons',
), ),
implode('', $icon_list)); $icon_list);
} }
$attrs = null; $attrs = null;
@ -135,12 +135,12 @@ final class PhabricatorObjectItemView extends AphrontView {
($first ? null : $spacer).$attribute); ($first ? null : $spacer).$attribute);
$first = false; $first = false;
} }
$attrs = phutil_render_tag( $attrs = phutil_tag(
'ul', 'ul',
array( array(
'class' => 'phabricator-object-item-attributes', 'class' => 'phabricator-object-item-attributes',
), ),
implode('', $attrs)); $attrs);
} }
$classes = array(); $classes = array();
@ -165,12 +165,12 @@ final class PhabricatorObjectItemView extends AphrontView {
), ),
$header.$attrs.$this->renderChildren()); $header.$attrs.$this->renderChildren());
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
), ),
$icons.$content); array($icons, $content));
} }
} }

View file

@ -34,7 +34,7 @@ final class PhabricatorPinboardItemView extends AphrontView {
$header = null; $header = null;
if ($this->header) { if ($this->header) {
$header = hsprintf('<a href="%s">%s</a>', $this->uri, $this->header); $header = hsprintf('<a href="%s">%s</a>', $this->uri, $this->header);
$header = phutil_render_tag( $header = phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-pinboard-item-header', 'class' => 'phabricator-pinboard-item-header',
@ -66,14 +66,12 @@ final class PhabricatorPinboardItemView extends AphrontView {
$content); $content);
} }
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-pinboard-item-view', 'class' => 'phabricator-pinboard-item-view',
), ),
$header. array($header, $image, $content));
$image.
$content);
} }
} }

View file

@ -131,9 +131,13 @@ final class PhabricatorPropertyListView extends AphrontView {
array( array(
'class' => 'phabricator-property-list-container', 'class' => 'phabricator-property-list-container',
), ),
$list. array(
'<div class="phabriator-property-list-view-end"></div>' $list,
); phutil_tag(
'div',
array('class' => 'phabriator-property-list-view-end'),
''),
));
} }
private function renderSectionPart(array $part) { private function renderSectionPart(array $part) {

View file

@ -109,12 +109,12 @@ final class PhabricatorTagView extends AphrontView {
$dot = null; $dot = null;
} }
$content = phutil_render_tag( $content = phutil_tag(
'span', 'span',
array( array(
'class' => 'phabricator-tag-core '.$color, 'class' => 'phabricator-tag-core '.$color,
), ),
$dot.phutil_escape_html($this->name)); array($dot, $this->name));
if ($this->barColor) { if ($this->barColor) {
$barcolor = 'phabricator-tag-color-'.$this->barColor; $barcolor = 'phabricator-tag-color-'.$this->barColor;
@ -129,13 +129,13 @@ final class PhabricatorTagView extends AphrontView {
$bar = null; $bar = null;
} }
return phutil_render_tag( return phutil_tag(
$this->href ? 'a' : 'span', $this->href ? 'a' : 'span',
array( array(
'href' => $this->href, 'href' => $this->href,
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
), ),
$bar.$content); array($bar, $content));
} }
public static function getTagTypes() { public static function getTagTypes() {

View file

@ -273,7 +273,7 @@ final class PhabricatorTimelineEventView extends AphrontView {
->setAnchorName($this->anchor) ->setAnchorName($this->anchor)
->render(); ->render();
$date = $anchor.phutil_render_tag( $date = $anchor.phutil_tag(
'a', 'a',
array( array(
'href' => '#'.$this->anchor, 'href' => '#'.$this->anchor,

View file

@ -327,14 +327,14 @@ final class PhabricatorMainMenuView extends AphrontView {
$container_classes[] = 'alert-unread'; $container_classes[] = 'alert-unread';
} }
$bubble_tag = phutil_render_tag( $bubble_tag = phutil_tag(
'a', 'a',
array( array(
'href' => '/notification/', 'href' => '/notification/',
'class' => implode(' ', $container_classes), 'class' => implode(' ', $container_classes),
'id' => $bubble_id, 'id' => $bubble_id,
), ),
$icon_tag.$count_tag); array($icon_tag, $count_tag));
Javelin::initBehavior( Javelin::initBehavior(
'aphlict-dropdown', 'aphlict-dropdown',