@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.

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

+194 -236
+16 -19
src/applications/config/view/PhabricatorSetupIssueView.php
··· 115 115 array( 116 116 'class' => 'setup-issue', 117 117 ), 118 - $this->renderSingleView( 119 - array( 120 - $name, 121 - $description, 122 - $next, 123 - ))); 118 + array( 119 + $name, 120 + $description, 121 + $next, 122 + )); 124 123 } 125 124 126 125 private function renderPhabricatorConfig(array $configs) { ··· 188 187 array( 189 188 'class' => 'setup-issue-config', 190 189 ), 191 - self::renderSingleView( 192 - array( 193 - $table_info, 194 - $table, 195 - $update_info, 196 - $update, 197 - ))); 190 + array( 191 + $table_info, 192 + $table, 193 + $update_info, 194 + $update, 195 + )); 198 196 } 199 197 200 198 private function renderPHPConfig(array $configs) { ··· 294 292 array( 295 293 'class' => 'setup-issue-config', 296 294 ), 297 - $this->renderSingleView( 298 - array( 299 - $table_info, 300 - $table, 301 - $info, 302 - ))); 295 + array( 296 + $table_info, 297 + $table, 298 + $info, 299 + )); 303 300 } 304 301 305 302 private function renderValueTable(array $dict) {
+1 -1
src/applications/conpherence/view/ConpherenceFileWidgetView.php
··· 58 58 ->setNoDataString(pht('No files attached to conpherence.')) 59 59 ->setHeaders(array('', pht('Name'))) 60 60 ->setColumnClasses(array('', 'wide wrap')); 61 - return $this->renderSingleView(array($header, $table)); 61 + return array($header, $table); 62 62 63 63 } 64 64
+8 -9
src/applications/conpherence/view/ConpherenceMenuItemView.php
··· 139 139 (int)$this->unreadCount); 140 140 } 141 141 142 - return $this->renderSingleView( 143 - array( 144 - $image, 145 - $title, 146 - $subtitle, 147 - $message, 148 - $epoch, 149 - $unread_count, 150 - )); 142 + return array( 143 + $image, 144 + $title, 145 + $subtitle, 146 + $message, 147 + $epoch, 148 + $unread_count, 149 + ); 151 150 } 152 151 }
+3 -3
src/applications/conpherence/view/ConpherenceTransactionView.php
··· 81 81 break; 82 82 } 83 83 84 - $transaction_view 85 - ->appendChild(phutil_tag( 84 + $transaction_view->appendChild( 85 + phutil_tag( 86 86 'div', 87 87 array( 88 88 'class' => $content_class 89 89 ), 90 - $this->renderSingleView($content))); 90 + $content)); 91 91 92 92 return $transaction_view->render(); 93 93 }
+10 -11
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 92 92 'class' => $class, 93 93 'id' => $id, 94 94 ), 95 - $this->renderSingleView( 96 - array( 97 - id(new PhabricatorAnchorView()) 98 - ->setAnchorName($changeset->getAnchorName()) 99 - ->setNavigationMarker(true) 100 - ->render(), 101 - $buttons, 102 - phutil_tag('h1', array(), $display_filename), 103 - phutil_tag('div', array('style' => 'clear: both'), ''), 104 - $this->renderChildren(), 105 - ))); 95 + array( 96 + id(new PhabricatorAnchorView()) 97 + ->setAnchorName($changeset->getAnchorName()) 98 + ->setNavigationMarker(true) 99 + ->render(), 100 + $buttons, 101 + phutil_tag('h1', array(), $display_filename), 102 + phutil_tag('div', array('style' => 'clear: both'), ''), 103 + $this->renderChildren(), 104 + )); 106 105 } 107 106 108 107 }
+12 -13
src/applications/differential/view/DifferentialChangesetListView.php
··· 187 187 )); 188 188 } 189 189 190 - return $this->renderSingleView( 191 - array( 192 - id(new PhabricatorHeaderView()) 193 - ->setHeader($this->getTitle()) 194 - ->render(), 195 - phutil_tag( 196 - 'div', 197 - array( 198 - 'class' => 'differential-review-stage', 199 - 'id' => 'differential-review-stage', 200 - ), 201 - $output), 202 - )); 190 + return array( 191 + id(new PhabricatorHeaderView()) 192 + ->setHeader($this->getTitle()) 193 + ->render(), 194 + phutil_tag( 195 + 'div', 196 + array( 197 + 'class' => 'differential-review-stage', 198 + 'id' => 'differential-review-stage', 199 + ), 200 + $output), 201 + ); 203 202 } 204 203 205 204 /**
+1 -1
src/applications/differential/view/DifferentialRevisionCommentView.php
··· 210 210 $xaction_view->appendChild(hsprintf( 211 211 '<div class="differential-comment-core">%s%s</div>', 212 212 $content, 213 - $this->renderSingleView($inline_render))); 213 + $inline_render)); 214 214 } 215 215 216 216 return $xaction_view->render();
+1 -1
src/applications/diffusion/view/DiffusionCommentView.php
··· 144 144 $engine->getOutput( 145 145 $comment, 146 146 PhabricatorAuditComment::MARKUP_FIELD_BODY), 147 - $this->renderSingleView($this->renderInlines())); 147 + $this->renderInlines()); 148 148 } 149 149 } 150 150
+1 -1
src/applications/feed/view/PhabricatorFeedStoryView.php
··· 119 119 : 'phabricator-feed-story', 120 120 'style' => $image_style, 121 121 ), 122 - $this->renderSingleView(array($head, $body, $foot))); 122 + array($head, $body, $foot)); 123 123 } 124 124 125 125 }
+1 -1
src/applications/maniphest/view/ManiphestTaskListView.php
··· 45 45 $views[] = $view->render(); 46 46 } 47 47 48 - return $this->renderSingleView($views); 48 + return $views; 49 49 } 50 50 51 51 }
+1 -1
src/applications/maniphest/view/ManiphestTaskProjectsView.php
··· 52 52 "\xE2\x80\xA6"); 53 53 } 54 54 55 - return $this->renderSingleView($tags); 55 + return $tags; 56 56 } 57 57 58 58 }
+4 -9
src/applications/meta/view/PhabricatorApplicationLaunchView.php
··· 167 167 'href' => $application ? $application->getBaseURI() : null, 168 168 'title' => $title, 169 169 ), 170 - $this->renderSingleView( 171 - array( 172 - $icon, 173 - $content, 174 - ))); 175 - 176 - return $this->renderSingleView( 177 170 array( 178 - $app_button, 179 - $create_button, 171 + $icon, 172 + $content, 180 173 )); 174 + 175 + return array($app_button, $create_button); 181 176 } 182 177 }
+14 -17
src/applications/pholio/view/PholioInlineCommentEditView.php
··· 46 46 'method' => 'POST', 47 47 'sigil' => 'inline-edit-form', 48 48 ), 49 - $this->renderSingleView( 50 - array( 51 - $this->renderInputs(), 52 - $this->renderBody(), 53 - ))); 49 + array( 50 + $this->renderInputs(), 51 + $this->renderBody(), 52 + )); 54 53 55 54 return $content; 56 55 } ··· 121 120 array( 122 121 'class' => 'pholio-inline-comment-dialog-buttons', 123 122 ), 124 - $this->renderSingleView( 125 - array( 126 - $formatting, 127 - $buttons, 128 - phutil_tag('div', array('style' => 'clear: both'), ''), 129 - ))); 123 + array( 124 + $formatting, 125 + $buttons, 126 + phutil_tag('div', array('style' => 'clear: both'), ''), 127 + )); 130 128 131 129 return javelin_tag( 132 130 'div', 133 131 array( 134 132 'class' => 'pholio-inline-comment-dialog', 135 133 ), 136 - $this->renderSingleView( 137 - array( 138 - $title, 139 - $body, 140 - $edit, 141 - ))); 134 + array( 135 + $title, 136 + $body, 137 + $edit, 138 + )); 142 139 } 143 140 144 141 }
+14 -17
src/applications/pholio/view/PholioInlineCommentSaveView.php
··· 41 41 'class' => 'pholio-new-inline-comment', 42 42 'id' => 'pholio-new-inline-comment-dialog' 43 43 ), 44 - $this->renderSingleView( 45 - array( 46 - $this->renderInputs(), 47 - $this->renderBody(), 48 - ))); 44 + array( 45 + $this->renderInputs(), 46 + $this->renderBody(), 47 + )); 49 48 50 49 return $content; 51 50 } ··· 109 108 array( 110 109 'class' => 'pholio-inline-comment-dialog-buttons', 111 110 ), 112 - $this->renderSingleView( 113 - array( 114 - $formatting, 115 - $buttons, 116 - phutil_tag('div', array('style' => 'clear: both'), ''), 117 - ))); 111 + array( 112 + $formatting, 113 + $buttons, 114 + phutil_tag('div', array('style' => 'clear: both'), ''), 115 + )); 118 116 119 117 return javelin_tag( 120 118 'div', 121 119 array( 122 120 ), 123 - $this->renderSingleView( 124 - array( 125 - $title, 126 - $body, 127 - $edit, 128 - ))); 121 + array( 122 + $title, 123 + $body, 124 + $edit, 125 + )); 129 126 } 130 127 131 128 }
+1 -4
src/applications/pholio/view/PholioInlineCommentView.php
··· 118 118 $classes[] = 'pholio-inline-comment-draft'; 119 119 } 120 120 121 - $comment_block = javelin_tag( 121 + return javelin_tag( 122 122 'div', 123 123 array( 124 124 'id' => "{$phid}_comment", ··· 129 129 ) 130 130 ), 131 131 array($comment_header, $comment_body)); 132 - 133 - 134 - return $this->renderSingleView($comment_block); 135 132 } 136 133 }
+1 -3
src/applications/pholio/view/PholioMockEmbedView.php
··· 94 94 $icon_list); 95 95 96 96 97 - $mock_view = phutil_tag( 97 + return phutil_tag( 98 98 'div', 99 99 array( 100 100 'class' => 'pholio-mock-embed' 101 101 ), 102 102 array($mock_header, $mock_body, $mock_footer)); 103 - 104 - return $this->renderSingleView($mock_view); 105 103 } 106 104 }
+1 -1
src/applications/pholio/view/PholioMockImagesView.php
··· 158 158 ), 159 159 array($mock_wrapper, $carousel_holder, $inline_comments_holder)); 160 160 161 - return $this->renderSingleView($mockview); 161 + return $mockview; 162 162 } 163 163 }
+16 -22
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 58 58 if (!$user->isLoggedIn()) { 59 59 $uri = id(new PhutilURI('/login/')) 60 60 ->setQueryParam('next', (string) $this->getRequestURI()); 61 - return self::renderSingleView( 62 - phutil_tag( 63 - 'div', 61 + return phutil_tag( 62 + 'div', 63 + array( 64 + 'class' => 'login-to-comment' 65 + ), 66 + javelin_tag( 67 + 'a', 64 68 array( 65 - 'class' => 'login-to-comment' 69 + 'class' => 'button', 70 + 'sigil' => 'workflow', 71 + 'href' => $uri 66 72 ), 67 - javelin_tag( 68 - 'a', 69 - array( 70 - 'class' => 'button', 71 - 'sigil' => 'workflow', 72 - 'href' => $uri 73 - ), 74 - pht('Login to Comment')))); 73 + pht('Login to Comment'))); 75 74 } 76 75 77 76 $data = array(); ··· 97 96 'draftKey' => $this->getDraft()->getDraftKey(), 98 97 )); 99 98 100 - return self::renderSingleView( 101 - array( 102 - $comment, 103 - $preview, 104 - )); 99 + return array($comment, $preview); 105 100 } 106 101 107 102 private function renderCommentPanel() { ··· 157 152 'id' => $this->getPreviewPanelID(), 158 153 'style' => 'display: none', 159 154 ), 160 - self::renderSingleView( 161 - array( 162 - $header, 163 - $preview, 164 - ))); 155 + array( 156 + $header, 157 + $preview, 158 + )); 165 159 } 166 160 167 161 private function getPreviewPanelID() {
+9 -16
src/view/AphrontView.php
··· 30 30 } 31 31 32 32 final protected function renderChildren() { 33 - $out = array(); 34 - foreach ($this->children as $child) { 35 - $out[] = $this->renderSingleView($child); 36 - } 37 - return $out; 33 + return $this->children; 38 34 } 39 35 36 + /** 37 + * @deprecated 38 + */ 40 39 final protected function renderSingleView($child) { 41 - if ($child instanceof AphrontView) { 42 - return $child->render(); 43 - } else if (is_array($child)) { 44 - $out = array(); 45 - foreach ($child as $element) { 46 - $out[] = $this->renderSingleView($element); 47 - } 48 - return phutil_implode_html('', $out); 49 - } else { 50 - return $child; 51 - } 40 + phutil_deprecated( 41 + 'AphrontView->renderSingleView()', 42 + "This method no longer does anything; it can be removed and replaced ". 43 + "with its arguments."); 44 + return $child; 52 45 } 53 46 54 47 final protected function isEmptyContent($content) {
+4 -5
src/view/form/control/PhabricatorRemarkupControl.php
··· 154 154 array( 155 155 'sigil' => 'remarkup-assist-control', 156 156 ), 157 - $this->renderSingleView( 158 - array( 159 - $buttons, 160 - parent::renderInput(), 161 - ))); 157 + array( 158 + $buttons, 159 + parent::renderInput(), 160 + )); 162 161 } 163 162 164 163 }
+1 -1
src/view/layout/AphrontCrumbsView.php
··· 15 15 16 16 $out = array(); 17 17 foreach ($this->crumbs as $crumb) { 18 - $out[] = $this->renderSingleView($crumb); 18 + $out[] = $crumb; 19 19 } 20 20 $out = phutil_implode_html( 21 21 hsprintf('<span class="aphront-crumbs-spacer">'."\xC2\xBB".'</span>'),
+11 -12
src/view/layout/AphrontSideNavFilterView.php
··· 231 231 ), 232 232 ''); 233 233 234 - $local_menu = $this->renderSingleView( 235 - array( 236 - $menu_background, 237 - phutil_tag( 238 - 'div', 239 - array( 240 - 'class' => 'phabricator-nav-local phabricator-side-menu', 241 - 'id' => $local_id, 242 - ), 243 - self::renderSingleView($this->menu->setID($this->getMenuID()))), 244 - )); 234 + $local_menu = array( 235 + $menu_background, 236 + phutil_tag( 237 + 'div', 238 + array( 239 + 'class' => 'phabricator-nav-local phabricator-side-menu', 240 + 'id' => $local_id, 241 + ), 242 + $this->menu->setID($this->getMenuID())), 243 + ); 245 244 } 246 245 247 246 $crumbs = null; ··· 294 293 ), 295 294 array( 296 295 $crumbs, 297 - phutil_implode_html('', $this->renderChildren()), 296 + $this->renderChildren(), 298 297 )) 299 298 )); 300 299 }
+1 -1
src/view/layout/PhabricatorActionListView.php
··· 42 42 array( 43 43 'class' => 'phabricator-action-list-view', 44 44 ), 45 - $this->renderSingleView($actions)); 45 + $actions); 46 46 } 47 47 48 48
+1 -1
src/view/layout/PhabricatorAnchorView.php
··· 39 39 ), 40 40 ''); 41 41 42 - return $this->renderSingleView(array($marker, $anchor)); 42 + return array($marker, $anchor); 43 43 } 44 44 45 45 }
+5 -6
src/view/layout/PhabricatorCrumbsView.php
··· 55 55 array( 56 56 'class' => 'phabricator-crumbs-actions', 57 57 ), 58 - $this->renderSingleView($actions)); 58 + $actions); 59 59 } 60 60 61 61 if ($this->crumbs) { ··· 68 68 'class' => 'phabricator-crumbs-view '. 69 69 'sprite-gradient gradient-breadcrumbs', 70 70 ), 71 - $this->renderSingleView( 72 - array( 73 - $action_view, 74 - $this->crumbs, 75 - ))); 71 + array( 72 + $action_view, 73 + $this->crumbs, 74 + )); 76 75 } 77 76 78 77 }
+1 -1
src/view/layout/PhabricatorHeaderView.php
··· 44 44 array( 45 45 'class' => 'phabricator-header-tags', 46 46 ), 47 - $this->renderSingleView($this->tags)); 47 + $this->tags); 48 48 } 49 49 50 50 return phutil_tag(
+8 -6
src/view/layout/PhabricatorMenuItemView.php
··· 114 114 array( 115 115 'class' => 'phabricator-menu-item-name', 116 116 ), 117 - $this->name.$external); 117 + array( 118 + $this->name, 119 + $external, 120 + )); 118 121 } 119 122 120 - return $this->renderSingleView( 121 - array( 122 - $this->renderChildren(), 123 - $name, 124 - )); 123 + return array( 124 + $this->renderChildren(), 125 + $name, 126 + ); 125 127 } 126 128 127 129 }
+1 -1
src/view/layout/PhabricatorMenuView.php
··· 168 168 } 169 169 170 170 protected function getTagContent() { 171 - return $this->renderSingleView($this->items); 171 + return $this->items; 172 172 } 173 173 }
+7 -8
src/view/layout/PhabricatorObjectItemListView.php
··· 48 48 } 49 49 50 50 if ($this->items) { 51 - $items = $this->renderSingleView($this->items); 51 + $items = $this->items; 52 52 } else { 53 53 $string = nonempty($this->noDataString, pht('No data.')); 54 54 $items = id(new AphrontErrorView()) ··· 58 58 59 59 $pager = null; 60 60 if ($this->pager) { 61 - $pager = $this->renderSingleView($this->pager); 61 + $pager = $this->pager; 62 62 } 63 63 64 64 $classes[] = 'phabricator-object-item-list-view'; ··· 71 71 array( 72 72 'class' => implode(' ', $classes), 73 73 ), 74 - $this->renderSingleView( 75 - array( 76 - $header, 77 - $items, 78 - $pager, 79 - ))); 74 + array( 75 + $header, 76 + $items, 77 + $pager, 78 + )); 80 79 } 81 80 82 81 }
+5 -6
src/view/layout/PhabricatorObjectItemView.php
··· 177 177 array( 178 178 'class' => 'phabricator-object-item-content', 179 179 ), 180 - $this->renderSingleView( 181 - array( 182 - $header, 183 - $attrs, 184 - $this->renderChildren(), 185 - ))); 180 + array( 181 + $header, 182 + $attrs, 183 + $this->renderChildren(), 184 + )); 186 185 187 186 return phutil_tag( 188 187 'li',
+6 -7
src/view/layout/PhabricatorPinboardItemView.php
··· 103 103 array( 104 104 'class' => 'phabricator-pinboard-item-view', 105 105 ), 106 - $this->renderSingleView( 107 - array( 108 - $header, 109 - $image, 110 - $icons, 111 - $content, 112 - ))); 106 + array( 107 + $header, 108 + $image, 109 + $icons, 110 + $content, 111 + )); 113 112 } 114 113 115 114 }
+1 -1
src/view/layout/PhabricatorPinboardView.php
··· 31 31 array( 32 32 'class' => 'phabricator-pinboard-view', 33 33 ), 34 - $this->renderSingleView($this->items)); 34 + $this->items); 35 35 } 36 36 37 37 }
+2 -2
src/view/layout/PhabricatorProfileHeaderView.php
··· 68 68 </table> 69 69 %s', 70 70 $this->profileName, 71 - self::renderSingleView($this->profileActions), 71 + $this->profileActions, 72 72 $image, 73 73 $description, 74 - phutil_implode_html('', $this->renderChildren())); 74 + $this->renderChildren()); 75 75 } 76 76 }
+2 -2
src/view/layout/PhabricatorPropertyListView.php
··· 112 112 array( 113 113 'class' => 'phabricator-property-list-view', 114 114 ), 115 - $this->renderSingleView($items)); 115 + $items); 116 116 } 117 117 118 118 private function renderPropertyPart(array $part) { ··· 133 133 array( 134 134 'class' => 'phabricator-property-list-value', 135 135 ), 136 - $this->renderSingleView($value)); 136 + $value); 137 137 } 138 138 139 139 $list = phutil_tag(
+10 -11
src/view/layout/PhabricatorTimelineEventView.php
··· 138 138 ), 139 139 array($title, $extra)); 140 140 141 - $title = $this->renderSingleView(array($icon, $title)); 141 + $title = array($icon, $title); 142 142 } 143 143 144 144 $wedge = phutil_tag( ··· 275 275 ->setAnchorName($this->anchor) 276 276 ->render(); 277 277 278 - $date = $this->renderSingleView( 279 - array( 280 - $anchor, 281 - phutil_tag( 282 - 'a', 283 - array( 284 - 'href' => '#'.$this->anchor, 285 - ), 286 - $date), 287 - )); 278 + $date = array( 279 + $anchor, 280 + phutil_tag( 281 + 'a', 282 + array( 283 + 'href' => '#'.$this->anchor, 284 + ), 285 + $date), 286 + ); 288 287 } 289 288 $extra[] = $date; 290 289 }
+1 -1
src/view/layout/PhabricatorTimelineView.php
··· 23 23 $events = array(); 24 24 foreach ($this->events as $event) { 25 25 $events[] = $spacer; 26 - $events[] = $this->renderSingleView($event); 26 + $events[] = $event; 27 27 } 28 28 $events[] = $spacer; 29 29
+2 -2
src/view/layout/PhabricatorTransactionView.php
··· 124 124 } 125 125 126 126 private function renderTransactionActions() { 127 - return phutil_implode_html('', $this->actions); 127 + return $this->actions; 128 128 } 129 129 130 130 private function renderTransactionStyle() { ··· 143 143 return phutil_tag( 144 144 'div', 145 145 array('class' => 'phabricator-transaction-content'), 146 - $this->renderSingleView($content)); 146 + $content); 147 147 } 148 148 149 149 }
+10 -12
src/view/page/menu/PhabricatorMainMenuView.php
··· 56 56 array( 57 57 'class' => 'phabricator-main-menu-alerts', 58 58 ), 59 - self::renderSingleView($alerts)); 59 + $alerts); 60 60 } 61 61 62 62 $application_menu = $this->getApplicationMenu(); ··· 72 72 'id' => $header_id, 73 73 ), 74 74 array( 75 - self::renderSingleView(array( 76 - $this->renderPhabricatorMenuButton($header_id), 77 - $application_menu 78 - ? $this->renderApplicationMenuButton($header_id) 79 - : null, 80 - $this->renderPhabricatorLogo(), 81 - $alerts, 82 - $phabricator_menu, 83 - $application_menu, 84 - )), 85 - self::renderSingleView($menus), 75 + $this->renderPhabricatorMenuButton($header_id), 76 + $application_menu 77 + ? $this->renderApplicationMenuButton($header_id) 78 + : null, 79 + $this->renderPhabricatorLogo(), 80 + $alerts, 81 + $phabricator_menu, 82 + $application_menu, 83 + $menus, 86 84 )); 87 85 } 88 86