'Nuke', 'version' => preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change 'description' => 'Gives sysops the ability to mass delete pages', 'descriptionmsg' => 'nuke-desc', 'author' => 'Brion Vibber', 'url' => 'http://www.mediawiki.org/wiki/Extension:Nuke' ); $wgGroupPermissions['sysop']['nuke'] = true; $wgAvailableRights[] = 'nuke'; function wfSetupNuke() { wfLoadExtensionMessages( 'Nuke' ); $GLOBALS['wgSpecialPages']['Nuke'] = array( /*class*/ 'SpecialPage', /*name*/ 'Nuke', /* permission */'nuke', /*listed*/ true, /*function*/ false, /*file*/ false ); } function wfSpecialNuke( $par = '' ) { global $wgRequest; $target = $wgRequest->getText( 'target', $par ); $form = new NukeForm( $target, $wgRequest ); $form->run(); } class NukeForm { function NukeForm( $target, $request ) { global $wgUser; $this->mTarget = $target; $this->mReason = $request->getText( 'wpReason', wfMsgForContent( 'nuke-defaultreason', $target ) ); $this->mPosted = $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ); if( $this->mPosted ) { $this->mPages = $request->getArray( 'pages' ); } } function run() { if( $this->mPosted && $this->mPages ) { return $this->doDelete( $this->mPages, $this->mReason ); } if( $this->mTarget != '' ) { $this->listForm( $this->mTarget, $this->mReason ); } else { $this->promptForm(); } } function promptForm() { global $wgUser, $wgOut; $sk =& $wgUser->getSkin(); $nuke = Title::makeTitle( NS_SPECIAL, 'Nuke' ); $submit = wfElement( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-user' ) ) ); $wgOut->addWikiText( wfMsg( 'nuke-tools' ) ); $wgOut->addHTML( wfElement( 'form', array( 'action' => $nuke->getLocalURL( 'action=submit' ), 'method' => 'post' ), null ) . wfElement( 'input', array( 'type' => 'text', 'size' => 40, 'name' => 'target' ) ) . "\n$submit\n" ); $wgOut->addHTML( "" ); } function listForm( $username, $reason ) { global $wgUser, $wgOut, $wgLang; $pages = $this->getNewPages( $username ); $escapedName = wfEscapeWikiText( $username ); if( count( $pages ) == 0 ) { $wgOut->addWikiText( wfMsg( 'nuke-nopages', $escapedName ) ); return $this->promptForm(); } $wgOut->addWikiText( wfMsg( 'nuke-list', $escapedName ) ); $nuke = Title::makeTitle( NS_SPECIAL, 'Nuke' ); $submit = wfElement( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-delete' ) ) ); $wgOut->addHTML( wfElement( 'form', array( 'action' => $nuke->getLocalURL( 'action=delete' ), 'method' => 'post' ), null ) . "\n