@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+517 -519
+6 -5
src/applications/auth/controller/PhabricatorEmailTokenController.php
··· 51 51 'invalid or out of date. Make sure you are copy-and-pasting the '. 52 52 'entire link into your browser. You can try again, or request '. 53 53 'a new email.'))); 54 - $view->appendChild(hsprintf( 55 - '<div class="aphront-failure-continue">'. 56 - '<a class="button" href="/login/email/">%s</a>'. 57 - '</div>', 58 - pht('Send Another Email'))); 54 + $view->appendChild(phutil_tag_div( 55 + 'aphront-failure-continue', 56 + phutil_tag( 57 + 'a', 58 + array('class' => 'button', 'href' => '/login/email/'), 59 + pht('Send Another Email')))); 59 60 60 61 return $this->buildStandardPageResponse( 61 62 $view,
+2 -2
src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
··· 48 48 $error_view->appendChild(phutil_tag('p', array(), pht( 49 49 'If you did not receive an email, you can click the button below '. 50 50 'to try sending another one.'))); 51 - $error_view->appendChild(hsprintf( 52 - '<div class="aphront-failure-continue">%s</div>', 51 + $error_view->appendChild(phutil_tag_div( 52 + 'aphront-failure-continue', 53 53 phabricator_form( 54 54 $user, 55 55 array(
+4 -4
src/applications/auth/provider/PhabricatorAuthProviderLDAP.php
··· 254 254 $captions = array( 255 255 self::KEY_HOSTNAME => 256 256 pht('Example: %s', 257 - hsprintf('<tt>%s</tt>', pht('ldap.example.com'))), 257 + phutil_tag('tt', array(), pht('ldap.example.com'))), 258 258 self::KEY_DISTINGUISHED_NAME => 259 259 pht('Example: %s', 260 - hsprintf('<tt>%s</tt>', pht('ou=People, dc=example, dc=com'))), 260 + phutil_tag('tt', array(), pht('ou=People, dc=example, dc=com'))), 261 261 self::KEY_SEARCH_ATTRIBUTE => 262 262 pht('Example: %s', 263 - hsprintf('<tt>%s</tt>', pht('sn'))), 263 + phutil_tag('tt', array(), pht('sn'))), 264 264 self::KEY_USERNAME_ATTRIBUTE => 265 265 pht('Optional, if different from search attribute.'), 266 266 self::KEY_REALNAME_ATTRIBUTES => 267 267 pht('Optional. Example: %s', 268 - hsprintf('<tt>%s</tt>', pht('firstname, lastname'))), 268 + phutil_tag('tt', array(), pht('firstname, lastname'))), 269 269 self::KEY_REFERRALS => 270 270 pht('Follow referrals. Disable this for Windows AD 2003.'), 271 271 self::KEY_START_TLS =>
+1 -3
src/applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php
··· 84 84 "improves security by preventing an attacker from capturing ". 85 85 "an insecure Facebook session and escalating it into a ". 86 86 "Phabricator session. Enabling it is recommended.", 87 - hsprintf( 88 - '<strong>%s</strong>', 89 - pht('Require Secure Browsing:'))))); 87 + phutil_tag('strong', array(), pht('Require Secure Browsing:'))))); 90 88 } 91 89 92 90 public function renderConfigPropertyTransactionTitle(
+3 -2
src/applications/base/controller/PhabricatorController.php
··· 246 246 $view = new PhabricatorStandardPageView(); 247 247 $view->setRequest($request); 248 248 $view->setController($this); 249 - $view->appendChild(hsprintf( 250 - '<div style="padding: 2em 0;">%s</div>', 249 + $view->appendChild(phutil_tag( 250 + 'div', 251 + array('style' => 'padding: 2em 0;'), 251 252 $response->buildResponseString())); 252 253 $page_response = new AphrontWebpageResponse(); 253 254 $page_response->setContent($view->render());
+1 -1
src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
··· 61 61 $nav->appendChild( 62 62 array( 63 63 $this->getNoticeView(), 64 - hsprintf('<div style="padding: 20px;">%s</div>', $month_view), 64 + phutil_tag('div', array('style' => 'padding: 20px;'), $month_view), 65 65 )); 66 66 67 67 return $this->buildApplicationPage(
+42 -36
src/applications/calendar/view/AphrontCalendarMonthView.php
··· 87 87 } else { 88 88 $show_events = array_fill_keys( 89 89 array_keys($show_events), 90 - hsprintf( 91 - '<div class="aphront-calendar-event aphront-calendar-event-empty">'. 92 - '&nbsp;'. 93 - '</div>')); 90 + phutil_tag_div( 91 + 'aphront-calendar-event aphront-calendar-event-empty', 92 + "\xC2\xA0")); // &nbsp; 94 93 } 95 94 96 95 foreach ($events as $event) { ··· 119 118 $name); 120 119 } 121 120 122 - $markup[] = hsprintf( 123 - '<div class="%s">'. 124 - '<div class="aphront-calendar-date-number">%s</div>'. 125 - '%s%s'. 126 - '</div>', 121 + $markup[] = phutil_tag_div( 127 122 $class, 128 - $day_number, 129 - $holiday_markup, 130 - phutil_implode_html("\n", $show_events)); 123 + array( 124 + phutil_tag_div('aphront-calendar-date-number', $day_number), 125 + $holiday_markup, 126 + phutil_implode_html("\n", $show_events), 127 + )); 131 128 } 132 129 133 130 $table = array(); 134 131 $rows = array_chunk($markup, 7); 135 132 foreach ($rows as $row) { 136 - $table[] = hsprintf('<tr>'); 133 + $cells = array(); 137 134 while (count($row) < 7) { 138 135 $row[] = $empty_box; 139 136 } 140 137 foreach ($row as $cell) { 141 - $table[] = phutil_tag('td', array(), $cell); 138 + $cells[] = phutil_tag('td', array(), $cell); 142 139 } 143 - $table[] = hsprintf('</tr>'); 140 + $table[] = phutil_tag('tr', array(), $cells); 144 141 } 145 - $table = hsprintf( 146 - '<table class="aphront-calendar-view">'. 147 - '%s'. 148 - '<tr class="aphront-calendar-day-of-week-header">'. 149 - '<th>Sun</th>'. 150 - '<th>Mon</th>'. 151 - '<th>Tue</th>'. 152 - '<th>Wed</th>'. 153 - '<th>Thu</th>'. 154 - '<th>Fri</th>'. 155 - '<th>Sat</th>'. 156 - '</tr>'. 157 - '%s'. 158 - '</table>', 159 - $this->renderCalendarHeader($first), 160 - phutil_implode_html("\n", $table)); 142 + 143 + $header = phutil_tag( 144 + 'tr', 145 + array('class' => 'aphront-calendar-day-of-week-header'), 146 + array( 147 + phutil_tag('th', array(), pht('Sun')), 148 + phutil_tag('th', array(), pht('Mon')), 149 + phutil_tag('th', array(), pht('Tue')), 150 + phutil_tag('th', array(), pht('Wed')), 151 + phutil_tag('th', array(), pht('Thu')), 152 + phutil_tag('th', array(), pht('Fri')), 153 + phutil_tag('th', array(), pht('Sat')), 154 + )); 155 + 156 + $table = phutil_tag( 157 + 'table', 158 + array('class' => 'aphront-calendar-view'), 159 + array( 160 + $this->renderCalendarHeader($first), 161 + $header, 162 + phutil_implode_html("\n", $table), 163 + )); 161 164 162 165 return $table; 163 166 } ··· 190 193 $right_th = phutil_tag('th', array(), $next_link); 191 194 } 192 195 193 - return hsprintf( 194 - '<tr class="aphront-calendar-month-year-header">%s%s%s</tr>', 195 - $left_th, 196 - phutil_tag('th', array('colspan' => $colspan), $date->format('F Y')), 197 - $right_th); 196 + return phutil_tag( 197 + 'tr', 198 + array('class' => 'aphront-calendar-month-year-header'), 199 + array( 200 + $left_th, 201 + phutil_tag('th', array('colspan' => $colspan), $date->format('F Y')), 202 + $right_th, 203 + )); 198 204 } 199 205 200 206 private function getNextYearAndMonth() {
+4 -1
src/applications/conduit/controller/PhabricatorConduitAPIController.php
··· 423 423 $value = $json->encodeFormatted($value); 424 424 } 425 425 426 - $value = hsprintf('<pre style="white-space: pre-wrap;">%s</pre>', $value); 426 + $value = phutil_tag( 427 + 'pre', 428 + array('style' => 'white-space: pre-wrap;'), 429 + $value); 427 430 428 431 return $value; 429 432 }
+3 -2
src/applications/conduit/query/PhabricatorConduitSearchEngine.php
··· 61 61 ->setLabel('Applications') 62 62 ->setName('applicationNames') 63 63 ->setValue(implode(', ', $names)) 64 - ->setCaption( 65 - pht('Example: %s', hsprintf('<tt>differential, paste</tt>')))); 64 + ->setCaption(pht( 65 + 'Example: %s', 66 + phutil_tag('tt', array(), 'differential, paste')))); 66 67 67 68 $is_stable = $saved->getParameter('isStable'); 68 69 $is_unstable = $saved->getParameter('isUnstable');
+16 -16
src/applications/config/controller/PhabricatorConfigEditController.php
··· 473 473 } 474 474 475 475 $table = array(); 476 - $table[] = hsprintf( 477 - '<tr class="column-labels"><th>%s</th><th>%s</th></tr>', 478 - pht('Example'), 479 - pht('Value')); 476 + $table[] = phutil_tag('tr', array('class' => 'column-labels'), array( 477 + phutil_tag('th', array(), pht('Example')), 478 + phutil_tag('th', array(), pht('Value')), 479 + )); 480 480 foreach ($examples as $example) { 481 481 list($value, $description) = $example; 482 482 ··· 488 488 } 489 489 } 490 490 491 - $table[] = hsprintf( 492 - '<tr><th>%s</th><td>%s</td></tr>', 493 - $description, 494 - $value); 491 + $table[] = phutil_tag('tr', array(), array( 492 + phutil_tag('th', array(), $description), 493 + phutil_tag('th', array(), $value), 494 + )); 495 495 } 496 496 497 497 require_celerity_resource('config-options-css'); ··· 509 509 $stack = $stack->getStack(); 510 510 511 511 $table = array(); 512 - $table[] = hsprintf( 513 - '<tr class="column-labels"><th>%s</th><th>%s</th></tr>', 514 - pht('Source'), 515 - pht('Value')); 512 + $table[] = phutil_tag('tr', array('class' => 'column-labels'), array( 513 + phutil_tag('th', array(), pht('Source')), 514 + phutil_tag('th', array(), pht('Value')), 515 + )); 516 516 foreach ($stack as $key => $source) { 517 517 $value = $source->getKeys( 518 518 array( ··· 526 526 $value[$option->getKey()]); 527 527 } 528 528 529 - $table[] = hsprintf( 530 - '<tr><th>%s</th><td>%s</td></tr>', 531 - $source->getName(), 532 - $value); 529 + $table[] = phutil_tag('tr', array('class' => 'column-labels'), array( 530 + phutil_tag('th', array(), $source->getName()), 531 + phutil_tag('td', array(), $value), 532 + )); 533 533 } 534 534 535 535 require_celerity_resource('config-options-css');
+2 -2
src/applications/conpherence/controller/ConpherenceNotificationPanelController.php
··· 72 72 } 73 73 $content = $view->render(); 74 74 } else { 75 - $content = hsprintf( 76 - '<div class="phabricator-notification no-notifications">%s</div>', 75 + $content = phutil_tag_div( 76 + 'phabricator-notification no-notifications', 77 77 pht('You have no messages.')); 78 78 } 79 79
+1 -1
src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
··· 43 43 $dialog = new AphrontDialogView(); 44 44 $dialog->setUser($request->getUser()); 45 45 $dialog->setTitle(pht('Really delete this countdown?')); 46 - $dialog->appendChild(hsprintf('<p>%s</p>', $inst)); 46 + $dialog->appendChild(phutil_tag('p', array(), $inst)); 47 47 $dialog->addSubmitButton(pht('Delete')); 48 48 $dialog->addCancelButton('/countdown/'); 49 49 $dialog->setSubmitURI($request->getPath());
+22 -21
src/applications/countdown/view/PhabricatorCountdownView.php
··· 42 42 } 43 43 44 44 45 - $container = celerity_generate_unique_node_id(); 46 - $content = hsprintf( 47 - '<div class="phabricator-timer" id="%s"> 48 - %s 49 - <table class="phabricator-timer-table"> 50 - <tr> 51 - <th>%s</th> 52 - <th>%s</th> 53 - <th>%s</th> 54 - <th>%s</th> 55 - </tr> 56 - <tr>%s%s%s%s</tr> 57 - </table> 58 - </div>', 59 - $container, 60 - $header, 61 - pht('Days'), 62 - pht('Hours'), 63 - pht('Minutes'), 64 - pht('Seconds'), 45 + $ths = array( 46 + phutil_tag('th', array(), pht('Days')), 47 + phutil_tag('th', array(), pht('Hours')), 48 + phutil_tag('th', array(), pht('Minutes')), 49 + phutil_tag('th', array(), pht('Seconds')), 50 + ); 51 + 52 + $dashes = array( 65 53 javelin_tag('td', array('sigil' => 'phabricator-timer-days'), '-'), 66 54 javelin_tag('td', array('sigil' => 'phabricator-timer-hours'), '-'), 67 55 javelin_tag('td', array('sigil' => 'phabricator-timer-minutes'), '-'), 68 - javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-')); 56 + javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-'), 57 + ); 58 + 59 + $container = celerity_generate_unique_node_id(); 60 + $content = phutil_tag( 61 + 'div', 62 + array('class' => 'phabricator-timer', 'id' => $container), 63 + array( 64 + $header, 65 + phutil_tag('table', array('class' => 'phabricator-timer-table'), array( 66 + phutil_tag('tr', array(), $ths), 67 + phutil_tag('tr', array(), $dashes), 68 + )), 69 + )); 69 70 70 71 Javelin::initBehavior('countdown-timer', array( 71 72 'timestamp' => $countdown->getEpoch(),
+3 -2
src/applications/differential/controller/DifferentialDiffViewController.php
··· 36 36 // TODO: implement optgroup support in AphrontFormSelectControl? 37 37 $select = array(); 38 38 $select[] = hsprintf('<optgroup label="%s">', pht('Create New Revision')); 39 - $select[] = hsprintf( 40 - '<option value="">%s</option>', 39 + $select[] = phutil_tag( 40 + 'option', 41 + array('value' => ''), 41 42 pht('Create a new Revision...')); 42 43 $select[] = hsprintf('</optgroup>'); 43 44
+1 -1
src/applications/differential/controller/DifferentialRevisionLandController.php
··· 49 49 $ex->getMessage(), 50 50 $ex->getPreviousException()->getMessage()); 51 51 } else { 52 - $text = hsprintf('<pre>%s</pre>', $ex->getMessage()); 52 + $text = phutil_tag('pre', array(), $ex->getMessage()); 53 53 } 54 54 $text = id(new AphrontErrorView()) 55 55 ->appendChild($text);
+13 -21
src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
··· 250 250 } 251 251 } 252 252 253 - return hsprintf( 254 - '<div class="differential-meta-notice">%s</div>', 255 - $message); 253 + return phutil_tag_div('differential-meta-notice', $message); 256 254 } 257 255 258 256 protected function renderPropertyChangeHeader() { ··· 281 279 $nval = phutil_escape_html_newlines($nval); 282 280 } 283 281 284 - $rows[] = hsprintf( 285 - '<tr>'. 286 - '<th>%s</th>'. 287 - '<td class="oval">%s</td>'. 288 - '<td class="nval">%s</td>'. 289 - '</tr>', 290 - $key, 291 - $oval, 292 - $nval); 282 + $rows[] = phutil_tag('tr', array(), array( 283 + phutil_tag('th', array(), $key), 284 + phutil_tag('td', array('class' => 'oval'), $oval), 285 + phutil_tag('td', array('class' => 'nval'), $nval), 286 + )); 293 287 } 294 288 } 295 289 296 - array_unshift($rows, hsprintf( 297 - '<tr class="property-table-header">'. 298 - '<th>%s</th>'. 299 - '<td class="oval">%s</td>'. 300 - '<td class="nval">%s</td>'. 301 - '</tr>', 302 - pht('Property Changes'), 303 - pht('Old Value'), 304 - pht('New Value'))); 290 + array_unshift( 291 + $rows, 292 + phutil_tag('tr', array('class' => 'property-table-header'), array( 293 + phutil_tag('th', array(), pht('Property Changes')), 294 + phutil_tag('td', array('class' => 'oval'), pht('Old Value')), 295 + phutil_tag('td', array('class' => 'nval'), pht('New Value')), 296 + ))); 305 297 306 298 return phutil_tag( 307 299 'table',
+7 -7
src/applications/differential/render/DifferentialChangesetOneUpRenderer.php
··· 27 27 } else { 28 28 $class = 'left'; 29 29 } 30 - $out[] = hsprintf('<th>%s</th>', $p['line']); 31 - $out[] = hsprintf('<th></th>'); 32 - $out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']); 30 + $out[] = phutil_tag('th', array(), $p['line']); 31 + $out[] = phutil_tag('th', array()); 32 + $out[] = phutil_tag('td', array('class' => $class), $p['render']); 33 33 } else if ($type == 'new') { 34 34 if ($p['htype']) { 35 35 $class = 'right new'; 36 - $out[] = hsprintf('<th />'); 36 + $out[] = phutil_tag('th', array()); 37 37 } else { 38 38 $class = 'right'; 39 - $out[] = hsprintf('<th>%s</th>', $p['oline']); 39 + $out[] = phutil_tag('th', array(), $p['oline']); 40 40 } 41 - $out[] = hsprintf('<th>%s</th>', $p['line']); 42 - $out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']); 41 + $out[] = phutil_tag('th', array(), $p['line']); 42 + $out[] = phutil_tag('td', array('class' => $class), $p['render']); 43 43 } 44 44 $out[] = hsprintf('</tr>'); 45 45 break;
+49 -56
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 222 222 $cov_class = $coverage[$n_num - 1]; 223 223 } 224 224 $cov_class = 'cov-'.$cov_class; 225 - $n_cov = hsprintf('<td class="cov %s"></td>', $cov_class); 225 + $n_cov = phutil_tag('td', array('class' => "cov {$cov_class}")); 226 226 $n_colspan--; 227 227 } 228 228 ··· 240 240 $n_classes = $n_class; 241 241 242 242 if ($new_lines[$ii]['type'] == '\\' || !isset($copy_lines[$n_num])) { 243 - $n_copy = hsprintf('<td class="copy %s"></td>', $n_class); 243 + $n_copy = phutil_tag('td', array('class' => "copy {$n_class}")); 244 244 } else { 245 245 list($orig_file, $orig_line, $orig_type) = $copy_lines[$n_num]; 246 246 $title = ($orig_type == '-' ? 'Moved' : 'Copied').' from '; ··· 283 283 $n_id = null; 284 284 } 285 285 286 + // NOTE: This is a unicode zero-width space, which we use as a hint 287 + // when intercepting 'copy' events to make sure sensible text ends 288 + // up on the clipboard. See the 'phabricator-oncopy' behavior. 289 + $zero_space = "\xE2\x80\x8B"; 290 + 286 291 // NOTE: The Javascript is sensitive to whitespace changes in this 287 292 // block! 288 293 289 - $html[] = hsprintf( 290 - '<tr>'. 291 - '%s'. 292 - '<td class="%s">%s</td>'. 293 - '%s'. 294 - '%s'. 295 - // NOTE: This is a unicode zero-width space, which we use as a hint 296 - // when intercepting 'copy' events to make sure sensible text ends 297 - // up on the clipboard. See the 'phabricator-oncopy' behavior. 298 - '<td class="%s" colspan="%s">'. 299 - "\xE2\x80\x8B%s". 300 - '</td>'. 301 - '%s'. 302 - '</tr>', 294 + $html[] = phutil_tag('tr', array(), array( 303 295 phutil_tag('th', array('id' => $o_id), $o_num), 304 - $o_classes, $o_text, 296 + phutil_tag('td', array('class' => $o_classes), $o_text), 305 297 phutil_tag('th', array('id' => $n_id), $n_num), 306 298 $n_copy, 307 - $n_classes, $n_colspan, $n_text, 308 - $n_cov); 299 + phutil_tag( 300 + 'td', 301 + array('class' => $n_classes, 'colspan' => $n_colspan), 302 + array($zero_space, $n_text)), 303 + $n_cov, 304 + )); 309 305 310 306 if ($context_not_available && ($ii == $rows - 1)) { 311 307 $html[] = $context_not_available; ··· 328 324 } 329 325 } 330 326 } 331 - $html[] = hsprintf( 332 - '<tr class="inline">'. 333 - '<th />'. 334 - '<td class="left">%s</td>'. 335 - '<th />'. 336 - '<td colspan="3" class="right3">%s</td>'. 337 - '</tr>', 338 - $comment_html, 339 - $new); 327 + $html[] = phutil_tag('tr', array('class' => 'inline'), array( 328 + phutil_tag('th', array()), 329 + phutil_tag('td', array('class' => 'left'), $comment_html), 330 + phutil_tag('th', array()), 331 + phutil_tag('td', array('colspan' => 3, 'class' => 'right3'), $new), 332 + )); 340 333 } 341 334 } 342 335 if ($n_num && isset($new_comments[$n_num])) { 343 336 foreach ($new_comments[$n_num] as $comment) { 344 337 $comment_html = $this->renderInlineComment($comment, 345 338 $on_right = true); 346 - $html[] = hsprintf( 347 - '<tr class="inline">'. 348 - '<th />'. 349 - '<td class="left" />'. 350 - '<th />'. 351 - '<td colspan="3" class="right3">%s</td>'. 352 - '</tr>', 353 - $comment_html); 339 + $html[] = phutil_tag('tr', array('class' => 'inline'), array( 340 + phutil_tag('th', array()), 341 + phutil_tag('td', array('class' => 'left')), 342 + phutil_tag('th', array()), 343 + phutil_tag( 344 + 'td', 345 + array('colspan' => 3, 'class' => 'right3'), 346 + $comment_html), 347 + )); 354 348 } 355 349 } 356 350 } ··· 395 389 foreach ($this->getOldComments() as $on_line => $comment_group) { 396 390 foreach ($comment_group as $comment) { 397 391 $comment_html = $this->renderInlineComment($comment, $on_right = false); 398 - $html_old[] = hsprintf( 399 - '<tr class="inline">'. 400 - '<th />'. 401 - '<td class="left">%s</td>'. 402 - '<th />'. 403 - '<td class="right3" colspan="3" />'. 404 - '</tr>', 405 - $comment_html); 392 + $html_old[] = phutil_tag('tr', array('class' => 'inline'), array( 393 + phutil_tag('th', array()), 394 + phutil_tag('td', array('class' => 'left'), $comment_html), 395 + phutil_tag('th', array()), 396 + phutil_tag('td', array('colspan' => 3, 'class' => 'right3')), 397 + )); 406 398 } 407 399 } 408 400 foreach ($this->getNewComments() as $lin_line => $comment_group) { 409 401 foreach ($comment_group as $comment) { 410 402 $comment_html = $this->renderInlineComment($comment, $on_right = true); 411 - $html_new[] = hsprintf( 412 - '<tr class="inline">'. 413 - '<th />'. 414 - '<td class="left" />'. 415 - '<th />'. 416 - '<td class="right3" colspan="3">%s</td>'. 417 - '</tr>', 418 - $comment_html); 403 + $html_new[] = phutil_tag('tr', array('class' => 'inline'), array( 404 + phutil_tag('th', array()), 405 + phutil_tag('td', array('class' => 'left')), 406 + phutil_tag('th', array()), 407 + phutil_tag( 408 + 'td', 409 + array('colspan' => 3, 'class' => 'right3'), 410 + $comment_html), 411 + )); 419 412 } 420 413 } 421 414 422 415 if (!$old) { 423 - $th_old = hsprintf('<th></th>'); 416 + $th_old = phutil_tag('th', array()); 424 417 } else { 425 - $th_old = hsprintf('<th id="C%sOL1">1</th>', $vs); 418 + $th_old = phutil_tag('th', array('id' => "C{$vs}OL1"), 1); 426 419 } 427 420 428 421 if (!$new) { 429 - $th_new = hsprintf('<th></th>'); 422 + $th_new = phutil_tag('th', array()); 430 423 } else { 431 - $th_new = hsprintf('<th id="C%sNL1">1</th>', $id); 424 + $th_new = phutil_tag('th', array('id' => "C{$id}OL1"), 1); 432 425 } 433 426 434 427 $output = hsprintf(
+9 -8
src/applications/differential/view/DifferentialAddCommentView.php
··· 181 181 182 182 $warn = phutil_tag('div', array('id' => 'warnings'), $warning_container); 183 183 184 - $preview = hsprintf( 185 - '<div class="aphront-panel-preview aphront-panel-flush">'. 186 - '<div id="comment-preview">'. 187 - '<span class="aphront-panel-preview-loading-text">%s</span>'. 188 - '</div>'. 189 - '<div id="inline-comment-preview">'. 190 - '</div>'. 191 - '</div>', 184 + $loading = phutil_tag( 185 + 'span', 186 + array('class' => 'aphront-panel-preview-loading-text'), 192 187 pht('Loading comment preview...')); 193 188 189 + $preview = phutil_tag_div( 190 + 'aphront-panel-preview aphront-panel-flush', 191 + array( 192 + phutil_tag('div', array('id' => 'comment-preview'), $loading), 193 + phutil_tag('div', array('id' => 'inline-comment-preview')), 194 + )); 194 195 195 196 196 197 $comment_box = id(new PHUIObjectBoxView())
+14 -12
src/applications/differential/view/DifferentialChangesetListView.php
··· 246 246 array('Changes discarded. ', $link)); 247 247 248 248 return array( 249 - 'l' => hsprintf( 250 - '<table><tr>'. 251 - '<th></th><td>%s</td>'. 252 - '<th></th><td colspan="3"></td>'. 253 - '</tr></table>', 254 - $div), 249 + 'l' => phutil_tag('table', array(), 250 + phutil_tag('tr', array(), array( 251 + phutil_tag('th', array()), 252 + phutil_tag('td', array(), $div), 253 + phutil_tag('th', array()), 254 + phutil_tag('td', array('colspan' => 3)), 255 + ))), 255 256 256 - 'r' => hsprintf( 257 - '<table><tr>'. 258 - '<th></th><td></td>'. 259 - '<th></th><td colspan="3">%s</td>'. 260 - '</tr></table>', 261 - $div), 257 + 'r' => phutil_tag('table', array(), 258 + phutil_tag('tr', array(), array( 259 + phutil_tag('th', array()), 260 + phutil_tag('td', array()), 261 + phutil_tag('th', array()), 262 + phutil_tag('td', array('colspan' => 3), $div), 263 + ))), 262 264 ); 263 265 } 264 266
+23 -26
src/applications/differential/view/DifferentialDiffTableOfContentsView.php
··· 136 136 $pchar = 137 137 ($changeset->getOldProperties() === $changeset->getNewProperties()) 138 138 ? null 139 - : hsprintf('<span title="%s">M</span>', pht('Properties Changed')); 139 + : phutil_tag('span', array('title' => pht('Properties Changed')), 'M') 140 + ; 140 141 141 142 $fname = $changeset->getFilename(); 142 143 $cov = $this->renderCoverage($coverage, $fname); ··· 152 153 (isset($this->visibleChangesets[$id]) ? 'Loading...' : '?')); 153 154 } 154 155 155 - $rows[] = hsprintf( 156 - '<tr>'. 157 - '<td class="differential-toc-char" title="%s">%s</td>'. 158 - '<td class="differential-toc-prop">%s</td>'. 159 - '<td class="differential-toc-ftype">%s</td>'. 160 - '<td class="differential-toc-file">%s%s</td>'. 161 - '<td class="differential-toc-cov">%s</td>'. 162 - '<td class="differential-toc-mcov">%s</td>'. 163 - '</tr>', 164 - $chartitle, $char, 165 - $pchar, 166 - $desc, 167 - $link, $lines, 168 - $cov, 169 - $mcov); 156 + $rows[] = phutil_tag('tr', array(), array( 157 + phutil_tag( 158 + 'td', 159 + array('class' => 'differential-toc-char', 'title' => $chartitle), 160 + $char), 161 + phutil_tag('td', array('class' => 'differential-toc-prop'), $pchar), 162 + phutil_tag('td', array('class' => 'differential-toc-ftype'), $desc), 163 + phutil_tag( 164 + 'td', 165 + array('class' => 'differential-toc-file'), 166 + array($link, $lines)), 167 + phutil_tag('td', array('class' => 'differential-toc-cov'), $cov), 168 + phutil_tag('td', array('class' => 'differential-toc-mcov'), $mcov), 169 + )); 170 170 if ($meta) { 171 - $rows[] = hsprintf( 172 - '<tr>'. 173 - '<td colspan="3"></td>'. 174 - '<td class="differential-toc-meta">%s</td>'. 175 - '</tr>', 176 - $meta); 171 + $rows[] = phutil_tag('tr', array(), array( 172 + phutil_tag('td', array('colspan' => 3)), 173 + phutil_tag('td', array('class' => 'differential-toc-meta'), $meta), 174 + )); 177 175 } 178 176 if ($this->diff && $this->repository) { 179 177 $paths[] = ··· 208 206 ), 209 207 pht('Show All Context')); 210 208 211 - $buttons = hsprintf( 212 - '<tr><td colspan="7">%s%s</td></tr>', 213 - $editor_link, 214 - $reveal_link); 209 + $buttons = phutil_tag('tr', array(), 210 + phutil_tag('td', array('colspan' => 7), 211 + array($editor_link, $reveal_link))); 215 212 216 213 $content = hsprintf( 217 214 '%s'.
+15 -11
src/applications/differential/view/DifferentialInlineCommentEditView.php
··· 60 60 $this->renderBody(), 61 61 )); 62 62 63 - return hsprintf( 64 - '<table>'. 65 - '<tr class="inline-comment-splint">'. 66 - '<th></th>'. 67 - '<td class="left">%s</td>'. 68 - '<th></th>'. 69 - '<td colspan="3" class="right3">%s</td>'. 70 - '</tr>'. 71 - '</table>', 72 - $this->onRight ? null : $content, 73 - $this->onRight ? $content : null); 63 + return phutil_tag('table', array(), phutil_tag( 64 + 'tr', 65 + array('class' => 'inline-comment-splint'), 66 + array( 67 + phutil_tag('th', array()), 68 + phutil_tag( 69 + 'td', 70 + array('class' => 'left'), 71 + $this->onRight ? null : $content), 72 + phutil_tag('th', array()), 73 + phutil_tag( 74 + 'td', 75 + array('colspan' => 3, 'class' => 'right3'), 76 + $this->onRight ? $content : null), 77 + ))); 74 78 } 75 79 76 80 private function renderInputs() {
+28 -23
src/applications/differential/view/DifferentialInlineCommentView.php
··· 217 217 $author = $handles[$inline->getAuthorPHID()]->getName(); 218 218 } 219 219 220 + $line = phutil_tag( 221 + 'span', 222 + array('class' => 'differential-inline-comment-line'), 223 + $line); 224 + 220 225 $markup = javelin_tag( 221 226 'div', 222 227 array( ··· 224 229 'sigil' => $sigil, 225 230 'meta' => $metadata, 226 231 ), 227 - hsprintf( 228 - '<div class="differential-inline-comment-head">'. 229 - '%s%s <span class="differential-inline-comment-line">%s</span> %s'. 230 - '</div>'. 231 - '<div class="differential-inline-comment-content">'. 232 - '<div class="phabricator-remarkup">%s</div>'. 233 - '</div>', 234 - $anchor, 235 - $links, 236 - $line, 237 - $author, 238 - $content)); 232 + array( 233 + phutil_tag_div('differential-inline-comment-head', array( 234 + $anchor, 235 + $links, 236 + ' ', 237 + $line, 238 + ' ', 239 + $author, 240 + )), 241 + phutil_tag_div( 242 + 'differential-inline-comment-content', 243 + phutil_tag_div('phabricator-remarkup', $content)), 244 + )); 239 245 240 246 return $this->scaffoldMarkup($markup); 241 247 } ··· 248 254 $left_markup = !$this->onRight ? $markup : ''; 249 255 $right_markup = $this->onRight ? $markup : ''; 250 256 251 - return hsprintf( 252 - '<table>'. 253 - '<tr class="inline">'. 254 - '<th></th>'. 255 - '<td class="left">%s</td>'. 256 - '<th></th>'. 257 - '<td class="right3" colspan="3">%s</td>'. 258 - '</tr>'. 259 - '</table>', 260 - $left_markup, 261 - $right_markup); 257 + return phutil_tag('table', array(), 258 + phutil_tag('tr', array(), array( 259 + phutil_tag('th', array()), 260 + phutil_tag('td', array('class' => 'left'), $left_markup), 261 + phutil_tag('th', array()), 262 + phutil_tag( 263 + 'td', 264 + array('colspan' => 3, 'class' => 'right3'), 265 + $right_markup), 266 + ))); 262 267 } 263 268 264 269 }
+4 -6
src/applications/differential/view/DifferentialLocalCommitsView.php
··· 128 128 129 129 $headers = phutil_tag('tr', array(), $headers); 130 130 131 - $content = hsprintf( 132 - '<div class="differential-panel">'. 133 - '<table class="differential-local-commits-table">%s%s</table>'. 134 - '</div>', 135 - $headers, 136 - phutil_implode_html("\n", $rows)); 131 + $content = phutil_tag_div('differential-panel', phutil_tag( 132 + 'table', 133 + array('class' => 'differential-local-commits-table'), 134 + array($headers, phutil_implode_html("\n", $rows)))); 137 135 138 136 return id(new PHUIObjectBoxView()) 139 137 ->setHeaderText(pht('Local Commits'))
+4 -7
src/applications/differential/view/DifferentialRevisionCommentView.php
··· 87 87 $comment, 88 88 PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY); 89 89 90 - $content = hsprintf( 91 - '<div class="phabricator-remarkup">%s</div>', 92 - $content); 90 + $content = phutil_tag_div('phabricator-remarkup', $content); 93 91 } 94 92 95 93 $inline_render = $this->renderInlineComments(); ··· 207 205 } 208 206 209 207 if (!$hide_comments) { 210 - $xaction_view->appendChild(hsprintf( 211 - '<div class="differential-comment-core">%s%s</div>', 212 - $content, 213 - $inline_render)); 208 + $xaction_view->appendChild(phutil_tag_div( 209 + 'differential-comment-core', 210 + array($content, $inline_render))); 214 211 } 215 212 216 213 return $xaction_view->render();
+19 -17
src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
··· 200 200 phutil_tag('th', array(), pht('Unit')), 201 201 ))); 202 202 203 - $content = hsprintf( 204 - '<div class="differential-revision-history differential-panel">'. 205 - '<form action="#toc">'. 206 - '<table class="differential-revision-history-table">'. 207 - '%s'. 208 - '<tr>'. 209 - '<td colspan="9" class="diff-differ-submit">'. 210 - '<label>%s</label>'. 211 - '<button>%s</button>'. 212 - '</td>'. 213 - '</tr>'. 214 - '</table>'. 215 - '</form>'. 216 - '</div>', 217 - phutil_implode_html("\n", $rows), 218 - pht('Whitespace Changes: %s', $select), 219 - pht('Show Diff')); 203 + $label = pht('Whitespace Changes: %s', $select); 204 + 205 + $content = phutil_tag_div( 206 + 'differential-revision-history differential-panel', 207 + phutil_tag( 208 + 'form', 209 + array('action' => '#toc'), 210 + phutil_tag( 211 + 'table', 212 + array('class' => 'differential-revision-history-table'), array( 213 + phutil_implode_html("\n", $rows), 214 + phutil_tag('tr', array(), phutil_tag( 215 + 'td', 216 + array('colspan' => 9, 'class' => 'diff-differ-submit'), 217 + array( 218 + phutil_tag('label', array(), $label), 219 + phutil_tag('button', array(), pht('Show Diff')), 220 + ))) 221 + )))); 220 222 221 223 return id(new PHUIObjectBoxView()) 222 224 ->setHeaderText(pht('Revision Update History'))
+18 -18
src/applications/diffusion/controller/DiffusionCommitController.php
··· 744 744 'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/', 745 745 )); 746 746 747 - $preview_panel = hsprintf( 748 - '<div class="aphront-panel-preview aphront-panel-flush"> 749 - <div id="audit-preview"> 750 - <div class="aphront-panel-preview-loading-text"> 751 - Loading preview... 752 - </div> 753 - </div> 754 - <div id="inline-comment-preview"> 755 - </div> 756 - </div>'); 747 + $loading = phutil_tag_div( 748 + 'aphront-panel-preview-loading-text', 749 + pht('Loading preview...')); 750 + 751 + $preview_panel = phutil_tag_div( 752 + 'aphront-panel-preview aphront-panel-flush', 753 + array( 754 + phutil_tag('div', array('id' => 'audit-preview'), $loading), 755 + phutil_tag('div', array('id' => 'inline-comment-preview')) 756 + )); 757 757 758 758 // TODO: This is pretty awkward, unify the CSS between Diffusion and 759 759 // Differential better. 760 760 require_celerity_resource('differential-core-view-css'); 761 + 762 + $anchor = id(new PhabricatorAnchorView()) 763 + ->setAnchorName('comment') 764 + ->setNavigationMarker(true) 765 + ->render(); 761 766 762 767 $comment_box = id(new PHUIObjectBoxView()) 763 768 ->setHeader($header) ··· 768 773 array( 769 774 'id' => $pane_id, 770 775 ), 771 - hsprintf( 772 - '<div class="differential-add-comment-panel">%s%s%s</div>', 773 - id(new PhabricatorAnchorView()) 774 - ->setAnchorName('comment') 775 - ->setNavigationMarker(true) 776 - ->render(), 777 - $comment_box, 778 - $preview_panel)); 776 + phutil_tag_div( 777 + 'differential-add-comment-panel', 778 + array($anchor, $comment_box, $preview_panel))); 779 779 } 780 780 781 781 /**
+13 -18
src/applications/diffusion/controller/DiffusionLintController.php
··· 69 69 70 70 $total += $code['n']; 71 71 72 + $href_lint = $drequest->generateURI(array( 73 + 'action' => 'lint', 74 + 'lint' => $code['code'], 75 + )); 76 + $href_browse = $drequest->generateURI(array( 77 + 'action' => 'browse', 78 + 'lint' => $code['code'], 79 + )); 80 + $href_repo = $drequest->generateURI(array('action' => 'lint')); 81 + 72 82 $rows[] = array( 73 - hsprintf( 74 - '<a href="%s">%s</a>', 75 - $drequest->generateURI(array( 76 - 'action' => 'lint', 77 - 'lint' => $code['code'], 78 - )), 79 - $code['n']), 80 - hsprintf( 81 - '<a href="%s">%s</a>', 82 - $drequest->generateURI(array( 83 - 'action' => 'browse', 84 - 'lint' => $code['code'], 85 - )), 86 - $code['files']), 87 - hsprintf( 88 - '<a href="%s">%s</a>', 89 - $drequest->generateURI(array('action' => 'lint')), 90 - $drequest->getCallsign()), 83 + phutil_tag('a', array('href' => $href_lint), $code['n']), 84 + phutil_tag('a', array('href' => $href_browse), $code['files']), 85 + phutil_tag('a', array('href' => $href_repo), $drequest->getCallsign()), 91 86 ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']), 92 87 $code['code'], 93 88 $code['maxName'],
+8 -8
src/applications/diffusion/controller/DiffusionLintDetailsController.php
··· 15 15 16 16 $rows = array(); 17 17 foreach ($messages as $message) { 18 - $path = hsprintf( 19 - '<a href="%s">%s</a>', 20 - $drequest->generateURI(array( 18 + $path = phutil_tag( 19 + 'a', 20 + array('href' => $drequest->generateURI(array( 21 21 'action' => 'lint', 22 22 'path' => $message['path'], 23 - )), 23 + ))), 24 24 substr($message['path'], strlen($drequest->getPath()) + 1)); 25 25 26 - $line = hsprintf( 27 - '<a href="%s">%s</a>', 28 - $drequest->generateURI(array( 26 + $line = phutil_tag( 27 + 'a', 28 + array('href' => $drequest->generateURI(array( 29 29 'action' => 'browse', 30 30 'path' => $message['path'], 31 31 'line' => $message['line'], 32 32 'commit' => $branch->getLintCommit(), 33 - )), 33 + ))), 34 34 $message['line']); 35 35 36 36 $author = $message['authorPHID'];
+4 -4
src/applications/diffusion/view/DiffusionBrowseTableView.php
··· 74 74 75 75 $lint = self::loadLintMessagesCount($drequest); 76 76 if ($lint !== null) { 77 - $return['lint'] = hsprintf( 78 - '<a href="%s">%s</a>', 79 - $drequest->generateURI(array( 77 + $return['lint'] = phutil_tag( 78 + 'a', 79 + array('href' => $drequest->generateURI(array( 80 80 'action' => 'lint', 81 81 'lint' => null, 82 - )), 82 + ))), 83 83 number_format($lint)); 84 84 } 85 85
+3 -3
src/applications/diffusion/view/DiffusionCommentView.php
··· 139 139 if (!strlen($comment->getContent()) && empty($this->inlineComments)) { 140 140 return null; 141 141 } else { 142 - return hsprintf( 143 - '<div class="phabricator-remarkup">%s%s</div>', 142 + return phutil_tag_div('phabricator-remarkup', array( 144 143 $engine->getOutput( 145 144 $comment, 146 145 PhabricatorAuditComment::MARKUP_FIELD_BODY), 147 - $this->renderInlines()); 146 + $this->renderInlines(), 147 + )); 148 148 } 149 149 } 150 150
+2 -2
src/applications/feed/builder/PhabricatorFeedBuilder.php
··· 47 47 48 48 if ($date !== $last_date) { 49 49 if ($last_date !== null) { 50 - $null_view->appendChild(hsprintf( 51 - '<div class="phabricator-feed-story-date-separator"></div>')); 50 + $null_view->appendChild( 51 + phutil_tag_div('phabricator-feed-story-date-separator')); 52 52 } 53 53 $last_date = $date; 54 54 $header = new PhabricatorActionHeaderView();
+1 -3
src/applications/feed/controller/PhabricatorFeedDetailController.php
··· 27 27 28 28 $title = pht('Story'); 29 29 30 - $feed_view = hsprintf( 31 - '<div class="phabricator-feed-frame">%s</div>', 32 - $feed_view); 30 + $feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view); 33 31 34 32 $crumbs = $this->buildApplicationCrumbs(); 35 33 $crumbs->addCrumb(
+1 -3
src/applications/feed/controller/PhabricatorFeedListController.php
··· 32 32 $builder->setUser($this->getRequest()->getUser()); 33 33 $view = $builder->buildView(); 34 34 35 - return hsprintf( 36 - '<div class="phabricator-feed-frame">%s</div>', 37 - $view); 35 + return phutil_tag_div('phabricator-feed-frame', $view); 38 36 } 39 37 40 38 }
+2 -1
src/applications/feed/controller/PhabricatorFeedPublicStreamController.php
··· 25 25 ->setFramed(true) 26 26 ->setUser($viewer); 27 27 28 - $view = hsprintf('<div class="phabricator-public-feed-frame">%s</div>', 28 + $view = phutil_tag_div( 29 + 'phabricator-public-feed-frame', 29 30 $builder->buildView()); 30 31 31 32 return $this->buildStandardPageResponse(
+2 -2
src/applications/feed/story/PhabricatorFeedStoryCommit.php
··· 37 37 } 38 38 39 39 if ($author) { 40 - $title = hsprintf( 40 + $title = pht( 41 41 "%s committed %s (authored by %s)", 42 42 $committer, 43 43 $commit, 44 44 $author); 45 45 } else { 46 - $title = hsprintf( 46 + $title = pht( 47 47 "%s committed %s", 48 48 $committer, 49 49 $commit);
+14 -6
src/applications/harbormaster/view/ShellLogView.php
··· 61 61 62 62 // TODO: Provide nice links. 63 63 64 + $th = phutil_tag( 65 + 'th', 66 + array( 67 + 'class' => 'phabricator-source-line', 68 + 'style' => 'background-color: #fff;', 69 + ), 70 + $content_number); 71 + 72 + $td = phutil_tag( 73 + 'td', 74 + array('class' => 'phabricator-source-code'), 75 + $content_line); 76 + 64 77 $rows[] = phutil_tag( 65 78 'tr', 66 79 $row_attributes, 67 - hsprintf( 68 - '<th class="phabricator-source-line" '. 69 - 'style="background-color: #fff;">%s</th>'. 70 - '<td class="phabricator-source-code">%s</td>', 71 - $content_number, 72 - $content_line)); 80 + array($th, $td)); 73 81 74 82 if ($hit_limit) { 75 83 break;
+2 -2
src/applications/herald/controller/HeraldTestConsoleController.php
··· 94 94 95 95 $form = id(new AphrontFormView()) 96 96 ->setUser($user) 97 - ->appendChild(hsprintf( 98 - '<p class="aphront-form-instructions">%s</p>', $text)) 97 + ->appendChild( 98 + phutil_tag('p', array('class' => 'aphront-form-instructions'), $text)) 99 99 ->appendChild( 100 100 id(new AphrontFormTextControl()) 101 101 ->setLabel(pht('Object Name'))
+35 -30
src/applications/herald/controller/HeraldTranscriptController.php
··· 133 133 $value = implode(', ', $value); 134 134 } 135 135 136 - return hsprintf('<span class="condition-test-value">%s</span>', $value); 136 + return phutil_tag('span', array('class' => 'condition-test-value'), $value); 137 137 } 138 138 139 139 private function buildSideNav() { ··· 306 306 } 307 307 308 308 if ($apply_xscript->getApplied()) { 309 - $success = pht('SUCCESS'); 310 - $outcome = 311 - hsprintf('<span class="outcome-success">%s</span>', $success); 309 + $outcome = phutil_tag( 310 + 'span', 311 + array('class' => 'outcome-success'), 312 + pht('SUCCESS')); 312 313 } else { 313 - $failure = pht('FAILURE'); 314 - $outcome = 315 - hsprintf('<span class="outcome-failure">%s</span>', $failure); 314 + $outcome = phutil_tag( 315 + 'span', 316 + array('class' => 'outcome-failure'), 317 + pht('FAILURE')); 316 318 } 317 319 318 320 $rows[] = array( ··· 366 368 $cond_markup = array(); 367 369 foreach ($xscript->getConditionTranscriptsForRule($rule_id) as $cond) { 368 370 if ($cond->getNote()) { 369 - $note = hsprintf( 370 - '<div class="herald-condition-note">%s</div>', 371 - $cond->getNote()); 371 + $note = phutil_tag_div('herald-condition-note', $cond->getNote()); 372 372 } else { 373 373 $note = null; 374 374 } 375 375 376 376 if ($cond->getResult()) { 377 - $result = hsprintf( 378 - '<span class="herald-outcome condition-pass">'. 379 - "\xE2\x9C\x93". 380 - '</span>'); 377 + $result = phutil_tag( 378 + 'span', 379 + array('class' => 'herald-outcome condition-pass'), 380 + "\xE2\x9C\x93"); 381 381 } else { 382 - $result = hsprintf( 383 - '<span class="herald-outcome condition-fail">'. 384 - "\xE2\x9C\x98". 385 - '</span>'); 382 + $result = phutil_tag( 383 + 'span', 384 + array('class' => 'herald-outcome condition-fail'), 385 + "\xE2\x9C\x98"); 386 386 } 387 387 388 388 $cond_markup[] = phutil_tag( ··· 398 398 } 399 399 400 400 if ($rule->getResult()) { 401 - $pass = pht('PASS'); 402 - $result = hsprintf( 403 - '<span class="herald-outcome rule-pass">%s</span>', $pass); 401 + $result = phutil_tag( 402 + 'span', 403 + array('class' => 'herald-outcome rule-pass'), 404 + pht('PASS')); 404 405 $class = 'herald-rule-pass'; 405 406 } else { 406 - $fail = pht('FAIL'); 407 - $result = hsprintf( 408 - '<span class="herald-outcome rule-fail">%s</span>', $fail); 407 + $result = phutil_tag( 408 + 'span', 409 + array('class' => 'herald-outcome rule-fail'), 410 + pht('FAIL')); 409 411 $class = 'herald-rule-fail'; 410 412 } 411 413 412 - $cond_markup[] = hsprintf('<li>%s %s</li>', $result, $rule->getReason()); 414 + $cond_markup[] = phutil_tag( 415 + 'li', 416 + array(), 417 + array($result, $rule->getReason())); 413 418 $user_phid = $this->getRequest()->getUser()->getPHID(); 414 419 415 420 $name = $rule->getRuleName(); ··· 420 425 array( 421 426 'class' => $class, 422 427 ), 423 - hsprintf( 424 - '<div class="rule-name"><strong>%s</strong> %s</div>%s', 425 - $name, 426 - $handles[$rule->getRuleOwner()]->getName(), 427 - phutil_tag('ul', array(), $cond_markup))); 428 + phutil_tag_div('rule-name', array( 429 + phutil_tag('strong', array(), $name), 430 + ' ', 431 + phutil_tag('ul', array(), $cond_markup), 432 + ))); 428 433 } 429 434 430 435 $panel = '';
+3 -3
src/applications/maniphest/controller/ManiphestReportController.php
··· 252 252 "of this project in the past but no longer is, it is not ". 253 253 "counted at all."); 254 254 $header = pht("Task Burn Rate for Project %s", $handle->renderLink()); 255 - $caption = hsprintf("<p>%s</p>", $inst); 255 + $caption = phutil_tag('p', array(), $inst); 256 256 } else { 257 257 $header = pht("Task Burn Rate for All Tasks"); 258 258 $caption = null; ··· 362 362 $fmt = number_format($delta); 363 363 if ($delta > 0) { 364 364 $fmt = '+'.$fmt; 365 - $fmt = hsprintf('<span class="red">%s</span>', $fmt); 365 + $fmt = phutil_tag('span', array('class' => 'red'), $fmt); 366 366 } else { 367 - $fmt = hsprintf('<span class="green">%s</span>', $fmt); 367 + $fmt = phutil_tag('span', array('class' => 'green'), $fmt); 368 368 } 369 369 370 370 return array(
+1 -3
src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php
··· 18 18 ManiphestTask::MARKUP_FIELD_DESCRIPTION, 19 19 $request->getUser()); 20 20 21 - $content = hsprintf( 22 - '<div class="phabricator-remarkup">%s</div>', 23 - $output); 21 + $content = phutil_tag_div('phabricator-remarkup', $output); 24 22 25 23 return id(new AphrontAjaxResponse()) 26 24 ->setContent($content);
+8 -7
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 348 348 $comment_header = id(new PHUIHeaderView()) 349 349 ->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In')); 350 350 351 - $preview_panel = hsprintf( 352 - '<div class="aphront-panel-preview"> 353 - <div id="transaction-preview"> 354 - <div class="aphront-panel-preview-loading-text">%s</div> 355 - </div> 356 - </div>', 357 - pht('Loading preview...')); 351 + $preview_panel = phutil_tag_div( 352 + 'aphront-panel-preview', 353 + phutil_tag( 354 + 'div', 355 + array('id' => 'transaction-preview'), 356 + phutil_tag_div( 357 + 'aphront-panel-preview-loading-text', 358 + pht('Loading preview...')))); 358 359 359 360 $timeline = id(new PhabricatorApplicationTransactionView()) 360 361 ->setUser($user)
+3 -5
src/applications/notification/controller/PhabricatorNotificationListController.php
··· 45 45 $builder = new PhabricatorNotificationBuilder($notifications); 46 46 $view = $builder->buildView()->render(); 47 47 } else { 48 - $view = hsprintf( 49 - '<div class="phabricator-notification no-notifications">%s</div>', 48 + $view = phutil_tag_div( 49 + 'phabricator-notification no-notifications', 50 50 $no_data); 51 51 } 52 52 53 - $view = hsprintf( 54 - '<div class="phabricator-notification-list">%s</div>', 55 - $view); 53 + $view = phutil_tag_div('phabricator-notification-list', $view); 56 54 57 55 $panel = new AphrontPanelView(); 58 56 $panel->setHeader($header);
+2 -2
src/applications/notification/controller/PhabricatorNotificationPanelController.php
··· 20 20 $notifications_view = $builder->buildView(); 21 21 $content = $notifications_view->render(); 22 22 } else { 23 - $content = hsprintf( 24 - '<div class="phabricator-notification no-notifications">%s</div>', 23 + $content = phutil_tag_div( 24 + 'phabricator-notification no-notifications', 25 25 pht('You have no notifications.')); 26 26 } 27 27
+1 -3
src/applications/owners/controller/PhabricatorOwnersDeleteController.php
··· 29 29 $dialog = id(new AphrontDialogView()) 30 30 ->setUser($user) 31 31 ->setTitle('Really delete this package?') 32 - ->appendChild(hsprintf( 33 - '<p>%s</p>', 34 - $text)) 32 + ->appendChild(phutil_tag('p', array(), $text)) 35 33 ->addSubmitButton(pht('Delete')) 36 34 ->addCancelButton('/owners/package/'.$package->getID().'/') 37 35 ->setSubmitURI($request->getRequestURI());
+8 -9
src/applications/people/controller/PhabricatorPeopleEditController.php
··· 414 414 415 415 if ($is_self) { 416 416 $inst = pht('NOTE: You can not edit your own role.'); 417 - $form->appendChild(hsprintf( 418 - '<p class="aphront-form-instructions">%s</p>', $inst)); 417 + $form->appendChild( 418 + phutil_tag('p', array('class' => 'aphront-form-instructions'), $inst)); 419 419 } 420 420 421 421 $form ··· 473 473 $form 474 474 ->setUser($admin) 475 475 ->setAction($request->getRequestURI()) 476 - ->appendChild(hsprintf( 477 - '<p class="aphront-form-instructions">%s</p>', $inst)); 476 + ->appendChild( 477 + phutil_tag('p', array('class' => 'aphront-form-instructions'), $inst)); 478 478 479 479 if ($user->getIsSystemAgent()) { 480 480 $form ··· 703 703 ), 704 704 pht('User Guide: Account Roles')); 705 705 706 - $inst = pht('For a detailed explanation of account roles, see %s.', 707 - $roles_link); 708 - return hsprintf( 709 - '<p class="aphront-form-instructions">%s</p>', 710 - $inst); 706 + return phutil_tag( 707 + 'p', 708 + array('class' => 'aphront-form-instructions'), 709 + pht('For a detailed explanation of account roles, see %s.', $roles_link)); 711 710 } 712 711 713 712 private function processSetAccountPicture(PhabricatorUser $user) {
+2 -4
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 127 127 $builder->setShowHovercards(true); 128 128 $view = $builder->buildView(); 129 129 130 - return hsprintf( 131 - '<div class="profile-feed profile-wrap-responsive"> 132 - %s 133 - </div>', 130 + return phutil_tag_div( 131 + 'profile-feed profile-wrap-responsive', 134 132 $view->render()); 135 133 } 136 134 }
+8 -11
src/applications/phame/controller/post/PhamePostEditController.php
··· 143 143 ->addCancelButton($cancel_uri) 144 144 ->setValue($submit_button)); 145 145 146 - $preview_panel = hsprintf( 147 - '<div class="aphront-panel-preview"> 148 - <div class="phame-post-preview-header"> 149 - Post Preview 150 - </div> 151 - <div id="post-preview"> 152 - <div class="aphront-panel-preview-loading-text"> 153 - Loading preview... 154 - </div> 155 - </div> 156 - </div>'); 146 + $loading = phutil_tag_div( 147 + 'aphront-panel-preview-loading-text', 148 + pht('Loading preview...')); 149 + 150 + $preview_panel = phutil_tag_div('aphront-panel-preview', array( 151 + phutil_tag_div('phame-post-preview-header', pht('Post Preview')), 152 + phutil_tag('div', array('id' => 'post-preview'), $loading), 153 + )); 157 154 158 155 require_celerity_resource('phame-css'); 159 156 Javelin::initBehavior(
+1 -1
src/applications/phame/controller/post/PhamePostPreviewController.php
··· 23 23 PhamePost::MARKUP_FIELD_BODY, 24 24 $user); 25 25 26 - $content = hsprintf('<div class="phabricator-remarkup">%s</div>', $content); 26 + $content = phutil_tag_div('phabricator-remarkup', $content); 27 27 28 28 return id(new AphrontAjaxResponse())->setContent($content); 29 29 }
+1 -1
src/applications/phame/skins/PhameBasicBlogSkin.php
··· 123 123 } 124 124 125 125 protected function render404Page() { 126 - return hsprintf('<h2>404 Not Found</h2>'); 126 + return phutil_tag('h2', array(), pht('404 Not Found')); 127 127 } 128 128 129 129 final public function getResourceURI($resource) {
+8 -9
src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
··· 14 14 15 15 $response = new AphrontWebpageResponse(); 16 16 $response->setFrameable(true); 17 - $response->setContent(hsprintf( 18 - '<frameset cols="33%%, 34%%, 33%%">'. 19 - '<frame src="/xhpast/input/%s/" />'. 20 - '<frame src="/xhpast/tree/%s/" />'. 21 - '<frame src="/xhpast/stream/%s/" />'. 22 - '</frameset>', 23 - $id, 24 - $id, 25 - $id)); 17 + $response->setContent(phutil_tag( 18 + 'frameset', 19 + array('cols' => '33%, 34%, 33%'), 20 + array( 21 + phutil_tag('frame', array('src' => "/xhpast/input/{$id}/")), 22 + phutil_tag('frame', array('src' => "/xhpast/tree/{$id}/")), 23 + phutil_tag('frame', array('src' => "/xhpast/stream/{$id}/")), 24 + ))); 26 25 27 26 return $response; 28 27 }
+7 -9
src/applications/phriction/controller/PhrictionDiffController.php
··· 174 174 pht('Most Recent Change')); 175 175 } 176 176 177 - $navigation_table = hsprintf( 178 - '<table class="phriction-history-nav-table"> 179 - <tr> 180 - <td class="nav-prev">%s</td> 181 - <td class="nav-next">%s</td> 182 - </tr> 183 - </table>', 184 - $link_l, 185 - $link_r); 177 + $navigation_table = phutil_tag( 178 + 'table', 179 + array('class' => 'phriction-history-nav-table'), 180 + phutil_tag('tr', array(), array( 181 + phutil_tag('td', array('class' => 'nav-prev'), $link_l), 182 + phutil_tag('td', array('class' => 'nav-next'), $link_r), 183 + ))); 186 184 } 187 185 188 186
+1 -1
src/applications/phriction/controller/PhrictionNewController.php
··· 26 26 ->setUser($user) 27 27 ->appendChild(pht( 28 28 'The document %s already exists. Do you want to edit it instead?', 29 - hsprintf('<tt>%s</tt>', $slug))) 29 + phutil_tag('tt', array(), $slug))) 30 30 ->addHiddenInput('slug', $slug) 31 31 ->addHiddenInput('prompt', 'yes') 32 32 ->addCancelButton('/w/')
+7 -11
src/applications/phriction/storage/PhrictionContent.php
··· 75 75 $engine); 76 76 77 77 if ($toc) { 78 - $toc = hsprintf( 79 - '<div class="phabricator-remarkup-toc">'. 80 - '<div class="phabricator-remarkup-toc-header">%s</div>'. 81 - '%s'. 82 - '</div>', 83 - pht('Table of Contents'), 84 - $toc); 78 + $toc = phutil_tag_div('phabricator-remarkup-toc', array( 79 + phutil_tag_div( 80 + 'phabricator-remarkup-toc-header', 81 + pht('Table of Contents')), 82 + $toc, 83 + )); 85 84 } 86 85 87 - return hsprintf( 88 - '<div class="phabricator-remarkup">%s%s</div>', 89 - $toc, 90 - $output); 86 + return phutil_tag_div('phabricator-remarkup', array($toc, $output)); 91 87 } 92 88 93 89
+17 -17
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 52 52 ->addColumn($feed) 53 53 ->setFluidLayout(true); 54 54 55 - $content = hsprintf( 56 - '<div class="phabricator-project-layout">%s%s</div>', 57 - $tasks, 58 - $content); 55 + $content = phutil_tag_div( 56 + 'phabricator-project-layout', 57 + array($tasks, $content)); 59 58 60 59 $header = id(new PHUIHeaderView()) 61 60 ->setHeader($project->getName()) ··· 109 108 if ($affiliated) { 110 109 $affiliated = phutil_tag('ul', array(), $affiliated); 111 110 } else { 112 - $affiliated = hsprintf('<p><em>%s</em></p>', pht( 113 - 'No one is affiliated with this project.')); 111 + $affiliated = phutil_tag('p', array(), 112 + phutil_tag('em', array(), 113 + pht('No one is affiliated with this project.'))); 114 114 } 115 115 116 - return hsprintf( 117 - '<div class="phabricator-profile-info-group profile-wrap-responsive">'. 118 - '<h1 class="phabricator-profile-info-header">%s</h1>'. 119 - '<div class="phabricator-profile-info-pane">%s</div>'. 120 - '</div>', 121 - pht('People'), 122 - $affiliated); 116 + return phutil_tag_div( 117 + 'phabricator-profile-info-group profile-wrap-responsive', 118 + array( 119 + phutil_tag( 120 + 'h1', 121 + array('class' => 'phabricator-profile-info-header'), 122 + pht('People')), 123 + phutil_tag_div('phabricator-profile-info-pane', $affiliated), 124 + )); 123 125 } 124 126 125 127 private function renderFeedPage( ··· 147 149 $builder->setShowHovercards(true); 148 150 $view = $builder->buildView(); 149 151 150 - return hsprintf( 151 - '<div class="profile-feed profile-wrap-responsive">'. 152 - '%s'. 153 - '</div>', 152 + return phutil_tag_div( 153 + 'profile-feed profile-wrap-responsive', 154 154 $view->render()); 155 155 } 156 156
+3 -2
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 87 87 id(new AphrontFormTextControl()) 88 88 ->setLabel('Indexed Languages') 89 89 ->setName('symbolIndexLanguages') 90 - ->setCaption( 91 - hsprintf('Separate with commas, for example: <tt>php, py</tt>')) 90 + ->setCaption(pht( 91 + 'Separate with commas, for example: %s', 92 + phutil_tag('tt', array(), 'php, py'))) 92 93 ->setValue($langs)) 93 94 ->appendChild( 94 95 id(new AphrontFormTokenizerControl())
+9 -10
src/applications/search/controller/PhabricatorSearchController.php
··· 252 252 $results[] = $view->render(); 253 253 } 254 254 255 - $results = hsprintf( 256 - '<div class="phabricator-search-result-list">'. 257 - '%s'. 258 - '<div class="search-results-pager">%s</div>'. 259 - '</div>', 255 + $results = phutil_tag_div('phabricator-search-result-list', array( 260 256 phutil_implode_html("\n", $results), 261 - $pager->render()); 257 + phutil_tag_div('search-results-pager', $pager->render()), 258 + )); 262 259 } else { 263 - $results = hsprintf( 264 - '<div class="phabricator-search-result-list">'. 265 - '<p class="phabricator-search-no-results">No search results.</p>'. 266 - '</div>'); 260 + $results = phutil_tag_div( 261 + 'phabricator-search-result-list', 262 + phutil_tag( 263 + 'p', 264 + array('class' => 'phabricator-search-no-results'), 265 + pht('No search results.'))); 267 266 } 268 267 $results = id(new PHUIBoxView()) 269 268 ->addMargin(PHUI::MARGIN_LARGE)
+8 -5
src/applications/settings/panel/PhabricatorSettingsPanelConduit.php
··· 67 67 $cert_form = new AphrontFormView(); 68 68 $cert_form 69 69 ->setUser($user) 70 - ->appendChild(hsprintf( 71 - '<p class="aphront-form-instructions">%s</p>', 70 + ->appendChild(phutil_tag( 71 + 'p', 72 + array('class' => 'aphront-form-instructions'), 72 73 pht('This certificate allows you to authenticate over Conduit, '. 73 74 'the Phabricator API. Normally, you just run %s to install it.', 74 - hsprintf('<tt>%s</tt>', 'arc install-certificate')))) 75 + phutil_tag('tt', array(), 'arc install-certificate')))) 75 76 ->appendChild( 76 77 id(new AphrontFormTextAreaControl()) 77 78 ->setLabel(pht('Certificate')) ··· 90 91 ->setUser($user) 91 92 ->setAction($this->getPanelURI()) 92 93 ->setWorkflow(true) 93 - ->appendChild(hsprintf( 94 - '<p class="aphront-form-instructions">%s</p>', $regen_instruction)) 94 + ->appendChild(phutil_tag( 95 + 'p', 96 + array('class' => 'aphront-form-instructions'), 97 + $regen_instruction)) 95 98 ->appendChild( 96 99 id(new AphrontFormSubmitControl()) 97 100 ->setValue(pht('Regenerate Certificate')));
+1 -1
src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php
··· 73 73 $editor_instructions = pht('Link to edit files in external editor. '. 74 74 '%%f is replaced by filename, %%l by line number, %%r by repository '. 75 75 'callsign, %%%% by literal %%. For documentation, see: %s', 76 - hsprintf('%s', $editor_doc_link)); 76 + $editor_doc_link); 77 77 78 78 $form = id(new AphrontFormView()) 79 79 ->setUser($user)
+7 -7
src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php
··· 301 301 ->setUser($user) 302 302 ->addHiddenInput('verify', $email_id) 303 303 ->setTitle(pht("Send Another Verification Email?")) 304 - ->appendChild(hsprintf( 305 - '<p>%s</p>', 306 - pht('Send another copy of the verification email to %s?', $address))) 304 + ->appendChild(phutil_tag('p', array(), pht( 305 + 'Send another copy of the verification email to %s?', 306 + $address))) 307 307 ->addSubmitButton(pht('Send Email')) 308 308 ->addCancelButton($uri); 309 309 ··· 342 342 ->setUser($user) 343 343 ->addHiddenInput('primary', $email_id) 344 344 ->setTitle(pht("Change primary email address?")) 345 - ->appendChild(hsprintf( 346 - '<p>If you change your primary address, Phabricator will send'. 347 - ' all email to %s.</p>', 348 - $address)) 345 + ->appendChild(phutil_tag('p', array(), pht( 346 + 'If you change your primary address, Phabricator will send'. 347 + ' all email to %s.', 348 + $address))) 349 349 ->addSubmitButton(pht('Change Primary Address')) 350 350 ->addCancelButton($uri); 351 351
+1 -1
src/applications/system/PhabricatorDebugController.php
··· 28 28 $out = ob_get_clean(); 29 29 30 30 $response = new AphrontWebpageResponse(); 31 - $response->setContent(hsprintf('<pre>%s</pre>', $out)); 31 + $response->setContent(phutil_tag('pre', array(), $out)); 32 32 return $response; 33 33 } 34 34
+9 -4
webroot/index.php
··· 99 99 phlog($unexpected_output); 100 100 101 101 if ($response instanceof AphrontWebpageResponse) { 102 - echo hsprintf( 103 - '<div style="background: #eeddff; white-space: pre-wrap; 104 - z-index: 200000; position: relative; padding: 8px; 105 - font-family: monospace;">%s</div>', 102 + echo phutil_tag( 103 + 'div', 104 + array('style' => 105 + 'background: #eeddff;'. 106 + 'white-space: pre-wrap;'. 107 + 'z-index: 200000;'. 108 + 'position: relative;'. 109 + 'padding: 8px;'. 110 + 'font-family: monospace'), 106 111 $unexpected_output); 107 112 } 108 113 }