Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13990928
D7547.id17032.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
20 KB
Referenced Files
None
Subscribers
None
D7547.id17032.diff
View Options
Index: src/aphront/response/AphrontRedirectResponse.php
===================================================================
--- src/aphront/response/AphrontRedirectResponse.php
+++ src/aphront/response/AphrontRedirectResponse.php
@@ -42,18 +42,20 @@
$error->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$error->setTitle('Stopped on Redirect');
+ $error->appendChild(phutil_tag('p', array(), pht(
+ 'You were stopped here because %s is set in your configuration.',
+ phutil_tag('tt', array(), 'debug.stop-on-redirect'))));
+
$link = phutil_tag(
'a',
array(
'href' => $this->getURI(),
),
- 'Continue to: '.$this->getURI());
+ $this->getURI());
- $error->appendChild(hsprintf(
- '<p>You were stopped here because <tt>debug.stop-on-redirect</tt> '.
- 'is set in your configuration.</p>'.
- '<p>%s</p>',
- $link));
+ $error->appendChild(phutil_tag('p', array(), pht(
+ 'Continue to: %s',
+ $link)));
$view->appendChild($error);
Index: src/infrastructure/celerity/CelerityStaticResourceResponse.php
===================================================================
--- src/infrastructure/celerity/CelerityStaticResourceResponse.php
+++ src/infrastructure/celerity/CelerityStaticResourceResponse.php
@@ -196,10 +196,11 @@
if (strpos($data, '<!') !== false) {
throw new Exception('Literal <! is not allowed inside inline script.');
}
- return hsprintf(
- // We don't use <![CDATA[ ]]> because it is ignored by HTML parsers. We
- // would need to send the document with XHTML content type.
- '<script type="text/javascript">%s</script>',
+ // We don't use <![CDATA[ ]]> because it is ignored by HTML parsers. We
+ // would need to send the document with XHTML content type.
+ return phutil_tag(
+ 'script',
+ array('type' => 'text/javascript'),
phutil_safe_html($data));
}
Index: src/infrastructure/diff/PhabricatorInlineCommentController.php
===================================================================
--- src/infrastructure/diff/PhabricatorInlineCommentController.php
+++ src/infrastructure/diff/PhabricatorInlineCommentController.php
@@ -71,7 +71,8 @@
$dialog->setTitle('Really delete this comment?');
$dialog->addHiddenInput('id', $this->getCommentID());
$dialog->addHiddenInput('op', 'delete');
- $dialog->appendChild(hsprintf('<p>Delete this inline comment?</p>'));
+ $dialog->appendChild(
+ phutil_tag('p', array(), pht('Delete this inline comment?')));
$dialog->addCancelButton('#');
$dialog->addSubmitButton('Delete');
Index: src/infrastructure/diff/view/PhabricatorInlineSummaryView.php
===================================================================
--- src/infrastructure/diff/view/PhabricatorInlineSummaryView.php
+++ src/infrastructure/diff/view/PhabricatorInlineSummaryView.php
@@ -19,12 +19,7 @@
}
private function renderHeader() {
- return phutil_tag(
- 'div',
- array(
- 'class' => 'phabricator-inline-summary',
- ),
- 'Inline Comments');
+ return phutil_tag_div('phabricator-inline-summary', pht('Inline Comments'));
}
private function renderTable() {
@@ -39,7 +34,10 @@
}
}
- $rows[] = hsprintf('<tr><th colspan="3">%s</th></tr>', $group);
+ $rows[] = phutil_tag(
+ 'tr',
+ array(),
+ phutil_tag('th', array('colspan' => 3), $group));
foreach ($items as $item) {
@@ -80,25 +78,21 @@
$where = idx($item, 'where');
$colspan = ($has_where ? null : 2);
- $rows[] = hsprintf(
- '<tr>'.
- '<td class="inline-line-number">%s</td>'.
- '%s'.
- '%s'.
- '</tr>',
- $lines,
- ($has_where
- ? hsprintf('<td class="inline-which-diff">%s</td>', $where)
- : null),
- phutil_tag(
- 'td',
- array(
- 'class' => 'inline-summary-content',
- 'colspan' => $colspan,
- ),
- hsprintf(
- '<div class="phabricator-remarkup">%s</div>',
- $item['content'])));
+ $rows[] = phutil_tag(
+ 'tr',
+ array(),
+ array(
+ phutil_tag('td', array('class' => 'inline-line-number'), $lines),
+ ($has_where
+ ? phutil_tag('td', array('class' => 'inline-which-diff'), $where)
+ : null),
+ phutil_tag(
+ 'td',
+ array(
+ 'class' => 'inline-summary-content',
+ 'colspan' => $colspan,
+ ),
+ phutil_tag_div('phabricator-remarkup', $item['content']))));
}
}
Index: src/infrastructure/markup/rule/PhabricatorRemarkupRuleYoutube.php
===================================================================
--- src/infrastructure/markup/rule/PhabricatorRemarkupRuleYoutube.php
+++ src/infrastructure/markup/rule/PhabricatorRemarkupRuleYoutube.php
@@ -30,8 +30,8 @@
}
$youtube_src = 'https://www.youtube.com/embed/'.$v;
- $iframe = hsprintf(
- '<div class="embedded-youtube-video">%s</div>',
+ $iframe = phutil_tag_div(
+ 'embedded-youtube-video',
phutil_tag(
'iframe',
array(
Index: src/view/control/AphrontTableView.php
===================================================================
--- src/view/control/AphrontTableView.php
+++ src/view/control/AphrontTableView.php
@@ -272,10 +272,13 @@
}
} else {
$colspan = max(count(array_filter($visibility)), 1);
- $table[] = hsprintf(
- '<tr class="no-data"><td colspan="%s">%s</td></tr>',
- $colspan,
- coalesce($this->noDataString, pht('No data available.')));
+ $table[] = phutil_tag(
+ 'tr',
+ array('class' => 'no-data'),
+ phutil_tag(
+ 'td',
+ array('colspan' => $colspan),
+ coalesce($this->noDataString, pht('No data available.'))));
}
$table_class = 'aphront-table-view';
@@ -287,7 +290,7 @@
}
$html = phutil_tag('table', array('class' => $table_class), $table);
- return hsprintf('<div class="aphront-table-wrap">%s</div>', $html);
+ return phutil_tag_div('aphront-table-wrap', $html);
}
public static function renderSingleDisplayLine($line) {
Index: src/view/control/PhabricatorObjectSelectorDialog.php
===================================================================
--- src/view/control/PhabricatorObjectSelectorDialog.php
+++ src/view/control/PhabricatorObjectSelectorDialog.php
@@ -117,22 +117,19 @@
'action' => $this->submitURI,
'id' => $search_id,
),
- hsprintf(
- '<table class="phabricator-object-selector-search">
- <tr>
- <td class="phabricator-object-selector-search-filter">%s</td>
- <td class="phabricator-object-selector-search-text">%s</td>
- </tr>
- </table>',
- phutil_tag(
- 'select',
- array('id' => $filter_id),
- $options),
- phutil_tag(
- 'input',
- array(
- 'id' => $query_id,
- 'type' => 'text'))));
+ phutil_tag(
+ 'table',
+ array('class' => 'phabricator-object-selector-search'),
+ phutil_tag('tr', array(), array(
+ phutil_tag(
+ 'td',
+ array('class' => 'phabricator-object-selector-search-filter'),
+ phutil_tag('select', array('id' => $filter_id), $options)),
+ phutil_tag(
+ 'td',
+ array('class' => 'phabricator-object-selector-search-text'),
+ phutil_tag('input', array('id' => $query_id, 'type' => 'text'))),
+ ))));
$result_box = phutil_tag(
'div',
@@ -142,17 +139,15 @@
),
'');
- $attached_box = hsprintf(
- '<div class="phabricator-object-selector-current">'.
- '<div class="phabricator-object-selector-currently-attached">'.
- '<div class="phabricator-object-selector-header">%s</div>'.
- '<div id="%s"></div>'.
- '%s'.
- '</div>'.
- '</div>',
- $this->header,
- $current_id,
- $instructions);
+ $attached_box = phutil_tag_div(
+ 'phabricator-object-selector-current',
+ phutil_tag_div(
+ 'phabricator-object-selector-currently-attached',
+ array(
+ phutil_tag_div('phabricator-object-selector-header', $this->header),
+ phutil_tag('div', array('id' => $current_id)),
+ $instructions,
+ )));
$dialog = new AphrontDialogView();
$dialog
Index: src/view/form/control/AphrontFormCheckboxControl.php
===================================================================
--- src/view/form/control/AphrontFormCheckboxControl.php
+++ src/view/form/control/AphrontFormCheckboxControl.php
@@ -38,10 +38,10 @@
'for' => $id,
),
$box['label']);
- $rows[] = hsprintf(
- '<tr><td>%s</td><th>%s</th></tr>',
- $checkbox,
- $label);
+ $rows[] = phutil_tag('tr', array(), array(
+ phutil_tag('td', array(), $checkbox),
+ phutil_tag('th', array(), $label)
+ ));
}
return phutil_tag(
'table',
Index: src/view/form/control/AphrontFormRadioButtonControl.php
===================================================================
--- src/view/form/control/AphrontFormRadioButtonControl.php
+++ src/view/form/control/AphrontFormRadioButtonControl.php
@@ -51,15 +51,15 @@
$button['label']);
if ($button['caption']) {
- $label = hsprintf(
- '%s<div class="aphront-form-radio-caption">%s</div>',
+ $label = array(
$label,
- $button['caption']);
+ phutil_tag_div('aphront-form-radio-caption', $button['caption']),
+ );
}
- $rows[] = hsprintf(
- '<tr><td>%s</td><th>%s</th></tr>',
- $radio,
- $label);
+ $rows[] = phutil_tag('tr', array(), array(
+ phutil_tag('td', array(), $radio),
+ phutil_tag('th', array(), $label),
+ ));
}
return phutil_tag(
Index: src/view/layout/AphrontContextBarView.php
===================================================================
--- src/view/layout/AphrontContextBarView.php
+++ src/view/layout/AphrontContextBarView.php
@@ -15,16 +15,15 @@
require_celerity_resource('aphront-contextbar-view-css');
- return hsprintf(
- '<div class="aphront-contextbar-view">'.
- '<div class="aphront-contextbar-core">'.
- '<div class="aphront-contextbar-buttons">%s</div>'.
- '<div class="aphront-contextbar-content">%s</div>'.
- '</div>'.
- '<div style="clear: both;"></div>'.
- '</div>',
- $view->render(),
- $this->renderChildren());
+ return phutil_tag_div(
+ 'aphront-contextbar-view',
+ array(
+ phutil_tag_div('aphront-contextbar-core', array(
+ phutil_tag_div('aphront-contextbar-buttons', $view->render()),
+ phutil_tag_div('aphront-contextbar-content', $this->renderChildren()),
+ )),
+ phutil_tag('div', array('style' => 'clear: both;')),
+ ));
}
}
Index: src/view/layout/AphrontPanelView.php
===================================================================
--- src/view/layout/AphrontPanelView.php
+++ src/view/layout/AphrontPanelView.php
@@ -69,25 +69,20 @@
}
if ($this->caption !== null) {
- $caption = phutil_tag(
- 'div',
- array('class' => 'aphront-panel-view-caption'),
- $this->caption);
+ $caption = phutil_tag_div('aphront-panel-view-caption', $this->caption);
} else {
$caption = null;
}
$buttons = null;
if ($this->buttons) {
- $buttons = hsprintf(
- '<div class="aphront-panel-view-buttons">%s</div>',
+ $buttons = phutil_tag_div(
+ 'aphront-panel-view-buttons',
phutil_implode_html(" ", $this->buttons));
}
- $header_elements = hsprintf(
- '<div class="aphront-panel-header">%s%s%s</div>',
- $buttons,
- $header,
- $caption);
+ $header_elements = phutil_tag_div(
+ 'aphront-panel-header',
+ array($buttons, $header, $caption));
$table = phutil_implode_html('', $this->renderChildren());
Index: src/view/layout/PhabricatorSourceCodeView.php
===================================================================
--- src/view/layout/PhabricatorSourceCodeView.php
+++ src/view/layout/PhabricatorSourceCodeView.php
@@ -116,11 +116,8 @@
$classes[] = 'remarkup-code';
$classes[] = 'PhabricatorMonospaced';
- return phutil_tag(
- 'div',
- array(
- 'class' => 'phabricator-source-code-container',
- ),
+ return phutil_tag_div(
+ 'phabricator-source-code-container',
javelin_tag(
'table',
array(
Index: src/view/layout/PhabricatorTransactionView.php
===================================================================
--- src/view/layout/PhabricatorTransactionView.php
+++ src/view/layout/PhabricatorTransactionView.php
@@ -62,6 +62,10 @@
$transaction_id = $this->anchorName ? 'anchor-'.$this->anchorName : null;
+ $header = phutil_tag_div(
+ 'phabricator-transaction-header',
+ array($info, $actions));
+
return phutil_tag(
'div',
array(
@@ -69,15 +73,9 @@
'id' => $transaction_id,
'style' => $style,
),
- hsprintf(
- '<div class="phabricator-transaction-detail %s">'.
- '<div class="phabricator-transaction-header">%s%s</div>'.
- '%s'.
- '</div>',
- $classes,
- $info,
- $actions,
- $content));
+ phutil_tag_div(
+ 'phabricator-transaction-detail '.$classes,
+ array($header, $content)));
}
@@ -118,8 +116,9 @@
$info = phutil_implode_html(" \xC2\xB7 ", $info);
- return hsprintf(
- '<span class="phabricator-transaction-info">%s</span>',
+ return phutil_tag(
+ 'span',
+ array('class' => 'phabricator-transaction-info'),
$info);
}
@@ -139,9 +138,8 @@
if (!$this->hasChildren()) {
return null;
}
- return phutil_tag(
- 'div',
- array('class' => 'phabricator-transaction-content'),
+ return phutil_tag_div(
+ 'phabricator-transaction-content',
$this->renderChildren());
}
Index: src/view/page/AphrontRequestFailureView.php
===================================================================
--- src/view/page/AphrontRequestFailureView.php
+++ src/view/page/AphrontRequestFailureView.php
@@ -13,15 +13,15 @@
final public function render() {
require_celerity_resource('aphront-request-failure-view-css');
- return hsprintf(
- '<div class="aphront-request-failure-view">'.
- '<div class="aphront-request-failure-head">'.
- '<h1>%s</h1>'.
- '</div>'.
- '<div class="aphront-request-failure-body">%s</div>'.
- '</div>',
- $this->header,
+ $head = phutil_tag_div(
+ 'aphront-request-failure-head',
+ phutil_tag('h1', array(), $this->header));
+
+ $body = phutil_tag_div(
+ 'aphront-request-failure-body',
$this->renderChildren());
+
+ return phutil_tag_div('aphront-request-failure-view', array($head, $body));
}
}
Index: src/view/page/PhabricatorStandardPageView.php
===================================================================
--- src/view/page/PhabricatorStandardPageView.php
+++ src/view/page/PhabricatorStandardPageView.php
@@ -298,11 +298,8 @@
$developer_warning = null;
if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode') &&
DarkConsoleErrorLogPluginAPI::getErrors()) {
- $developer_warning = phutil_tag(
- 'div',
- array(
- 'class' => 'aphront-developer-error-callout',
- ),
+ $developer_warning = phutil_tag_div(
+ 'aphront-developer-error-callout',
pht(
'This page raised PHP errors. Find them in DarkConsole '.
'or the error log.'));
@@ -313,11 +310,8 @@
if ($user && $user->getIsAdmin()) {
$open = PhabricatorSetupCheck::getOpenSetupIssueCount();
if ($open) {
- $setup_warning = phutil_tag(
- 'div',
- array(
- 'class' => 'setup-warning-callout',
- ),
+ $setup_warning = phutil_tag_div(
+ 'setup-warning-callout',
phutil_tag(
'a',
array(
@@ -334,16 +328,16 @@
'id' => 'base-page',
'class' => 'phabricator-standard-page',
),
- hsprintf(
- '%s%s%s'.
- '<div class="phabricator-standard-page-body">'.
- '%s%s<div style="clear: both;"></div>'.
- '</div>',
- $developer_warning,
- $setup_warning,
- $header_chrome,
- ($console ? hsprintf('<darkconsole />') : null),
- parent::getBody()));
+ array(
+ $developer_warning,
+ $setup_warning,
+ $header_chrome,
+ phutil_tag_div('phabricator-standard-page-body', array(
+ ($console ? hsprintf('<darkconsole />') : null),
+ parent::getBody(),
+ phutil_tag('div', array('style' => 'clear: both;')),
+ )),
+ ));
}
protected function getTail() {
Index: src/view/page/menu/PhabricatorMainMenuSearchView.php
===================================================================
--- src/view/page/menu/PhabricatorMainMenuSearchView.php
+++ src/view/page/menu/PhabricatorMainMenuSearchView.php
@@ -66,13 +66,12 @@
'action' => '/search/',
'method' => 'POST',
),
- hsprintf(
- '<div class="phabricator-main-menu-search-container">'.
- '%s<button>Search</button>%s%s'.
- '</div>',
+ phutil_tag_div('phabricator-main-menu-search-container', array(
$input,
+ phutil_tag('button', array(), pht('Search')),
$scope_input,
- $target));
+ $target,
+ )));
return $form;
}
Index: src/view/widget/bars/AphrontProgressBarView.php
===================================================================
--- src/view/widget/bars/AphrontProgressBarView.php
+++ src/view/widget/bars/AphrontProgressBarView.php
@@ -38,18 +38,15 @@
$color = $this->getColor();
- return phutil_tag(
- 'div',
- array(
- 'class' => "aphront-bar progress color-{$color}",
- ),
+ return phutil_tag_div(
+ "aphront-bar progress color-{$color}",
array(
phutil_tag(
'div',
array('title' => $this->alt),
phutil_tag(
'div',
- array('style' => hsprintf("width: %dpx;", $width)),
+ array('style' => "width: {$width}px;"),
'')),
phutil_tag(
'span',
Index: src/view/widget/hovercard/PhabricatorHovercardView.php
===================================================================
--- src/view/widget/hovercard/PhabricatorHovercardView.php
+++ src/view/widget/hovercard/PhabricatorHovercardView.php
@@ -92,22 +92,15 @@
$body_title = $handle->getFullName();
}
- $body[] = phutil_tag(
- 'div',
- array(
- 'class' => 'phabricator-hovercard-body-header'
- ),
- $body_title);
+ $body[] = phutil_tag_div('phabricator-hovercard-body-header', $body_title);
foreach ($this->fields as $field) {
- $item = hsprintf('<strong>%s:</strong> <span>%s</span>',
- $field['label'], $field['value']);
- $body[] = phutil_tag(
- 'div',
- array(
- 'class' => 'phabricator-hovercard-body-item'
- ),
- $item);
+ $item = array(
+ phutil_tag('strong', array(), $field['label']),
+ ' ',
+ phutil_tag('span', array(), $field['value']),
+ );
+ $body[] = phutil_tag_div('phabricator-hovercard-body-item', $item);
}
if ($handle->getImageURI()) {
@@ -147,40 +140,22 @@
$tail = null;
if ($buttons) {
- $tail = phutil_tag('div',
- array('class' => 'phabricator-hovercard-tail'),
- $buttons);
+ $tail = phutil_tag_div('phabricator-hovercard-tail', $buttons);
}
// Assemble container
// TODO: Add color support
- $content = hsprintf(
- '%s%s%s',
- phutil_tag('div',
- array(
- 'class' => 'phabricator-hovercard-head'
- ),
- $header),
- phutil_tag('div',
- array(
- 'class' => 'phabricator-hovercard-body'
- ),
- $body),
- $tail);
-
- $hovercard = phutil_tag("div",
+ $hovercard = phutil_tag_div(
+ 'phabricator-hovercard-container',
array(
- "class" => "phabricator-hovercard-container",
- ),
- $content);
+ phutil_tag_div('phabricator-hovercard-head', $header),
+ phutil_tag_div('phabricator-hovercard-body', $body),
+ $tail,
+ ));
// Wrap for thick border
// and later the tip at the bottom
- return phutil_tag('div',
- array(
- 'class' => 'phabricator-hovercard-wrapper',
- ),
- $hovercard);
+ return phutil_tag_div('phabricator-hovercard-wrapper', $hovercard);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 7:23 AM (4 w, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716892
Default Alt Text
D7547.id17032.diff (20 KB)
Attached To
Mode
D7547: Replace some hsprintf() with phutil_tag() and phutil_tag_div() Depends on D7545.
Attached
Detach File
Event Timeline
Log In to Comment