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( - '
'. - '%s'. - '
', - 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( - '
%s
', + $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('%s', pht('ldap.example.com'))), + phutil_tag('tt', array(), pht('ldap.example.com'))), self::KEY_DISTINGUISHED_NAME => pht('Example: %s', - hsprintf('%s', 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('%s', 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('%s', 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( - '%s', - 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( - '
%s
', + $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('
%s
', $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( - '
'. - ' '. - '
')); + phutil_tag_div( + 'aphront-calendar-event aphront-calendar-event-empty', + "\xC2\xA0")); //   } foreach ($events as $event) { @@ -119,45 +118,49 @@ $name); } - $markup[] = hsprintf( - '
'. - '
%s
'. - '%s%s'. - '
', + $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(''); + $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(''); + $table[] = phutil_tag('tr', array(), $cells); } - $table = hsprintf( - ''. - '%s'. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '%s'. - '
SunMonTueWedThuFriSat
', - $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( - '%s%s%s', - $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('
%s
', $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('differential, paste')))); + ->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( - '%s%s', - 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( - '%s%s', - $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( - '%s%s', - 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( - '%s%s', - $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( - '
%s
', + $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('

%s

', $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( - '
- %s - - - - - - - - %s%s%s%s -
%s%s%s%s
-
', - $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('', pht('Create New Revision')); - $select[] = hsprintf( - '', + $select[] = phutil_tag( + 'option', + array('value' => ''), pht('Create a new Revision...')); $select[] = hsprintf(''); 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('
%s
', $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( - '
%s
', - $message); + return phutil_tag_div('differential-meta-notice', $message); } protected function renderPropertyChangeHeader() { @@ -281,27 +279,21 @@ $nval = phutil_escape_html_newlines($nval); } - $rows[] = hsprintf( - ''. - '%s'. - '%s'. - '%s'. - '', - $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( - ''. - '%s'. - '%s'. - '%s'. - '', - 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('%s', $p['line']); - $out[] = hsprintf(''); - $out[] = hsprintf('%s', $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(''); + $out[] = phutil_tag('th', array()); } else { $class = 'right'; - $out[] = hsprintf('%s', $p['oline']); + $out[] = phutil_tag('th', array(), $p['oline']); } - $out[] = hsprintf('%s', $p['line']); - $out[] = hsprintf('%s', $class, $p['render']); + $out[] = phutil_tag('th', array(), $p['line']); + $out[] = phutil_tag('td', array('class' => $class), $p['render']); } $out[] = hsprintf(''); 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('', $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('', $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( - ''. - '%s'. - '%s'. - '%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. - ''. - "\xE2\x80\x8B%s". - ''. - '%s'. - '', + $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( - ''. - ''. - '%s'. - ''. - '%s'. - '', - $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( - ''. - ''. - ''. - ''. - '%s'. - '', - $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( - ''. - ''. - '%s'. - ''. - ''. - '', - $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( - ''. - ''. - ''. - ''. - '%s'. - '', - $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_old = phutil_tag('th', array()); } else { - $th_old = hsprintf('1', $vs); + $th_old = phutil_tag('th', array('id' => "C{$vs}OL1"), 1); } if (!$new) { - $th_new = hsprintf(''); + $th_new = phutil_tag('th', array()); } else { - $th_new = hsprintf('1', $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( - '
'. - '
'. - '%s'. - '
'. - '
'. - '
'. - '
', + $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( - ''. - ''. - ''. - '
%s
', - $div), - - 'r' => hsprintf( - ''. - ''. - ''. - '
%s
', - $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('M', 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( - ''. - '%s'. - '%s'. - '%s'. - '%s%s'. - '%s'. - '%s'. - '', - $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( - ''. - ''. - '%s'. - '', - $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( - '%s%s', - $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( - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
%s%s
', - $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( - '
'. - '%s%s %s %s'. - '
'. - '
'. - '
%s
'. - '
', - $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( - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
%s%s
', - $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( - '
'. - '%s%s
'. - '
', - $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( - '
%s
', - $content); + $content = phutil_tag_div('phabricator-remarkup', $content); } $inline_render = $this->renderInlineComments(); @@ -207,10 +205,9 @@ } if (!$hide_comments) { - $xaction_view->appendChild(hsprintf( - '
%s%s
', - $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( - '
'. - '
'. - ''. - '%s'. - ''. - ''. - ''. - '
'. - ''. - ''. - '
'. - '
'. - '
', - 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( - '
-
-
- Loading preview... -
-
-
-
-
'); + $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( - '
%s%s%s
', - 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( - '%s', - $drequest->generateURI(array( - 'action' => 'lint', - 'lint' => $code['code'], - )), - $code['n']), - hsprintf( - '%s', - $drequest->generateURI(array( - 'action' => 'browse', - 'lint' => $code['code'], - )), - $code['files']), - hsprintf( - '%s', - $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( - '%s', - $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( - '%s', - $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( - '%s', - $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( - '
%s%s
', + 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( - '
')); + $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( - '
%s
', - $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( - '
%s
', - $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('
%s
', + $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( - '%s'. - '%s', - $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( - '

%s

', $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('%s', $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('%s', $success); + $outcome = phutil_tag( + 'span', + array('class' => 'outcome-success'), + pht('SUCCESS')); } else { - $failure = pht('FAILURE'); - $outcome = - hsprintf('%s', $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( - '
%s
', - $cond->getNote()); + $note = phutil_tag_div('herald-condition-note', $cond->getNote()); } else { $note = null; } if ($cond->getResult()) { - $result = hsprintf( - ''. - "\xE2\x9C\x93". - ''); + $result = phutil_tag( + 'span', + array('class' => 'herald-outcome condition-pass'), + "\xE2\x9C\x93"); } else { - $result = hsprintf( - ''. - "\xE2\x9C\x98". - ''); + $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( - '%s', $pass); + $result = phutil_tag( + 'span', + array('class' => 'herald-outcome rule-pass'), + pht('PASS')); $class = 'herald-rule-pass'; } else { - $fail = pht('FAIL'); - $result = hsprintf( - '%s', $fail); + $result = phutil_tag( + 'span', + array('class' => 'herald-outcome rule-fail'), + pht('FAIL')); $class = 'herald-rule-fail'; } - $cond_markup[] = hsprintf('
  • %s %s
  • ', $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( - '
    %s %s
    %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("

    %s

    ", $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('%s', $fmt); + $fmt = phutil_tag('span', array('class' => 'red'), $fmt); } else { - $fmt = hsprintf('%s', $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( - '
    %s
    ', - $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( - '
    -
    -
    %s
    -
    -
    ', - 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( - '
    %s
    ', + $view = phutil_tag_div( + 'phabricator-notification no-notifications', $no_data); } - $view = hsprintf( - '
    %s
    ', - $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( - '
    %s
    ', + $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( - '

    %s

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

    %s

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

    %s

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

    %s

    ', - $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( - '
    - %s -
    ', + 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( - '
    -
    - Post Preview -
    -
    -
    - Loading preview... -
    -
    -
    '); + $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('
    %s
    ', $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('

    404 Not Found

    '); + 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( - ''. - ''. - ''. - ''. - '', - $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( - ' - - - - -
    ', - $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('%s', $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( - '
    '. - '
    %s
    '. - '%s'. - '
    ', - 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( - '
    %s%s
    ', - $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( - '
    %s%s
    ', - $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('

    %s

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

    %s

    '. - '
    %s
    '. - '
    ', - 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( - '
    '. - '%s'. - '
    ', + 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: php, py')) + ->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( - '
    '. - '%s'. - '
    %s
    '. - '
    ', + $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( - '
    '. - '

    No search results.

    '. - '
    '); + $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( - '

    %s

    ', + ->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('%s', '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( - '

    %s

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

    %s

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

    If you change your primary address, Phabricator will send'. - ' all email to %s.

    ', - $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('
    %s
    ', $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( - '
    %s
    ', + echo phutil_tag( + 'div', + array('style' => + 'background: #eeddff;'. + 'white-space: pre-wrap;'. + 'z-index: 200000;'. + 'position: relative;'. + 'padding: 8px;'. + 'font-family: monospace'), $unexpected_output); } }