From ebc2937dc89f4d62563681e5d9c408a4be08cdf9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 4 Feb 2013 11:38:04 -0800 Subject: [PATCH] render_tag -> tag: final block Summary: Convert a final few `render_tag()` calls to `tag()` calls. This leaves us with 36 calls: - 9 are in Conpherence, and will be converted after merging. Using Views makes the most sense here, to get access to renderHTMLView() and such. - 2 are the definition and its library map entry. - 3 are in the documentation. - I believe the remaining 22 are too difficult to convert pre-merge. About half are in code which is slated for destruction; the other half are in the base implementations of very common classes (like PhabricatorStandardPageView) and can only be converted by converting the entire codebase. My plan at this point is: - Test the branch thoroughly. - Merge to master. - Over time, resolve the remaining issues: lint means things shouldn't get any worse. Test Plan: See inlines. Reviewers: vrana Reviewed By: vrana CC: aran, edward Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4802 --- .../ponder/view/PonderPostBodyView.php | 30 ++++++++----------- .../PhabricatorRepositoryListController.php | 2 +- src/view/layout/AphrontPanelView.php | 2 +- src/view/layout/PhabricatorMenuView.php | 2 +- src/view/layout/PhabricatorTimelineView.php | 4 +-- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/applications/ponder/view/PonderPostBodyView.php b/src/applications/ponder/view/PonderPostBodyView.php index 77e72ee33b..4bfb4362ea 100644 --- a/src/applications/ponder/view/PonderPostBodyView.php +++ b/src/applications/ponder/view/PonderPostBodyView.php @@ -56,10 +56,12 @@ final class PonderPostBodyView extends AphrontView { $target->getMarkupField(), $this->user); - $content = - '
'. - $content. - '
'; + $content = phutil_tag( + 'div', + array( + 'class' => 'phabricator-remarkup', + ), + $content); $author = $this->handles[$target->getAuthorPHID()]; $actions = array($author->renderLink().' '.$this->action); @@ -88,10 +90,12 @@ final class PonderPostBodyView extends AphrontView { } $xaction_view->appendChild( - '
'. - $content. - '
' - ); + phutil_tag( + 'div', + array( + 'class' => 'ponder-post-core', + ), + $content)); $outerview = $xaction_view; if (!$this->preview) { @@ -113,14 +117,4 @@ final class PonderPostBodyView extends AphrontView { return $outerview->render(); } - private function renderHandleList(array $phids) { - $result = array(); - foreach ($phids as $phid) { - $result[] = $this->handles[$phid]->renderLink(); - } - return implode(', ', $result); - } - - - } diff --git a/src/applications/repository/controller/PhabricatorRepositoryListController.php b/src/applications/repository/controller/PhabricatorRepositoryListController.php index 8c4baea1d0..3b32685467 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryListController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryListController.php @@ -113,7 +113,7 @@ final class PhabricatorRepositoryListController 'class' => 'button grey small', ), 'Edit'), - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/repository/project/delete/'.$project->getID().'/', diff --git a/src/view/layout/AphrontPanelView.php b/src/view/layout/AphrontPanelView.php index 2c186d6e24..2d2e313977 100644 --- a/src/view/layout/AphrontPanelView.php +++ b/src/view/layout/AphrontPanelView.php @@ -15,7 +15,7 @@ final class AphrontPanelView extends AphrontView { public function setCreateButton($create_button, $href) { $this->addButton( - phutil_render_tag( + phutil_tag( 'a', array( 'href' => $href, diff --git a/src/view/layout/PhabricatorMenuView.php b/src/view/layout/PhabricatorMenuView.php index bf1d601eb2..c863f9dfa1 100644 --- a/src/view/layout/PhabricatorMenuView.php +++ b/src/view/layout/PhabricatorMenuView.php @@ -159,6 +159,6 @@ final class PhabricatorMenuView extends AphrontTagView { } protected function getTagContent() { - return $this->renderSingleView($this->items); + return $this->renderHTMLView($this->items); } } diff --git a/src/view/layout/PhabricatorTimelineView.php b/src/view/layout/PhabricatorTimelineView.php index e5d7dae568..3977a320b2 100644 --- a/src/view/layout/PhabricatorTimelineView.php +++ b/src/view/layout/PhabricatorTimelineView.php @@ -27,13 +27,13 @@ final class PhabricatorTimelineView extends AphrontView { } $events[] = $spacer; - return phutil_render_tag( + return phutil_tag( 'div', array( 'class' => 'phabricator-timeline-view', 'id' => $this->id, ), - implode('', $events)); + $events); } public static function renderSpacer() {