1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-01 06:59:15 +01:00

Fix some HTML problems

Summary: I'm too lazy to attaching them for diffs where they were introduced.

Test Plan:
/
/D1, wrote comment with code snippet
DarkConsole
commit detail, wrote comment
task detail, wrote comment

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4911
This commit is contained in:
vrana 2013-02-11 15:10:00 -08:00
parent 8c71815028
commit 868ca71451
23 changed files with 141 additions and 156 deletions

View file

@ -134,6 +134,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
$panel->appendChild('<h1>'.pht('LDAP login').'</h1>'); $panel->appendChild('<h1>'.pht('LDAP login').'</h1>');
$panel->appendChild($ldap_form); $panel->appendChild($ldap_form);
$error_view = null;
if (isset($errors) && count($errors) > 0) { if (isset($errors) && count($errors) > 0) {
$error_view = new AphrontErrorView(); $error_view = new AphrontErrorView();
$error_view->setTitle(pht('Login Failed')); $error_view->setTitle(pht('Login Failed'));
@ -142,7 +143,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
array( array(
isset($error_view) ? $error_view : null, $error_view,
$panel, $panel,
), ),
array( array(

View file

@ -299,7 +299,7 @@ final class PhabricatorLoginController
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$error_view, $error_view,
$login_message, phutil_safe_html($login_message),
$panel, $panel,
), ),
array( array(

View file

@ -55,9 +55,7 @@ final class PhabricatorCalendarBrowseController
$nav->appendChild( $nav->appendChild(
array( array(
$this->getNoticeView(), $this->getNoticeView(),
'<div style="padding: 20px;">', hsprintf('<div style="padding: 20px;">%s</div>', $month_view->render()),
$month_view,
'</div>',
)); ));
return $this->buildApplicationPage( return $this->buildApplicationPage(

View file

@ -94,7 +94,6 @@ final class PhabricatorChatLogChannelLogController
require_celerity_resource('phabricator-chatlog-css'); require_celerity_resource('phabricator-chatlog-css');
$out = array(); $out = array();
$out[] = '<table class="phabricator-chat-log">';
foreach ($blocks as $block) { foreach ($blocks as $block) {
$author = $block['author']; $author = $block['author'];
$author = phutil_utf8_shorten($author, 18); $author = phutil_utf8_shorten($author, 18);
@ -122,7 +121,6 @@ final class PhabricatorChatLogChannelLogController
), ),
array($author, $message, $timestamp)); array($author, $message, $timestamp));
} }
$out[] = '</table>';
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($user) ->setUser($user)
@ -140,12 +138,11 @@ final class PhabricatorChatLogChannelLogController
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
array( array(
'<div class="phabricator-chat-log-panel">', hsprintf(
'<div class="phabricator-chat-log-panel">%s<br />%s%s</div>',
$form, $form,
'<br />', phutil_tag('table', array('class' => 'phabricator-chat-log'), $out),
implode("\n", $out), $pager),
$pager,
'</div>',
), ),
array( array(
'title' => 'Channel Log', 'title' => 'Channel Log',

View file

@ -155,35 +155,35 @@ final class DifferentialAddCommentView extends AphrontView {
'inline' => 'inline-comment-preview', 'inline' => 'inline-comment-preview',
)); ));
$warning_container = '<div id="warnings">'; $warning_container = array();
foreach ($warnings as $warning) { foreach ($warnings as $warning) {
if ($warning) { if ($warning) {
$warning_container .= $warning->render(); $warning_container[] = $warning->render();
} }
} }
$warning_container .= '</div>';
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action')); ->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action'));
return return hsprintf(
id(new PhabricatorAnchorView()) '%s'.
->setAnchorName('comment')
->setNavigationMarker(true)
->render().
'<div class="differential-add-comment-panel">'. '<div class="differential-add-comment-panel">'.
$header->render(). '%s%s%s'.
$form->render().
$warning_container.
'<div class="aphront-panel-preview aphront-panel-flush">'. '<div class="aphront-panel-preview aphront-panel-flush">'.
'<div id="comment-preview">'. '<div id="comment-preview">'.
'<span class="aphront-panel-preview-loading-text">'. '<span class="aphront-panel-preview-loading-text">%s</span>'.
pht('Loading comment preview...').
'</span>'.
'</div>'. '</div>'.
'<div id="inline-comment-preview">'. '<div id="inline-comment-preview">'.
'</div>'. '</div>'.
'</div>'. '</div>'.
'</div>'; '</div>',
id(new PhabricatorAnchorView())
->setAnchorName('comment')
->setNavigationMarker(true)
->render(),
$header->render(),
$form->render(),
phutil_tag('div', array('id' => 'warnings'), $warning_container),
pht('Loading comment preview...'));
} }
} }

View file

@ -687,7 +687,7 @@ final class DiffusionCommitController extends DiffusionController {
'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/', 'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/',
)); ));
$preview_panel = $preview_panel = hsprintf(
'<div class="aphront-panel-preview aphront-panel-flush"> '<div class="aphront-panel-preview aphront-panel-flush">
<div id="audit-preview"> <div id="audit-preview">
<div class="aphront-panel-preview-loading-text"> <div class="aphront-panel-preview-loading-text">
@ -696,27 +696,24 @@ final class DiffusionCommitController extends DiffusionController {
</div> </div>
<div id="inline-comment-preview"> <div id="inline-comment-preview">
</div> </div>
</div>'; </div>');
// TODO: This is pretty awkward, unify the CSS between Diffusion and // TODO: This is pretty awkward, unify the CSS between Diffusion and
// Differential better. // Differential better.
require_celerity_resource('differential-core-view-css'); require_celerity_resource('differential-core-view-css');
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'id' => $pane_id, 'id' => $pane_id,
), ),
phutil_render_tag( hsprintf(
'div', '<div class="differential-add-comment-panel">%s%s%s</div>',
array(
'class' => 'differential-add-comment-panel',
),
id(new PhabricatorAnchorView()) id(new PhabricatorAnchorView())
->setAnchorName('comment') ->setAnchorName('comment')
->setNavigationMarker(true) ->setNavigationMarker(true)
->render(). ->render(),
$panel->render(). $panel->render(),
$preview_panel)); $preview_panel));
} }

View file

@ -50,10 +50,7 @@ final class DivinerListController extends PhabricatorController {
$flavor); $flavor);
} }
$out = $out = phutil_tag('div', array('class' => 'aphront-directory-list'), $out);
'<div class="aphront-directory-list">'.
implode("\n", $out).
'</div>';
return $this->buildApplicationPage( return $this->buildApplicationPage(
$out, $out,

View file

@ -32,14 +32,14 @@ final class HeraldRuleEditHistoryView extends AphrontView {
switch ($edit->getAction()) { switch ($edit->getAction()) {
case 'create': case 'create':
$details = "Created rule '{$rule_name}'."; $details = pht("Created rule '%s'.", $rule_name);
break; break;
case 'delete': case 'delete':
$details = "Deleted rule '{$rule_name}'."; $details = pht("Deleted rule '%s'.", $rule_name);
break; break;
case 'edit': case 'edit':
default: default:
$details = "Edited rule '{$rule_name}'."; $details = pht("Edited rule '%s'.", $rule_name);
break; break;
} }

View file

@ -301,14 +301,13 @@ final class ManiphestTaskDetailController extends ManiphestController {
$comment_header = id(new PhabricatorHeaderView()) $comment_header = id(new PhabricatorHeaderView())
->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In')); ->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In'));
$preview_panel = $preview_panel = hsprintf(
'<div class="aphront-panel-preview"> '<div class="aphront-panel-preview">
<div id="transaction-preview"> <div id="transaction-preview">
<div class="aphront-panel-preview-loading-text"> <div class="aphront-panel-preview-loading-text">%s</div>
'.pht('Loading preview...').'
</div> </div>
</div> </div>',
</div>'; pht('Loading preview...'));
$transaction_view = new ManiphestTransactionListView(); $transaction_view = new ManiphestTransactionListView();
$transaction_view->setTransactions($transactions); $transaction_view->setTransactions($transactions);

View file

@ -512,7 +512,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$panel->appendChild($form); $panel->appendChild($form);
$panel->setNoBackground(); $panel->setNoBackground();
$description_preview_panel = $description_preview_panel = hsprintf(
'<div class="aphront-panel-preview aphront-panel-preview-full"> '<div class="aphront-panel-preview aphront-panel-preview-full">
<div class="maniphest-description-preview-header"> <div class="maniphest-description-preview-header">
Description Preview Description Preview
@ -522,7 +522,7 @@ final class ManiphestTaskEditController extends ManiphestController {
Loading preview... Loading preview...
</div> </div>
</div> </div>
</div>'; </div>');
Javelin::initBehavior( Javelin::initBehavior(
'maniphest-description-preview', 'maniphest-description-preview',
@ -542,7 +542,7 @@ final class ManiphestTaskEditController extends ManiphestController {
array( array(
$error_view, $error_view,
$panel, $panel,
$description_preview_panel $description_preview_panel,
), ),
array( array(
'title' => $header_name, 'title' => $header_name,

View file

@ -43,19 +43,16 @@ final class PhabricatorNotificationListController
if ($notifications) { if ($notifications) {
$builder = new PhabricatorNotificationBuilder($notifications); $builder = new PhabricatorNotificationBuilder($notifications);
$view = $builder->buildView(); $view = $builder->buildView()->render();
} else { } else {
$view = $view = hsprintf(
'<div class="phabricator-notification no-notifications">'. '<div class="phabricator-notification no-notifications">%s</div>',
$no_data. $no_data);
'</div>';
} }
$view = array( $view = hsprintf(
'<div class="phabricator-notification-list">', '<div class="phabricator-notification-list">%s</div>',
$view, $view);
'</div>',
);
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader($header); $panel->setHeader($header);

View file

@ -148,7 +148,7 @@ final class PhamePostEditController
->setValue($submit_button) ->setValue($submit_button)
); );
$preview_panel = $preview_panel = hsprintf(
'<div class="aphront-panel-preview"> '<div class="aphront-panel-preview">
<div class="phame-post-preview-header"> <div class="phame-post-preview-header">
Post Preview Post Preview
@ -158,7 +158,7 @@ final class PhamePostEditController
Loading preview... Loading preview...
</div> </div>
</div> </div>
</div>'; </div>');
require_celerity_resource('phame-css'); require_celerity_resource('phame-css');
Javelin::initBehavior( Javelin::initBehavior(

View file

@ -155,28 +155,32 @@ final class PhrictionDiffController
$link_r = pht('Most Recent Change'); $link_r = pht('Most Recent Change');
} }
$navigation_table = $navigation_table = hsprintf(
'<table class="phriction-history-nav-table"> '<table class="phriction-history-nav-table">
<tr> <tr>
<td class="nav-prev">'.$link_l.'</td> <td class="nav-prev">%s</td>
<td class="nav-next">'.$link_r.'</td> <td class="nav-next">%s</td>
</tr> </tr>
</table>'; </table>',
$link_l,
$link_r);
} }
$output = $output = hsprintf(
'<div class="phriction-document-history-diff">'. '<div class="phriction-document-history-diff">'.
$comparison_table->render(). '%s<br /><br />%s'.
'<br />'.
'<br />'.
$navigation_table.
'<table class="phriction-revert-table">'. '<table class="phriction-revert-table">'.
'<tr><td>'.$revert_l.'</td><td>'.$revert_r.'</td>'. '<tr><td>%s</td><td>%s</td>'.
'</table>'. '</table>'.
$output. '%s'.
'</div>'; '</div>',
$comparison_table->render(),
$navigation_table,
$revert_l,
$revert_r,
$output);
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
array( array(

View file

@ -110,9 +110,9 @@ final class PhrictionDocumentController
$project_info = null; $project_info = null;
if ($project_phid) { if ($project_phid) {
$project_info = $project_info = hsprintf(
'<br />This document is about the project '. '<br />This document is about the project %s.',
$handles[$project_phid]->renderLink().'.'; $handles[$project_phid]->renderLink());
} }
$index_link = phutil_tag( $index_link = phutil_tag(
@ -122,12 +122,11 @@ final class PhrictionDocumentController
), ),
pht('Document Index')); pht('Document Index'));
$byline = $byline = hsprintf(
'<div class="phriction-byline">'. '<div class="phriction-byline">Last updated %s by %s.%s</div>',
"Last updated {$when} by ". $when,
$handles[$content->getAuthorPHID()]->renderLink().'.'. $handles[$content->getAuthorPHID()]->renderLink(),
$project_info. $project_info);
'</div>';
$doc_status = $document->getStatus(); $doc_status = $document->getStatus();
@ -145,12 +144,11 @@ final class PhrictionDocumentController
throw new Exception("Unknown document status '{$doc_status}'!"); throw new Exception("Unknown document status '{$doc_status}'!");
} }
$page_content = $page_content = hsprintf(
'<div class="phriction-content">'. '<div class="phriction-content">%s%s%s</div>',
$index_link. $index_link,
$byline. $byline,
$core_content. $core_content);
'</div>';
} }
if ($version_note) { if ($version_note) {
@ -170,17 +168,14 @@ final class PhrictionDocumentController
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader($page_title); ->setHeader($page_title);
$page =
$crumbs->render().
$header->render().
$actions->render().
$version_note.
$page_content.
$children;
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$page, $crumbs->render(),
$header->render(),
$actions->render(),
$version_note,
$page_content,
$children,
), ),
array( array(
'title' => $page_title, 'title' => $page_title,
@ -309,31 +304,32 @@ final class PhrictionDocumentController
$children = isort($children, 'title'); $children = isort($children, 'title');
$list = array(); $list = array();
$list[] = '<ul>';
foreach ($children as $child) { foreach ($children as $child) {
$list[] = hsprintf('<li>');
$list[] = $this->renderChildDocumentLink($child); $list[] = $this->renderChildDocumentLink($child);
$grand = idx($grandchildren, $child['slug'], array()); $grand = idx($grandchildren, $child['slug'], array());
if ($grand) { if ($grand) {
$list[] = '<ul>'; $list[] = hsprintf('<ul>');
foreach ($grand as $grandchild) { foreach ($grand as $grandchild) {
$list[] = hsprintf('<li>');
$list[] = $this->renderChildDocumentLink($grandchild); $list[] = $this->renderChildDocumentLink($grandchild);
$list[] = hsprintf('</li>');
} }
$list[] = '</ul>'; $list[] = hsprintf('</ul>');
} }
$list[] = hsprintf('</li>');
} }
if ($more_children) { if ($more_children) {
$list[] = '<li>'.pht('More...').'</li>'; $list[] = phutil_tag('li', array(), pht('More...'));
} }
$list[] = '</ul>';
$list = implode("\n", $list);
return return hsprintf(
'<div class="phriction-children">'. '<div class="phriction-children">'.
'<div class="phriction-children-header">'. '<div class="phriction-children-header">%s</div>'.
pht('Document Hierarchy'). '%s'.
'</div>'. '</div>',
$list. pht('Document Hierarchy'),
'</div>'; phutil_tag('ul', array(), $list));
} }
private function renderChildDocumentLink(array $info) { private function renderChildDocumentLink(array $info) {
@ -346,10 +342,10 @@ final class PhrictionDocumentController
$title); $title);
if (isset($info['empty'])) { if (isset($info['empty'])) {
$item = '<em>'.$item.'</em>'; $item = phutil_tag('em', array(), $item);
} }
return '<li>'.$item.'</li>'; return $item;
} }
} }

View file

@ -231,17 +231,15 @@ final class PhrictionEditController
->setHeader($panel_header) ->setHeader($panel_header)
->appendChild($form); ->appendChild($form);
$preview_panel = $preview_panel = hsprintf(
'<div class="aphront-panel-preview aphront-panel-preview-wide"> '<div class="aphront-panel-preview aphront-panel-preview-wide">
<div class="phriction-document-preview-header"> <div class="phriction-document-preview-header">%s</div>
'.pht('Document Preview').'
</div>
<div id="document-preview"> <div id="document-preview">
<div class="aphront-panel-preview-loading-text"> <div class="aphront-panel-preview-loading-text">%s</div>
'.pht('Loading preview...').'
</div> </div>
</div> </div>',
</div>'; pht('Document Preview'),
pht('Loading preview...'));
Javelin::initBehavior( Javelin::initBehavior(
'phriction-document-preview', 'phriction-document-preview',

View file

@ -74,14 +74,13 @@ final class PonderQuestionAskController extends PonderController {
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Ask Away!')); ->setValue('Ask Away!'));
$preview = $preview = hsprintf(
'<div class="aphront-panel-flush">'. '<div class="aphront-panel-flush">'.
'<div id="question-preview">'. '<div id="question-preview">'.
'<span class="aphront-panel-preview-loading-text">'. '<span class="aphront-panel-preview-loading-text">%s</span>'.
pht('Loading question preview...').
'</span>'.
'</div>'. '</div>'.
'</div>'; '</div>',
pht('Loading question preview...'));
Javelin::initBehavior( Javelin::initBehavior(
'ponder-feedback-preview', 'ponder-feedback-preview',

View file

@ -242,18 +242,18 @@ final class PhabricatorSearchController
->setObject(idx($objects, $phid)); ->setObject(idx($objects, $phid));
$results[] = $view->render(); $results[] = $view->render();
} }
$results = $results = hsprintf(
'<div class="phabricator-search-result-list">'. '<div class="phabricator-search-result-list">'.
implode("\n", $results). '%s'.
'<div class="search-results-pager">'. '<div class="search-results-pager">%s</div>'.
$pager->render(). '</div>',
'</div>'. phutil_implode_html("\n", $results),
'</div>'; $pager->render());
} else { } else {
$results = $results = hsprintf(
'<div class="phabricator-search-result-list">'. '<div class="phabricator-search-result-list">'.
'<p class="phabricator-search-no-results">No search results.</p>'. '<p class="phabricator-search-no-results">No search results.</p>'.
'</div>'; '</div>');
} }
} else { } else {
$results = null; $results = null;

View file

@ -104,7 +104,7 @@ final class PhabricatorActionListExample extends PhabricatorUIExample {
return array( return array(
$view, $view,
'<div style="clear: both;"></div>', hsprintf('<div style="clear: both;"></div>'),
$notices, $notices,
); );
} }

View file

@ -35,11 +35,11 @@ final class PhabricatorButtonsExample extends PhabricatorUIExample {
), ),
ucwords($size.' '.$color.' '.$tag)); ucwords($size.' '.$color.' '.$tag));
$view[] = '<br /><br />'; $view[] = hsprintf('<br /><br />');
} }
} }
} }
return '<div style="margin: 1em 2em;">'.implode('', $view).'</div>'; return phutil_tag('div', array('style' => 'margin: 1em 2em;'), $view);
} }
} }

View file

@ -19,7 +19,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setName('@alincoln') ->setName('@alincoln')
->setHref('#'); ->setHref('#');
$tags[] = ' how is stuff?'; $tags[] = ' how is stuff?';
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = 'Did you hear that '; $tags[] = 'Did you hear that ';
@ -41,7 +41,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setDotColor(PhabricatorTagView::COLOR_GREY) ->setDotColor(PhabricatorTagView::COLOR_GREY)
->setHref('#'); ->setHref('#');
$tags[] = ' is gone?'; $tags[] = ' is gone?';
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = 'Take a look at '; $tags[] = 'Take a look at ';
$tags[] = id(new PhabricatorTagView()) $tags[] = id(new PhabricatorTagView())
@ -49,7 +49,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setName('D123') ->setName('D123')
->setHref('#'); ->setHref('#');
$tags[] = ' when you get a chance.'; $tags[] = ' when you get a chance.';
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = 'Hmm? '; $tags[] = 'Hmm? ';
$tags[] = id(new PhabricatorTagView()) $tags[] = id(new PhabricatorTagView())
@ -63,7 +63,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBackgroundColor(PhabricatorTagView::COLOR_BLACK) ->setBackgroundColor(PhabricatorTagView::COLOR_BLACK)
->setName('Abandoned'); ->setName('Abandoned');
$tags[] = '.'; $tags[] = '.';
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = 'I hope someone is going to '; $tags[] = 'I hope someone is going to ';
$tags[] = id(new PhabricatorTagView()) $tags[] = id(new PhabricatorTagView())
@ -77,7 +77,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBackgroundColor(PhabricatorTagView::COLOR_REDORANGE) ->setBackgroundColor(PhabricatorTagView::COLOR_REDORANGE)
->setName('High Priority'); ->setName('High Priority');
$tags[] = '!'; $tags[] = '!';
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = id(new PhabricatorHeaderView()) $tags[] = id(new PhabricatorHeaderView())
@ -89,7 +89,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setType(PhabricatorTagView::TYPE_STATE) ->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor($color) ->setBackgroundColor($color)
->setName(ucwords($color)); ->setName(ucwords($color));
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
} }
$tags[] = id(new PhabricatorHeaderView()) $tags[] = id(new PhabricatorHeaderView())
@ -101,14 +101,14 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setDotColor(PhabricatorTagView::COLOR_RED) ->setDotColor(PhabricatorTagView::COLOR_RED)
->setBarColor(PhabricatorTagView::COLOR_RED) ->setBarColor(PhabricatorTagView::COLOR_RED)
->setName('Christmas'); ->setName('Christmas');
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = id(new PhabricatorTagView()) $tags[] = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_OBJECT) ->setType(PhabricatorTagView::TYPE_OBJECT)
->setBackgroundColor(PhabricatorTagView::COLOR_ORANGE) ->setBackgroundColor(PhabricatorTagView::COLOR_ORANGE)
->setDotColor(PhabricatorTagView::COLOR_BLACK) ->setDotColor(PhabricatorTagView::COLOR_BLACK)
->setBarColor(PhabricatorTagView::COLOR_BLACK) ->setBarColor(PhabricatorTagView::COLOR_BLACK)
->setName('Halloween'); ->setName('Halloween');
$tags[] = '<br /><br />'; $tags[] = hsprintf('<br /><br />');
$tags[] = id(new PhabricatorTagView()) $tags[] = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE) ->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_MAGENTA) ->setBackgroundColor(PhabricatorTagView::COLOR_MAGENTA)
@ -116,10 +116,9 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBarColor(PhabricatorTagView::COLOR_BLUE) ->setBarColor(PhabricatorTagView::COLOR_BLUE)
->setName('Easter'); ->setName('Easter');
return array( return phutil_tag(
'<div style="padding: 1em 2em;">', 'div',
$tags, array('style' => 'padding: 1em 2em;'),
'</div>', $tags);
);
} }
} }

View file

@ -23,7 +23,7 @@ final class PhabricatorUINotificationExample extends PhabricatorUIExample {
), ),
'Show Notification'); 'Show Notification');
$content = '<div style="padding: 1em 3em;">'.$content.'</content>'; $content = hsprintf('<div style="padding: 1em 3em;">%s</div>', $content);
return $content; return $content;
} }

View file

@ -3,8 +3,9 @@
final class AphrontMiniPanelView extends AphrontView { final class AphrontMiniPanelView extends AphrontView {
public function render() { public function render() {
return hsprintf( return phutil_tag(
'<div class="aphront-mini-panel-view">%s</div>', 'div',
array('class' => 'aphront-mini-panel-view'),
$this->renderChildren()); $this->renderChildren());
} }

View file

@ -409,7 +409,9 @@ final class PhabricatorMainMenuView extends AphrontView {
''); '');
return array( return array(
$bubble_tag.$message_tag, $notification_dropdown); hsprintf('%s%s', $bubble_tag, $message_tag),
$notification_dropdown,
);
} }
private function renderMenuIcon($name) { private function renderMenuIcon($name) {