From a29b5b070f5ab1d39cbb57581958bfec0a54130a Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 11 Nov 2013 09:23:23 -0800 Subject: [PATCH] Replace some hsprintf() by phutil_tag() Test Plan: Looked at a diff with inline comment. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7549 --- .../PhabricatorEmailTokenController.php | 11 +- .../PhabricatorMustVerifyEmailController.php | 4 +- .../provider/PhabricatorAuthProviderLDAP.php | 8 +- .../PhabricatorAuthProviderOAuthFacebook.php | 4 +- .../base/controller/PhabricatorController.php | 5 +- .../PhabricatorCalendarBrowseController.php | 2 +- .../view/AphrontCalendarMonthView.php | 78 +++++++------ .../PhabricatorConduitAPIController.php | 5 +- .../query/PhabricatorConduitSearchEngine.php | 5 +- .../PhabricatorConfigEditController.php | 32 +++--- ...ConpherenceNotificationPanelController.php | 4 +- .../PhabricatorCountdownDeleteController.php | 2 +- .../view/PhabricatorCountdownView.php | 43 +++---- .../DifferentialDiffViewController.php | 5 +- .../DifferentialRevisionLandController.php | 2 +- .../DifferentialChangesetHTMLRenderer.php | 34 +++--- .../DifferentialChangesetOneUpRenderer.php | 14 +-- .../DifferentialChangesetTwoUpRenderer.php | 105 ++++++++---------- .../view/DifferentialAddCommentView.php | 17 +-- .../view/DifferentialChangesetListView.php | 26 +++-- .../DifferentialDiffTableOfContentsView.php | 49 ++++---- .../DifferentialInlineCommentEditView.php | 26 +++-- .../view/DifferentialInlineCommentView.php | 51 +++++---- .../view/DifferentialLocalCommitsView.php | 10 +- .../view/DifferentialRevisionCommentView.php | 11 +- .../DifferentialRevisionUpdateHistoryView.php | 36 +++--- .../controller/DiffusionCommitController.php | 36 +++--- .../controller/DiffusionLintController.php | 31 +++--- .../DiffusionLintDetailsController.php | 16 +-- .../view/DiffusionBrowseTableView.php | 8 +- .../diffusion/view/DiffusionCommentView.php | 6 +- .../feed/builder/PhabricatorFeedBuilder.php | 4 +- .../PhabricatorFeedDetailController.php | 4 +- .../PhabricatorFeedListController.php | 4 +- .../PhabricatorFeedPublicStreamController.php | 3 +- .../feed/story/PhabricatorFeedStoryCommit.php | 4 +- .../harbormaster/view/ShellLogView.php | 20 +++- .../HeraldTestConsoleController.php | 4 +- .../controller/HeraldTranscriptController.php | 65 ++++++----- .../controller/ManiphestReportController.php | 6 +- ...iphestTaskDescriptionPreviewController.php | 4 +- .../ManiphestTaskDetailController.php | 15 +-- .../PhabricatorNotificationListController.php | 8 +- ...PhabricatorNotificationPanelController.php | 4 +- .../PhabricatorOwnersDeleteController.php | 4 +- .../PhabricatorPeopleEditController.php | 17 ++- .../PhabricatorPeopleProfileController.php | 6 +- .../post/PhamePostEditController.php | 19 ++-- .../post/PhamePostPreviewController.php | 2 +- .../phame/skins/PhameBasicBlogSkin.php | 2 +- ...habricatorXHPASTViewFramesetController.php | 17 ++- .../controller/PhrictionDiffController.php | 16 ++- .../controller/PhrictionNewController.php | 2 +- .../phriction/storage/PhrictionContent.php | 18 ++- .../PhabricatorProjectProfileController.php | 34 +++--- ...epositoryArcanistProjectEditController.php | 5 +- .../PhabricatorSearchController.php | 19 ++-- .../panel/PhabricatorSettingsPanelConduit.php | 13 ++- ...ricatorSettingsPanelDisplayPreferences.php | 2 +- ...PhabricatorSettingsPanelEmailAddresses.php | 14 +-- .../system/PhabricatorDebugController.php | 2 +- webroot/index.php | 13 ++- 62 files changed, 517 insertions(+), 519 deletions(-) diff --git a/src/applications/auth/controller/PhabricatorEmailTokenController.php b/src/applications/auth/controller/PhabricatorEmailTokenController.php index e907a7dcb4..0964a7a966 100644 --- a/src/applications/auth/controller/PhabricatorEmailTokenController.php +++ b/src/applications/auth/controller/PhabricatorEmailTokenController.php @@ -51,11 +51,12 @@ final class PhabricatorEmailTokenController '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, diff --git a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php index 67a253b406..7b580a1ef7 100644 --- a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php +++ b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php @@ -48,8 +48,8 @@ final class PhabricatorMustVerifyEmailController $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( diff --git a/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php b/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php index 6b68b42493..9c4a365fcb 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php @@ -254,18 +254,18 @@ final class PhabricatorAuthProviderLDAP $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 => diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php index 0fe5169683..10f7a5921e 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php @@ -84,9 +84,7 @@ final class PhabricatorAuthProviderOAuthFacebook "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( diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 5449546b0a..d4cbd60de7 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -246,8 +246,9 @@ abstract class PhabricatorController extends AphrontController { $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()); diff --git a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php index 5ab0928687..88e2dfeb05 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php @@ -61,7 +61,7 @@ final class PhabricatorCalendarBrowseController $nav->appendChild( array( $this->getNoticeView(), - hsprintf('
%s
', $month_view), + phutil_tag('div', array('style' => 'padding: 20px;'), $month_view), )); return $this->buildApplicationPage( diff --git a/src/applications/calendar/view/AphrontCalendarMonthView.php b/src/applications/calendar/view/AphrontCalendarMonthView.php index 3597857a8d..0859e0acf9 100644 --- a/src/applications/calendar/view/AphrontCalendarMonthView.php +++ b/src/applications/calendar/view/AphrontCalendarMonthView.php @@ -87,10 +87,9 @@ final class AphrontCalendarMonthView extends AphrontView { } 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 @@ final class AphrontCalendarMonthView extends AphrontView { $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 @@ final class AphrontCalendarMonthView extends AphrontView { $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() { diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php index 837674996e..ce6b6a02c9 100644 --- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php +++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php @@ -423,7 +423,10 @@ final class PhabricatorConduitAPIController $value = $json->encodeFormatted($value); } - $value = hsprintf('
%s
', $value); + $value = phutil_tag( + 'pre', + array('style' => 'white-space: pre-wrap;'), + $value); return $value; } diff --git a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php index 91a0ad7e49..43bf22bd3a 100644 --- a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php +++ b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php @@ -61,8 +61,9 @@ final class PhabricatorConduitSearchEngine ->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'); diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index e2da019e96..7ec6e41c77 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -473,10 +473,10 @@ final class PhabricatorConfigEditController } $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 @@ final class PhabricatorConfigEditController } } - $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 @@ final class PhabricatorConfigEditController $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 @@ final class PhabricatorConfigEditController $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'); diff --git a/src/applications/conpherence/controller/ConpherenceNotificationPanelController.php b/src/applications/conpherence/controller/ConpherenceNotificationPanelController.php index 76c5897e62..1da1521bd2 100644 --- a/src/applications/conpherence/controller/ConpherenceNotificationPanelController.php +++ b/src/applications/conpherence/controller/ConpherenceNotificationPanelController.php @@ -72,8 +72,8 @@ final class ConpherenceNotificationPanelController } $content = $view->render(); } else { - $content = hsprintf( - '
%s
', + $content = phutil_tag_div( + 'phabricator-notification no-notifications', pht('You have no messages.')); } diff --git a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php index e241aac4f1..d82cebaa5d 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php @@ -43,7 +43,7 @@ final class PhabricatorCountdownDeleteController $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()); diff --git a/src/applications/countdown/view/PhabricatorCountdownView.php b/src/applications/countdown/view/PhabricatorCountdownView.php index 9c09144b51..1f4b961144 100644 --- a/src/applications/countdown/view/PhabricatorCountdownView.php +++ b/src/applications/countdown/view/PhabricatorCountdownView.php @@ -42,30 +42,31 @@ final class PhabricatorCountdownView extends AphrontTagView { } - $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(), diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index e55cb30afd..f6543a93d5 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -36,8 +36,9 @@ final class DifferentialDiffViewController extends DifferentialController { // 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(''); diff --git a/src/applications/differential/controller/DifferentialRevisionLandController.php b/src/applications/differential/controller/DifferentialRevisionLandController.php index fad8b48e07..b42c50c8cd 100644 --- a/src/applications/differential/controller/DifferentialRevisionLandController.php +++ b/src/applications/differential/controller/DifferentialRevisionLandController.php @@ -49,7 +49,7 @@ final class DifferentialRevisionLandController extends DifferentialController { $ex->getMessage(), $ex->getPreviousException()->getMessage()); } else { - $text = hsprintf('
%s
', $ex->getMessage()); + $text = phutil_tag('pre', array(), $ex->getMessage()); } $text = id(new AphrontErrorView()) ->appendChild($text); diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php index b965b78fcd..bf2aeadded 100644 --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -250,9 +250,7 @@ abstract class DifferentialChangesetHTMLRenderer } } - return hsprintf( - '
%s
', - $message); + return phutil_tag_div('differential-meta-notice', $message); } protected function renderPropertyChangeHeader() { @@ -281,27 +279,21 @@ abstract class DifferentialChangesetHTMLRenderer $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', diff --git a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php index 567116db05..25d8aeee58 100644 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -27,19 +27,19 @@ final class DifferentialChangesetOneUpRenderer } 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; diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 378d4bdcc5..f44889ce5e 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -222,7 +222,7 @@ final class DifferentialChangesetTwoUpRenderer $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 @@ final class DifferentialChangesetTwoUpRenderer $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 @@ final class DifferentialChangesetTwoUpRenderer $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 @@ final class DifferentialChangesetTwoUpRenderer } } } - $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 @@ final class DifferentialChangesetTwoUpRenderer 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( diff --git a/src/applications/differential/view/DifferentialAddCommentView.php b/src/applications/differential/view/DifferentialAddCommentView.php index ceba6a2197..822a85d6ac 100644 --- a/src/applications/differential/view/DifferentialAddCommentView.php +++ b/src/applications/differential/view/DifferentialAddCommentView.php @@ -181,16 +181,17 @@ final class DifferentialAddCommentView extends AphrontView { $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()) diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index ca05bf97b0..17ed42eac9 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -246,19 +246,21 @@ final class DifferentialChangesetListView extends AphrontView { array('Changes discarded. ', $link)); return array( - 'l' => 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' => hsprintf( - ''. - ''. - ''. - '
%s
', - $div), + '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), + ))), ); } diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php index 1ba389839a..84fae42243 100644 --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -136,7 +136,8 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { $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 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { (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 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { ), 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'. diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php index 672d945e4e..a2318eb069 100644 --- a/src/applications/differential/view/DifferentialInlineCommentEditView.php +++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php @@ -60,17 +60,21 @@ final class DifferentialInlineCommentEditView extends AphrontView { $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() { diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php index f9ff40e2b7..0b491b64e0 100644 --- a/src/applications/differential/view/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/DifferentialInlineCommentView.php @@ -217,6 +217,11 @@ final class DifferentialInlineCommentView extends AphrontView { $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 @@ final class DifferentialInlineCommentView extends AphrontView { '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 @@ final class DifferentialInlineCommentView extends AphrontView { $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), + ))); } } diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php index aec57bfe81..4321807139 100644 --- a/src/applications/differential/view/DifferentialLocalCommitsView.php +++ b/src/applications/differential/view/DifferentialLocalCommitsView.php @@ -128,12 +128,10 @@ final class DifferentialLocalCommitsView extends AphrontView { $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')) diff --git a/src/applications/differential/view/DifferentialRevisionCommentView.php b/src/applications/differential/view/DifferentialRevisionCommentView.php index c7499ddcca..820954dfff 100644 --- a/src/applications/differential/view/DifferentialRevisionCommentView.php +++ b/src/applications/differential/view/DifferentialRevisionCommentView.php @@ -87,9 +87,7 @@ final class DifferentialRevisionCommentView extends AphrontView { $comment, PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY); - $content = hsprintf( - '
%s
', - $content); + $content = phutil_tag_div('phabricator-remarkup', $content); } $inline_render = $this->renderInlineComments(); @@ -207,10 +205,9 @@ final class DifferentialRevisionCommentView extends AphrontView { } 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(); diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php index c10f985b1d..e4a78860df 100644 --- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php +++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php @@ -200,23 +200,25 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { 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')) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index d52bda931b..067fe72a37 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -744,21 +744,26 @@ final class DiffusionCommitController extends DiffusionController { '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 @@ final class DiffusionCommitController extends DiffusionController { 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))); } /** diff --git a/src/applications/diffusion/controller/DiffusionLintController.php b/src/applications/diffusion/controller/DiffusionLintController.php index 3280f60c26..061258b24e 100644 --- a/src/applications/diffusion/controller/DiffusionLintController.php +++ b/src/applications/diffusion/controller/DiffusionLintController.php @@ -69,25 +69,20 @@ final class DiffusionLintController extends DiffusionController { $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'], diff --git a/src/applications/diffusion/controller/DiffusionLintDetailsController.php b/src/applications/diffusion/controller/DiffusionLintDetailsController.php index d9437e6f12..6225fd68bb 100644 --- a/src/applications/diffusion/controller/DiffusionLintDetailsController.php +++ b/src/applications/diffusion/controller/DiffusionLintDetailsController.php @@ -15,22 +15,22 @@ final class DiffusionLintDetailsController extends DiffusionController { $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']; diff --git a/src/applications/diffusion/view/DiffusionBrowseTableView.php b/src/applications/diffusion/view/DiffusionBrowseTableView.php index b0efba9c1b..cf64a18d7c 100644 --- a/src/applications/diffusion/view/DiffusionBrowseTableView.php +++ b/src/applications/diffusion/view/DiffusionBrowseTableView.php @@ -74,12 +74,12 @@ final class DiffusionBrowseTableView extends DiffusionView { $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)); } diff --git a/src/applications/diffusion/view/DiffusionCommentView.php b/src/applications/diffusion/view/DiffusionCommentView.php index a5dc0c59bb..defaf49a07 100644 --- a/src/applications/diffusion/view/DiffusionCommentView.php +++ b/src/applications/diffusion/view/DiffusionCommentView.php @@ -139,12 +139,12 @@ final class DiffusionCommentView extends AphrontView { 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(), + )); } } diff --git a/src/applications/feed/builder/PhabricatorFeedBuilder.php b/src/applications/feed/builder/PhabricatorFeedBuilder.php index 180ca92bfb..a92cc52e95 100644 --- a/src/applications/feed/builder/PhabricatorFeedBuilder.php +++ b/src/applications/feed/builder/PhabricatorFeedBuilder.php @@ -47,8 +47,8 @@ final class PhabricatorFeedBuilder { 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(); diff --git a/src/applications/feed/controller/PhabricatorFeedDetailController.php b/src/applications/feed/controller/PhabricatorFeedDetailController.php index 1608b1633f..9b43f150bc 100644 --- a/src/applications/feed/controller/PhabricatorFeedDetailController.php +++ b/src/applications/feed/controller/PhabricatorFeedDetailController.php @@ -27,9 +27,7 @@ final class PhabricatorFeedDetailController extends PhabricatorFeedController { $title = pht('Story'); - $feed_view = hsprintf( - '
%s
', - $feed_view); + $feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addCrumb( diff --git a/src/applications/feed/controller/PhabricatorFeedListController.php b/src/applications/feed/controller/PhabricatorFeedListController.php index f292735bb6..42dd0fb5f9 100644 --- a/src/applications/feed/controller/PhabricatorFeedListController.php +++ b/src/applications/feed/controller/PhabricatorFeedListController.php @@ -32,9 +32,7 @@ final class PhabricatorFeedListController extends PhabricatorFeedController $builder->setUser($this->getRequest()->getUser()); $view = $builder->buildView(); - return hsprintf( - '
%s
', - $view); + return phutil_tag_div('phabricator-feed-frame', $view); } } diff --git a/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php b/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php index 84e8f3f155..b43e79450f 100644 --- a/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php +++ b/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php @@ -25,7 +25,8 @@ final class PhabricatorFeedPublicStreamController ->setFramed(true) ->setUser($viewer); - $view = hsprintf('
%s
', + $view = phutil_tag_div( + 'phabricator-public-feed-frame', $builder->buildView()); return $this->buildStandardPageResponse( diff --git a/src/applications/feed/story/PhabricatorFeedStoryCommit.php b/src/applications/feed/story/PhabricatorFeedStoryCommit.php index 7c99682089..488e5d81aa 100644 --- a/src/applications/feed/story/PhabricatorFeedStoryCommit.php +++ b/src/applications/feed/story/PhabricatorFeedStoryCommit.php @@ -37,13 +37,13 @@ final class PhabricatorFeedStoryCommit extends PhabricatorFeedStory { } 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); diff --git a/src/applications/harbormaster/view/ShellLogView.php b/src/applications/harbormaster/view/ShellLogView.php index db7f85548f..feaa8ffc07 100644 --- a/src/applications/harbormaster/view/ShellLogView.php +++ b/src/applications/harbormaster/view/ShellLogView.php @@ -61,15 +61,23 @@ final class ShellLogView extends AphrontView { // 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; diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php index 4ee5cab5d2..22595d3ada 100644 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -94,8 +94,8 @@ final class HeraldTestConsoleController extends HeraldController { $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')) diff --git a/src/applications/herald/controller/HeraldTranscriptController.php b/src/applications/herald/controller/HeraldTranscriptController.php index 7cdf5aade1..e3297c0d55 100644 --- a/src/applications/herald/controller/HeraldTranscriptController.php +++ b/src/applications/herald/controller/HeraldTranscriptController.php @@ -133,7 +133,7 @@ final class HeraldTranscriptController extends HeraldController { $value = implode(', ', $value); } - return hsprintf('%s', $value); + return phutil_tag('span', array('class' => 'condition-test-value'), $value); } private function buildSideNav() { @@ -306,13 +306,15 @@ final class HeraldTranscriptController extends HeraldController { } 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 @@ final class HeraldTranscriptController extends HeraldController { $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 @@ final class HeraldTranscriptController extends HeraldController { } 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 @@ final class HeraldTranscriptController extends HeraldController { 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 = ''; diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index 5b0979fd7f..67e4b673c0 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -252,7 +252,7 @@ final class ManiphestReportController extends ManiphestController { "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 @@ final class ManiphestReportController extends ManiphestController { $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( diff --git a/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php b/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php index ee185362c5..98725245f1 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php @@ -18,9 +18,7 @@ final class ManiphestTaskDescriptionPreviewController ManiphestTask::MARKUP_FIELD_DESCRIPTION, $request->getUser()); - $content = hsprintf( - '
    %s
    ', - $output); + $content = phutil_tag_div('phabricator-remarkup', $output); return id(new AphrontAjaxResponse()) ->setContent($content); diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index 99b2d907d2..36665045a0 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -348,13 +348,14 @@ final class ManiphestTaskDetailController extends ManiphestController { $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) diff --git a/src/applications/notification/controller/PhabricatorNotificationListController.php b/src/applications/notification/controller/PhabricatorNotificationListController.php index 1557c8acc8..b497620be6 100644 --- a/src/applications/notification/controller/PhabricatorNotificationListController.php +++ b/src/applications/notification/controller/PhabricatorNotificationListController.php @@ -45,14 +45,12 @@ final class PhabricatorNotificationListController $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); diff --git a/src/applications/notification/controller/PhabricatorNotificationPanelController.php b/src/applications/notification/controller/PhabricatorNotificationPanelController.php index 567aec38d5..8adc1e15a9 100644 --- a/src/applications/notification/controller/PhabricatorNotificationPanelController.php +++ b/src/applications/notification/controller/PhabricatorNotificationPanelController.php @@ -20,8 +20,8 @@ final class PhabricatorNotificationPanelController $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.')); } diff --git a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php index dd1cf89b59..306658eb6b 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php @@ -29,9 +29,7 @@ final class PhabricatorOwnersDeleteController $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()); diff --git a/src/applications/people/controller/PhabricatorPeopleEditController.php b/src/applications/people/controller/PhabricatorPeopleEditController.php index f952899e89..ab466dabf7 100644 --- a/src/applications/people/controller/PhabricatorPeopleEditController.php +++ b/src/applications/people/controller/PhabricatorPeopleEditController.php @@ -414,8 +414,8 @@ final class PhabricatorPeopleEditController 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 @@ final class PhabricatorPeopleEditController $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 @@ final class PhabricatorPeopleEditController ), 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) { diff --git a/src/applications/people/controller/PhabricatorPeopleProfileController.php b/src/applications/people/controller/PhabricatorPeopleProfileController.php index 5098438f50..261d2f27a6 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileController.php @@ -127,10 +127,8 @@ final class PhabricatorPeopleProfileController $builder->setShowHovercards(true); $view = $builder->buildView(); - return hsprintf( - '
    - %s -
    ', + return phutil_tag_div( + 'profile-feed profile-wrap-responsive', $view->render()); } } diff --git a/src/applications/phame/controller/post/PhamePostEditController.php b/src/applications/phame/controller/post/PhamePostEditController.php index 494bc4f4db..06e80891e8 100644 --- a/src/applications/phame/controller/post/PhamePostEditController.php +++ b/src/applications/phame/controller/post/PhamePostEditController.php @@ -143,17 +143,14 @@ final class PhamePostEditController ->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( diff --git a/src/applications/phame/controller/post/PhamePostPreviewController.php b/src/applications/phame/controller/post/PhamePostPreviewController.php index 06fe3de4da..8353b98d72 100644 --- a/src/applications/phame/controller/post/PhamePostPreviewController.php +++ b/src/applications/phame/controller/post/PhamePostPreviewController.php @@ -23,7 +23,7 @@ extends PhameController { PhamePost::MARKUP_FIELD_BODY, $user); - $content = hsprintf('
    %s
    ', $content); + $content = phutil_tag_div('phabricator-remarkup', $content); return id(new AphrontAjaxResponse())->setContent($content); } diff --git a/src/applications/phame/skins/PhameBasicBlogSkin.php b/src/applications/phame/skins/PhameBasicBlogSkin.php index 850a5f0a92..b248bc6b92 100644 --- a/src/applications/phame/skins/PhameBasicBlogSkin.php +++ b/src/applications/phame/skins/PhameBasicBlogSkin.php @@ -123,7 +123,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin { } protected function render404Page() { - return hsprintf('

    404 Not Found

    '); + return phutil_tag('h2', array(), pht('404 Not Found')); } final public function getResourceURI($resource) { diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php index bec14d9a21..2ca3b17e96 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php @@ -14,15 +14,14 @@ final class PhabricatorXHPASTViewFramesetController $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; } diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index 6db052d98f..3e926db60a 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -174,15 +174,13 @@ final class PhrictionDiffController 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), + ))); } diff --git a/src/applications/phriction/controller/PhrictionNewController.php b/src/applications/phriction/controller/PhrictionNewController.php index 22089b1b46..609907955c 100644 --- a/src/applications/phriction/controller/PhrictionNewController.php +++ b/src/applications/phriction/controller/PhrictionNewController.php @@ -26,7 +26,7 @@ final class PhrictionNewController extends PhrictionController { ->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/') diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php index ebc252cba8..d40aec3c05 100644 --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -75,19 +75,15 @@ final class PhrictionContent extends PhrictionDAO $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)); } diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index 826f5e72ac..21ecf19e39 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -52,10 +52,9 @@ final class PhabricatorProjectProfileController ->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 @@ final class PhabricatorProjectProfileController 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 @@ final class PhabricatorProjectProfileController $builder->setShowHovercards(true); $view = $builder->buildView(); - return hsprintf( - '
    '. - '%s'. - '
    ', + return phutil_tag_div( + 'profile-feed profile-wrap-responsive', $view->render()); } diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php index 2330177d42..f98075ddfd 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php @@ -87,8 +87,9 @@ final class PhabricatorRepositoryArcanistProjectEditController 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()) diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php index f9296b8a7b..78ef4be93d 100644 --- a/src/applications/search/controller/PhabricatorSearchController.php +++ b/src/applications/search/controller/PhabricatorSearchController.php @@ -252,18 +252,17 @@ final class PhabricatorSearchController $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) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php index eb79fa2c5a..e44d86e8f9 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php @@ -67,11 +67,12 @@ final class PhabricatorSettingsPanelConduit $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 @@ final class PhabricatorSettingsPanelConduit ->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'))); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php index 9a6100f467..79d6d3d3b5 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php @@ -73,7 +73,7 @@ EXAMPLE; $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) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php index 02495e88bf..b7bacccdf7 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -301,9 +301,9 @@ final class PhabricatorSettingsPanelEmailAddresses ->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 @@ final class PhabricatorSettingsPanelEmailAddresses ->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); diff --git a/src/applications/system/PhabricatorDebugController.php b/src/applications/system/PhabricatorDebugController.php index e26dd0e6c9..7a66906684 100644 --- a/src/applications/system/PhabricatorDebugController.php +++ b/src/applications/system/PhabricatorDebugController.php @@ -28,7 +28,7 @@ final class PhabricatorDebugController extends PhabricatorController { $out = ob_get_clean(); $response = new AphrontWebpageResponse(); - $response->setContent(hsprintf('
    %s
    ', $out)); + $response->setContent(phutil_tag('pre', array(), $out)); return $response; } diff --git a/webroot/index.php b/webroot/index.php index 92a41bce8e..1557b499e2 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -99,10 +99,15 @@ try { 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); } }