r53338 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53337‎ | r53338 | r53339 >
Date:22:48, 15 July 2009
Author:demon
Status:ok
Tags:
Comment:
2nd followup to r53286, indentation fixes.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -39,10 +39,10 @@
4040 $this->langCode = $this->table->lang->getCode();
4141
4242 $wgOut->addHTML( $this->buildForm() .
43 - $this->table->getNavigationBar() .
44 - $this->table->getLimitForm() .
45 - $this->table->getBody() .
46 - $this->table->getNavigationBar() );
 43+ $this->table->getNavigationBar() .
 44+ $this->table->getLimitForm() .
 45+ $this->table->getBody() .
 46+ $this->table->getNavigationBar() );
4747
4848 }
4949
@@ -55,35 +55,35 @@
5656 Xml::hidden( 'title', $this->getTitle() ) .
5757 Xml::element( 'legend', null, wfMsg( 'allmessages' ) ) . "<table><tr>\n" .
5858 "<td class=\"mw-label\">" .
59 - Xml::label( wfMsg('allmessages-prefix'), 'am-form-prefix' ) .
60 - "</td>\n<td class=\"mw-input\">" .
61 - Xml::input( 'prefix', 20, str_replace('_',' ',$this->prefix), array( 'id' => 'am-form-prefix' ) ) .
62 - "</select>" .
 59+ Xml::label( wfMsg('allmessages-prefix'), 'am-form-prefix' ) .
 60+ "</td>\n<td class=\"mw-input\">" .
 61+ Xml::input( 'prefix', 20, str_replace('_',' ',$this->prefix), array( 'id' => 'am-form-prefix' ) ) .
 62+ "</select>" .
6363 "</td>\n</tr><tr>\n<td class='mw-label'>" .
64 - Xml::label( wfMsg('allmessages-filter'), 'am-form-filter' ) .
65 - "</td>\n<td class='mw-input'>" .
66 - Xml::radioLabel( wfMsg('allmessages-filter-unmodified'),
67 - 'filter',
68 - 'unmodified',
69 - 'am-form-filter-unmodified',
70 - ( $this->filter == 'unmodified' ? true : false )
71 - ) .
72 - Xml::radioLabel( wfMsg('allmessages-filter-all'),
73 - 'filter',
74 - 'all',
75 - 'am-form-filter-all',
76 - ( $this->filter == 'all' ? true : false )
77 - ) .
78 - Xml::radioLabel( wfMsg('allmessages-filter-modified'),
79 - 'filter',
80 - 'modified',
81 - 'am-form-filter-modified',
82 - ( $this->filter == 'modified' ? true : false )
83 - ) .
 64+ Xml::label( wfMsg('allmessages-filter'), 'am-form-filter' ) .
 65+ "</td>\n<td class='mw-input'>" .
 66+ Xml::radioLabel( wfMsg('allmessages-filter-unmodified'),
 67+ 'filter',
 68+ 'unmodified',
 69+ 'am-form-filter-unmodified',
 70+ ( $this->filter == 'unmodified' ? true : false )
 71+ ) .
 72+ Xml::radioLabel( wfMsg('allmessages-filter-all'),
 73+ 'filter',
 74+ 'all',
 75+ 'am-form-filter-all',
 76+ ( $this->filter == 'all' ? true : false )
 77+ ) .
 78+ Xml::radioLabel( wfMsg('allmessages-filter-modified'),
 79+ 'filter',
 80+ 'modified',
 81+ 'am-form-filter-modified',
 82+ ( $this->filter == 'modified' ? true : false )
 83+ ) .
8484 "</td>\n</tr><tr>\n<td class=\"mw-label\">" .
85 - Xml::label( wfMsg('yourlanguage'), 'am-form-lang' ) .
86 - "</td>\n<td class=\"mw-input\">" .
87 - Xml::openElement( 'select', array( 'id' => 'am-form-lang', 'name' => 'lang' ) );
 85+ Xml::label( wfMsg('yourlanguage'), 'am-form-lang' ) .
 86+ "</td>\n<td class=\"mw-input\">" .
 87+ Xml::openElement( 'select', array( 'id' => 'am-form-lang', 'name' => 'lang' ) );
8888 foreach( $languages as $lang => $name ) {
8989 $selected = $lang == $this->langCode ? 'selected="selected"' : '';
9090 $out .= "<option value=\"$lang\" $selected>$name</option>\n";
@@ -188,11 +188,11 @@
189189
190190 $dbr = wfGetDB( DB_SLAVE );
191191 $res = $dbr->select( 'page',
192 - array( 'page_namespace', 'page_title' ),
193 - array( 'page_namespace' => array(NS_MEDIAWIKI,NS_MEDIAWIKI_TALK) ),
194 - __METHOD__,
195 - array( 'USE INDEX' => 'name_title' )
196 - );
 192+ array( 'page_namespace', 'page_title' ),
 193+ array( 'page_namespace' => array(NS_MEDIAWIKI,NS_MEDIAWIKI_TALK) ),
 194+ __METHOD__,
 195+ array( 'USE INDEX' => 'name_title' )
 196+ );
197197
198198 while( $s = $dbr->fetchObject( $res ) ) {
199199 if( $s->page_namespace == NS_MEDIAWIKI ){
@@ -200,7 +200,7 @@
201201 $title = explode( '/', $s->page_title );
202202 if( $this->langcode == $title[1] && array_key_exists( $title[0], $this->messages ) ){
203203 $this->messages["{$title[0]}"]['customised'] = 1;
204 - }
 204+ }
205205 } else if( array_key_exists( $s->page_title , $this->messages ) ){
206206 $this->messages[$s->page_title]['customised'] = 1;
207207 }
@@ -227,14 +227,15 @@
228228 $count = 0;
229229 foreach( $this->messages as $key => $value ){
230230 if( $value['customised'] !== $this->custom &&
231 - ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) &&
 231+ ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) &&
232232 (( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix === false )
233 - ){
234 - $mResult->result[] = array( 'am_title' => $key,
235 - 'am_actual' => $value['actual'],
236 - 'am_default' => $value['default'],
237 - 'am_customised' => $value['customised'],
238 - );
 233+ ){
 234+ $mResult->result[] = array(
 235+ 'am_title' => $key,
 236+ 'am_actual' => $value['actual'],
 237+ 'am_default' => $value['default'],
 238+ 'am_customised' => $value['customised'],
 239+ );
239240 unset( $this->messages[$key] ); // save a few bytes
240241 $count++;
241242 }
@@ -246,8 +247,8 @@
247248
248249 function getStartBody() {
249250 return "<table border=\"1\" class=\"TablePager\" style=\"width:100%;\" id=\"allmessagestable\"><thead>\n<tr>" .
250 - "<th rowspan=\"2\">" . wfMsg('allmessagesname') . "</th><th>" . wfMsg('allmessagesdefault') .
251 - "</tr>\n<tr><th>" . wfMsg('allmessagescurrent') . "</th></tr>\n";
 251+ "<th rowspan=\"2\">" . wfMsg('allmessagesname') . "</th><th>" . wfMsg('allmessagesdefault') .
 252+ "</tr>\n<tr><th>" . wfMsg('allmessagescurrent') . "</th></tr>\n";
252253 }
253254
254255 function formatValue( $field , $value ){
@@ -299,7 +300,7 @@
300301 $formatted = '&nbsp;';
301302 }
302303 $s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
303 - . "</tr>\n";
 304+ . "</tr>\n";
304305 }
305306 return $s;
306307 }
@@ -326,8 +327,8 @@
327328
328329 // This is not actually used, as getStartBody is overridden above
329330 function getFieldNames() {
330 - return array( 'am_title' => wfMsg('allmessagesname'),
331 - 'am_default' => wfMsg('allmessagesdefault') );
 331+ return array( 'am_title' => wfMsg('allmessagesname'),
 332+ 'am_default' => wfMsg('allmessagesdefault') );
332333 }
333334 function getTitle() {
334335 return SpecialPage::getTitleFor( 'Allmessages', false );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53286(bug 16497) Paginate Special:AllMessagesdemon02:03, 15 July 2009

Status & tagging log