r51106 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51105‎ | r51106 | r51107 >
Date:10:55, 28 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Remove cruft, few escaping fixes
Modified paths:
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslatePage.php
@@ -20,9 +20,7 @@
2121 protected $options = null;
2222
2323 function __construct() {
24 - wfMemIn( __METHOD__ );
2524 SpecialPage::SpecialPage( 'Translate' );
26 - wfMemOut( __METHOD__ );
2725 }
2826
2927 /**
@@ -30,7 +28,6 @@
3129 * GLOBALS: $wgHooks, $wgOut.
3230 */
3331 public function execute( $parameters ) {
34 - wfMemIn( __METHOD__ );
3532 wfLoadExtensionMessages( 'Translate' );
3633 TranslateUtils::injectCSS();
3734 global $wgOut, $wgTranslateBlacklist;
@@ -64,7 +61,6 @@
6562 $wgOut->addHTML( $this->settingsForm( $errors ) );
6663
6764 if ( count( $errors ) ) {
68 - wfMemOut( __METHOD__ );
6965 return;
7066 } else {
7167 $checks = array(
@@ -110,11 +106,9 @@
111107 $wgOut->addHTML( $description . $links . $output . $links );
112108 }
113109 }
114 - wfMemOut( __METHOD__ );
115110 }
116111
117112 protected function setup( $parameters ) {
118 - wfMemIn( __METHOD__ );
119113 global $wgUser, $wgRequest;
120114
121115 $defaults = array(
@@ -163,14 +157,12 @@
164158
165159 $this->group = MessageGroups::getGroup( $this->options['group'] );
166160 $this->task = TranslateTasks::getTask( $this->options['task'] );
167 - wfMemOut( __METHOD__ );
168161 }
169162
170163 /**
171164 * GLOBALS: $wgScript
172165 */
173166 protected function settingsForm( $errors ) {
174 - wfMemIn( __METHOD__ );
175167 global $wgScript;
176168
177169 $task = $this->taskSelector();
@@ -183,7 +175,7 @@
184176 $options = array();
185177 foreach ( array( 'task', 'group', 'language', 'limit' ) as $g ) {
186178 $options[] = self::optionRow(
187 - Xml::tags( 'label', array( 'for' => $g ), wfMsg( self::MSG . $g, 'escapenoentities' ) ),
 179+ Xml::tags( 'label', array( 'for' => $g ), wfMsgExt( self::MSG . $g, 'escapenoentities' ) ),
188180 $$g,
189181 array_key_exists( $g, $errors ) ? $errors[$g] : null
190182 );
@@ -200,7 +192,6 @@
201193 Xml::closeElement( 'table' ) .
202194 Xml::closeElement( 'form' ) .
203195 Xml::closeElement( 'fieldset' );
204 - wfMemOut( __METHOD__ );
205196 return $form;
206197 }
207198
@@ -217,7 +208,6 @@
218209 /* Selectors ahead */
219210
220211 protected function groupSelector() {
221 - wfMemIn( __METHOD__ );
222212 $groups = MessageGroups::singleton()->getGroups();
223213 $selector = new HTMLSelector( 'group', 'group', $this->options['group'] );
224214 foreach ( $groups as $id => $class ) {
@@ -225,18 +215,15 @@
226216 $selector->addOption( $class->getLabel(), $id );
227217 }
228218 }
229 - wfMemOut( __METHOD__ );
230219 return $selector->getHTML();
231220 }
232221
233222 protected function taskSelector() {
234 - wfMemIn( __METHOD__ );
235223 $selector = new HTMLSelector( 'task', 'task', $this->options['task'] );
236224 foreach ( TranslateTasks::getTasks() as $id ) {
237225 $label = call_user_func( array( 'TranslateTask', 'labelForTask' ), $id );
238226 $selector->addOption( $label, $id );
239227 }
240 - wfMemOut( __METHOD__ );
241228 return $selector->getHTML();
242229 }
243230
@@ -246,32 +233,26 @@
247234 }
248235
249236 protected function limitSelector() {
250 - wfMemIn( __METHOD__ );
251237 global $wgLang;
252238 $items = array( 100, 250, 500, 1000, 2500 );
253239 $selector = new HTMLSelector( 'limit', 'limit', $this->options['limit'] );
254240 foreach ( $items as $count ) {
255241 $selector->addOption( wfMsgExt( self::MSG . 'limit-option', 'parsemag', $wgLang->formatNum( $count ) ), $count );
256242 }
257 - wfMemOut( __METHOD__ );
258243 return $selector->getHTML();
259244 }
260245
261246 private $paging = null;
262247 public function cbAddPagingNumbers( $start, $count, $total ) {
263 - wfMemIn( __METHOD__ );
264248 $this->paging = array(
265249 'start' => $start,
266250 'count' => $count,
267251 'total' => $total
268252 );
269 - wfMemOut( __METHOD__ );
270253 }
271254
272255 protected function doStupidLinks() {
273 - wfMemIn( __METHOD__ );
274256 if ( $this->paging === null ) {
275 - wfMemOut( __METHOD__ );
276257 return '';
277258 }
278259
@@ -311,7 +292,6 @@
312293 $navigation = Xml::tags( 'p', null, $showing . ' ' . $navigation );
313294 }
314295
315 - wfMemOut( __METHOD__ );
316296 return
317297 Xml::openElement( 'fieldset' ) .
318298 Xml::element( 'legend', null, wfMsg( self::MSG . 'navigation-legend' ) ) .
@@ -320,7 +300,6 @@
321301 }
322302
323303 private function makeOffsetLink( $label, $offset ) {
324 - wfMemIn( __METHOD__ );
325304 global $wgUser;
326305 $skin = $wgUser->getSkin();
327306 $link = $skin->makeLinkObj( $this->getTitle(), $label,
@@ -329,7 +308,6 @@
330309 $this->nondefaults
331310 )
332311 );
333 - wfMemOut( __METHOD__ );
334312 return $link;
335313 }
336314

Status & tagging log