diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 5fa0cd61d5..6912054f67 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -114,7 +114,7 @@ final class PhabricatorSetupIssueView extends AphrontView { array( 'class' => 'setup-issue', ), - $this->renderHTMLView( + $this->renderSingleView( array( $name, $description, @@ -187,7 +187,7 @@ final class PhabricatorSetupIssueView extends AphrontView { array( 'class' => 'setup-issue-config', ), - self::renderHTMLView( + self::renderSingleView( array( $table_info, $table, @@ -293,7 +293,7 @@ final class PhabricatorSetupIssueView extends AphrontView { array( 'class' => 'setup-issue-config', ), - $this->renderHTMLView( + $this->renderSingleView( array( $table_info, $table, diff --git a/src/applications/conpherence/view/ConpherenceMenuItemView.php b/src/applications/conpherence/view/ConpherenceMenuItemView.php index c69d7c502d..539a107122 100644 --- a/src/applications/conpherence/view/ConpherenceMenuItemView.php +++ b/src/applications/conpherence/view/ConpherenceMenuItemView.php @@ -139,7 +139,7 @@ final class ConpherenceMenuItemView extends AphrontTagView { (int)$this->unreadCount); } - return $this->renderHTMLView( + return $this->renderSingleView( array( $image, $title, diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php index 5c8c8a9ba1..7e5020fe90 100644 --- a/src/applications/conpherence/view/ConpherenceTransactionView.php +++ b/src/applications/conpherence/view/ConpherenceTransactionView.php @@ -91,7 +91,7 @@ final class ConpherenceTransactionView extends AphrontView { array( 'class' => $content_class ), - $this->renderHTMLView($content)) + $this->renderSingleView($content)) ); return $transaction_view->render(); diff --git a/src/applications/differential/view/DifferentialChangesetDetailView.php b/src/applications/differential/view/DifferentialChangesetDetailView.php index f77b5377d3..3810325ea2 100644 --- a/src/applications/differential/view/DifferentialChangesetDetailView.php +++ b/src/applications/differential/view/DifferentialChangesetDetailView.php @@ -92,7 +92,7 @@ final class DifferentialChangesetDetailView extends AphrontView { 'class' => $class, 'id' => $id, ), - $this->renderHTMLView( + $this->renderSingleView( array( id(new PhabricatorAnchorView()) ->setAnchorName($changeset->getAnchorName()) diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index aae5f31f23..5a3f531a1e 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -187,7 +187,7 @@ final class DifferentialChangesetListView extends AphrontView { )); } - return $this->renderHTMLView( + return $this->renderSingleView( array( id(new PhabricatorHeaderView()) ->setHeader($this->getTitle()) diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php index 1fccbe5f82..5bc2bbdb4a 100644 --- a/src/applications/differential/view/DifferentialInlineCommentEditView.php +++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php @@ -55,7 +55,7 @@ final class DifferentialInlineCommentEditView extends AphrontView { 'method' => 'POST', 'sigil' => 'inline-edit-form', ), - $this->renderHTMLView( + $this->renderSingleView( array( $this->renderInputs(), $this->renderBody(), @@ -130,7 +130,7 @@ final class DifferentialInlineCommentEditView extends AphrontView { array( 'class' => 'differential-inline-comment-edit-buttons', ), - $this->renderHTMLView( + $this->renderSingleView( array( $formatting, $buttons, @@ -148,7 +148,7 @@ final class DifferentialInlineCommentEditView extends AphrontView { 'length' => $this->length, ), ), - $this->renderHTMLView( + $this->renderSingleView( array( $title, $body, diff --git a/src/applications/maniphest/view/ManiphestTaskListView.php b/src/applications/maniphest/view/ManiphestTaskListView.php index f808ab9104..aa8baac074 100644 --- a/src/applications/maniphest/view/ManiphestTaskListView.php +++ b/src/applications/maniphest/view/ManiphestTaskListView.php @@ -45,7 +45,7 @@ final class ManiphestTaskListView extends ManiphestView { $views[] = $view->render(); } - return $this->renderHTMLView($views); + return $this->renderSingleView($views); } } diff --git a/src/applications/maniphest/view/ManiphestTaskProjectsView.php b/src/applications/maniphest/view/ManiphestTaskProjectsView.php index 00f4ad86f2..f292157a91 100644 --- a/src/applications/maniphest/view/ManiphestTaskProjectsView.php +++ b/src/applications/maniphest/view/ManiphestTaskProjectsView.php @@ -52,7 +52,7 @@ final class ManiphestTaskProjectsView extends ManiphestView { "\xE2\x80\xA6"); } - return $this->renderHTMLView($tags); + return $this->renderSingleView($tags); } } diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php index 8af4f65ff4..faa0c348ff 100644 --- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php +++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php @@ -128,13 +128,13 @@ final class PhabricatorApplicationLaunchView extends AphrontView { 'href' => $application ? $application->getBaseURI() : null, 'title' => $application ? $application->getShortDescription() : null, ), - $this->renderHTMLView( + $this->renderSingleView( array( $icon, $content, ))); - return $this->renderHTMLView( + return $this->renderSingleView( array( $app_button, $create_button, diff --git a/src/applications/pholio/view/PholioMockImagesView.php b/src/applications/pholio/view/PholioMockImagesView.php index 71d8615c8c..f75849f554 100644 --- a/src/applications/pholio/view/PholioMockImagesView.php +++ b/src/applications/pholio/view/PholioMockImagesView.php @@ -81,6 +81,6 @@ final class PholioMockImagesView extends AphrontView { $thumbnails); } - return $this->renderHTMLView($mockview); + return $this->renderSingleView($mockview); } } diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index aba6d84bab..a943ec6179 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -128,7 +128,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { 'id' => $this->getPreviewPanelID(), 'style' => 'display: none', ), - self::renderHTMLView( + self::renderSingleView( array( $header, $preview, diff --git a/src/docs/developer/rendering_html.diviner b/src/docs/developer/rendering_html.diviner index 617192d319..48f600f616 100644 --- a/src/docs/developer/rendering_html.diviner +++ b/src/docs/developer/rendering_html.diviner @@ -125,12 +125,12 @@ return `phutil_tag()` or `javelin_tag()`: return phutil_tag('div', ...); @{class:AphrontView} subclasses can use `renderHTMLChildren()` and -`renderHTMLView()` to build @{class@libphutil:PhutilSafeHTML} objects from +`renderSingleView()` to build @{class@libphutil:PhutilSafeHTML} objects from children or arbitrary lists of components. -@{class:AphrontView} subclasses should avoid `renderChildren()` and -`renderSingleView()` and transition callers to the `HTML` varieties. These older -methods do not return @{class@libphutil:PhutilSafeHTML} objects. +@{class:AphrontView} subclasses should avoid `renderChildren()` and transition +callers to `renderHTMLChildren()`. This older method does not return +@{class@libphutil:PhutilSafeHTML} objects. = Internationalization: pht() = diff --git a/src/view/AphrontView.php b/src/view/AphrontView.php index fa484885fe..b5bf238f7d 100644 --- a/src/view/AphrontView.php +++ b/src/view/AphrontView.php @@ -39,7 +39,7 @@ abstract class AphrontView extends Phobject { final protected function renderHTMLChildren() { $out = array(); foreach ($this->children as $child) { - $out[] = $this->renderHTMLView($child); + $out[] = $this->renderSingleView($child); } return $out; } @@ -58,22 +58,6 @@ abstract class AphrontView extends Phobject { } } - final protected function renderHTMLView($child) { - if ($child instanceof AphrontView) { - return $child->render(); - } else if ($child instanceof PhutilSafeHTML) { - return $child; - } else if (is_array($child)) { - $out = array(); - foreach ($child as $element) { - $out[] = $this->renderHTMLView($element); - } - return phutil_implode_html('', $out); - } else { - return hsprintf('%s', $child); - } - } - final protected function isEmptyContent($content) { if (is_array($content)) { foreach ($content as $element) { diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index e34f090fcb..3ca49c2120 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -154,7 +154,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { array( 'sigil' => 'remarkup-assist-control', ), - $this->renderHTMLView( + $this->renderSingleView( array( $buttons, parent::renderInput(), diff --git a/src/view/layout/AphrontSideNavFilterView.php b/src/view/layout/AphrontSideNavFilterView.php index a7f295fb25..f37222f919 100644 --- a/src/view/layout/AphrontSideNavFilterView.php +++ b/src/view/layout/AphrontSideNavFilterView.php @@ -231,7 +231,7 @@ final class AphrontSideNavFilterView extends AphrontView { ), ''); - $local_menu = $this->renderHTMLView( + $local_menu = $this->renderSingleView( array( $menu_background, phutil_tag( diff --git a/src/view/layout/PhabricatorActionListView.php b/src/view/layout/PhabricatorActionListView.php index d4a9a22fdf..3240a821ed 100644 --- a/src/view/layout/PhabricatorActionListView.php +++ b/src/view/layout/PhabricatorActionListView.php @@ -42,7 +42,7 @@ final class PhabricatorActionListView extends AphrontView { array( 'class' => 'phabricator-action-list-view', ), - $this->renderHTMLView($actions)); + $this->renderSingleView($actions)); } diff --git a/src/view/layout/PhabricatorAnchorView.php b/src/view/layout/PhabricatorAnchorView.php index 44e8f33730..6ffd7e59fe 100644 --- a/src/view/layout/PhabricatorAnchorView.php +++ b/src/view/layout/PhabricatorAnchorView.php @@ -39,7 +39,7 @@ final class PhabricatorAnchorView extends AphrontView { ), ''); - return $this->renderHTMLView(array($marker, $anchor)); + return $this->renderSingleView(array($marker, $anchor)); } } diff --git a/src/view/layout/PhabricatorCrumbsView.php b/src/view/layout/PhabricatorCrumbsView.php index f621394f1e..2ee9d48022 100644 --- a/src/view/layout/PhabricatorCrumbsView.php +++ b/src/view/layout/PhabricatorCrumbsView.php @@ -55,7 +55,7 @@ final class PhabricatorCrumbsView extends AphrontView { array( 'class' => 'phabricator-crumbs-actions', ), - $this->renderHTMLView($actions)); + $this->renderSingleView($actions)); } if ($this->crumbs) { @@ -68,7 +68,7 @@ final class PhabricatorCrumbsView extends AphrontView { 'class' => 'phabricator-crumbs-view '. 'sprite-gradient gradient-breadcrumbs', ), - $this->renderHTMLView( + $this->renderSingleView( array( $action_view, $this->crumbs, diff --git a/src/view/layout/PhabricatorHeaderView.php b/src/view/layout/PhabricatorHeaderView.php index 8652de7095..63e0d9e930 100644 --- a/src/view/layout/PhabricatorHeaderView.php +++ b/src/view/layout/PhabricatorHeaderView.php @@ -44,7 +44,7 @@ final class PhabricatorHeaderView extends AphrontView { array( 'class' => 'phabricator-header-tags', ), - $this->renderHTMLView($this->tags)); + $this->renderSingleView($this->tags)); } return phutil_tag( diff --git a/src/view/layout/PhabricatorMenuItemView.php b/src/view/layout/PhabricatorMenuItemView.php index 934c93c940..28fa9584f0 100644 --- a/src/view/layout/PhabricatorMenuItemView.php +++ b/src/view/layout/PhabricatorMenuItemView.php @@ -117,7 +117,7 @@ final class PhabricatorMenuItemView extends AphrontTagView { $this->name.$external); } - return $this->renderHTMLView( + return $this->renderSingleView( array( $this->renderHTMLChildren(), $name, diff --git a/src/view/layout/PhabricatorMenuView.php b/src/view/layout/PhabricatorMenuView.php index c3a27a173a..c350d00351 100644 --- a/src/view/layout/PhabricatorMenuView.php +++ b/src/view/layout/PhabricatorMenuView.php @@ -167,6 +167,6 @@ final class PhabricatorMenuView extends AphrontTagView { } protected function getTagContent() { - return $this->renderHTMLView($this->items); + return $this->renderSingleView($this->items); } } diff --git a/src/view/layout/PhabricatorObjectItemListView.php b/src/view/layout/PhabricatorObjectItemListView.php index cc9abb01a4..d98feaef38 100644 --- a/src/view/layout/PhabricatorObjectItemListView.php +++ b/src/view/layout/PhabricatorObjectItemListView.php @@ -48,7 +48,7 @@ final class PhabricatorObjectItemListView extends AphrontView { } if ($this->items) { - $items = $this->renderHTMLView($this->items); + $items = $this->renderSingleView($this->items); } else { $string = nonempty($this->noDataString, pht('No data.')); $items = id(new AphrontErrorView()) @@ -58,7 +58,7 @@ final class PhabricatorObjectItemListView extends AphrontView { $pager = null; if ($this->pager) { - $pager = $this->renderHTMLView($this->pager); + $pager = $this->renderSingleView($this->pager); } $classes[] = 'phabricator-object-item-list-view'; @@ -71,7 +71,7 @@ final class PhabricatorObjectItemListView extends AphrontView { array( 'class' => implode(' ', $classes), ), - $this->renderHTMLView( + $this->renderSingleView( array( $header, $items, diff --git a/src/view/layout/PhabricatorObjectItemView.php b/src/view/layout/PhabricatorObjectItemView.php index c6646f2f9e..c0ce3506ba 100644 --- a/src/view/layout/PhabricatorObjectItemView.php +++ b/src/view/layout/PhabricatorObjectItemView.php @@ -166,7 +166,7 @@ final class PhabricatorObjectItemView extends AphrontView { array( 'class' => 'phabricator-object-item-content', ), - $this->renderHTMLView( + $this->renderSingleView( array( $header, $attrs, diff --git a/src/view/layout/PhabricatorPinboardItemView.php b/src/view/layout/PhabricatorPinboardItemView.php index 683a6cf4dd..d83a1d0a6d 100644 --- a/src/view/layout/PhabricatorPinboardItemView.php +++ b/src/view/layout/PhabricatorPinboardItemView.php @@ -70,7 +70,7 @@ final class PhabricatorPinboardItemView extends AphrontView { array( 'class' => 'phabricator-pinboard-item-view', ), - $this->renderHTMLView( + $this->renderSingleView( array( $header, $image, diff --git a/src/view/layout/PhabricatorPinboardView.php b/src/view/layout/PhabricatorPinboardView.php index f62a2be459..ace3b0b34f 100644 --- a/src/view/layout/PhabricatorPinboardView.php +++ b/src/view/layout/PhabricatorPinboardView.php @@ -31,7 +31,7 @@ final class PhabricatorPinboardView extends AphrontView { array( 'class' => 'phabricator-pinboard-view', ), - $this->renderHTMLView($this->items)); + $this->renderSingleView($this->items)); } } diff --git a/src/view/layout/PhabricatorPropertyListView.php b/src/view/layout/PhabricatorPropertyListView.php index 3cedcdbbf9..b0e0afbfbb 100644 --- a/src/view/layout/PhabricatorPropertyListView.php +++ b/src/view/layout/PhabricatorPropertyListView.php @@ -78,7 +78,7 @@ final class PhabricatorPropertyListView extends AphrontView { array( 'class' => 'phabricator-property-list-view', ), - $this->renderHTMLView($items)); + $this->renderSingleView($items)); } private function renderPropertyPart(array $part) { @@ -99,7 +99,7 @@ final class PhabricatorPropertyListView extends AphrontView { array( 'class' => 'phabricator-property-list-value', ), - $this->renderHTMLView($value)); + $this->renderSingleView($value)); } $list = phutil_tag( @@ -107,7 +107,7 @@ final class PhabricatorPropertyListView extends AphrontView { array( 'class' => 'phabricator-property-list-properties', ), - $this->renderHTMLView($items)); + $this->renderSingleView($items)); $shortcuts = null; if ($this->hasKeyboardShortcuts) { diff --git a/src/view/layout/PhabricatorTimelineEventView.php b/src/view/layout/PhabricatorTimelineEventView.php index 0bb29a2bbd..8534b05076 100644 --- a/src/view/layout/PhabricatorTimelineEventView.php +++ b/src/view/layout/PhabricatorTimelineEventView.php @@ -138,7 +138,7 @@ final class PhabricatorTimelineEventView extends AphrontView { ), array($title, $extra)); - $title = $this->renderHTMLView(array($icon, $title)); + $title = $this->renderSingleView(array($icon, $title)); } $wedge = phutil_tag( @@ -275,7 +275,7 @@ final class PhabricatorTimelineEventView extends AphrontView { ->setAnchorName($this->anchor) ->render(); - $date = $this->renderHTMLView( + $date = $this->renderSingleView( array( $anchor, phutil_tag(