1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-18 17:58:37 +01:00

Fix some easy phutil_render_tag()

Summary:
  - Grepped for phutil_render_tag().
  - Fixed some easy ones.

Test Plan:
  - Browsed around; site didn't seem more broken than it was before.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4638
This commit is contained in:
epriestley 2013-01-25 05:50:50 -08:00
parent 9670f0c636
commit 3e147dd61c
15 changed files with 82 additions and 75 deletions

View file

@ -166,14 +166,12 @@ abstract class ConpherenceController extends PhabricatorController {
} }
private function getNoConpherencesBlock() { private function getNoConpherencesBlock() {
return phutil_tag(
return phutil_render_tag(
'div', 'div',
array( array(
'class' => 'no-conpherences-menu-item' 'class' => 'no-conpherences-menu-item'
), ),
pht('No more conpherences.') pht('No more conpherences.'));
);
} }
public function buildApplicationMenu() { public function buildApplicationMenu() {

View file

@ -69,50 +69,48 @@ final class ConpherenceListController extends
private function renderEmptyMainPane() { private function renderEmptyMainPane() {
$this->initJavelinBehaviors(); $this->initJavelinBehaviors();
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'id' => 'conpherence-main-pane' 'id' => 'conpherence-main-pane'
), ),
phutil_render_tag( array(
'div', phutil_tag(
array(
'class' => 'conpherence-header-pane',
'id' => 'conpherence-header-pane',
),
''
).
phutil_render_tag(
'div',
array(
'class' => 'conpherence-widget-pane',
'id' => 'conpherence-widget-pane'
),
''
).
javelin_render_tag(
'div',
array(
'class' => 'conpherence-message-pane',
'id' => 'conpherence-message-pane'
),
phutil_render_tag(
'div', 'div',
array( array(
'class' => 'conpherence-messages', 'class' => 'conpherence-header-pane',
'id' => 'conpherence-messages' 'id' => 'conpherence-header-pane',
), ),
'' ''),
). phutil_tag(
phutil_render_tag(
'div', 'div',
array( array(
'id' => 'conpherence-form' 'class' => 'conpherence-widget-pane',
'id' => 'conpherence-widget-pane'
), ),
'' ''),
) phutil_tag(
) 'div',
); array(
'class' => 'conpherence-message-pane',
'id' => 'conpherence-message-pane'
),
array(
phutil_tag(
'div',
array(
'class' => 'conpherence-messages',
'id' => 'conpherence-messages'
),
''),
phutil_tag(
'div',
array(
'id' => 'conpherence-form'
),
''),
)),
));
} }

View file

@ -92,10 +92,10 @@ final class ConpherenceNewController extends ConpherenceController {
->setTitle('Success') ->setTitle('Success')
->addCancelButton('#', 'Okay') ->addCancelButton('#', 'Okay')
->appendChild( ->appendChild(
phutil_render_tag('p', phutil_tag(
array(), 'p',
pht('Message sent successfully.') array(),
) pht('Message sent successfully.'))
); );
$response = id(new AphrontDialogResponse()) $response = id(new AphrontDialogResponse())
->setDialog($dialog); ->setDialog($dialog);

View file

@ -182,7 +182,7 @@ final class ConpherenceUpdateController extends
->appendChild( ->appendChild(
id(new AphrontFormMarkupControl()) id(new AphrontFormMarkupControl())
->setLabel(pht('Image')) ->setLabel(pht('Image'))
->setValue(phutil_render_tag( ->setValue(phutil_tag(
'img', 'img',
array( array(
'src' => $conpherence->loadImageURI(), 'src' => $conpherence->loadImageURI(),

View file

@ -85,7 +85,7 @@ final class ConpherenceMenuItemView extends AphrontTagView {
protected function getTagContent() { protected function getTagContent() {
$image = null; $image = null;
if ($this->imageURI) { if ($this->imageURI) {
$image = phutil_render_tag( $image = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-image', 'class' => 'conpherence-menu-item-image',
@ -95,34 +95,34 @@ final class ConpherenceMenuItemView extends AphrontTagView {
} }
$title = null; $title = null;
if ($this->title) { if ($this->title) {
$title = phutil_render_tag( $title = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-title', 'class' => 'conpherence-menu-item-title',
), ),
phutil_escape_html($this->title)); $this->title);
} }
$subtitle = null; $subtitle = null;
if ($this->subtitle) { if ($this->subtitle) {
$subtitle = phutil_render_tag( $subtitle = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-subtitle', 'class' => 'conpherence-menu-item-subtitle',
), ),
phutil_escape_html($this->subtitle)); $this->subtitle);
} }
$message = null; $message = null;
if ($this->messageText) { if ($this->messageText) {
$message = phutil_render_tag( $message = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-message-text' 'class' => 'conpherence-menu-item-message-text'
), ),
phutil_escape_html($this->messageText)); $this->messageText);
} }
$epoch = null; $epoch = null;
if ($this->epoch) { if ($this->epoch) {
$epoch = phutil_render_tag( $epoch = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-date', 'class' => 'conpherence-menu-item-date',
@ -131,12 +131,12 @@ final class ConpherenceMenuItemView extends AphrontTagView {
} }
$unread_count = null; $unread_count = null;
if ($this->unreadCount) { if ($this->unreadCount) {
$unread_count = phutil_render_tag( $unread_count = phutil_tag(
'span', 'span',
array( array(
'class' => 'conpherence-menu-item-unread-count' 'class' => 'conpherence-menu-item-unread-count'
), ),
$this->unreadCount); (int)$this->unreadCount);
} }
return $image.$title.$subtitle.$message.$epoch.$unread_count; return $image.$title.$subtitle.$message.$epoch.$unread_count;

View file

@ -47,12 +47,11 @@ final class ConpherenceTransactionView extends AphrontView {
case ConpherenceTransactionType::TYPE_PICTURE: case ConpherenceTransactionType::TYPE_PICTURE:
$img = $transaction->getHandle($transaction->getNewValue()); $img = $transaction->getHandle($transaction->getNewValue());
$content = $transaction->getTitle() . $content = $transaction->getTitle() .
phutil_render_tag( phutil_tag(
'img', 'img',
array( array(
'src' => $img->getImageURI() 'src' => $img->getImageURI()
) ));
);
$transaction_view->addClass('conpherence-edited'); $transaction_view->addClass('conpherence-edited');
break; break;
case ConpherenceTransactionType::TYPE_PARTICIPANTS: case ConpherenceTransactionType::TYPE_PARTICIPANTS:

View file

@ -23,13 +23,13 @@ final class PhabricatorCountdownViewController
$chrome_visible = $request->getBool('chrome', true); $chrome_visible = $request->getBool('chrome', true);
$chrome_new = $chrome_visible ? false : null; $chrome_new = $chrome_visible ? false : null;
$chrome_link = phutil_render_tag( $chrome_link = phutil_tag(
'a', 'a',
array( array(
'href' => $request->getRequestURI()->alter('chrome', $chrome_new), 'href' => $request->getRequestURI()->alter('chrome', $chrome_new),
'class' => 'phabricator-timer-chrome-link', 'class' => 'phabricator-timer-chrome-link',
), ),
$chrome_visible ? 'Disable Chrome' : 'Enable Chrome'); $chrome_visible ? pht('Disable Chrome') : pht('Enable Chrome'));
$container = celerity_generate_unique_node_id(); $container = celerity_generate_unique_node_id();
$content = $content =

View file

@ -39,7 +39,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$application->getName()); $application->getName());
if ($application->isBeta()) { if ($application->isBeta()) {
$content[] = phutil_render_tag( $content[] = phutil_tag(
'span', 'span',
array( array(
'class' => 'phabricator-application-beta', 'class' => 'phabricator-application-beta',
@ -97,13 +97,13 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$classes[] = 'phabricator-application-create-icon'; $classes[] = 'phabricator-application-create-icon';
$classes[] = 'sprite-icon'; $classes[] = 'sprite-icon';
$classes[] = 'action-new-grey'; $classes[] = 'action-new-grey';
$plus_icon = phutil_render_tag( $plus_icon = phutil_tag(
'span', 'span',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
)); ));
$create_button = phutil_render_tag( $create_button = phutil_tag(
'a', 'a',
array( array(
'href' => $application->getQuickCreateURI(), 'href' => $application->getQuickCreateURI(),

View file

@ -21,7 +21,7 @@ final class PholioMockImagesView extends AphrontView {
"phid=%s", "phid=%s",
$image->getFilePHID()); $image->getFilePHID());
$image_tag = phutil_render_tag( $image_tag = phutil_tag(
'img', 'img',
array( array(
'src' => $file->getBestURI(), 'src' => $file->getBestURI(),
@ -29,7 +29,7 @@ final class PholioMockImagesView extends AphrontView {
), ),
''); '');
return phutil_render_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'pholio-mock-image-container', 'class' => 'pholio-mock-image-container',

View file

@ -28,12 +28,18 @@ final class PhabricatorRepositoryDeleteController
phutil_escape_html($repository->getCallsign()); phutil_escape_html($repository->getCallsign());
$text_2 = pht('Repositories touch many objects and as such deletes are '. $text_2 = pht('Repositories touch many objects and as such deletes are '.
'prohibitively expensive to run from the web UI.'); 'prohibitively expensive to run from the web UI.');
$body = phutil_render_tag( $body = phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-remarkup', 'class' => 'phabricator-remarkup',
), ),
'<p>'.$text_1.'</p><p><tt>'.$command.'</tt></p><p>'.$text_2.'</p>'); array(
phutil_tag('p', array(), $text_1),
phutil_tag('p', array(),
phutil_tag('tt', array(), $command)),
phutil_tag('p', array(), $text_2),
));
$dialog $dialog
->setUser($request->getUser()) ->setUser($request->getUser())
->setTitle(pht('Really want to delete the repository?')) ->setTitle(pht('Really want to delete the repository?'))

View file

@ -68,16 +68,18 @@ final class PhabricatorInlineSummaryView extends AphrontView {
$tail = null; $tail = null;
} }
$lines = phutil_escape_html($lines);
if ($href) { if ($href) {
$lines = phutil_render_tag( $lines = phutil_tag(
'a', 'a',
array( array(
'href' => $href, 'href' => $href,
'target' => $target, 'target' => $target,
'class' => 'num', 'class' => 'num',
), ),
$lines.$tail); array(
$lines,
$tail,
));
} }
$where = idx($item, 'where'); $where = idx($item, 'where');

View file

@ -30,7 +30,7 @@ final class PhabricatorRemarkupRuleMeme
->alter('uppertext', $options['above']) ->alter('uppertext', $options['above'])
->alter('lowertext', $options['below']); ->alter('lowertext', $options['below']);
$img = phutil_render_tag( $img = phutil_tag(
'img', 'img',
array( array(
'src' => (string)$uri, 'src' => (string)$uri,

View file

@ -188,13 +188,17 @@ final class AphrontTableView extends AphrontView {
), ),
''); '');
$header = phutil_render_tag( $header = phutil_tag(
'a', 'a',
array( array(
'href' => $this->sortURI->alter($this->sortParam, $sort_value), 'href' => $this->sortURI->alter($this->sortParam, $sort_value),
'class' => 'aphront-table-view-sort-link', 'class' => 'aphront-table-view-sort-link',
), ),
$header.' '.$sort_glyph); array(
$header,
' ',
$sort_glyph,
));
} }
if ($classes) { if ($classes) {
@ -204,7 +208,7 @@ final class AphrontTableView extends AphrontView {
} }
if ($short_headers[$col_num] !== null) { if ($short_headers[$col_num] !== null) {
$header_nodevice = phutil_render_tag( $header_nodevice = phutil_tag(
'span', 'span',
array( array(
'class' => 'aphront-table-view-nodevice', 'class' => 'aphront-table-view-nodevice',

View file

@ -91,7 +91,7 @@ final class PhabricatorObjectSelectorDialog {
$options = array(); $options = array();
foreach ($this->filters as $key => $label) { foreach ($this->filters as $key => $label) {
$options[] = phutil_render_tag( $options[] = phutil_tag(
'option', 'option',
array( array(
'value' => $key, 'value' => $key,

View file

@ -249,12 +249,12 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
if ($user && $user->getIsAdmin()) { if ($user && $user->getIsAdmin()) {
$open = PhabricatorSetupCheck::getOpenSetupIssueCount(); $open = PhabricatorSetupCheck::getOpenSetupIssueCount();
if ($open) { if ($open) {
$setup_warning = phutil_render_tag( $setup_warning = phutil_tag(
'div', 'div',
array( array(
'class' => 'setup-warning-callout', 'class' => 'setup-warning-callout',
), ),
phutil_render_tag( phutil_tag(
'a', 'a',
array( array(
'href' => '/config/issue/', 'href' => '/config/issue/',