Page MenuHomePhabricator

D7549.id.diff
No OneTemporary

D7549.id.diff

Index: src/applications/auth/controller/PhabricatorEmailTokenController.php
===================================================================
--- src/applications/auth/controller/PhabricatorEmailTokenController.php
+++ src/applications/auth/controller/PhabricatorEmailTokenController.php
@@ -51,11 +51,12 @@
'invalid or out of date. Make sure you are copy-and-pasting the '.
'entire link into your browser. You can try again, or request '.
'a new email.')));
- $view->appendChild(hsprintf(
- '<div class="aphront-failure-continue">'.
- '<a class="button" href="/login/email/">%s</a>'.
- '</div>',
- pht('Send Another Email')));
+ $view->appendChild(phutil_tag_div(
+ 'aphront-failure-continue',
+ phutil_tag(
+ 'a',
+ array('class' => 'button', 'href' => '/login/email/'),
+ pht('Send Another Email'))));
return $this->buildStandardPageResponse(
$view,
Index: src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
===================================================================
--- src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
+++ src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
@@ -48,8 +48,8 @@
$error_view->appendChild(phutil_tag('p', array(), pht(
'If you did not receive an email, you can click the button below '.
'to try sending another one.')));
- $error_view->appendChild(hsprintf(
- '<div class="aphront-failure-continue">%s</div>',
+ $error_view->appendChild(phutil_tag_div(
+ 'aphront-failure-continue',
phabricator_form(
$user,
array(
Index: src/applications/auth/provider/PhabricatorAuthProviderLDAP.php
===================================================================
--- src/applications/auth/provider/PhabricatorAuthProviderLDAP.php
+++ src/applications/auth/provider/PhabricatorAuthProviderLDAP.php
@@ -254,18 +254,18 @@
$captions = array(
self::KEY_HOSTNAME =>
pht('Example: %s',
- hsprintf('<tt>%s</tt>', pht('ldap.example.com'))),
+ phutil_tag('tt', array(), pht('ldap.example.com'))),
self::KEY_DISTINGUISHED_NAME =>
pht('Example: %s',
- hsprintf('<tt>%s</tt>', pht('ou=People, dc=example, dc=com'))),
+ phutil_tag('tt', array(), pht('ou=People, dc=example, dc=com'))),
self::KEY_SEARCH_ATTRIBUTE =>
pht('Example: %s',
- hsprintf('<tt>%s</tt>', pht('sn'))),
+ phutil_tag('tt', array(), pht('sn'))),
self::KEY_USERNAME_ATTRIBUTE =>
pht('Optional, if different from search attribute.'),
self::KEY_REALNAME_ATTRIBUTES =>
pht('Optional. Example: %s',
- hsprintf('<tt>%s</tt>', pht('firstname, lastname'))),
+ phutil_tag('tt', array(), pht('firstname, lastname'))),
self::KEY_REFERRALS =>
pht('Follow referrals. Disable this for Windows AD 2003.'),
self::KEY_START_TLS =>
Index: src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php
===================================================================
--- src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php
+++ src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php
@@ -84,9 +84,7 @@
"improves security by preventing an attacker from capturing ".
"an insecure Facebook session and escalating it into a ".
"Phabricator session. Enabling it is recommended.",
- hsprintf(
- '<strong>%s</strong>',
- pht('Require Secure Browsing:')))));
+ phutil_tag('strong', array(), pht('Require Secure Browsing:')))));
}
public function renderConfigPropertyTransactionTitle(
Index: src/applications/base/controller/PhabricatorController.php
===================================================================
--- src/applications/base/controller/PhabricatorController.php
+++ src/applications/base/controller/PhabricatorController.php
@@ -246,8 +246,9 @@
$view = new PhabricatorStandardPageView();
$view->setRequest($request);
$view->setController($this);
- $view->appendChild(hsprintf(
- '<div style="padding: 2em 0;">%s</div>',
+ $view->appendChild(phutil_tag(
+ 'div',
+ array('style' => 'padding: 2em 0;'),
$response->buildResponseString()));
$page_response = new AphrontWebpageResponse();
$page_response->setContent($view->render());
Index: src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
===================================================================
--- src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
+++ src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
@@ -61,7 +61,7 @@
$nav->appendChild(
array(
$this->getNoticeView(),
- hsprintf('<div style="padding: 20px;">%s</div>', $month_view),
+ phutil_tag('div', array('style' => 'padding: 20px;'), $month_view),
));
return $this->buildApplicationPage(
Index: src/applications/calendar/view/AphrontCalendarMonthView.php
===================================================================
--- src/applications/calendar/view/AphrontCalendarMonthView.php
+++ src/applications/calendar/view/AphrontCalendarMonthView.php
@@ -87,10 +87,9 @@
} else {
$show_events = array_fill_keys(
array_keys($show_events),
- hsprintf(
- '<div class="aphront-calendar-event aphront-calendar-event-empty">'.
- '&nbsp;'.
- '</div>'));
+ phutil_tag_div(
+ 'aphront-calendar-event aphront-calendar-event-empty',
+ "\xC2\xA0")); // &nbsp;
}
foreach ($events as $event) {
@@ -119,45 +118,49 @@
$name);
}
- $markup[] = hsprintf(
- '<div class="%s">'.
- '<div class="aphront-calendar-date-number">%s</div>'.
- '%s%s'.
- '</div>',
+ $markup[] = phutil_tag_div(
$class,
- $day_number,
- $holiday_markup,
- phutil_implode_html("\n", $show_events));
+ array(
+ phutil_tag_div('aphront-calendar-date-number', $day_number),
+ $holiday_markup,
+ phutil_implode_html("\n", $show_events),
+ ));
}
$table = array();
$rows = array_chunk($markup, 7);
foreach ($rows as $row) {
- $table[] = hsprintf('<tr>');
+ $cells = array();
while (count($row) < 7) {
$row[] = $empty_box;
}
foreach ($row as $cell) {
- $table[] = phutil_tag('td', array(), $cell);
+ $cells[] = phutil_tag('td', array(), $cell);
}
- $table[] = hsprintf('</tr>');
+ $table[] = phutil_tag('tr', array(), $cells);
}
- $table = hsprintf(
- '<table class="aphront-calendar-view">'.
- '%s'.
- '<tr class="aphront-calendar-day-of-week-header">'.
- '<th>Sun</th>'.
- '<th>Mon</th>'.
- '<th>Tue</th>'.
- '<th>Wed</th>'.
- '<th>Thu</th>'.
- '<th>Fri</th>'.
- '<th>Sat</th>'.
- '</tr>'.
- '%s'.
- '</table>',
- $this->renderCalendarHeader($first),
- phutil_implode_html("\n", $table));
+
+ $header = phutil_tag(
+ 'tr',
+ array('class' => 'aphront-calendar-day-of-week-header'),
+ array(
+ phutil_tag('th', array(), pht('Sun')),
+ phutil_tag('th', array(), pht('Mon')),
+ phutil_tag('th', array(), pht('Tue')),
+ phutil_tag('th', array(), pht('Wed')),
+ phutil_tag('th', array(), pht('Thu')),
+ phutil_tag('th', array(), pht('Fri')),
+ phutil_tag('th', array(), pht('Sat')),
+ ));
+
+ $table = phutil_tag(
+ 'table',
+ array('class' => 'aphront-calendar-view'),
+ array(
+ $this->renderCalendarHeader($first),
+ $header,
+ phutil_implode_html("\n", $table),
+ ));
return $table;
}
@@ -190,11 +193,14 @@
$right_th = phutil_tag('th', array(), $next_link);
}
- return hsprintf(
- '<tr class="aphront-calendar-month-year-header">%s%s%s</tr>',
- $left_th,
- phutil_tag('th', array('colspan' => $colspan), $date->format('F Y')),
- $right_th);
+ return phutil_tag(
+ 'tr',
+ array('class' => 'aphront-calendar-month-year-header'),
+ array(
+ $left_th,
+ phutil_tag('th', array('colspan' => $colspan), $date->format('F Y')),
+ $right_th,
+ ));
}
private function getNextYearAndMonth() {
Index: src/applications/conduit/controller/PhabricatorConduitAPIController.php
===================================================================
--- src/applications/conduit/controller/PhabricatorConduitAPIController.php
+++ src/applications/conduit/controller/PhabricatorConduitAPIController.php
@@ -423,7 +423,10 @@
$value = $json->encodeFormatted($value);
}
- $value = hsprintf('<pre style="white-space: pre-wrap;">%s</pre>', $value);
+ $value = phutil_tag(
+ 'pre',
+ array('style' => 'white-space: pre-wrap;'),
+ $value);
return $value;
}
Index: src/applications/conduit/query/PhabricatorConduitSearchEngine.php
===================================================================
--- src/applications/conduit/query/PhabricatorConduitSearchEngine.php
+++ src/applications/conduit/query/PhabricatorConduitSearchEngine.php
@@ -61,8 +61,9 @@
->setLabel('Applications')
->setName('applicationNames')
->setValue(implode(', ', $names))
- ->setCaption(
- pht('Example: %s', hsprintf('<tt>differential, paste</tt>'))));
+ ->setCaption(pht(
+ 'Example: %s',
+ phutil_tag('tt', array(), 'differential, paste'))));
$is_stable = $saved->getParameter('isStable');
$is_unstable = $saved->getParameter('isUnstable');
Index: src/applications/config/controller/PhabricatorConfigEditController.php
===================================================================
--- src/applications/config/controller/PhabricatorConfigEditController.php
+++ src/applications/config/controller/PhabricatorConfigEditController.php
@@ -473,10 +473,10 @@
}
$table = array();
- $table[] = hsprintf(
- '<tr class="column-labels"><th>%s</th><th>%s</th></tr>',
- pht('Example'),
- pht('Value'));
+ $table[] = phutil_tag('tr', array('class' => 'column-labels'), array(
+ phutil_tag('th', array(), pht('Example')),
+ phutil_tag('th', array(), pht('Value')),
+ ));
foreach ($examples as $example) {
list($value, $description) = $example;
@@ -488,10 +488,10 @@
}
}
- $table[] = hsprintf(
- '<tr><th>%s</th><td>%s</td></tr>',
- $description,
- $value);
+ $table[] = phutil_tag('tr', array(), array(
+ phutil_tag('th', array(), $description),
+ phutil_tag('th', array(), $value),
+ ));
}
require_celerity_resource('config-options-css');
@@ -509,10 +509,10 @@
$stack = $stack->getStack();
$table = array();
- $table[] = hsprintf(
- '<tr class="column-labels"><th>%s</th><th>%s</th></tr>',
- pht('Source'),
- pht('Value'));
+ $table[] = phutil_tag('tr', array('class' => 'column-labels'), array(
+ phutil_tag('th', array(), pht('Source')),
+ phutil_tag('th', array(), pht('Value')),
+ ));
foreach ($stack as $key => $source) {
$value = $source->getKeys(
array(
@@ -526,10 +526,10 @@
$value[$option->getKey()]);
}
- $table[] = hsprintf(
- '<tr><th>%s</th><td>%s</td></tr>',
- $source->getName(),
- $value);
+ $table[] = phutil_tag('tr', array('class' => 'column-labels'), array(
+ phutil_tag('th', array(), $source->getName()),
+ phutil_tag('td', array(), $value),
+ ));
}
require_celerity_resource('config-options-css');
Index: src/applications/conpherence/controller/ConpherenceNotificationPanelController.php
===================================================================
--- src/applications/conpherence/controller/ConpherenceNotificationPanelController.php
+++ src/applications/conpherence/controller/ConpherenceNotificationPanelController.php
@@ -72,8 +72,8 @@
}
$content = $view->render();
} else {
- $content = hsprintf(
- '<div class="phabricator-notification no-notifications">%s</div>',
+ $content = phutil_tag_div(
+ 'phabricator-notification no-notifications',
pht('You have no messages.'));
}
Index: src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
===================================================================
--- src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
+++ src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
@@ -43,7 +43,7 @@
$dialog = new AphrontDialogView();
$dialog->setUser($request->getUser());
$dialog->setTitle(pht('Really delete this countdown?'));
- $dialog->appendChild(hsprintf('<p>%s</p>', $inst));
+ $dialog->appendChild(phutil_tag('p', array(), $inst));
$dialog->addSubmitButton(pht('Delete'));
$dialog->addCancelButton('/countdown/');
$dialog->setSubmitURI($request->getPath());
Index: src/applications/countdown/view/PhabricatorCountdownView.php
===================================================================
--- src/applications/countdown/view/PhabricatorCountdownView.php
+++ src/applications/countdown/view/PhabricatorCountdownView.php
@@ -42,30 +42,31 @@
}
- $container = celerity_generate_unique_node_id();
- $content = hsprintf(
- '<div class="phabricator-timer" id="%s">
- %s
- <table class="phabricator-timer-table">
- <tr>
- <th>%s</th>
- <th>%s</th>
- <th>%s</th>
- <th>%s</th>
- </tr>
- <tr>%s%s%s%s</tr>
- </table>
- </div>',
- $container,
- $header,
- pht('Days'),
- pht('Hours'),
- pht('Minutes'),
- pht('Seconds'),
+ $ths = array(
+ phutil_tag('th', array(), pht('Days')),
+ phutil_tag('th', array(), pht('Hours')),
+ phutil_tag('th', array(), pht('Minutes')),
+ phutil_tag('th', array(), pht('Seconds')),
+ );
+
+ $dashes = array(
javelin_tag('td', array('sigil' => 'phabricator-timer-days'), '-'),
javelin_tag('td', array('sigil' => 'phabricator-timer-hours'), '-'),
javelin_tag('td', array('sigil' => 'phabricator-timer-minutes'), '-'),
- javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-'));
+ javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-'),
+ );
+
+ $container = celerity_generate_unique_node_id();
+ $content = phutil_tag(
+ 'div',
+ array('class' => 'phabricator-timer', 'id' => $container),
+ array(
+ $header,
+ phutil_tag('table', array('class' => 'phabricator-timer-table'), array(
+ phutil_tag('tr', array(), $ths),
+ phutil_tag('tr', array(), $dashes),
+ )),
+ ));
Javelin::initBehavior('countdown-timer', array(
'timestamp' => $countdown->getEpoch(),
Index: src/applications/differential/controller/DifferentialDiffViewController.php
===================================================================
--- src/applications/differential/controller/DifferentialDiffViewController.php
+++ src/applications/differential/controller/DifferentialDiffViewController.php
@@ -36,8 +36,9 @@
// TODO: implement optgroup support in AphrontFormSelectControl?
$select = array();
$select[] = hsprintf('<optgroup label="%s">', pht('Create New Revision'));
- $select[] = hsprintf(
- '<option value="">%s</option>',
+ $select[] = phutil_tag(
+ 'option',
+ array('value' => ''),
pht('Create a new Revision...'));
$select[] = hsprintf('</optgroup>');
Index: src/applications/differential/controller/DifferentialRevisionLandController.php
===================================================================
--- src/applications/differential/controller/DifferentialRevisionLandController.php
+++ src/applications/differential/controller/DifferentialRevisionLandController.php
@@ -49,7 +49,7 @@
$ex->getMessage(),
$ex->getPreviousException()->getMessage());
} else {
- $text = hsprintf('<pre>%s</pre>', $ex->getMessage());
+ $text = phutil_tag('pre', array(), $ex->getMessage());
}
$text = id(new AphrontErrorView())
->appendChild($text);
Index: src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
===================================================================
--- src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
+++ src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
@@ -250,9 +250,7 @@
}
}
- return hsprintf(
- '<div class="differential-meta-notice">%s</div>',
- $message);
+ return phutil_tag_div('differential-meta-notice', $message);
}
protected function renderPropertyChangeHeader() {
@@ -281,27 +279,21 @@
$nval = phutil_escape_html_newlines($nval);
}
- $rows[] = hsprintf(
- '<tr>'.
- '<th>%s</th>'.
- '<td class="oval">%s</td>'.
- '<td class="nval">%s</td>'.
- '</tr>',
- $key,
- $oval,
- $nval);
+ $rows[] = phutil_tag('tr', array(), array(
+ phutil_tag('th', array(), $key),
+ phutil_tag('td', array('class' => 'oval'), $oval),
+ phutil_tag('td', array('class' => 'nval'), $nval),
+ ));
}
}
- array_unshift($rows, hsprintf(
- '<tr class="property-table-header">'.
- '<th>%s</th>'.
- '<td class="oval">%s</td>'.
- '<td class="nval">%s</td>'.
- '</tr>',
- pht('Property Changes'),
- pht('Old Value'),
- pht('New Value')));
+ array_unshift(
+ $rows,
+ phutil_tag('tr', array('class' => 'property-table-header'), array(
+ phutil_tag('th', array(), pht('Property Changes')),
+ phutil_tag('td', array('class' => 'oval'), pht('Old Value')),
+ phutil_tag('td', array('class' => 'nval'), pht('New Value')),
+ )));
return phutil_tag(
'table',
Index: src/applications/differential/render/DifferentialChangesetOneUpRenderer.php
===================================================================
--- src/applications/differential/render/DifferentialChangesetOneUpRenderer.php
+++ src/applications/differential/render/DifferentialChangesetOneUpRenderer.php
@@ -27,19 +27,19 @@
} else {
$class = 'left';
}
- $out[] = hsprintf('<th>%s</th>', $p['line']);
- $out[] = hsprintf('<th></th>');
- $out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']);
+ $out[] = phutil_tag('th', array(), $p['line']);
+ $out[] = phutil_tag('th', array());
+ $out[] = phutil_tag('td', array('class' => $class), $p['render']);
} else if ($type == 'new') {
if ($p['htype']) {
$class = 'right new';
- $out[] = hsprintf('<th />');
+ $out[] = phutil_tag('th', array());
} else {
$class = 'right';
- $out[] = hsprintf('<th>%s</th>', $p['oline']);
+ $out[] = phutil_tag('th', array(), $p['oline']);
}
- $out[] = hsprintf('<th>%s</th>', $p['line']);
- $out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']);
+ $out[] = phutil_tag('th', array(), $p['line']);
+ $out[] = phutil_tag('td', array('class' => $class), $p['render']);
}
$out[] = hsprintf('</tr>');
break;
Index: src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
===================================================================
--- src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
+++ src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
@@ -222,7 +222,7 @@
$cov_class = $coverage[$n_num - 1];
}
$cov_class = 'cov-'.$cov_class;
- $n_cov = hsprintf('<td class="cov %s"></td>', $cov_class);
+ $n_cov = phutil_tag('td', array('class' => "cov {$cov_class}"));
$n_colspan--;
}
@@ -240,7 +240,7 @@
$n_classes = $n_class;
if ($new_lines[$ii]['type'] == '\\' || !isset($copy_lines[$n_num])) {
- $n_copy = hsprintf('<td class="copy %s"></td>', $n_class);
+ $n_copy = phutil_tag('td', array('class' => "copy {$n_class}"));
} else {
list($orig_file, $orig_line, $orig_type) = $copy_lines[$n_num];
$title = ($orig_type == '-' ? 'Moved' : 'Copied').' from ';
@@ -283,29 +283,25 @@
$n_id = null;
}
+ // NOTE: This is a unicode zero-width space, which we use as a hint
+ // when intercepting 'copy' events to make sure sensible text ends
+ // up on the clipboard. See the 'phabricator-oncopy' behavior.
+ $zero_space = "\xE2\x80\x8B";
+
// NOTE: The Javascript is sensitive to whitespace changes in this
// block!
- $html[] = hsprintf(
- '<tr>'.
- '%s'.
- '<td class="%s">%s</td>'.
- '%s'.
- '%s'.
- // NOTE: This is a unicode zero-width space, which we use as a hint
- // when intercepting 'copy' events to make sure sensible text ends
- // up on the clipboard. See the 'phabricator-oncopy' behavior.
- '<td class="%s" colspan="%s">'.
- "\xE2\x80\x8B%s".
- '</td>'.
- '%s'.
- '</tr>',
+ $html[] = phutil_tag('tr', array(), array(
phutil_tag('th', array('id' => $o_id), $o_num),
- $o_classes, $o_text,
+ phutil_tag('td', array('class' => $o_classes), $o_text),
phutil_tag('th', array('id' => $n_id), $n_num),
$n_copy,
- $n_classes, $n_colspan, $n_text,
- $n_cov);
+ phutil_tag(
+ 'td',
+ array('class' => $n_classes, 'colspan' => $n_colspan),
+ array($zero_space, $n_text)),
+ $n_cov,
+ ));
if ($context_not_available && ($ii == $rows - 1)) {
$html[] = $context_not_available;
@@ -328,29 +324,27 @@
}
}
}
- $html[] = hsprintf(
- '<tr class="inline">'.
- '<th />'.
- '<td class="left">%s</td>'.
- '<th />'.
- '<td colspan="3" class="right3">%s</td>'.
- '</tr>',
- $comment_html,
- $new);
+ $html[] = phutil_tag('tr', array('class' => 'inline'), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array('class' => 'left'), $comment_html),
+ phutil_tag('th', array()),
+ phutil_tag('td', array('colspan' => 3, 'class' => 'right3'), $new),
+ ));
}
}
if ($n_num && isset($new_comments[$n_num])) {
foreach ($new_comments[$n_num] as $comment) {
$comment_html = $this->renderInlineComment($comment,
$on_right = true);
- $html[] = hsprintf(
- '<tr class="inline">'.
- '<th />'.
- '<td class="left" />'.
- '<th />'.
- '<td colspan="3" class="right3">%s</td>'.
- '</tr>',
- $comment_html);
+ $html[] = phutil_tag('tr', array('class' => 'inline'), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array('class' => 'left')),
+ phutil_tag('th', array()),
+ phutil_tag(
+ 'td',
+ array('colspan' => 3, 'class' => 'right3'),
+ $comment_html),
+ ));
}
}
}
@@ -395,40 +389,39 @@
foreach ($this->getOldComments() as $on_line => $comment_group) {
foreach ($comment_group as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = false);
- $html_old[] = hsprintf(
- '<tr class="inline">'.
- '<th />'.
- '<td class="left">%s</td>'.
- '<th />'.
- '<td class="right3" colspan="3" />'.
- '</tr>',
- $comment_html);
+ $html_old[] = phutil_tag('tr', array('class' => 'inline'), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array('class' => 'left'), $comment_html),
+ phutil_tag('th', array()),
+ phutil_tag('td', array('colspan' => 3, 'class' => 'right3')),
+ ));
}
}
foreach ($this->getNewComments() as $lin_line => $comment_group) {
foreach ($comment_group as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = true);
- $html_new[] = hsprintf(
- '<tr class="inline">'.
- '<th />'.
- '<td class="left" />'.
- '<th />'.
- '<td class="right3" colspan="3">%s</td>'.
- '</tr>',
- $comment_html);
+ $html_new[] = phutil_tag('tr', array('class' => 'inline'), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array('class' => 'left')),
+ phutil_tag('th', array()),
+ phutil_tag(
+ 'td',
+ array('colspan' => 3, 'class' => 'right3'),
+ $comment_html),
+ ));
}
}
if (!$old) {
- $th_old = hsprintf('<th></th>');
+ $th_old = phutil_tag('th', array());
} else {
- $th_old = hsprintf('<th id="C%sOL1">1</th>', $vs);
+ $th_old = phutil_tag('th', array('id' => "C{$vs}OL1"), 1);
}
if (!$new) {
- $th_new = hsprintf('<th></th>');
+ $th_new = phutil_tag('th', array());
} else {
- $th_new = hsprintf('<th id="C%sNL1">1</th>', $id);
+ $th_new = phutil_tag('th', array('id' => "C{$id}OL1"), 1);
}
$output = hsprintf(
Index: src/applications/differential/view/DifferentialAddCommentView.php
===================================================================
--- src/applications/differential/view/DifferentialAddCommentView.php
+++ src/applications/differential/view/DifferentialAddCommentView.php
@@ -181,16 +181,17 @@
$warn = phutil_tag('div', array('id' => 'warnings'), $warning_container);
- $preview = hsprintf(
- '<div class="aphront-panel-preview aphront-panel-flush">'.
- '<div id="comment-preview">'.
- '<span class="aphront-panel-preview-loading-text">%s</span>'.
- '</div>'.
- '<div id="inline-comment-preview">'.
- '</div>'.
- '</div>',
+ $loading = phutil_tag(
+ 'span',
+ array('class' => 'aphront-panel-preview-loading-text'),
pht('Loading comment preview...'));
+ $preview = phutil_tag_div(
+ 'aphront-panel-preview aphront-panel-flush',
+ array(
+ phutil_tag('div', array('id' => 'comment-preview'), $loading),
+ phutil_tag('div', array('id' => 'inline-comment-preview')),
+ ));
$comment_box = id(new PHUIObjectBoxView())
Index: src/applications/differential/view/DifferentialChangesetListView.php
===================================================================
--- src/applications/differential/view/DifferentialChangesetListView.php
+++ src/applications/differential/view/DifferentialChangesetListView.php
@@ -246,19 +246,21 @@
array('Changes discarded. ', $link));
return array(
- 'l' => hsprintf(
- '<table><tr>'.
- '<th></th><td>%s</td>'.
- '<th></th><td colspan="3"></td>'.
- '</tr></table>',
- $div),
-
- 'r' => hsprintf(
- '<table><tr>'.
- '<th></th><td></td>'.
- '<th></th><td colspan="3">%s</td>'.
- '</tr></table>',
- $div),
+ 'l' => phutil_tag('table', array(),
+ phutil_tag('tr', array(), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array(), $div),
+ phutil_tag('th', array()),
+ phutil_tag('td', array('colspan' => 3)),
+ ))),
+
+ 'r' => phutil_tag('table', array(),
+ phutil_tag('tr', array(), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array()),
+ phutil_tag('th', array()),
+ phutil_tag('td', array('colspan' => 3), $div),
+ ))),
);
}
Index: src/applications/differential/view/DifferentialDiffTableOfContentsView.php
===================================================================
--- src/applications/differential/view/DifferentialDiffTableOfContentsView.php
+++ src/applications/differential/view/DifferentialDiffTableOfContentsView.php
@@ -136,7 +136,8 @@
$pchar =
($changeset->getOldProperties() === $changeset->getNewProperties())
? null
- : hsprintf('<span title="%s">M</span>', pht('Properties Changed'));
+ : phutil_tag('span', array('title' => pht('Properties Changed')), 'M')
+ ;
$fname = $changeset->getFilename();
$cov = $this->renderCoverage($coverage, $fname);
@@ -152,28 +153,25 @@
(isset($this->visibleChangesets[$id]) ? 'Loading...' : '?'));
}
- $rows[] = hsprintf(
- '<tr>'.
- '<td class="differential-toc-char" title="%s">%s</td>'.
- '<td class="differential-toc-prop">%s</td>'.
- '<td class="differential-toc-ftype">%s</td>'.
- '<td class="differential-toc-file">%s%s</td>'.
- '<td class="differential-toc-cov">%s</td>'.
- '<td class="differential-toc-mcov">%s</td>'.
- '</tr>',
- $chartitle, $char,
- $pchar,
- $desc,
- $link, $lines,
- $cov,
- $mcov);
+ $rows[] = phutil_tag('tr', array(), array(
+ phutil_tag(
+ 'td',
+ array('class' => 'differential-toc-char', 'title' => $chartitle),
+ $char),
+ phutil_tag('td', array('class' => 'differential-toc-prop'), $pchar),
+ phutil_tag('td', array('class' => 'differential-toc-ftype'), $desc),
+ phutil_tag(
+ 'td',
+ array('class' => 'differential-toc-file'),
+ array($link, $lines)),
+ phutil_tag('td', array('class' => 'differential-toc-cov'), $cov),
+ phutil_tag('td', array('class' => 'differential-toc-mcov'), $mcov),
+ ));
if ($meta) {
- $rows[] = hsprintf(
- '<tr>'.
- '<td colspan="3"></td>'.
- '<td class="differential-toc-meta">%s</td>'.
- '</tr>',
- $meta);
+ $rows[] = phutil_tag('tr', array(), array(
+ phutil_tag('td', array('colspan' => 3)),
+ phutil_tag('td', array('class' => 'differential-toc-meta'), $meta),
+ ));
}
if ($this->diff && $this->repository) {
$paths[] =
@@ -208,10 +206,9 @@
),
pht('Show All Context'));
- $buttons = hsprintf(
- '<tr><td colspan="7">%s%s</td></tr>',
- $editor_link,
- $reveal_link);
+ $buttons = phutil_tag('tr', array(),
+ phutil_tag('td', array('colspan' => 7),
+ array($editor_link, $reveal_link)));
$content = hsprintf(
'%s'.
Index: src/applications/differential/view/DifferentialInlineCommentEditView.php
===================================================================
--- src/applications/differential/view/DifferentialInlineCommentEditView.php
+++ src/applications/differential/view/DifferentialInlineCommentEditView.php
@@ -60,17 +60,21 @@
$this->renderBody(),
));
- return hsprintf(
- '<table>'.
- '<tr class="inline-comment-splint">'.
- '<th></th>'.
- '<td class="left">%s</td>'.
- '<th></th>'.
- '<td colspan="3" class="right3">%s</td>'.
- '</tr>'.
- '</table>',
- $this->onRight ? null : $content,
- $this->onRight ? $content : null);
+ return phutil_tag('table', array(), phutil_tag(
+ 'tr',
+ array('class' => 'inline-comment-splint'),
+ array(
+ phutil_tag('th', array()),
+ phutil_tag(
+ 'td',
+ array('class' => 'left'),
+ $this->onRight ? null : $content),
+ phutil_tag('th', array()),
+ phutil_tag(
+ 'td',
+ array('colspan' => 3, 'class' => 'right3'),
+ $this->onRight ? $content : null),
+ )));
}
private function renderInputs() {
Index: src/applications/differential/view/DifferentialInlineCommentView.php
===================================================================
--- src/applications/differential/view/DifferentialInlineCommentView.php
+++ src/applications/differential/view/DifferentialInlineCommentView.php
@@ -217,6 +217,11 @@
$author = $handles[$inline->getAuthorPHID()]->getName();
}
+ $line = phutil_tag(
+ 'span',
+ array('class' => 'differential-inline-comment-line'),
+ $line);
+
$markup = javelin_tag(
'div',
array(
@@ -224,18 +229,19 @@
'sigil' => $sigil,
'meta' => $metadata,
),
- hsprintf(
- '<div class="differential-inline-comment-head">'.
- '%s%s <span class="differential-inline-comment-line">%s</span> %s'.
- '</div>'.
- '<div class="differential-inline-comment-content">'.
- '<div class="phabricator-remarkup">%s</div>'.
- '</div>',
- $anchor,
- $links,
- $line,
- $author,
- $content));
+ array(
+ phutil_tag_div('differential-inline-comment-head', array(
+ $anchor,
+ $links,
+ ' ',
+ $line,
+ ' ',
+ $author,
+ )),
+ phutil_tag_div(
+ 'differential-inline-comment-content',
+ phutil_tag_div('phabricator-remarkup', $content)),
+ ));
return $this->scaffoldMarkup($markup);
}
@@ -248,17 +254,16 @@
$left_markup = !$this->onRight ? $markup : '';
$right_markup = $this->onRight ? $markup : '';
- return hsprintf(
- '<table>'.
- '<tr class="inline">'.
- '<th></th>'.
- '<td class="left">%s</td>'.
- '<th></th>'.
- '<td class="right3" colspan="3">%s</td>'.
- '</tr>'.
- '</table>',
- $left_markup,
- $right_markup);
+ return phutil_tag('table', array(),
+ phutil_tag('tr', array(), array(
+ phutil_tag('th', array()),
+ phutil_tag('td', array('class' => 'left'), $left_markup),
+ phutil_tag('th', array()),
+ phutil_tag(
+ 'td',
+ array('colspan' => 3, 'class' => 'right3'),
+ $right_markup),
+ )));
}
}
Index: src/applications/differential/view/DifferentialLocalCommitsView.php
===================================================================
--- src/applications/differential/view/DifferentialLocalCommitsView.php
+++ src/applications/differential/view/DifferentialLocalCommitsView.php
@@ -128,12 +128,10 @@
$headers = phutil_tag('tr', array(), $headers);
- $content = hsprintf(
- '<div class="differential-panel">'.
- '<table class="differential-local-commits-table">%s%s</table>'.
- '</div>',
- $headers,
- phutil_implode_html("\n", $rows));
+ $content = phutil_tag_div('differential-panel', phutil_tag(
+ 'table',
+ array('class' => 'differential-local-commits-table'),
+ array($headers, phutil_implode_html("\n", $rows))));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Local Commits'))
Index: src/applications/differential/view/DifferentialRevisionCommentView.php
===================================================================
--- src/applications/differential/view/DifferentialRevisionCommentView.php
+++ src/applications/differential/view/DifferentialRevisionCommentView.php
@@ -87,9 +87,7 @@
$comment,
PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY);
- $content = hsprintf(
- '<div class="phabricator-remarkup">%s</div>',
- $content);
+ $content = phutil_tag_div('phabricator-remarkup', $content);
}
$inline_render = $this->renderInlineComments();
@@ -207,10 +205,9 @@
}
if (!$hide_comments) {
- $xaction_view->appendChild(hsprintf(
- '<div class="differential-comment-core">%s%s</div>',
- $content,
- $inline_render));
+ $xaction_view->appendChild(phutil_tag_div(
+ 'differential-comment-core',
+ array($content, $inline_render)));
}
return $xaction_view->render();
Index: src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
===================================================================
--- src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -200,23 +200,25 @@
phutil_tag('th', array(), pht('Unit')),
)));
- $content = hsprintf(
- '<div class="differential-revision-history differential-panel">'.
- '<form action="#toc">'.
- '<table class="differential-revision-history-table">'.
- '%s'.
- '<tr>'.
- '<td colspan="9" class="diff-differ-submit">'.
- '<label>%s</label>'.
- '<button>%s</button>'.
- '</td>'.
- '</tr>'.
- '</table>'.
- '</form>'.
- '</div>',
- phutil_implode_html("\n", $rows),
- pht('Whitespace Changes: %s', $select),
- pht('Show Diff'));
+ $label = pht('Whitespace Changes: %s', $select);
+
+ $content = phutil_tag_div(
+ 'differential-revision-history differential-panel',
+ phutil_tag(
+ 'form',
+ array('action' => '#toc'),
+ phutil_tag(
+ 'table',
+ array('class' => 'differential-revision-history-table'), array(
+ phutil_implode_html("\n", $rows),
+ phutil_tag('tr', array(), phutil_tag(
+ 'td',
+ array('colspan' => 9, 'class' => 'diff-differ-submit'),
+ array(
+ phutil_tag('label', array(), $label),
+ phutil_tag('button', array(), pht('Show Diff')),
+ )))
+ ))));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Revision Update History'))
Index: src/applications/diffusion/controller/DiffusionCommitController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionCommitController.php
+++ src/applications/diffusion/controller/DiffusionCommitController.php
@@ -744,21 +744,26 @@
'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/',
));
- $preview_panel = hsprintf(
- '<div class="aphront-panel-preview aphront-panel-flush">
- <div id="audit-preview">
- <div class="aphront-panel-preview-loading-text">
- Loading preview...
- </div>
- </div>
- <div id="inline-comment-preview">
- </div>
- </div>');
+ $loading = phutil_tag_div(
+ 'aphront-panel-preview-loading-text',
+ pht('Loading preview...'));
+
+ $preview_panel = phutil_tag_div(
+ 'aphront-panel-preview aphront-panel-flush',
+ array(
+ phutil_tag('div', array('id' => 'audit-preview'), $loading),
+ phutil_tag('div', array('id' => 'inline-comment-preview'))
+ ));
// TODO: This is pretty awkward, unify the CSS between Diffusion and
// Differential better.
require_celerity_resource('differential-core-view-css');
+ $anchor = id(new PhabricatorAnchorView())
+ ->setAnchorName('comment')
+ ->setNavigationMarker(true)
+ ->render();
+
$comment_box = id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($form);
@@ -768,14 +773,9 @@
array(
'id' => $pane_id,
),
- hsprintf(
- '<div class="differential-add-comment-panel">%s%s%s</div>',
- id(new PhabricatorAnchorView())
- ->setAnchorName('comment')
- ->setNavigationMarker(true)
- ->render(),
- $comment_box,
- $preview_panel));
+ phutil_tag_div(
+ 'differential-add-comment-panel',
+ array($anchor, $comment_box, $preview_panel)));
}
/**
Index: src/applications/diffusion/controller/DiffusionLintController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionLintController.php
+++ src/applications/diffusion/controller/DiffusionLintController.php
@@ -69,25 +69,20 @@
$total += $code['n'];
+ $href_lint = $drequest->generateURI(array(
+ 'action' => 'lint',
+ 'lint' => $code['code'],
+ ));
+ $href_browse = $drequest->generateURI(array(
+ 'action' => 'browse',
+ 'lint' => $code['code'],
+ ));
+ $href_repo = $drequest->generateURI(array('action' => 'lint'));
+
$rows[] = array(
- hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array(
- 'action' => 'lint',
- 'lint' => $code['code'],
- )),
- $code['n']),
- hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array(
- 'action' => 'browse',
- 'lint' => $code['code'],
- )),
- $code['files']),
- hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array('action' => 'lint')),
- $drequest->getCallsign()),
+ phutil_tag('a', array('href' => $href_lint), $code['n']),
+ phutil_tag('a', array('href' => $href_browse), $code['files']),
+ phutil_tag('a', array('href' => $href_repo), $drequest->getCallsign()),
ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']),
$code['code'],
$code['maxName'],
Index: src/applications/diffusion/controller/DiffusionLintDetailsController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionLintDetailsController.php
+++ src/applications/diffusion/controller/DiffusionLintDetailsController.php
@@ -15,22 +15,22 @@
$rows = array();
foreach ($messages as $message) {
- $path = hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array(
+ $path = phutil_tag(
+ 'a',
+ array('href' => $drequest->generateURI(array(
'action' => 'lint',
'path' => $message['path'],
- )),
+ ))),
substr($message['path'], strlen($drequest->getPath()) + 1));
- $line = hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array(
+ $line = phutil_tag(
+ 'a',
+ array('href' => $drequest->generateURI(array(
'action' => 'browse',
'path' => $message['path'],
'line' => $message['line'],
'commit' => $branch->getLintCommit(),
- )),
+ ))),
$message['line']);
$author = $message['authorPHID'];
Index: src/applications/diffusion/view/DiffusionBrowseTableView.php
===================================================================
--- src/applications/diffusion/view/DiffusionBrowseTableView.php
+++ src/applications/diffusion/view/DiffusionBrowseTableView.php
@@ -74,12 +74,12 @@
$lint = self::loadLintMessagesCount($drequest);
if ($lint !== null) {
- $return['lint'] = hsprintf(
- '<a href="%s">%s</a>',
- $drequest->generateURI(array(
+ $return['lint'] = phutil_tag(
+ 'a',
+ array('href' => $drequest->generateURI(array(
'action' => 'lint',
'lint' => null,
- )),
+ ))),
number_format($lint));
}
Index: src/applications/diffusion/view/DiffusionCommentView.php
===================================================================
--- src/applications/diffusion/view/DiffusionCommentView.php
+++ src/applications/diffusion/view/DiffusionCommentView.php
@@ -139,12 +139,12 @@
if (!strlen($comment->getContent()) && empty($this->inlineComments)) {
return null;
} else {
- return hsprintf(
- '<div class="phabricator-remarkup">%s%s</div>',
+ return phutil_tag_div('phabricator-remarkup', array(
$engine->getOutput(
$comment,
PhabricatorAuditComment::MARKUP_FIELD_BODY),
- $this->renderInlines());
+ $this->renderInlines(),
+ ));
}
}
Index: src/applications/feed/builder/PhabricatorFeedBuilder.php
===================================================================
--- src/applications/feed/builder/PhabricatorFeedBuilder.php
+++ src/applications/feed/builder/PhabricatorFeedBuilder.php
@@ -47,8 +47,8 @@
if ($date !== $last_date) {
if ($last_date !== null) {
- $null_view->appendChild(hsprintf(
- '<div class="phabricator-feed-story-date-separator"></div>'));
+ $null_view->appendChild(
+ phutil_tag_div('phabricator-feed-story-date-separator'));
}
$last_date = $date;
$header = new PhabricatorActionHeaderView();
Index: src/applications/feed/controller/PhabricatorFeedDetailController.php
===================================================================
--- src/applications/feed/controller/PhabricatorFeedDetailController.php
+++ src/applications/feed/controller/PhabricatorFeedDetailController.php
@@ -27,9 +27,7 @@
$title = pht('Story');
- $feed_view = hsprintf(
- '<div class="phabricator-feed-frame">%s</div>',
- $feed_view);
+ $feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
Index: src/applications/feed/controller/PhabricatorFeedListController.php
===================================================================
--- src/applications/feed/controller/PhabricatorFeedListController.php
+++ src/applications/feed/controller/PhabricatorFeedListController.php
@@ -32,9 +32,7 @@
$builder->setUser($this->getRequest()->getUser());
$view = $builder->buildView();
- return hsprintf(
- '<div class="phabricator-feed-frame">%s</div>',
- $view);
+ return phutil_tag_div('phabricator-feed-frame', $view);
}
}
Index: src/applications/feed/controller/PhabricatorFeedPublicStreamController.php
===================================================================
--- src/applications/feed/controller/PhabricatorFeedPublicStreamController.php
+++ src/applications/feed/controller/PhabricatorFeedPublicStreamController.php
@@ -25,7 +25,8 @@
->setFramed(true)
->setUser($viewer);
- $view = hsprintf('<div class="phabricator-public-feed-frame">%s</div>',
+ $view = phutil_tag_div(
+ 'phabricator-public-feed-frame',
$builder->buildView());
return $this->buildStandardPageResponse(
Index: src/applications/feed/story/PhabricatorFeedStoryCommit.php
===================================================================
--- src/applications/feed/story/PhabricatorFeedStoryCommit.php
+++ src/applications/feed/story/PhabricatorFeedStoryCommit.php
@@ -37,13 +37,13 @@
}
if ($author) {
- $title = hsprintf(
+ $title = pht(
"%s committed %s (authored by %s)",
$committer,
$commit,
$author);
} else {
- $title = hsprintf(
+ $title = pht(
"%s committed %s",
$committer,
$commit);
Index: src/applications/harbormaster/view/ShellLogView.php
===================================================================
--- src/applications/harbormaster/view/ShellLogView.php
+++ src/applications/harbormaster/view/ShellLogView.php
@@ -61,15 +61,23 @@
// TODO: Provide nice links.
+ $th = phutil_tag(
+ 'th',
+ array(
+ 'class' => 'phabricator-source-line',
+ 'style' => 'background-color: #fff;',
+ ),
+ $content_number);
+
+ $td = phutil_tag(
+ 'td',
+ array('class' => 'phabricator-source-code'),
+ $content_line);
+
$rows[] = phutil_tag(
'tr',
$row_attributes,
- hsprintf(
- '<th class="phabricator-source-line" '.
- 'style="background-color: #fff;">%s</th>'.
- '<td class="phabricator-source-code">%s</td>',
- $content_number,
- $content_line));
+ array($th, $td));
if ($hit_limit) {
break;
Index: src/applications/herald/controller/HeraldTestConsoleController.php
===================================================================
--- src/applications/herald/controller/HeraldTestConsoleController.php
+++ src/applications/herald/controller/HeraldTestConsoleController.php
@@ -94,8 +94,8 @@
$form = id(new AphrontFormView())
->setUser($user)
- ->appendChild(hsprintf(
- '<p class="aphront-form-instructions">%s</p>', $text))
+ ->appendChild(
+ phutil_tag('p', array('class' => 'aphront-form-instructions'), $text))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Object Name'))
Index: src/applications/herald/controller/HeraldTranscriptController.php
===================================================================
--- src/applications/herald/controller/HeraldTranscriptController.php
+++ src/applications/herald/controller/HeraldTranscriptController.php
@@ -133,7 +133,7 @@
$value = implode(', ', $value);
}
- return hsprintf('<span class="condition-test-value">%s</span>', $value);
+ return phutil_tag('span', array('class' => 'condition-test-value'), $value);
}
private function buildSideNav() {
@@ -306,13 +306,15 @@
}
if ($apply_xscript->getApplied()) {
- $success = pht('SUCCESS');
- $outcome =
- hsprintf('<span class="outcome-success">%s</span>', $success);
+ $outcome = phutil_tag(
+ 'span',
+ array('class' => 'outcome-success'),
+ pht('SUCCESS'));
} else {
- $failure = pht('FAILURE');
- $outcome =
- hsprintf('<span class="outcome-failure">%s</span>', $failure);
+ $outcome = phutil_tag(
+ 'span',
+ array('class' => 'outcome-failure'),
+ pht('FAILURE'));
}
$rows[] = array(
@@ -366,23 +368,21 @@
$cond_markup = array();
foreach ($xscript->getConditionTranscriptsForRule($rule_id) as $cond) {
if ($cond->getNote()) {
- $note = hsprintf(
- '<div class="herald-condition-note">%s</div>',
- $cond->getNote());
+ $note = phutil_tag_div('herald-condition-note', $cond->getNote());
} else {
$note = null;
}
if ($cond->getResult()) {
- $result = hsprintf(
- '<span class="herald-outcome condition-pass">'.
- "\xE2\x9C\x93".
- '</span>');
+ $result = phutil_tag(
+ 'span',
+ array('class' => 'herald-outcome condition-pass'),
+ "\xE2\x9C\x93");
} else {
- $result = hsprintf(
- '<span class="herald-outcome condition-fail">'.
- "\xE2\x9C\x98".
- '</span>');
+ $result = phutil_tag(
+ 'span',
+ array('class' => 'herald-outcome condition-fail'),
+ "\xE2\x9C\x98");
}
$cond_markup[] = phutil_tag(
@@ -398,18 +398,23 @@
}
if ($rule->getResult()) {
- $pass = pht('PASS');
- $result = hsprintf(
- '<span class="herald-outcome rule-pass">%s</span>', $pass);
+ $result = phutil_tag(
+ 'span',
+ array('class' => 'herald-outcome rule-pass'),
+ pht('PASS'));
$class = 'herald-rule-pass';
} else {
- $fail = pht('FAIL');
- $result = hsprintf(
- '<span class="herald-outcome rule-fail">%s</span>', $fail);
+ $result = phutil_tag(
+ 'span',
+ array('class' => 'herald-outcome rule-fail'),
+ pht('FAIL'));
$class = 'herald-rule-fail';
}
- $cond_markup[] = hsprintf('<li>%s %s</li>', $result, $rule->getReason());
+ $cond_markup[] = phutil_tag(
+ 'li',
+ array(),
+ array($result, $rule->getReason()));
$user_phid = $this->getRequest()->getUser()->getPHID();
$name = $rule->getRuleName();
@@ -420,11 +425,11 @@
array(
'class' => $class,
),
- hsprintf(
- '<div class="rule-name"><strong>%s</strong> %s</div>%s',
- $name,
- $handles[$rule->getRuleOwner()]->getName(),
- phutil_tag('ul', array(), $cond_markup)));
+ phutil_tag_div('rule-name', array(
+ phutil_tag('strong', array(), $name),
+ ' ',
+ phutil_tag('ul', array(), $cond_markup),
+ )));
}
$panel = '';
Index: src/applications/maniphest/controller/ManiphestReportController.php
===================================================================
--- src/applications/maniphest/controller/ManiphestReportController.php
+++ src/applications/maniphest/controller/ManiphestReportController.php
@@ -252,7 +252,7 @@
"of this project in the past but no longer is, it is not ".
"counted at all.");
$header = pht("Task Burn Rate for Project %s", $handle->renderLink());
- $caption = hsprintf("<p>%s</p>", $inst);
+ $caption = phutil_tag('p', array(), $inst);
} else {
$header = pht("Task Burn Rate for All Tasks");
$caption = null;
@@ -362,9 +362,9 @@
$fmt = number_format($delta);
if ($delta > 0) {
$fmt = '+'.$fmt;
- $fmt = hsprintf('<span class="red">%s</span>', $fmt);
+ $fmt = phutil_tag('span', array('class' => 'red'), $fmt);
} else {
- $fmt = hsprintf('<span class="green">%s</span>', $fmt);
+ $fmt = phutil_tag('span', array('class' => 'green'), $fmt);
}
return array(
Index: src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
===================================================================
--- src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
+++ src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
@@ -18,9 +18,7 @@
ManiphestTask::MARKUP_FIELD_DESCRIPTION,
$request->getUser());
- $content = hsprintf(
- '<div class="phabricator-remarkup">%s</div>',
- $output);
+ $content = phutil_tag_div('phabricator-remarkup', $output);
return id(new AphrontAjaxResponse())
->setContent($content);
Index: src/applications/maniphest/controller/ManiphestTaskDetailController.php
===================================================================
--- src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -348,13 +348,14 @@
$comment_header = id(new PHUIHeaderView())
->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In'));
- $preview_panel = hsprintf(
- '<div class="aphront-panel-preview">
- <div id="transaction-preview">
- <div class="aphront-panel-preview-loading-text">%s</div>
- </div>
- </div>',
- pht('Loading preview...'));
+ $preview_panel = phutil_tag_div(
+ 'aphront-panel-preview',
+ phutil_tag(
+ 'div',
+ array('id' => 'transaction-preview'),
+ phutil_tag_div(
+ 'aphront-panel-preview-loading-text',
+ pht('Loading preview...'))));
$timeline = id(new PhabricatorApplicationTransactionView())
->setUser($user)
Index: src/applications/notification/controller/PhabricatorNotificationListController.php
===================================================================
--- src/applications/notification/controller/PhabricatorNotificationListController.php
+++ src/applications/notification/controller/PhabricatorNotificationListController.php
@@ -45,14 +45,12 @@
$builder = new PhabricatorNotificationBuilder($notifications);
$view = $builder->buildView()->render();
} else {
- $view = hsprintf(
- '<div class="phabricator-notification no-notifications">%s</div>',
+ $view = phutil_tag_div(
+ 'phabricator-notification no-notifications',
$no_data);
}
- $view = hsprintf(
- '<div class="phabricator-notification-list">%s</div>',
- $view);
+ $view = phutil_tag_div('phabricator-notification-list', $view);
$panel = new AphrontPanelView();
$panel->setHeader($header);
Index: src/applications/notification/controller/PhabricatorNotificationPanelController.php
===================================================================
--- src/applications/notification/controller/PhabricatorNotificationPanelController.php
+++ src/applications/notification/controller/PhabricatorNotificationPanelController.php
@@ -20,8 +20,8 @@
$notifications_view = $builder->buildView();
$content = $notifications_view->render();
} else {
- $content = hsprintf(
- '<div class="phabricator-notification no-notifications">%s</div>',
+ $content = phutil_tag_div(
+ 'phabricator-notification no-notifications',
pht('You have no notifications.'));
}
Index: src/applications/owners/controller/PhabricatorOwnersDeleteController.php
===================================================================
--- src/applications/owners/controller/PhabricatorOwnersDeleteController.php
+++ src/applications/owners/controller/PhabricatorOwnersDeleteController.php
@@ -29,9 +29,7 @@
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle('Really delete this package?')
- ->appendChild(hsprintf(
- '<p>%s</p>',
- $text))
+ ->appendChild(phutil_tag('p', array(), $text))
->addSubmitButton(pht('Delete'))
->addCancelButton('/owners/package/'.$package->getID().'/')
->setSubmitURI($request->getRequestURI());
Index: src/applications/people/controller/PhabricatorPeopleEditController.php
===================================================================
--- src/applications/people/controller/PhabricatorPeopleEditController.php
+++ src/applications/people/controller/PhabricatorPeopleEditController.php
@@ -414,8 +414,8 @@
if ($is_self) {
$inst = pht('NOTE: You can not edit your own role.');
- $form->appendChild(hsprintf(
- '<p class="aphront-form-instructions">%s</p>', $inst));
+ $form->appendChild(
+ phutil_tag('p', array('class' => 'aphront-form-instructions'), $inst));
}
$form
@@ -473,8 +473,8 @@
$form
->setUser($admin)
->setAction($request->getRequestURI())
- ->appendChild(hsprintf(
- '<p class="aphront-form-instructions">%s</p>', $inst));
+ ->appendChild(
+ phutil_tag('p', array('class' => 'aphront-form-instructions'), $inst));
if ($user->getIsSystemAgent()) {
$form
@@ -703,11 +703,10 @@
),
pht('User Guide: Account Roles'));
- $inst = pht('For a detailed explanation of account roles, see %s.',
- $roles_link);
- return hsprintf(
- '<p class="aphront-form-instructions">%s</p>',
- $inst);
+ return phutil_tag(
+ 'p',
+ array('class' => 'aphront-form-instructions'),
+ pht('For a detailed explanation of account roles, see %s.', $roles_link));
}
private function processSetAccountPicture(PhabricatorUser $user) {
Index: src/applications/people/controller/PhabricatorPeopleProfileController.php
===================================================================
--- src/applications/people/controller/PhabricatorPeopleProfileController.php
+++ src/applications/people/controller/PhabricatorPeopleProfileController.php
@@ -127,10 +127,8 @@
$builder->setShowHovercards(true);
$view = $builder->buildView();
- return hsprintf(
- '<div class="profile-feed profile-wrap-responsive">
- %s
- </div>',
+ return phutil_tag_div(
+ 'profile-feed profile-wrap-responsive',
$view->render());
}
}
Index: src/applications/phame/controller/post/PhamePostEditController.php
===================================================================
--- src/applications/phame/controller/post/PhamePostEditController.php
+++ src/applications/phame/controller/post/PhamePostEditController.php
@@ -143,17 +143,14 @@
->addCancelButton($cancel_uri)
->setValue($submit_button));
- $preview_panel = hsprintf(
- '<div class="aphront-panel-preview">
- <div class="phame-post-preview-header">
- Post Preview
- </div>
- <div id="post-preview">
- <div class="aphront-panel-preview-loading-text">
- Loading preview...
- </div>
- </div>
- </div>');
+ $loading = phutil_tag_div(
+ 'aphront-panel-preview-loading-text',
+ pht('Loading preview...'));
+
+ $preview_panel = phutil_tag_div('aphront-panel-preview', array(
+ phutil_tag_div('phame-post-preview-header', pht('Post Preview')),
+ phutil_tag('div', array('id' => 'post-preview'), $loading),
+ ));
require_celerity_resource('phame-css');
Javelin::initBehavior(
Index: src/applications/phame/controller/post/PhamePostPreviewController.php
===================================================================
--- src/applications/phame/controller/post/PhamePostPreviewController.php
+++ src/applications/phame/controller/post/PhamePostPreviewController.php
@@ -23,7 +23,7 @@
PhamePost::MARKUP_FIELD_BODY,
$user);
- $content = hsprintf('<div class="phabricator-remarkup">%s</div>', $content);
+ $content = phutil_tag_div('phabricator-remarkup', $content);
return id(new AphrontAjaxResponse())->setContent($content);
}
Index: src/applications/phame/skins/PhameBasicBlogSkin.php
===================================================================
--- src/applications/phame/skins/PhameBasicBlogSkin.php
+++ src/applications/phame/skins/PhameBasicBlogSkin.php
@@ -123,7 +123,7 @@
}
protected function render404Page() {
- return hsprintf('<h2>404 Not Found</h2>');
+ return phutil_tag('h2', array(), pht('404 Not Found'));
}
final public function getResourceURI($resource) {
Index: src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
===================================================================
--- src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
+++ src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
@@ -14,15 +14,14 @@
$response = new AphrontWebpageResponse();
$response->setFrameable(true);
- $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));
+ $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;
}
Index: src/applications/phriction/controller/PhrictionDiffController.php
===================================================================
--- src/applications/phriction/controller/PhrictionDiffController.php
+++ src/applications/phriction/controller/PhrictionDiffController.php
@@ -174,15 +174,13 @@
pht('Most Recent Change'));
}
- $navigation_table = hsprintf(
- '<table class="phriction-history-nav-table">
- <tr>
- <td class="nav-prev">%s</td>
- <td class="nav-next">%s</td>
- </tr>
- </table>',
- $link_l,
- $link_r);
+ $navigation_table = phutil_tag(
+ 'table',
+ array('class' => 'phriction-history-nav-table'),
+ phutil_tag('tr', array(), array(
+ phutil_tag('td', array('class' => 'nav-prev'), $link_l),
+ phutil_tag('td', array('class' => 'nav-next'), $link_r),
+ )));
}
Index: src/applications/phriction/controller/PhrictionNewController.php
===================================================================
--- src/applications/phriction/controller/PhrictionNewController.php
+++ src/applications/phriction/controller/PhrictionNewController.php
@@ -26,7 +26,7 @@
->setUser($user)
->appendChild(pht(
'The document %s already exists. Do you want to edit it instead?',
- hsprintf('<tt>%s</tt>', $slug)))
+ phutil_tag('tt', array(), $slug)))
->addHiddenInput('slug', $slug)
->addHiddenInput('prompt', 'yes')
->addCancelButton('/w/')
Index: src/applications/phriction/storage/PhrictionContent.php
===================================================================
--- src/applications/phriction/storage/PhrictionContent.php
+++ src/applications/phriction/storage/PhrictionContent.php
@@ -75,19 +75,15 @@
$engine);
if ($toc) {
- $toc = hsprintf(
- '<div class="phabricator-remarkup-toc">'.
- '<div class="phabricator-remarkup-toc-header">%s</div>'.
- '%s'.
- '</div>',
- pht('Table of Contents'),
- $toc);
+ $toc = phutil_tag_div('phabricator-remarkup-toc', array(
+ phutil_tag_div(
+ 'phabricator-remarkup-toc-header',
+ pht('Table of Contents')),
+ $toc,
+ ));
}
- return hsprintf(
- '<div class="phabricator-remarkup">%s%s</div>',
- $toc,
- $output);
+ return phutil_tag_div('phabricator-remarkup', array($toc, $output));
}
Index: src/applications/project/controller/PhabricatorProjectProfileController.php
===================================================================
--- src/applications/project/controller/PhabricatorProjectProfileController.php
+++ src/applications/project/controller/PhabricatorProjectProfileController.php
@@ -52,10 +52,9 @@
->addColumn($feed)
->setFluidLayout(true);
- $content = hsprintf(
- '<div class="phabricator-project-layout">%s%s</div>',
- $tasks,
- $content);
+ $content = phutil_tag_div(
+ 'phabricator-project-layout',
+ array($tasks, $content));
$header = id(new PHUIHeaderView())
->setHeader($project->getName())
@@ -109,17 +108,20 @@
if ($affiliated) {
$affiliated = phutil_tag('ul', array(), $affiliated);
} else {
- $affiliated = hsprintf('<p><em>%s</em></p>', pht(
- 'No one is affiliated with this project.'));
+ $affiliated = phutil_tag('p', array(),
+ phutil_tag('em', array(),
+ pht('No one is affiliated with this project.')));
}
- return hsprintf(
- '<div class="phabricator-profile-info-group profile-wrap-responsive">'.
- '<h1 class="phabricator-profile-info-header">%s</h1>'.
- '<div class="phabricator-profile-info-pane">%s</div>'.
- '</div>',
- pht('People'),
- $affiliated);
+ return phutil_tag_div(
+ 'phabricator-profile-info-group profile-wrap-responsive',
+ array(
+ phutil_tag(
+ 'h1',
+ array('class' => 'phabricator-profile-info-header'),
+ pht('People')),
+ phutil_tag_div('phabricator-profile-info-pane', $affiliated),
+ ));
}
private function renderFeedPage(
@@ -147,10 +149,8 @@
$builder->setShowHovercards(true);
$view = $builder->buildView();
- return hsprintf(
- '<div class="profile-feed profile-wrap-responsive">'.
- '%s'.
- '</div>',
+ return phutil_tag_div(
+ 'profile-feed profile-wrap-responsive',
$view->render());
}
Index: src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
===================================================================
--- src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
+++ src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
@@ -87,8 +87,9 @@
id(new AphrontFormTextControl())
->setLabel('Indexed Languages')
->setName('symbolIndexLanguages')
- ->setCaption(
- hsprintf('Separate with commas, for example: <tt>php, py</tt>'))
+ ->setCaption(pht(
+ 'Separate with commas, for example: %s',
+ phutil_tag('tt', array(), 'php, py')))
->setValue($langs))
->appendChild(
id(new AphrontFormTokenizerControl())
Index: src/applications/search/controller/PhabricatorSearchController.php
===================================================================
--- src/applications/search/controller/PhabricatorSearchController.php
+++ src/applications/search/controller/PhabricatorSearchController.php
@@ -252,18 +252,17 @@
$results[] = $view->render();
}
- $results = hsprintf(
- '<div class="phabricator-search-result-list">'.
- '%s'.
- '<div class="search-results-pager">%s</div>'.
- '</div>',
+ $results = phutil_tag_div('phabricator-search-result-list', array(
phutil_implode_html("\n", $results),
- $pager->render());
+ phutil_tag_div('search-results-pager', $pager->render()),
+ ));
} else {
- $results = hsprintf(
- '<div class="phabricator-search-result-list">'.
- '<p class="phabricator-search-no-results">No search results.</p>'.
- '</div>');
+ $results = phutil_tag_div(
+ 'phabricator-search-result-list',
+ phutil_tag(
+ 'p',
+ array('class' => 'phabricator-search-no-results'),
+ pht('No search results.')));
}
$results = id(new PHUIBoxView())
->addMargin(PHUI::MARGIN_LARGE)
Index: src/applications/settings/panel/PhabricatorSettingsPanelConduit.php
===================================================================
--- src/applications/settings/panel/PhabricatorSettingsPanelConduit.php
+++ src/applications/settings/panel/PhabricatorSettingsPanelConduit.php
@@ -67,11 +67,12 @@
$cert_form = new AphrontFormView();
$cert_form
->setUser($user)
- ->appendChild(hsprintf(
- '<p class="aphront-form-instructions">%s</p>',
+ ->appendChild(phutil_tag(
+ 'p',
+ array('class' => 'aphront-form-instructions'),
pht('This certificate allows you to authenticate over Conduit, '.
'the Phabricator API. Normally, you just run %s to install it.',
- hsprintf('<tt>%s</tt>', 'arc install-certificate'))))
+ phutil_tag('tt', array(), 'arc install-certificate'))))
->appendChild(
id(new AphrontFormTextAreaControl())
->setLabel(pht('Certificate'))
@@ -90,8 +91,10 @@
->setUser($user)
->setAction($this->getPanelURI())
->setWorkflow(true)
- ->appendChild(hsprintf(
- '<p class="aphront-form-instructions">%s</p>', $regen_instruction))
+ ->appendChild(phutil_tag(
+ 'p',
+ array('class' => 'aphront-form-instructions'),
+ $regen_instruction))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Regenerate Certificate')));
Index: src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
===================================================================
--- src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
+++ src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
@@ -73,7 +73,7 @@
$editor_instructions = pht('Link to edit files in external editor. '.
'%%f is replaced by filename, %%l by line number, %%r by repository '.
'callsign, %%%% by literal %%. For documentation, see: %s',
- hsprintf('%s', $editor_doc_link));
+ $editor_doc_link);
$form = id(new AphrontFormView())
->setUser($user)
Index: src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php
===================================================================
--- src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php
+++ src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php
@@ -301,9 +301,9 @@
->setUser($user)
->addHiddenInput('verify', $email_id)
->setTitle(pht("Send Another Verification Email?"))
- ->appendChild(hsprintf(
- '<p>%s</p>',
- pht('Send another copy of the verification email to %s?', $address)))
+ ->appendChild(phutil_tag('p', array(), pht(
+ 'Send another copy of the verification email to %s?',
+ $address)))
->addSubmitButton(pht('Send Email'))
->addCancelButton($uri);
@@ -342,10 +342,10 @@
->setUser($user)
->addHiddenInput('primary', $email_id)
->setTitle(pht("Change primary email address?"))
- ->appendChild(hsprintf(
- '<p>If you change your primary address, Phabricator will send'.
- ' all email to %s.</p>',
- $address))
+ ->appendChild(phutil_tag('p', array(), pht(
+ 'If you change your primary address, Phabricator will send'.
+ ' all email to %s.',
+ $address)))
->addSubmitButton(pht('Change Primary Address'))
->addCancelButton($uri);
Index: src/applications/system/PhabricatorDebugController.php
===================================================================
--- src/applications/system/PhabricatorDebugController.php
+++ src/applications/system/PhabricatorDebugController.php
@@ -28,7 +28,7 @@
$out = ob_get_clean();
$response = new AphrontWebpageResponse();
- $response->setContent(hsprintf('<pre>%s</pre>', $out));
+ $response->setContent(phutil_tag('pre', array(), $out));
return $response;
}
Index: webroot/index.php
===================================================================
--- webroot/index.php
+++ webroot/index.php
@@ -99,10 +99,15 @@
phlog($unexpected_output);
if ($response instanceof AphrontWebpageResponse) {
- echo hsprintf(
- '<div style="background: #eeddff; white-space: pre-wrap;
- z-index: 200000; position: relative; padding: 8px;
- font-family: monospace;">%s</div>',
+ echo phutil_tag(
+ 'div',
+ array('style' =>
+ 'background: #eeddff;'.
+ 'white-space: pre-wrap;'.
+ 'z-index: 200000;'.
+ 'position: relative;'.
+ 'padding: 8px;'.
+ 'font-family: monospace'),
$unexpected_output);
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, May 21, 8:11 AM (1 w, 6 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/ul/6y/gshvlqaf2zyy2y57
Default Alt Text
D7549.id.diff (73 KB)

Event Timeline