Index: trunk/phase3/includes/specials/SpecialAllmessages.php |
— | — | @@ -39,10 +39,10 @@ |
40 | 40 | $this->langCode = $this->table->lang->getCode(); |
41 | 41 | |
42 | 42 | $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() ); |
47 | 47 | |
48 | 48 | } |
49 | 49 | |
— | — | @@ -55,35 +55,35 @@ |
56 | 56 | Xml::hidden( 'title', $this->getTitle() ) . |
57 | 57 | Xml::element( 'legend', null, wfMsg( 'allmessages' ) ) . "<table><tr>\n" . |
58 | 58 | "<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>" . |
63 | 63 | "</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 | + ) . |
84 | 84 | "</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' ) ); |
88 | 88 | foreach( $languages as $lang => $name ) { |
89 | 89 | $selected = $lang == $this->langCode ? 'selected="selected"' : ''; |
90 | 90 | $out .= "<option value=\"$lang\" $selected>$name</option>\n"; |
— | — | @@ -188,11 +188,11 @@ |
189 | 189 | |
190 | 190 | $dbr = wfGetDB( DB_SLAVE ); |
191 | 191 | $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 | + ); |
197 | 197 | |
198 | 198 | while( $s = $dbr->fetchObject( $res ) ) { |
199 | 199 | if( $s->page_namespace == NS_MEDIAWIKI ){ |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | $title = explode( '/', $s->page_title ); |
202 | 202 | if( $this->langcode == $title[1] && array_key_exists( $title[0], $this->messages ) ){ |
203 | 203 | $this->messages["{$title[0]}"]['customised'] = 1; |
204 | | - } |
| 204 | + } |
205 | 205 | } else if( array_key_exists( $s->page_title , $this->messages ) ){ |
206 | 206 | $this->messages[$s->page_title]['customised'] = 1; |
207 | 207 | } |
— | — | @@ -227,14 +227,15 @@ |
228 | 228 | $count = 0; |
229 | 229 | foreach( $this->messages as $key => $value ){ |
230 | 230 | if( $value['customised'] !== $this->custom && |
231 | | - ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) && |
| 231 | + ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) && |
232 | 232 | (( $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 | + ); |
239 | 240 | unset( $this->messages[$key] ); // save a few bytes |
240 | 241 | $count++; |
241 | 242 | } |
— | — | @@ -246,8 +247,8 @@ |
247 | 248 | |
248 | 249 | function getStartBody() { |
249 | 250 | 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"; |
252 | 253 | } |
253 | 254 | |
254 | 255 | function formatValue( $field , $value ){ |
— | — | @@ -299,7 +300,7 @@ |
300 | 301 | $formatted = ' '; |
301 | 302 | } |
302 | 303 | $s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted ) |
303 | | - . "</tr>\n"; |
| 304 | + . "</tr>\n"; |
304 | 305 | } |
305 | 306 | return $s; |
306 | 307 | } |
— | — | @@ -326,8 +327,8 @@ |
327 | 328 | |
328 | 329 | // This is not actually used, as getStartBody is overridden above |
329 | 330 | 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') ); |
332 | 333 | } |
333 | 334 | function getTitle() { |
334 | 335 | return SpecialPage::getTitleFor( 'Allmessages', false ); |