diff --git a/src/applications/auth/controller/PhabricatorLDAPLoginController.php b/src/applications/auth/controller/PhabricatorLDAPLoginController.php
index 5c912d5a5a..d3cdd28c5a 100644
--- a/src/applications/auth/controller/PhabricatorLDAPLoginController.php
+++ b/src/applications/auth/controller/PhabricatorLDAPLoginController.php
@@ -134,6 +134,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
$panel->appendChild('
'.pht('LDAP login').'
');
$panel->appendChild($ldap_form);
+ $error_view = null;
if (isset($errors) && count($errors) > 0) {
$error_view = new AphrontErrorView();
$error_view->setTitle(pht('Login Failed'));
@@ -142,7 +143,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
return $this->buildStandardPageResponse(
array(
- isset($error_view) ? $error_view : null,
+ $error_view,
$panel,
),
array(
diff --git a/src/applications/auth/controller/PhabricatorLoginController.php b/src/applications/auth/controller/PhabricatorLoginController.php
index 5a39d52372..f4bb0ab57a 100644
--- a/src/applications/auth/controller/PhabricatorLoginController.php
+++ b/src/applications/auth/controller/PhabricatorLoginController.php
@@ -299,7 +299,7 @@ final class PhabricatorLoginController
return $this->buildApplicationPage(
array(
$error_view,
- $login_message,
+ phutil_safe_html($login_message),
$panel,
),
array(
diff --git a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
index ad2b5e9863..9c4aaf4b4f 100644
--- a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
@@ -55,9 +55,7 @@ final class PhabricatorCalendarBrowseController
$nav->appendChild(
array(
$this->getNoticeView(),
- '',
- $month_view,
- '
',
+ hsprintf('%s
', $month_view->render()),
));
return $this->buildApplicationPage(
diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
index 581d3544ae..26dcadf1f8 100644
--- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
+++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
@@ -94,7 +94,6 @@ final class PhabricatorChatLogChannelLogController
require_celerity_resource('phabricator-chatlog-css');
$out = array();
- $out[] = '';
foreach ($blocks as $block) {
$author = $block['author'];
$author = phutil_utf8_shorten($author, 18);
@@ -122,7 +121,6 @@ final class PhabricatorChatLogChannelLogController
),
array($author, $message, $timestamp));
}
- $out[] = '
';
$form = id(new AphrontFormView())
->setUser($user)
@@ -140,12 +138,11 @@ final class PhabricatorChatLogChannelLogController
return $this->buildStandardPageResponse(
array(
- '',
- $form,
- '
',
- implode("\n", $out),
- $pager,
- '
',
+ hsprintf(
+ '%s
%s%s
',
+ $form,
+ phutil_tag('table', array('class' => 'phabricator-chat-log'), $out),
+ $pager),
),
array(
'title' => 'Channel Log',
diff --git a/src/applications/differential/view/DifferentialAddCommentView.php b/src/applications/differential/view/DifferentialAddCommentView.php
index 0670a062ca..e73679b874 100644
--- a/src/applications/differential/view/DifferentialAddCommentView.php
+++ b/src/applications/differential/view/DifferentialAddCommentView.php
@@ -155,35 +155,35 @@ final class DifferentialAddCommentView extends AphrontView {
'inline' => 'inline-comment-preview',
));
- $warning_container = '';
+ $warning_container = array();
foreach ($warnings as $warning) {
if ($warning) {
- $warning_container .= $warning->render();
+ $warning_container[] = $warning->render();
}
}
- $warning_container .= '
';
$header = id(new PhabricatorHeaderView())
->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action'));
- return
- id(new PhabricatorAnchorView())
- ->setAnchorName('comment')
- ->setNavigationMarker(true)
- ->render().
+ return hsprintf(
+ '%s'.
'';
+ '',
+ id(new PhabricatorAnchorView())
+ ->setAnchorName('comment')
+ ->setNavigationMarker(true)
+ ->render(),
+ $header->render(),
+ $form->render(),
+ phutil_tag('div', array('id' => 'warnings'), $warning_container),
+ pht('Loading comment preview...'));
}
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
index 60960934d2..3f87201454 100644
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -687,7 +687,7 @@ final class DiffusionCommitController extends DiffusionController {
'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/',
));
- $preview_panel =
+ $preview_panel = hsprintf(
'
@@ -696,27 +696,24 @@ final class DiffusionCommitController extends DiffusionController {
-
';
+
');
// TODO: This is pretty awkward, unify the CSS between Diffusion and
// Differential better.
require_celerity_resource('differential-core-view-css');
- return phutil_render_tag(
+ return phutil_tag(
'div',
array(
'id' => $pane_id,
),
- phutil_render_tag(
- 'div',
- array(
- 'class' => 'differential-add-comment-panel',
- ),
+ hsprintf(
+ '',
id(new PhabricatorAnchorView())
->setAnchorName('comment')
->setNavigationMarker(true)
- ->render().
- $panel->render().
+ ->render(),
+ $panel->render(),
$preview_panel));
}
diff --git a/src/applications/diviner/controller/DivinerListController.php b/src/applications/diviner/controller/DivinerListController.php
index 3d408fcc37..ab3089ba91 100644
--- a/src/applications/diviner/controller/DivinerListController.php
+++ b/src/applications/diviner/controller/DivinerListController.php
@@ -50,10 +50,7 @@ final class DivinerListController extends PhabricatorController {
$flavor);
}
- $out =
- ''.
- implode("\n", $out).
- '
';
+ $out = phutil_tag('div', array('class' => 'aphront-directory-list'), $out);
return $this->buildApplicationPage(
$out,
diff --git a/src/applications/herald/view/HeraldRuleEditHistoryView.php b/src/applications/herald/view/HeraldRuleEditHistoryView.php
index 7e3fb7b625..7bbfd2342f 100644
--- a/src/applications/herald/view/HeraldRuleEditHistoryView.php
+++ b/src/applications/herald/view/HeraldRuleEditHistoryView.php
@@ -32,14 +32,14 @@ final class HeraldRuleEditHistoryView extends AphrontView {
switch ($edit->getAction()) {
case 'create':
- $details = "Created rule '{$rule_name}'.";
+ $details = pht("Created rule '%s'.", $rule_name);
break;
case 'delete':
- $details = "Deleted rule '{$rule_name}'.";
+ $details = pht("Deleted rule '%s'.", $rule_name);
break;
case 'edit':
default:
- $details = "Edited rule '{$rule_name}'.";
+ $details = pht("Edited rule '%s'.", $rule_name);
break;
}
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
index 63b819a767..4cb394d8c5 100644
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -301,14 +301,13 @@ final class ManiphestTaskDetailController extends ManiphestController {
$comment_header = id(new PhabricatorHeaderView())
->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In'));
- $preview_panel =
+ $preview_panel = hsprintf(
'
-
- '.pht('Loading preview...').'
-
+
%s
-
';
+ ',
+ pht('Loading preview...'));
$transaction_view = new ManiphestTransactionListView();
$transaction_view->setTransactions($transactions);
diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
index cd3b13dc8e..3ca0812884 100644
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -512,7 +512,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$panel->appendChild($form);
$panel->setNoBackground();
- $description_preview_panel =
+ $description_preview_panel = hsprintf(
'
- ';
+ ');
Javelin::initBehavior(
'maniphest-description-preview',
@@ -542,7 +542,7 @@ final class ManiphestTaskEditController extends ManiphestController {
array(
$error_view,
$panel,
- $description_preview_panel
+ $description_preview_panel,
),
array(
'title' => $header_name,
diff --git a/src/applications/notification/controller/PhabricatorNotificationListController.php b/src/applications/notification/controller/PhabricatorNotificationListController.php
index 739a70f3ae..1557c8acc8 100644
--- a/src/applications/notification/controller/PhabricatorNotificationListController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationListController.php
@@ -43,19 +43,16 @@ final class PhabricatorNotificationListController
if ($notifications) {
$builder = new PhabricatorNotificationBuilder($notifications);
- $view = $builder->buildView();
+ $view = $builder->buildView()->render();
} else {
- $view =
- ''.
- $no_data.
- '
';
+ $view = hsprintf(
+ '%s
',
+ $no_data);
}
- $view = array(
- '',
- $view,
- '
',
- );
+ $view = hsprintf(
+ '%s
',
+ $view);
$panel = new AphrontPanelView();
$panel->setHeader($header);
diff --git a/src/applications/phame/controller/post/PhamePostEditController.php b/src/applications/phame/controller/post/PhamePostEditController.php
index 20217edc51..9af5a98b43 100644
--- a/src/applications/phame/controller/post/PhamePostEditController.php
+++ b/src/applications/phame/controller/post/PhamePostEditController.php
@@ -148,7 +148,7 @@ final class PhamePostEditController
->setValue($submit_button)
);
- $preview_panel =
+ $preview_panel = hsprintf(
'
- ';
+ ');
require_celerity_resource('phame-css');
Javelin::initBehavior(
diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php
index 9066468c22..7ce9082a29 100644
--- a/src/applications/phriction/controller/PhrictionDiffController.php
+++ b/src/applications/phriction/controller/PhrictionDiffController.php
@@ -155,28 +155,32 @@ final class PhrictionDiffController
$link_r = pht('Most Recent Change');
}
- $navigation_table =
+ $navigation_table = hsprintf(
'
- | '.$link_l.' |
- '.$link_r.' |
+ %s |
+ %s |
-
';
+ ',
+ $link_l,
+ $link_r);
}
- $output =
+ $output = hsprintf(
''.
- $comparison_table->render().
- '
'.
- '
'.
- $navigation_table.
+ '%s
%s'.
'
'.
- '| '.$revert_l.' | '.$revert_r.' | '.
+ '
| %s | %s | '.
'
'.
- $output.
- '
';
+ '%s'.
+ '',
+ $comparison_table->render(),
+ $navigation_table,
+ $revert_l,
+ $revert_r,
+ $output);
return $this->buildStandardPageResponse(
array(
diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php
index 6096f8b61e..338d894a66 100644
--- a/src/applications/phriction/controller/PhrictionDocumentController.php
+++ b/src/applications/phriction/controller/PhrictionDocumentController.php
@@ -110,9 +110,9 @@ final class PhrictionDocumentController
$project_info = null;
if ($project_phid) {
- $project_info =
- '
This document is about the project '.
- $handles[$project_phid]->renderLink().'.';
+ $project_info = hsprintf(
+ '
This document is about the project %s.',
+ $handles[$project_phid]->renderLink());
}
$index_link = phutil_tag(
@@ -122,12 +122,11 @@ final class PhrictionDocumentController
),
pht('Document Index'));
- $byline =
- ''.
- "Last updated {$when} by ".
- $handles[$content->getAuthorPHID()]->renderLink().'.'.
- $project_info.
- '
';
+ $byline = hsprintf(
+ 'Last updated %s by %s.%s
',
+ $when,
+ $handles[$content->getAuthorPHID()]->renderLink(),
+ $project_info);
$doc_status = $document->getStatus();
@@ -145,12 +144,11 @@ final class PhrictionDocumentController
throw new Exception("Unknown document status '{$doc_status}'!");
}
- $page_content =
- ''.
- $index_link.
- $byline.
- $core_content.
- '
';
+ $page_content = hsprintf(
+ '%s%s%s
',
+ $index_link,
+ $byline,
+ $core_content);
}
if ($version_note) {
@@ -170,17 +168,14 @@ final class PhrictionDocumentController
$header = id(new PhabricatorHeaderView())
->setHeader($page_title);
- $page =
- $crumbs->render().
- $header->render().
- $actions->render().
- $version_note.
- $page_content.
- $children;
-
return $this->buildApplicationPage(
array(
- $page,
+ $crumbs->render(),
+ $header->render(),
+ $actions->render(),
+ $version_note,
+ $page_content,
+ $children,
),
array(
'title' => $page_title,
@@ -309,31 +304,32 @@ final class PhrictionDocumentController
$children = isort($children, 'title');
$list = array();
- $list[] = '';
foreach ($children as $child) {
+ $list[] = hsprintf('- ');
$list[] = $this->renderChildDocumentLink($child);
$grand = idx($grandchildren, $child['slug'], array());
if ($grand) {
- $list[] = '
';
+ $list[] = hsprintf('');
foreach ($grand as $grandchild) {
+ $list[] = hsprintf('- ');
$list[] = $this->renderChildDocumentLink($grandchild);
+ $list[] = hsprintf('
');
}
- $list[] = '
';
+ $list[] = hsprintf('
');
}
+ $list[] = hsprintf(' ');
}
if ($more_children) {
- $list[] = '- '.pht('More...').'
';
+ $list[] = phutil_tag('li', array(), pht('More...'));
}
- $list[] = '
';
- $list = implode("\n", $list);
- return
+ return hsprintf(
''.
- ''.
- $list.
- '
';
+ ''.
+ '%s'.
+ '',
+ pht('Document Hierarchy'),
+ phutil_tag('ul', array(), $list));
}
private function renderChildDocumentLink(array $info) {
@@ -346,10 +342,10 @@ final class PhrictionDocumentController
$title);
if (isset($info['empty'])) {
- $item = ''.$item.'';
+ $item = phutil_tag('em', array(), $item);
}
- return ''.$item.'';
+ return $item;
}
}
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
index 83b0b30ddb..21d2e237ed 100644
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -231,17 +231,15 @@ final class PhrictionEditController
->setHeader($panel_header)
->appendChild($form);
- $preview_panel =
+ $preview_panel = hsprintf(
'
-
+
-
- '.pht('Loading preview...').'
-
+
%s
-
';
+ ',
+ pht('Document Preview'),
+ pht('Loading preview...'));
Javelin::initBehavior(
'phriction-document-preview',
diff --git a/src/applications/ponder/controller/PonderQuestionAskController.php b/src/applications/ponder/controller/PonderQuestionAskController.php
index 405ce3f7c5..77c6770ffe 100644
--- a/src/applications/ponder/controller/PonderQuestionAskController.php
+++ b/src/applications/ponder/controller/PonderQuestionAskController.php
@@ -74,14 +74,13 @@ final class PonderQuestionAskController extends PonderController {
id(new AphrontFormSubmitControl())
->setValue('Ask Away!'));
- $preview =
+ $preview = hsprintf(
''.
'
'.
- ''.
- pht('Loading question preview...').
- ''.
+ '%s'.
'
'.
- '
';
+ '',
+ pht('Loading question preview...'));
Javelin::initBehavior(
'ponder-feedback-preview',
diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php
index 93e55a11de..e0f128a73e 100644
--- a/src/applications/search/controller/PhabricatorSearchController.php
+++ b/src/applications/search/controller/PhabricatorSearchController.php
@@ -242,18 +242,18 @@ final class PhabricatorSearchController
->setObject(idx($objects, $phid));
$results[] = $view->render();
}
- $results =
+ $results = hsprintf(
''.
- implode("\n", $results).
- ''.
- '
';
+ '%s'.
+ ''.
+ '',
+ phutil_implode_html("\n", $results),
+ $pager->render());
} else {
- $results =
+ $results = hsprintf(
''.
'
No search results.
'.
- '
';
+ '');
}
} else {
$results = null;
diff --git a/src/applications/uiexample/examples/PhabricatorActionListExample.php b/src/applications/uiexample/examples/PhabricatorActionListExample.php
index 33df2496b5..1fe7698ebc 100644
--- a/src/applications/uiexample/examples/PhabricatorActionListExample.php
+++ b/src/applications/uiexample/examples/PhabricatorActionListExample.php
@@ -104,7 +104,7 @@ final class PhabricatorActionListExample extends PhabricatorUIExample {
return array(
$view,
- '',
+ hsprintf(''),
$notices,
);
}
diff --git a/src/applications/uiexample/examples/PhabricatorButtonsExample.php b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
index 0a3e57f715..fb7f0958bc 100644
--- a/src/applications/uiexample/examples/PhabricatorButtonsExample.php
+++ b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
@@ -35,11 +35,11 @@ final class PhabricatorButtonsExample extends PhabricatorUIExample {
),
ucwords($size.' '.$color.' '.$tag));
- $view[] = '
';
+ $view[] = hsprintf('
');
}
}
}
- return ''.implode('', $view).'
';
+ return phutil_tag('div', array('style' => 'margin: 1em 2em;'), $view);
}
}
diff --git a/src/applications/uiexample/examples/PhabricatorTagExample.php b/src/applications/uiexample/examples/PhabricatorTagExample.php
index e70a4f3a34..80518363ae 100644
--- a/src/applications/uiexample/examples/PhabricatorTagExample.php
+++ b/src/applications/uiexample/examples/PhabricatorTagExample.php
@@ -19,7 +19,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setName('@alincoln')
->setHref('#');
$tags[] = ' how is stuff?';
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = 'Did you hear that ';
@@ -41,7 +41,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setDotColor(PhabricatorTagView::COLOR_GREY)
->setHref('#');
$tags[] = ' is gone?';
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = 'Take a look at ';
$tags[] = id(new PhabricatorTagView())
@@ -49,7 +49,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setName('D123')
->setHref('#');
$tags[] = ' when you get a chance.';
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = 'Hmm? ';
$tags[] = id(new PhabricatorTagView())
@@ -63,7 +63,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBackgroundColor(PhabricatorTagView::COLOR_BLACK)
->setName('Abandoned');
$tags[] = '.';
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = 'I hope someone is going to ';
$tags[] = id(new PhabricatorTagView())
@@ -77,7 +77,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBackgroundColor(PhabricatorTagView::COLOR_REDORANGE)
->setName('High Priority');
$tags[] = '!';
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = id(new PhabricatorHeaderView())
@@ -89,7 +89,7 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor($color)
->setName(ucwords($color));
- $tags[] = '
';
+ $tags[] = hsprintf('
');
}
$tags[] = id(new PhabricatorHeaderView())
@@ -101,14 +101,14 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setDotColor(PhabricatorTagView::COLOR_RED)
->setBarColor(PhabricatorTagView::COLOR_RED)
->setName('Christmas');
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_OBJECT)
->setBackgroundColor(PhabricatorTagView::COLOR_ORANGE)
->setDotColor(PhabricatorTagView::COLOR_BLACK)
->setBarColor(PhabricatorTagView::COLOR_BLACK)
->setName('Halloween');
- $tags[] = '
';
+ $tags[] = hsprintf('
');
$tags[] = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_MAGENTA)
@@ -116,10 +116,9 @@ final class PhabricatorTagExample extends PhabricatorUIExample {
->setBarColor(PhabricatorTagView::COLOR_BLUE)
->setName('Easter');
- return array(
- '',
- $tags,
- '
',
- );
+ return phutil_tag(
+ 'div',
+ array('style' => 'padding: 1em 2em;'),
+ $tags);
}
}
diff --git a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php
index 429f6c1a12..3c53b2da47 100644
--- a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php
+++ b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php
@@ -23,7 +23,7 @@ final class PhabricatorUINotificationExample extends PhabricatorUIExample {
),
'Show Notification');
- $content = ''.$content.'';
+ $content = hsprintf('
%s
', $content);
return $content;
}
diff --git a/src/view/layout/AphrontMiniPanelView.php b/src/view/layout/AphrontMiniPanelView.php
index a0df4af89e..474eff4686 100644
--- a/src/view/layout/AphrontMiniPanelView.php
+++ b/src/view/layout/AphrontMiniPanelView.php
@@ -3,8 +3,9 @@
final class AphrontMiniPanelView extends AphrontView {
public function render() {
- return hsprintf(
- '
%s
',
+ return phutil_tag(
+ 'div',
+ array('class' => 'aphront-mini-panel-view'),
$this->renderChildren());
}
diff --git a/src/view/page/menu/PhabricatorMainMenuView.php b/src/view/page/menu/PhabricatorMainMenuView.php
index 4c071e183e..2234f92eee 100644
--- a/src/view/page/menu/PhabricatorMainMenuView.php
+++ b/src/view/page/menu/PhabricatorMainMenuView.php
@@ -409,7 +409,9 @@ final class PhabricatorMainMenuView extends AphrontView {
'');
return array(
- $bubble_tag.$message_tag, $notification_dropdown);
+ hsprintf('%s%s', $bubble_tag, $message_tag),
+ $notification_dropdown,
+ );
}
private function renderMenuIcon($name) {