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( - '

You were stopped here because debug.stop-on-redirect '. - 'is set in your configuration.

'. - '

%s

', - $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, ' because it is ignored by HTML parsers. We - // would need to send the document with XHTML content type. - '', + // We don't use 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('

Delete this inline comment?

')); + $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('%s', $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( - ''. - '%s'. - '%s'. - '%s'. - '', - $lines, - ($has_where - ? hsprintf('%s', $where) - : null), - phutil_tag( - 'td', - array( - 'class' => 'inline-summary-content', - 'colspan' => $colspan, - ), - hsprintf( - '
%s
', - $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( - '
%s
', + $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( - '%s', - $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('
%s
', $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( - ' - - - - - ', - 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( - '
'. - '
'. - '
%s
'. - '
'. - '%s'. - '
'. - '
', - $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( - '%s%s', - $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
%s
', + $label = array( $label, - $button['caption']); + phutil_tag_div('aphront-form-radio-caption', $button['caption']), + ); } - $rows[] = hsprintf( - '%s%s', - $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( - '
'. - '
'. - '
%s
'. - '
%s
'. - '
'. - '
'. - '
', - $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( - '
%s
', + $buttons = phutil_tag_div( + 'aphront-panel-view-buttons', phutil_implode_html(" ", $this->buttons)); } - $header_elements = hsprintf( - '
%s%s%s
', - $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( - '
'. - '
%s%s
'. - '%s'. - '
', - $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( - '%s', + 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( - '
'. - '
'. - '

%s

'. - '
'. - '
%s
'. - '
', - $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'. - '
'. - '%s%s
'. - '
', - $developer_warning, - $setup_warning, - $header_chrome, - ($console ? hsprintf('') : null), - parent::getBody())); + array( + $developer_warning, + $setup_warning, + $header_chrome, + phutil_tag_div('phabricator-standard-page-body', array( + ($console ? hsprintf('') : 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( - '
'. - '%s%s%s'. - '
', + 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('%s: %s', - $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); } }