Index: trunk/phase3/includes/SpecialProtectedpages.php |
— | — | @@ -9,6 +9,10 @@ |
10 | 10 | * @addtogroup SpecialPage |
11 | 11 | */ |
12 | 12 | class ProtectedPagesForm { |
| 13 | + |
| 14 | + protected $IdLevel = 'level'; |
| 15 | + protected $IdType = 'type'; |
| 16 | + |
13 | 17 | function showList( $msg = '' ) { |
14 | 18 | global $wgOut, $wgRequest; |
15 | 19 | |
— | — | @@ -22,8 +26,8 @@ |
23 | 27 | Title::purgeExpiredRestrictions(); |
24 | 28 | } |
25 | 29 | |
26 | | - $type = $wgRequest->getVal( 'type' ); |
27 | | - $level = $wgRequest->getVal( 'level' ); |
| 30 | + $type = $wgRequest->getVal( $this->IdType ); |
| 31 | + $level = $wgRequest->getVal( $this->IdLevel ); |
28 | 32 | $sizetype = $wgRequest->getVal( 'sizetype' ); |
29 | 33 | $size = $wgRequest->getIntOrNull( 'size' ); |
30 | 34 | $NS = $wgRequest->getIntOrNull( 'namespace' ); |
— | — | @@ -125,7 +129,7 @@ |
126 | 130 | $out .= " ".Xml::radio( 'sizetype', 'max', ($sizetype=='max'), array('id' => 'wpmax') ); |
127 | 131 | $out .= Xml::label( wfMsg("maximum-size"), 'wpmax' ); |
128 | 132 | $out .= " ".Xml::input('size', 9, $size, array( 'id' => 'wpsize' ) ); |
129 | | - $out .= ' '.wfMsg('pagesize'); |
| 133 | + $out .= ' '.wfMsgHtml('pagesize'); |
130 | 134 | return $out; |
131 | 135 | } |
132 | 136 | |
— | — | @@ -134,25 +138,28 @@ |
135 | 139 | * @private |
136 | 140 | */ |
137 | 141 | function getTypeMenu( $pr_type ) { |
138 | | - global $wgRestrictionTypes, $wgUser; |
| 142 | + global $wgRestrictionTypes; |
139 | 143 | |
140 | | - $out = "<select name='type'>\n"; |
141 | 144 | $m = array(); // Temporary array |
| 145 | + $options = array(); |
142 | 146 | |
143 | 147 | // First pass to load the log names |
144 | 148 | foreach( $wgRestrictionTypes as $type ) { |
145 | | - $text = wfMsgHtml("restriction-$type"); |
| 149 | + $text = wfMsg("restriction-$type"); |
146 | 150 | $m[$text] = $type; |
147 | 151 | } |
148 | 152 | |
149 | 153 | // Third pass generates sorted XHTML content |
150 | 154 | foreach( $m as $text => $type ) { |
151 | 155 | $selected = ($type == $pr_type ); |
152 | | - $out .= Xml::option( $text, $type, $selected ) . "\n"; |
| 156 | + $options[] = Xml::option( $text, $type, $selected ) . "\n"; |
153 | 157 | } |
154 | 158 | |
155 | | - $out .= '</select>'; |
156 | | - return "<label for='type'>" . wfMsgHtml('restriction-type') . "</label>: " . $out; |
| 159 | + return |
| 160 | + Xml::label( wfMsg('restriction-type') , $this->IdType ) . ' ' . |
| 161 | + Xml::tags( 'select', |
| 162 | + array( 'id' => $this->IdType, 'name' => $this->IdType ), |
| 163 | + implode( "\n", $options ) ); |
157 | 164 | } |
158 | 165 | |
159 | 166 | /** |
— | — | @@ -160,30 +167,30 @@ |
161 | 168 | * @private |
162 | 169 | */ |
163 | 170 | function getLevelMenu( $pr_level ) { |
164 | | - global $wgRestrictionLevels, $wgUser; |
165 | | - |
166 | | - $out = "<select name='level'>\n"; |
167 | | - $m = array( wfMsgHtml('restriction-level-all') => 0 ); // Temporary array |
| 171 | + global $wgRestrictionLevels; |
168 | 172 | |
| 173 | + $m = array( wfMsg('restriction-level-all') => 0 ); // Temporary array |
| 174 | + $options = array(); |
| 175 | + |
169 | 176 | // First pass to load the log names |
170 | 177 | foreach( $wgRestrictionLevels as $type ) { |
171 | 178 | if ( $type !='' && $type !='*') { |
172 | | - $text = wfMsgHtml("restriction-level-$type"); |
| 179 | + $text = wfMsg("restriction-level-$type"); |
173 | 180 | $m[$text] = $type; |
174 | 181 | } |
175 | 182 | } |
176 | 183 | |
177 | | - // Second pass to sort by name |
178 | | - ksort($m); |
179 | | - |
180 | 184 | // Third pass generates sorted XHTML content |
181 | 185 | foreach( $m as $text => $type ) { |
182 | 186 | $selected = ($type == $pr_level ); |
183 | | - $out .= Xml::option( $text, $type, $selected ) . "\n"; |
| 187 | + $options[] = Xml::option( $text, $type, $selected ); |
184 | 188 | } |
185 | 189 | |
186 | | - $out .= '</select>'; |
187 | | - return "<label for='level'>" . wfMsgHtml('restriction-level') . "</label>: " . $out; |
| 190 | + return |
| 191 | + Xml::label( wfMsg('restriction-level') , $this->IdLevel ) . ' ' . |
| 192 | + Xml::tags( 'select', |
| 193 | + array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ), |
| 194 | + implode( "\n", $options ) ); |
188 | 195 | } |
189 | 196 | } |
190 | 197 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1835,8 +1835,8 @@ |
1836 | 1836 | 'protect-summary-cascade' => 'cascading', |
1837 | 1837 | 'protect-expiring' => 'expires $1 (UTC)', |
1838 | 1838 | 'protect-cascade' => 'Cascading protection - protect any pages included in this page.', |
1839 | | -'restriction-type' => 'Permission', |
1840 | | -'restriction-level' => 'Restriction level', |
| 1839 | +'restriction-type' => 'Permission:', |
| 1840 | +'restriction-level' => 'Restriction level:', |
1841 | 1841 | 'minimum-size' => 'Min size', |
1842 | 1842 | 'maximum-size' => 'Max size', |
1843 | 1843 | 'pagesize' => '(bytes)', |
Index: trunk/phase3/languages/messages/MessagesFi.php |
— | — | @@ -1316,7 +1316,7 @@ |
1317 | 1317 | 'restriction-level' => 'Suojaus', |
1318 | 1318 | 'minimum-size' => 'Vähimmäiskoko', |
1319 | 1319 | 'maximum-size' => 'Enimmäiskoko', |
1320 | | -'pagesize' => '(tavuina)', |
| 1320 | +'pagesize' => 'tavua', |
1321 | 1321 | |
1322 | 1322 | # Restrictions (nouns) |
1323 | 1323 | 'restriction-edit' => 'muokkaus', |
— | — | @@ -1357,7 +1357,7 @@ |
1358 | 1358 | 'undelete-no-results' => 'Poistoarkistosta ei löytynyt haettuja sivuja.', |
1359 | 1359 | |
1360 | 1360 | # Namespace form on various pages |
1361 | | -'namespace' => 'Nimiavaruus:', |
| 1361 | +'namespace' => 'Nimiavaruus', |
1362 | 1362 | 'invert' => 'Käännä nimiavaruusvalinta päinvastaiseksi', |
1363 | 1363 | |
1364 | 1364 | # Contributions |