Skip to content

Commit 3e147dd

Browse files
author
epriestley
committed
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
1 parent 9670f0c commit 3e147dd

15 files changed

+82
-75
lines changed

src/applications/conpherence/controller/ConpherenceController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,12 @@ private function addConpherencesToNav(
166166
}
167167

168168
private function getNoConpherencesBlock() {
169-
170-
return phutil_render_tag(
169+
return phutil_tag(
171170
'div',
172171
array(
173172
'class' => 'no-conpherences-menu-item'
174173
),
175-
pht('No more conpherences.')
176-
);
174+
pht('No more conpherences.'));
177175
}
178176

179177
public function buildApplicationMenu() {

src/applications/conpherence/controller/ConpherenceListController.php

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -69,50 +69,48 @@ public function processRequest() {
6969

7070
private function renderEmptyMainPane() {
7171
$this->initJavelinBehaviors();
72-
return phutil_render_tag(
72+
return phutil_tag(
7373
'div',
7474
array(
7575
'id' => 'conpherence-main-pane'
7676
),
77-
phutil_render_tag(
78-
'div',
79-
array(
80-
'class' => 'conpherence-header-pane',
81-
'id' => 'conpherence-header-pane',
82-
),
83-
''
84-
).
85-
phutil_render_tag(
86-
'div',
87-
array(
88-
'class' => 'conpherence-widget-pane',
89-
'id' => 'conpherence-widget-pane'
90-
),
91-
''
92-
).
93-
javelin_render_tag(
94-
'div',
95-
array(
96-
'class' => 'conpherence-message-pane',
97-
'id' => 'conpherence-message-pane'
98-
),
99-
phutil_render_tag(
77+
array(
78+
phutil_tag(
10079
'div',
10180
array(
102-
'class' => 'conpherence-messages',
103-
'id' => 'conpherence-messages'
81+
'class' => 'conpherence-header-pane',
82+
'id' => 'conpherence-header-pane',
10483
),
105-
''
106-
).
107-
phutil_render_tag(
84+
''),
85+
phutil_tag(
10886
'div',
10987
array(
110-
'id' => 'conpherence-form'
88+
'class' => 'conpherence-widget-pane',
89+
'id' => 'conpherence-widget-pane'
11190
),
112-
''
113-
)
114-
)
115-
);
91+
''),
92+
phutil_tag(
93+
'div',
94+
array(
95+
'class' => 'conpherence-message-pane',
96+
'id' => 'conpherence-message-pane'
97+
),
98+
array(
99+
phutil_tag(
100+
'div',
101+
array(
102+
'class' => 'conpherence-messages',
103+
'id' => 'conpherence-messages'
104+
),
105+
''),
106+
phutil_tag(
107+
'div',
108+
array(
109+
'id' => 'conpherence-form'
110+
),
111+
''),
112+
)),
113+
));
116114
}
117115

118116

src/applications/conpherence/controller/ConpherenceNewController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ public function processRequest() {
9292
->setTitle('Success')
9393
->addCancelButton('#', 'Okay')
9494
->appendChild(
95-
phutil_render_tag('p',
96-
array(),
97-
pht('Message sent successfully.')
98-
)
95+
phutil_tag(
96+
'p',
97+
array(),
98+
pht('Message sent successfully.'))
9999
);
100100
$response = id(new AphrontDialogResponse())
101101
->setDialog($dialog);

src/applications/conpherence/controller/ConpherenceUpdateController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function processRequest() {
182182
->appendChild(
183183
id(new AphrontFormMarkupControl())
184184
->setLabel(pht('Image'))
185-
->setValue(phutil_render_tag(
185+
->setValue(phutil_tag(
186186
'img',
187187
array(
188188
'src' => $conpherence->loadImageURI(),

src/applications/conpherence/view/ConpherenceMenuItemView.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function getTagAttributes() {
8585
protected function getTagContent() {
8686
$image = null;
8787
if ($this->imageURI) {
88-
$image = phutil_render_tag(
88+
$image = phutil_tag(
8989
'span',
9090
array(
9191
'class' => 'conpherence-menu-item-image',
@@ -95,34 +95,34 @@ protected function getTagContent() {
9595
}
9696
$title = null;
9797
if ($this->title) {
98-
$title = phutil_render_tag(
98+
$title = phutil_tag(
9999
'span',
100100
array(
101101
'class' => 'conpherence-menu-item-title',
102102
),
103-
phutil_escape_html($this->title));
103+
$this->title);
104104
}
105105
$subtitle = null;
106106
if ($this->subtitle) {
107-
$subtitle = phutil_render_tag(
107+
$subtitle = phutil_tag(
108108
'span',
109109
array(
110110
'class' => 'conpherence-menu-item-subtitle',
111111
),
112-
phutil_escape_html($this->subtitle));
112+
$this->subtitle);
113113
}
114114
$message = null;
115115
if ($this->messageText) {
116-
$message = phutil_render_tag(
116+
$message = phutil_tag(
117117
'span',
118118
array(
119119
'class' => 'conpherence-menu-item-message-text'
120120
),
121-
phutil_escape_html($this->messageText));
121+
$this->messageText);
122122
}
123123
$epoch = null;
124124
if ($this->epoch) {
125-
$epoch = phutil_render_tag(
125+
$epoch = phutil_tag(
126126
'span',
127127
array(
128128
'class' => 'conpherence-menu-item-date',
@@ -131,12 +131,12 @@ protected function getTagContent() {
131131
}
132132
$unread_count = null;
133133
if ($this->unreadCount) {
134-
$unread_count = phutil_render_tag(
134+
$unread_count = phutil_tag(
135135
'span',
136136
array(
137137
'class' => 'conpherence-menu-item-unread-count'
138138
),
139-
$this->unreadCount);
139+
(int)$this->unreadCount);
140140
}
141141

142142
return $image.$title.$subtitle.$message.$epoch.$unread_count;

src/applications/conpherence/view/ConpherenceTransactionView.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ public function render() {
4747
case ConpherenceTransactionType::TYPE_PICTURE:
4848
$img = $transaction->getHandle($transaction->getNewValue());
4949
$content = $transaction->getTitle() .
50-
phutil_render_tag(
50+
phutil_tag(
5151
'img',
5252
array(
5353
'src' => $img->getImageURI()
54-
)
55-
);
54+
));
5655
$transaction_view->addClass('conpherence-edited');
5756
break;
5857
case ConpherenceTransactionType::TYPE_PARTICIPANTS:

src/applications/countdown/controller/PhabricatorCountdownViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public function processRequest() {
2323

2424
$chrome_visible = $request->getBool('chrome', true);
2525
$chrome_new = $chrome_visible ? false : null;
26-
$chrome_link = phutil_render_tag(
26+
$chrome_link = phutil_tag(
2727
'a',
2828
array(
2929
'href' => $request->getRequestURI()->alter('chrome', $chrome_new),
3030
'class' => 'phabricator-timer-chrome-link',
3131
),
32-
$chrome_visible ? 'Disable Chrome' : 'Enable Chrome');
32+
$chrome_visible ? pht('Disable Chrome') : pht('Enable Chrome'));
3333

3434
$container = celerity_generate_unique_node_id();
3535
$content =

src/applications/meta/view/PhabricatorApplicationLaunchView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function render() {
3939
$application->getName());
4040

4141
if ($application->isBeta()) {
42-
$content[] = phutil_render_tag(
42+
$content[] = phutil_tag(
4343
'span',
4444
array(
4545
'class' => 'phabricator-application-beta',
@@ -97,13 +97,13 @@ public function render() {
9797
$classes[] = 'phabricator-application-create-icon';
9898
$classes[] = 'sprite-icon';
9999
$classes[] = 'action-new-grey';
100-
$plus_icon = phutil_render_tag(
100+
$plus_icon = phutil_tag(
101101
'span',
102102
array(
103103
'class' => implode(' ', $classes),
104104
));
105105

106-
$create_button = phutil_render_tag(
106+
$create_button = phutil_tag(
107107
'a',
108108
array(
109109
'href' => $application->getQuickCreateURI(),

src/applications/pholio/view/PholioMockImagesView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public function render() {
2121
"phid=%s",
2222
$image->getFilePHID());
2323

24-
$image_tag = phutil_render_tag(
24+
$image_tag = phutil_tag(
2525
'img',
2626
array(
2727
'src' => $file->getBestURI(),
2828
'class' => 'pholio-mock-image',
2929
),
3030
'');
3131

32-
return phutil_render_tag(
32+
return phutil_tag(
3333
'div',
3434
array(
3535
'class' => 'pholio-mock-image-container',

src/applications/repository/controller/PhabricatorRepositoryDeleteController.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ public function processRequest() {
2828
phutil_escape_html($repository->getCallsign());
2929
$text_2 = pht('Repositories touch many objects and as such deletes are '.
3030
'prohibitively expensive to run from the web UI.');
31-
$body = phutil_render_tag(
31+
$body = phutil_tag(
3232
'div',
3333
array(
3434
'class' => 'phabricator-remarkup',
3535
),
36-
'<p>'.$text_1.'</p><p><tt>'.$command.'</tt></p><p>'.$text_2.'</p>');
36+
array(
37+
phutil_tag('p', array(), $text_1),
38+
phutil_tag('p', array(),
39+
phutil_tag('tt', array(), $command)),
40+
phutil_tag('p', array(), $text_2),
41+
));
42+
3743
$dialog
3844
->setUser($request->getUser())
3945
->setTitle(pht('Really want to delete the repository?'))

0 commit comments

Comments
 (0)