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

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
This commit is contained in:
epriestley 2013-02-04 11:38:04 -08:00
parent 0f1bdbe147
commit ebc2937dc8
5 changed files with 17 additions and 23 deletions

View file

@ -56,10 +56,12 @@ final class PonderPostBodyView extends AphrontView {
$target->getMarkupField(), $target->getMarkupField(),
$this->user); $this->user);
$content = $content = phutil_tag(
'<div class="phabricator-remarkup">'. 'div',
$content. array(
'</div>'; 'class' => 'phabricator-remarkup',
),
$content);
$author = $this->handles[$target->getAuthorPHID()]; $author = $this->handles[$target->getAuthorPHID()];
$actions = array($author->renderLink().' '.$this->action); $actions = array($author->renderLink().' '.$this->action);
@ -88,10 +90,12 @@ final class PonderPostBodyView extends AphrontView {
} }
$xaction_view->appendChild( $xaction_view->appendChild(
'<div class="ponder-post-core">'. phutil_tag(
$content. 'div',
'</div>' array(
); 'class' => 'ponder-post-core',
),
$content));
$outerview = $xaction_view; $outerview = $xaction_view;
if (!$this->preview) { if (!$this->preview) {
@ -113,14 +117,4 @@ final class PonderPostBodyView extends AphrontView {
return $outerview->render(); return $outerview->render();
} }
private function renderHandleList(array $phids) {
$result = array();
foreach ($phids as $phid) {
$result[] = $this->handles[$phid]->renderLink();
}
return implode(', ', $result);
}
} }

View file

@ -113,7 +113,7 @@ final class PhabricatorRepositoryListController
'class' => 'button grey small', 'class' => 'button grey small',
), ),
'Edit'), 'Edit'),
javelin_render_tag( javelin_tag(
'a', 'a',
array( array(
'href' => '/repository/project/delete/'.$project->getID().'/', 'href' => '/repository/project/delete/'.$project->getID().'/',

View file

@ -15,7 +15,7 @@ final class AphrontPanelView extends AphrontView {
public function setCreateButton($create_button, $href) { public function setCreateButton($create_button, $href) {
$this->addButton( $this->addButton(
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,

View file

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

View file

@ -27,13 +27,13 @@ final class PhabricatorTimelineView extends AphrontView {
} }
$events[] = $spacer; $events[] = $spacer;
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-timeline-view', 'class' => 'phabricator-timeline-view',
'id' => $this->id, 'id' => $this->id,
), ),
implode('', $events)); $events);
} }
public static function renderSpacer() { public static function renderSpacer() {