1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-06 17:38:29 +02:00

Convert more render_tag -> tag

Summary: Mostly straightforward.

Test Plan: Browsed most of the affected interfaces.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4687
This commit is contained in:
epriestley 2013-01-28 18:41:43 -08:00
parent 08bcb8c30a
commit fb6dbd7d3a
9 changed files with 46 additions and 40 deletions

View file

@ -237,14 +237,13 @@ final class ConpherenceViewController extends
foreach ($files as $file) { foreach ($files as $file) {
$thumb = $file->getThumb60x45URI(); $thumb = $file->getThumb60x45URI();
$table_data[] = array( $table_data[] = array(
phutil_render_tag( phutil_tag(
'img', 'img',
array( array(
'src' => $thumb 'src' => $thumb
), ),
'' ''),
), phutil_escape_html($file->getName()),
$file->getName()
); );
} }
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
@ -274,13 +273,12 @@ final class ConpherenceViewController extends
foreach ($actual_tasks as $task) { foreach ($actual_tasks as $task) {
$data[] = array( $data[] = array(
idx($priority_map, $task->getPriority(), pht('???')), idx($priority_map, $task->getPriority(), pht('???')),
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => '/T'.$task->getID() 'href' => '/T'.$task->getID()
), ),
phutil_escape_html($task->getTitle()) $task->getTitle()),
)
); );
} }
$table = id(new AphrontTableView($data)) $table = id(new AphrontTableView($data))

View file

@ -111,8 +111,7 @@ abstract class DiffusionBrowseQuery {
$readme_content = $content_query->getRawData(); $readme_content = $content_query->getRawData();
if (preg_match('/\\.txt$/', $readme->getPath())) { if (preg_match('/\\.txt$/', $readme->getPath())) {
$readme_content = phutil_escape_html($readme_content); $readme_content = phutil_escape_html_newlines($readme_content);
$readme_content = nl2br($readme_content);
$class = null; $class = null;
} else if (preg_match('/\\.rainbow$/', $readme->getPath())) { } else if (preg_match('/\\.rainbow$/', $readme->getPath())) {
@ -121,6 +120,7 @@ abstract class DiffusionBrowseQuery {
->getHighlightFuture($readme_content) ->getHighlightFuture($readme_content)
->resolve(); ->resolve();
$readme_content = nl2br($readme_content); $readme_content = nl2br($readme_content);
$readme_content = phutil_safe_html($readme_content);
require_celerity_resource('syntax-highlighting-css'); require_celerity_resource('syntax-highlighting-css');
$class = 'remarkup-code'; $class = 'remarkup-code';
@ -132,7 +132,7 @@ abstract class DiffusionBrowseQuery {
$class = 'phabricator-remarkup'; $class = 'phabricator-remarkup';
} }
$readme_content = phutil_render_tag( $readme_content = phutil_tag(
'div', 'div',
array( array(
'class' => $class, 'class' => $class,

View file

@ -61,8 +61,7 @@ final class DiffusionBranchTableView extends DiffusionView {
$drequest->getRepository(), $drequest->getRepository(),
$branch->getHeadCommitIdentifier()), $branch->getHeadCommitIdentifier()),
$datetime, $datetime,
AphrontTableView::renderSingleDisplayLine( AphrontTableView::renderSingleDisplayLine($details),
phutil_escape_html($details))
// TODO: etc etc // TODO: etc etc
); );
if ($branch->getName() == $current_branch) { if ($branch->getName() == $current_branch) {

View file

@ -59,8 +59,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
} }
} }
$details = AphrontTableView::renderSingleDisplayLine( $details = AphrontTableView::renderSingleDisplayLine($data->getSummary());
phutil_escape_html($data->getSummary()));
} else { } else {
$author = ''; $author = '';
$details = ''; $details = '';

View file

@ -138,8 +138,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
$date, $date,
$time, $time,
$author, $author,
AphrontTableView::renderSingleDisplayLine( AphrontTableView::renderSingleDisplayLine($history->getSummary()),
phutil_escape_html($history->getSummary())),
// TODO: etc etc // TODO: etc etc
); );
} }

View file

@ -338,11 +338,14 @@ final class PhabricatorDirectoryMainController
private function renderMiniPanel($title, $body) { private function renderMiniPanel($title, $body) {
$panel = new AphrontMiniPanelView(); $panel = new AphrontMiniPanelView();
$panel->appendChild( $panel->appendChild(
phutil_render_tag( phutil_tag(
'p', 'p',
array( array(
), ),
'<strong>'.$title.':</strong> '.$body)); array(
phutil_tag('strong', array(), $title.':'),
$body
)));
$this->minipanels[] = $panel; $this->minipanels[] = $panel;
} }

View file

@ -73,18 +73,20 @@ final class PonderVotableView extends AphrontView {
'vote' => (int)$this->vote, 'vote' => (int)$this->vote,
), ),
), ),
javelin_render_tag( array(
javelin_tag(
'div', 'div',
array( array(
'class' => 'ponder-votebox', 'class' => 'ponder-votebox',
), ),
$up.$count.$down). array($up, $count, $down)),
phutil_render_tag( phutil_render_tag(
'div', 'div',
array( array(
'class' => 'ponder-votebox-content', 'class' => 'ponder-votebox-content',
), ),
$this->renderChildren())); $this->renderChildren()),
));
} }
} }

View file

@ -1,11 +1,14 @@
<?php <?php
final class JavelinViewExampleServerView extends AphrontView { final class JavelinViewExampleServerView extends AphrontView {
public function render() { public function render() {
return phutil_render_tag( return phutil_tag(
'div', 'div',
array('class' => 'server-view'), array(
$this->renderChildren() 'class' => 'server-view',
); ),
$this->renderChildren());
} }
} }

View file

@ -311,12 +311,15 @@ final class AphrontTableView extends AphrontView {
array( array(
'class' => 'single-display-line-bounds', 'class' => 'single-display-line-bounds',
), ),
phutil_render_tag( array(
phutil_tag(
'span', 'span',
array( array(
'class' => 'single-display-line-content', 'class' => 'single-display-line-content',
), ),
$line).'&nbsp;'); $line),
"\xC2\xA0",
));
} }