}
function showForm( $err, $hookErr = '' ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser;
$ot = Title::newFromURL( $this->oldTitle );
if( is_null( $ot ) ) {
return;
}
- $start = $wgContLang->isRTL() ? 'right' : 'left';
- $end = $wgContLang->isRTL() ? 'left' : 'right';
$sk = $wgUser->getSkin();
$oldTitleLink = $sk->makeLinkObj( $ot );
# Show the current title as a default
# when the form is first opened.
$newTitle = $oldTitle;
- $encNewTitle = htmlspecialchars( $oldTitle );
} else {
if( $err == '' ) {
$nt = Title::newFromURL( $this->newTitle );
}
}
$newTitle = $this->newTitle;
- $encNewTitle = htmlspecialchars( $newTitle );
}
if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) {
$confirm = "
<tr>
<td></td>
- <td>" .
+ <td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'delete_and_move_confirm' ), 'wpConfirm', 'wpConfirm' ) .
"</td>
</tr>";
$errMsg = "";
if( $err == 'hookaborted' ) {
$errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n";
+ } else if (is_array($err)) {
+ $errMsg = '<p><strong class="error">' . call_user_func_array( 'wfMsgWikiHtml', $err ) . "</strong></p>\n";
} else {
$errMsg = '<p><strong class="error">' . wfMsgWikiHtml( $err ) . "</strong></p>\n";
}
$wgOut->addHTML( $errMsg );
}
- $moveTalkChecked = $this->moveTalk ? ' checked="checked"' : '';
-
$wgOut->addHTML(
Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'move-page-legend' ) ) .
- Xml::openElement( 'table', array( 'border' => '0' ) ) .
+ Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-movepage-table' ) ) .
"<tr>
- <td align='$end'>" .
+ <td class='mw-label'>" .
wfMsgHtml( 'movearticle' ) .
"</td>
- <td align='$start'>
+ <td class='mw-input'>
<strong>{$oldTitleLink}</strong>
</td>
</tr>
<tr>
- <td align='$end'>" .
+ <td class='mw-label'>" .
Xml::label( wfMsg( 'newtitle' ), 'wpNewTitle' ) .
"</td>
- <td align='$start'>" .
- Xml::input( 'wpNewTitle', 40, $this->newTitle, array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) .
+ <td class='mw-input'>" .
+ Xml::input( 'wpNewTitle', 40, $newTitle, array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) .
Xml::hidden( 'wpOldTitle', $oldTitle ) .
"</td>
</tr>
<tr>
- <td align='$end' valign='top'><br />" .
+ <td class='mw-label'>" .
Xml::label( wfMsg( 'movereason' ), 'wpReason' ) .
"</td>
- <td align='$start' valign='top'><br />" .
- Xml::openElement( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2 ) ) .
- htmlspecialchars( $this->reason ) .
- Xml::closeElement( 'textarea' ) .
+ <td class='mw-input'>" .
+ Xml::tags( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2 ), htmlspecialchars( $this->reason ) ) .
"</td>
</tr>"
);
$wgOut->addHTML( "
<tr>
<td></td>
- <td>" .
- Xml::checkLabel( wfMsg( 'movetalk' ), 'wpMovetalk', 'wpMovetalk', $moveTalkChecked ) .
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'movetalk' ), 'wpMovetalk', 'wpMovetalk', $this->moveTalk ) .
"</td>
</tr>"
);
$wgOut->addHTML( "
<tr>
<td></td>
- <td>" .
+ <td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'move-watch' ), 'wpWatch', 'watch', $watchChecked ) .
"</td>
</tr>
{$confirm}
<tr>
<td> </td>
- <td align='$start'>" .
+ <td class='mw-submit'>" .
Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
"</td>
</tr>" .
# Delete to make way if requested
if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) {
$article = new Article( $nt );
+
+ # Disallow deletions of big articles
+ $bigHistory = $article->isBigDeletion();
+ if( $bigHistory && !$nt->userCan( 'bigdelete' ) ) {
+ global $wgLang, $wgDeleteRevisionsLimit;
+ $this->showForm( array('delete-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) );
+ return;
+ }
+
// This may output an error message and exit
$article->doDelete( wfMsgForContent( 'delete_and_move_reason' ) );
}
}
function showLogFragment( $title, &$out ) {
- $out->addHTML( wfElement( 'h2', NULL, LogPage::logName( 'move' ) ) );
- $request = new FauxRequest( array( 'page' => $title->getPrefixedText(), 'type' => 'move' ) );
- $viewer = new LogViewer( new LogReader( $request ) );
- $viewer->showList( $out );
+ $out->addHTML( Xml::element( 'h2', NULL, LogPage::logName( 'move' ) ) );
+ LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() );
}
}