'SpecialExport' => 'includes/specials/SpecialExport.php',
'SpecialImport' => 'includes/specials/SpecialImport.php',
'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php',
+ 'SpecialMergeHistory' => 'includes/specials/SpecialMergeHistory.php',
'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
'SpecialPreferences' => 'includes/specials/SpecialPreferences.php',
'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
'Import' => 'SpecialImport',
'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ),
'Whatlinkshere' => 'SpecialWhatlinkshere',
- 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
+ 'MergeHistory' => 'SpecialMergeHistory',
# Other
'Booksources' => 'SpecialBookSources',
* Special page allowing users with the appropriate permissions to
* merge article histories, with some restrictions
*
- * @file
* @ingroup SpecialPage
*/
-
-/**
- * Constructor
- */
-function wfSpecialMergehistory( $par ) {
- global $wgRequest;
-
- $form = new MergehistoryForm( $wgRequest, $par );
- $form->execute();
-}
-
-/**
- * The HTML form for Special:MergeHistory, which allows users with the appropriate
- * permissions to view and restore deleted content.
- * @ingroup SpecialPage
- */
-class MergehistoryForm {
+class SpecialMergeHistory extends SpecialPage {
var $mAction, $mTarget, $mDest, $mTimestamp, $mTargetID, $mDestID, $mComment;
var $mTargetObj, $mDestObj;
- function MergehistoryForm( $request, $par = "" ) {
- global $wgUser;
+ public function __construct() {
+ parent::__construct( 'MergeHistory', 'mergehistory' );
+ }
+ private function loadRequestParams( $request ) {
+ global $wgUser;
$this->mAction = $request->getVal( 'action' );
$this->mTarget = $request->getVal( 'target' );
$this->mDest = $request->getVal( 'dest' );
$this->mTargetObj = null;
$this->mDestObj = null;
}
-
$this->preCacheMessages();
}
}
}
- function execute() {
- global $wgOut;
+ function execute( $par = '' ) {
+ global $wgOut, $wgRequest, $wgUser;
+
+ if( !$wgUser->isAllowed( 'mergehistory' ) ) {
+ $wgOut->permissionRequired( 'mergehistory' );
+ return;
+ }
+
+ $this->loadRequestParams( $wgRequest );
$wgOut->setPagetitle( wfMsgHtml( "mergehistory" ) );
'<fieldset>' .
Xml::element( 'legend', array(),
wfMsg( 'mergehistory-box' ) ) .
- Xml::hidden( 'title',
- SpecialPage::getTitleFor( 'Mergehistory' )->getPrefixedDbKey() ) .
+ Xml::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) .
Xml::hidden( 'submitted', '1' ) .
Xml::hidden( 'mergepoint', $this->mTimestamp ) .
Xml::openElement( 'table' ) .
$revisions = new MergeHistoryPager( $this, array(), $this->mTargetObj, $this->mDestObj );
$haveRevisions = $revisions && $revisions->getNumRows() > 0;
- $titleObj = SpecialPage::getTitleFor( "Mergehistory" );
+ $titleObj = $this->getTitle();
$action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
# Start the form here
$top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'merge' ) );