Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -268,17 +268,18 @@ |
269 | 269 | if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) { |
270 | 270 | $msg = $action; |
271 | 271 | } |
272 | | - $label = Xml::element( 'label', |
273 | | - array( 'for' => "mwProtect-level-$action" ), |
274 | | - $msg ); |
275 | | - $out .= "<tr><th>$label</th></tr>"; |
276 | | - $out .= "<tr><td>" . |
277 | | - $this->buildSelector( $action, $selected ) . |
278 | | - "</td></tr>"; |
| 272 | + $label = Xml::element( 'label', array( 'for' => "mwProtect-level-$action" ), $msg ); |
| 273 | + $out .= "<tr><td><table>" . |
| 274 | + "<tr><th>$label</th><th></th></tr>" . |
| 275 | + "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td><td>"; |
| 276 | + |
| 277 | + $reasonDropDown = Xml::listDropDown( 'wpProtectReasonList', |
| 278 | + wfMsgForContent( 'protect-dropdown' ), |
| 279 | + wfMsgForContent( 'protect-otherreason-op' ), '', 'mwProtect-reason', 4 ); |
279 | 280 | $scExpiryOptions = wfMsgForContent( 'ipboptions' ); // FIXME: use its own message |
280 | 281 | |
281 | 282 | $showProtectOptions = ($scExpiryOptions !== '-' && !$this->disabled); |
282 | | - |
| 283 | + |
283 | 284 | $mProtectexpiry = Xml::label( wfMsg( 'protectexpiry' ), "mwProtectExpiryList-$action" ); |
284 | 285 | $mProtectother = Xml::label( wfMsg( 'protect-othertime' ), "mwProtect-$action-expires" ); |
285 | 286 | $expiryFormOptions = Xml::option( wfMsg( 'protect-othertime-op' ), "wpProtectExpiryList-$action" ); |
— | — | @@ -292,7 +293,7 @@ |
293 | 294 | # Add expiry dropdown |
294 | 295 | if( $showProtectOptions && !$this->disabled ) { |
295 | 296 | $out .= " |
296 | | - <tr> |
| 297 | + <table><tr> |
297 | 298 | <td class='mw-label'> |
298 | 299 | {$mProtectexpiry} |
299 | 300 | </td> |
— | — | @@ -305,30 +306,27 @@ |
306 | 307 | 'tabindex' => '2' ) + $this->disabledAttrib, |
307 | 308 | $expiryFormOptions ) . |
308 | 309 | "</td> |
309 | | - </tr>"; |
| 310 | + </tr></table>"; |
310 | 311 | } |
311 | 312 | # Add custom expiry field |
312 | 313 | $attribs = array( 'id' => "mwProtect-$action-expires", 'onkeyup' => 'protectExpiryUpdate(this)' ) + $this->disabledAttrib; |
313 | | - $out .= "<tr> |
| 314 | + $out .= "<table><tr> |
314 | 315 | <td class='mw-label'>" . |
315 | 316 | $mProtectother . |
316 | 317 | '</td> |
317 | 318 | <td class="mw-input">' . |
318 | 319 | Xml::input( "mwProtect-expiry-$action", 60, $this->mExpiry[$action], $attribs ) . |
319 | 320 | '</td> |
320 | | - </tr>'; |
| 321 | + </tr></table>'; |
| 322 | + $out .= "</td></tr></table></td></tr>"; |
321 | 323 | } |
322 | | - $reasonDropDown = Xml::listDropDown( 'wpProtectReasonList', |
323 | | - wfMsgForContent( 'protect-dropdown' ), |
324 | | - wfMsgForContent( 'protect-otherreason-op' ), '', 'mwProtect-reason', 4 ); |
325 | 324 | |
| 325 | + $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' ); |
| 326 | + |
326 | 327 | // JavaScript will add another row with a value-chaining checkbox |
327 | | - $out .= Xml::closeElement( 'tbody' ) . |
328 | | - Xml::closeElement( 'table' ) . |
329 | | - Xml::openElement( 'table', array( 'id' => 'mw-protect-table2' ) ) . |
330 | | - Xml::openElement( 'tbody' ); |
331 | | - |
332 | 328 | if( $this->mTitle->exists() ) { |
| 329 | + $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table2' ) ) . |
| 330 | + Xml::openElement( 'tbody' ); |
333 | 331 | $out .= '<tr> |
334 | 332 | <td></td> |
335 | 333 | <td class="mw-input">' . |
— | — | @@ -336,9 +334,13 @@ |
337 | 335 | $this->mCascade, $this->disabledAttrib ) . |
338 | 336 | "</td> |
339 | 337 | </tr>\n"; |
| 338 | + $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' ); |
340 | 339 | } |
341 | | - # Add manual and custom reason field/selects |
| 340 | + |
| 341 | + # Add manual and custom reason field/selects as well as submit |
342 | 342 | if( !$this->disabled ) { |
| 343 | + $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table3' ) ) . |
| 344 | + Xml::openElement( 'tbody' ); |
343 | 345 | $out .= " |
344 | 346 | <tr> |
345 | 347 | <td class='mw-label'> |
— | — | @@ -371,12 +373,10 @@ |
372 | 374 | Xml::submitButton( wfMsg( 'confirm' ), array( 'id' => 'mw-Protect-submit' ) ) . |
373 | 375 | "</td> |
374 | 376 | </tr>\n"; |
| 377 | + $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' ); |
375 | 378 | } |
| 379 | + $out .= Xml::closeElement( 'fieldset' ); |
376 | 380 | |
377 | | - $out .= Xml::closeElement( 'tbody' ) . |
378 | | - Xml::closeElement( 'table' ) . |
379 | | - Xml::closeElement( 'fieldset' ); |
380 | | - |
381 | 381 | if ( !$this->disabled ) { |
382 | 382 | $out .= Xml::closeElement( 'form' ) . |
383 | 383 | $this->buildCleanupScript(); |
— | — | @@ -453,7 +453,8 @@ |
454 | 454 | } |
455 | 455 | } |
456 | 456 | $script .= "[" . implode(',',$CascadeableLevels) . "];\n"; |
457 | | - $script .= 'protectInitialize("mwProtectSet","' . Xml::escapeJsString( wfMsg( 'protect-unchain' ) ) . '","' . count($this->mApplicableTypes) . '")'; |
| 457 | + $script .= 'protectInitialize("mw-protect-table2","' . Xml::escapeJsString( wfMsg( 'protect-unchain' ) ) . |
| 458 | + '","' . count($this->mApplicableTypes) . '")'; |
458 | 459 | return Xml::tags( 'script', array( 'type' => 'text/javascript' ), $script ); |
459 | 460 | } |
460 | 461 | |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2503,7 +2503,7 @@ |
2504 | 2504 | |
2505 | 2505 | if ( $auth ) { |
2506 | 2506 | global $wgUser; |
2507 | | - $errors = array_merge($errors, |
| 2507 | + $errors = wfArrayMerge($errors, |
2508 | 2508 | $this->getUserPermissionsErrors('move', $wgUser), |
2509 | 2509 | $this->getUserPermissionsErrors('edit', $wgUser), |
2510 | 2510 | $nt->getUserPermissionsErrors('move', $wgUser), |
Index: trunk/phase3/includes/specials/SpecialMovepage.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | # when the form is first opened. |
95 | 95 | $newTitle = $oldTitle; |
96 | 96 | } else { |
97 | | - if( $err == '' ) { |
| 97 | + if( empty($err) ) { |
98 | 98 | $nt = Title::newFromURL( $this->newTitle ); |
99 | 99 | if( $nt ) { |
100 | 100 | # If a title was supplied, probably from the move log revert |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | $newTitle = $this->newTitle; |
110 | 110 | } |
111 | 111 | |
112 | | - if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { |
| 112 | + if ( !empty($err) && $err[0] == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { |
113 | 113 | $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle ); |
114 | 114 | $movepagebtn = wfMsg( 'delete_and_move' ); |
115 | 115 | $submitVar = 'wpDeleteAndMove'; |
— | — | @@ -144,9 +144,9 @@ |
145 | 145 | $titleObj = SpecialPage::getTitleFor( 'Movepage' ); |
146 | 146 | $token = htmlspecialchars( $wgUser->editToken() ); |
147 | 147 | |
148 | | - if ( $err != '' ) { |
| 148 | + if ( !empty($err) ) { |
149 | 149 | $wgOut->setSubtitle( wfMsg( 'formerror' ) ); |
150 | | - if( $err == 'hookaborted' ) { |
| 150 | + if( $err[0] == 'hookaborted' ) { |
151 | 151 | $errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n"; |
152 | 152 | $wgOut->addHTML( $errMsg ); |
153 | 153 | } else { |
— | — | @@ -292,12 +292,7 @@ |
293 | 293 | |
294 | 294 | $error = $ot->moveTo( $nt, true, $this->reason ); |
295 | 295 | if ( $error !== true ) { |
296 | | - if (isset($error[0][0]) && $error[0][0] = 'cascadeprotected') { |
297 | | - $wgOut->showPermissionsErrorPage($error, 'move'); |
298 | | - return; |
299 | | - } |
300 | | - # FIXME: showForm() should handle multiple errors |
301 | | - call_user_func_array(array($this, 'showForm'), $error[0]); |
| 296 | + call_user_func_array( array($this, 'showForm'), $error ); |
302 | 297 | return; |
303 | 298 | } |
304 | 299 | |