1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-21 11:09:02 +01:00

Remove all calls to renderSingleView() and deprecate it

Summary: After D5305, this method does nothing since we automatically figure out what we need to do.

Test Plan:
- Viewed a page with the main menu on it (MainMenuView).
- Viewed a revision with transactions on it (TransactionView).
- Viewed timeline UIExample (TimelineView, TimelineEventView).
- Viewed a revision (PropertyListView).
- Viewed a profile (ProfileHeaderView).
- Viewed Pholio list (PinboardView, PinboardItemView).
- Viewed Config (ObjectItemView, ObjectItemListView).
- Viewed Home (MenuView).
- Viewed a revision (HeaderView, CrumbsView, ActionListView).
- Viewed a revision with an inline comment (anchorview).
- Viewed a Phriction diff page (AphrontCrumbsView).
  - Filed T2721 to get rid of this.
- Looked at Pholio and made inlines and comments (mockimages, pholioinlinecomment/save/edit).
- Looked at conpherences.
- Browsed around.

Reviewers: chad, vrana

Reviewed By: chad

CC: edward, aran

Differential Revision: https://secure.phabricator.com/D5307
This commit is contained in:
epriestley 2013-03-09 13:52:41 -08:00
parent 5e41ead7c7
commit 4c914a5c49
38 changed files with 194 additions and 236 deletions

View file

@ -115,12 +115,11 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue',
),
$this->renderSingleView(
array(
$name,
$description,
$next,
)));
array(
$name,
$description,
$next,
));
}
private function renderPhabricatorConfig(array $configs) {
@ -188,13 +187,12 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue-config',
),
self::renderSingleView(
array(
$table_info,
$table,
$update_info,
$update,
)));
array(
$table_info,
$table,
$update_info,
$update,
));
}
private function renderPHPConfig(array $configs) {
@ -294,12 +292,11 @@ final class PhabricatorSetupIssueView extends AphrontView {
array(
'class' => 'setup-issue-config',
),
$this->renderSingleView(
array(
$table_info,
$table,
$info,
)));
array(
$table_info,
$table,
$info,
));
}
private function renderValueTable(array $dict) {

View file

@ -58,7 +58,7 @@ final class ConpherenceFileWidgetView extends AphrontView {
->setNoDataString(pht('No files attached to conpherence.'))
->setHeaders(array('', pht('Name')))
->setColumnClasses(array('', 'wide wrap'));
return $this->renderSingleView(array($header, $table));
return array($header, $table);
}

View file

@ -139,14 +139,13 @@ final class ConpherenceMenuItemView extends AphrontTagView {
(int)$this->unreadCount);
}
return $this->renderSingleView(
array(
$image,
$title,
$subtitle,
$message,
$epoch,
$unread_count,
));
return array(
$image,
$title,
$subtitle,
$message,
$epoch,
$unread_count,
);
}
}

View file

@ -81,13 +81,13 @@ final class ConpherenceTransactionView extends AphrontView {
break;
}
$transaction_view
->appendChild(phutil_tag(
$transaction_view->appendChild(
phutil_tag(
'div',
array(
'class' => $content_class
),
$this->renderSingleView($content)));
$content));
return $transaction_view->render();
}

View file

@ -92,17 +92,16 @@ final class DifferentialChangesetDetailView extends AphrontView {
'class' => $class,
'id' => $id,
),
$this->renderSingleView(
array(
id(new PhabricatorAnchorView())
->setAnchorName($changeset->getAnchorName())
->setNavigationMarker(true)
->render(),
$buttons,
phutil_tag('h1', array(), $display_filename),
phutil_tag('div', array('style' => 'clear: both'), ''),
$this->renderChildren(),
)));
array(
id(new PhabricatorAnchorView())
->setAnchorName($changeset->getAnchorName())
->setNavigationMarker(true)
->render(),
$buttons,
phutil_tag('h1', array(), $display_filename),
phutil_tag('div', array('style' => 'clear: both'), ''),
$this->renderChildren(),
));
}
}

View file

@ -187,19 +187,18 @@ final class DifferentialChangesetListView extends AphrontView {
));
}
return $this->renderSingleView(
array(
id(new PhabricatorHeaderView())
->setHeader($this->getTitle())
->render(),
phutil_tag(
'div',
array(
'class' => 'differential-review-stage',
'id' => 'differential-review-stage',
),
$output),
));
return array(
id(new PhabricatorHeaderView())
->setHeader($this->getTitle())
->render(),
phutil_tag(
'div',
array(
'class' => 'differential-review-stage',
'id' => 'differential-review-stage',
),
$output),
);
}
/**

View file

@ -210,7 +210,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
$xaction_view->appendChild(hsprintf(
'<div class="differential-comment-core">%s%s</div>',
$content,
$this->renderSingleView($inline_render)));
$inline_render));
}
return $xaction_view->render();

View file

@ -144,7 +144,7 @@ final class DiffusionCommentView extends AphrontView {
$engine->getOutput(
$comment,
PhabricatorAuditComment::MARKUP_FIELD_BODY),
$this->renderSingleView($this->renderInlines()));
$this->renderInlines());
}
}

View file

@ -119,7 +119,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView {
: 'phabricator-feed-story',
'style' => $image_style,
),
$this->renderSingleView(array($head, $body, $foot)));
array($head, $body, $foot));
}
}

View file

@ -45,7 +45,7 @@ final class ManiphestTaskListView extends ManiphestView {
$views[] = $view->render();
}
return $this->renderSingleView($views);
return $views;
}
}

View file

@ -52,7 +52,7 @@ final class ManiphestTaskProjectsView extends ManiphestView {
"\xE2\x80\xA6");
}
return $this->renderSingleView($tags);
return $tags;
}
}

View file

@ -167,16 +167,11 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
'href' => $application ? $application->getBaseURI() : null,
'title' => $title,
),
$this->renderSingleView(
array(
$icon,
$content,
)));
return $this->renderSingleView(
array(
$app_button,
$create_button,
$icon,
$content,
));
return array($app_button, $create_button);
}
}

View file

@ -46,11 +46,10 @@ final class PholioInlineCommentEditView extends AphrontView {
'method' => 'POST',
'sigil' => 'inline-edit-form',
),
$this->renderSingleView(
array(
$this->renderInputs(),
$this->renderBody(),
)));
array(
$this->renderInputs(),
$this->renderBody(),
));
return $content;
}
@ -121,24 +120,22 @@ final class PholioInlineCommentEditView extends AphrontView {
array(
'class' => 'pholio-inline-comment-dialog-buttons',
),
$this->renderSingleView(
array(
$formatting,
$buttons,
phutil_tag('div', array('style' => 'clear: both'), ''),
)));
array(
$formatting,
$buttons,
phutil_tag('div', array('style' => 'clear: both'), ''),
));
return javelin_tag(
'div',
array(
'class' => 'pholio-inline-comment-dialog',
),
$this->renderSingleView(
array(
$title,
$body,
$edit,
)));
array(
$title,
$body,
$edit,
));
}
}

View file

@ -41,11 +41,10 @@ final class PholioInlineCommentSaveView extends AphrontView {
'class' => 'pholio-new-inline-comment',
'id' => 'pholio-new-inline-comment-dialog'
),
$this->renderSingleView(
array(
$this->renderInputs(),
$this->renderBody(),
)));
array(
$this->renderInputs(),
$this->renderBody(),
));
return $content;
}
@ -109,23 +108,21 @@ final class PholioInlineCommentSaveView extends AphrontView {
array(
'class' => 'pholio-inline-comment-dialog-buttons',
),
$this->renderSingleView(
array(
$formatting,
$buttons,
phutil_tag('div', array('style' => 'clear: both'), ''),
)));
array(
$formatting,
$buttons,
phutil_tag('div', array('style' => 'clear: both'), ''),
));
return javelin_tag(
'div',
array(
),
$this->renderSingleView(
array(
$title,
$body,
$edit,
)));
array(
$title,
$body,
$edit,
));
}
}

View file

@ -118,7 +118,7 @@ final class PholioInlineCommentView extends AphrontView {
$classes[] = 'pholio-inline-comment-draft';
}
$comment_block = javelin_tag(
return javelin_tag(
'div',
array(
'id' => "{$phid}_comment",
@ -129,8 +129,5 @@ final class PholioInlineCommentView extends AphrontView {
)
),
array($comment_header, $comment_body));
return $this->renderSingleView($comment_block);
}
}

View file

@ -94,13 +94,11 @@ final class PholioMockEmbedView extends AphrontView {
$icon_list);
$mock_view = phutil_tag(
return phutil_tag(
'div',
array(
'class' => 'pholio-mock-embed'
),
array($mock_header, $mock_body, $mock_footer));
return $this->renderSingleView($mock_view);
}
}

View file

@ -158,6 +158,6 @@ final class PholioMockImagesView extends AphrontView {
),
array($mock_wrapper, $carousel_holder, $inline_comments_holder));
return $this->renderSingleView($mockview);
return $mockview;
}
}

View file

@ -58,20 +58,19 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView {
if (!$user->isLoggedIn()) {
$uri = id(new PhutilURI('/login/'))
->setQueryParam('next', (string) $this->getRequestURI());
return self::renderSingleView(
phutil_tag(
'div',
return phutil_tag(
'div',
array(
'class' => 'login-to-comment'
),
javelin_tag(
'a',
array(
'class' => 'login-to-comment'
'class' => 'button',
'sigil' => 'workflow',
'href' => $uri
),
javelin_tag(
'a',
array(
'class' => 'button',
'sigil' => 'workflow',
'href' => $uri
),
pht('Login to Comment'))));
pht('Login to Comment')));
}
$data = array();
@ -97,11 +96,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView {
'draftKey' => $this->getDraft()->getDraftKey(),
));
return self::renderSingleView(
array(
$comment,
$preview,
));
return array($comment, $preview);
}
private function renderCommentPanel() {
@ -157,11 +152,10 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView {
'id' => $this->getPreviewPanelID(),
'style' => 'display: none',
),
self::renderSingleView(
array(
$header,
$preview,
)));
array(
$header,
$preview,
));
}
private function getPreviewPanelID() {

View file

@ -30,25 +30,18 @@ abstract class AphrontView extends Phobject
}
final protected function renderChildren() {
$out = array();
foreach ($this->children as $child) {
$out[] = $this->renderSingleView($child);
}
return $out;
return $this->children;
}
/**
* @deprecated
*/
final protected function renderSingleView($child) {
if ($child instanceof AphrontView) {
return $child->render();
} else if (is_array($child)) {
$out = array();
foreach ($child as $element) {
$out[] = $this->renderSingleView($element);
}
return phutil_implode_html('', $out);
} else {
return $child;
}
phutil_deprecated(
'AphrontView->renderSingleView()',
"This method no longer does anything; it can be removed and replaced ".
"with its arguments.");
return $child;
}
final protected function isEmptyContent($content) {

View file

@ -154,11 +154,10 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
array(
'sigil' => 'remarkup-assist-control',
),
$this->renderSingleView(
array(
$buttons,
parent::renderInput(),
)));
array(
$buttons,
parent::renderInput(),
));
}
}

View file

@ -15,7 +15,7 @@ final class AphrontCrumbsView extends AphrontView {
$out = array();
foreach ($this->crumbs as $crumb) {
$out[] = $this->renderSingleView($crumb);
$out[] = $crumb;
}
$out = phutil_implode_html(
hsprintf('<span class="aphront-crumbs-spacer">'."\xC2\xBB".'</span>'),

View file

@ -231,17 +231,16 @@ final class AphrontSideNavFilterView extends AphrontView {
),
'');
$local_menu = $this->renderSingleView(
array(
$menu_background,
phutil_tag(
'div',
array(
'class' => 'phabricator-nav-local phabricator-side-menu',
'id' => $local_id,
),
self::renderSingleView($this->menu->setID($this->getMenuID()))),
));
$local_menu = array(
$menu_background,
phutil_tag(
'div',
array(
'class' => 'phabricator-nav-local phabricator-side-menu',
'id' => $local_id,
),
$this->menu->setID($this->getMenuID())),
);
}
$crumbs = null;
@ -294,7 +293,7 @@ final class AphrontSideNavFilterView extends AphrontView {
),
array(
$crumbs,
phutil_implode_html('', $this->renderChildren()),
$this->renderChildren(),
))
));
}

View file

@ -42,7 +42,7 @@ final class PhabricatorActionListView extends AphrontView {
array(
'class' => 'phabricator-action-list-view',
),
$this->renderSingleView($actions));
$actions);
}

View file

@ -39,7 +39,7 @@ final class PhabricatorAnchorView extends AphrontView {
),
'');
return $this->renderSingleView(array($marker, $anchor));
return array($marker, $anchor);
}
}

View file

@ -55,7 +55,7 @@ final class PhabricatorCrumbsView extends AphrontView {
array(
'class' => 'phabricator-crumbs-actions',
),
$this->renderSingleView($actions));
$actions);
}
if ($this->crumbs) {
@ -68,11 +68,10 @@ final class PhabricatorCrumbsView extends AphrontView {
'class' => 'phabricator-crumbs-view '.
'sprite-gradient gradient-breadcrumbs',
),
$this->renderSingleView(
array(
$action_view,
$this->crumbs,
)));
array(
$action_view,
$this->crumbs,
));
}
}

View file

@ -44,7 +44,7 @@ final class PhabricatorHeaderView extends AphrontView {
array(
'class' => 'phabricator-header-tags',
),
$this->renderSingleView($this->tags));
$this->tags);
}
return phutil_tag(

View file

@ -114,14 +114,16 @@ final class PhabricatorMenuItemView extends AphrontTagView {
array(
'class' => 'phabricator-menu-item-name',
),
$this->name.$external);
array(
$this->name,
$external,
));
}
return $this->renderSingleView(
array(
$this->renderChildren(),
$name,
));
return array(
$this->renderChildren(),
$name,
);
}
}

View file

@ -168,6 +168,6 @@ final class PhabricatorMenuView extends AphrontTagView {
}
protected function getTagContent() {
return $this->renderSingleView($this->items);
return $this->items;
}
}

View file

@ -48,7 +48,7 @@ final class PhabricatorObjectItemListView extends AphrontView {
}
if ($this->items) {
$items = $this->renderSingleView($this->items);
$items = $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->renderSingleView($this->pager);
$pager = $this->pager;
}
$classes[] = 'phabricator-object-item-list-view';
@ -71,12 +71,11 @@ final class PhabricatorObjectItemListView extends AphrontView {
array(
'class' => implode(' ', $classes),
),
$this->renderSingleView(
array(
$header,
$items,
$pager,
)));
array(
$header,
$items,
$pager,
));
}
}

View file

@ -177,12 +177,11 @@ final class PhabricatorObjectItemView extends AphrontView {
array(
'class' => 'phabricator-object-item-content',
),
$this->renderSingleView(
array(
$header,
$attrs,
$this->renderChildren(),
)));
array(
$header,
$attrs,
$this->renderChildren(),
));
return phutil_tag(
'li',

View file

@ -103,13 +103,12 @@ final class PhabricatorPinboardItemView extends AphrontView {
array(
'class' => 'phabricator-pinboard-item-view',
),
$this->renderSingleView(
array(
$header,
$image,
$icons,
$content,
)));
array(
$header,
$image,
$icons,
$content,
));
}
}

View file

@ -31,7 +31,7 @@ final class PhabricatorPinboardView extends AphrontView {
array(
'class' => 'phabricator-pinboard-view',
),
$this->renderSingleView($this->items));
$this->items);
}
}

View file

@ -68,9 +68,9 @@ final class PhabricatorProfileHeaderView extends AphrontView {
</table>
%s',
$this->profileName,
self::renderSingleView($this->profileActions),
$this->profileActions,
$image,
$description,
phutil_implode_html('', $this->renderChildren()));
$this->renderChildren());
}
}

View file

@ -112,7 +112,7 @@ final class PhabricatorPropertyListView extends AphrontView {
array(
'class' => 'phabricator-property-list-view',
),
$this->renderSingleView($items));
$items);
}
private function renderPropertyPart(array $part) {
@ -133,7 +133,7 @@ final class PhabricatorPropertyListView extends AphrontView {
array(
'class' => 'phabricator-property-list-value',
),
$this->renderSingleView($value));
$value);
}
$list = phutil_tag(

View file

@ -138,7 +138,7 @@ final class PhabricatorTimelineEventView extends AphrontView {
),
array($title, $extra));
$title = $this->renderSingleView(array($icon, $title));
$title = array($icon, $title);
}
$wedge = phutil_tag(
@ -275,16 +275,15 @@ final class PhabricatorTimelineEventView extends AphrontView {
->setAnchorName($this->anchor)
->render();
$date = $this->renderSingleView(
array(
$anchor,
phutil_tag(
'a',
array(
'href' => '#'.$this->anchor,
),
$date),
));
$date = array(
$anchor,
phutil_tag(
'a',
array(
'href' => '#'.$this->anchor,
),
$date),
);
}
$extra[] = $date;
}

View file

@ -23,7 +23,7 @@ final class PhabricatorTimelineView extends AphrontView {
$events = array();
foreach ($this->events as $event) {
$events[] = $spacer;
$events[] = $this->renderSingleView($event);
$events[] = $event;
}
$events[] = $spacer;

View file

@ -124,7 +124,7 @@ final class PhabricatorTransactionView extends AphrontView {
}
private function renderTransactionActions() {
return phutil_implode_html('', $this->actions);
return $this->actions;
}
private function renderTransactionStyle() {
@ -143,7 +143,7 @@ final class PhabricatorTransactionView extends AphrontView {
return phutil_tag(
'div',
array('class' => 'phabricator-transaction-content'),
$this->renderSingleView($content));
$content);
}
}

View file

@ -56,7 +56,7 @@ final class PhabricatorMainMenuView extends AphrontView {
array(
'class' => 'phabricator-main-menu-alerts',
),
self::renderSingleView($alerts));
$alerts);
}
$application_menu = $this->getApplicationMenu();
@ -72,17 +72,15 @@ final class PhabricatorMainMenuView extends AphrontView {
'id' => $header_id,
),
array(
self::renderSingleView(array(
$this->renderPhabricatorMenuButton($header_id),
$application_menu
? $this->renderApplicationMenuButton($header_id)
: null,
$this->renderPhabricatorLogo(),
$alerts,
$phabricator_menu,
$application_menu,
)),
self::renderSingleView($menus),
$this->renderPhabricatorMenuButton($header_id),
$application_menu
? $this->renderApplicationMenuButton($header_id)
: null,
$this->renderPhabricatorLogo(),
$alerts,
$phabricator_menu,
$application_menu,
$menus,
));
}