$params = $this->extractRequestParams();
$this->requireOnlyOneParameter( $params, 'title', 'pageid' );
-
- if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
if ( isset( $params['title'] ) ) {
$titleObj = Title::newFromText( $params['title'] );
array( 'nosuchpageid', 'pageid' ),
array( 'notanarticle' ),
array( 'hookaborted', 'error' ),
- array( 'show' ),
) );
}
public function execute() {
global $wgUser;
$params = $this->extractRequestParams();
-
- if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
-
if ( is_null( $params['reason'] ) ) {
$params['reason'] = '';
}
array( 'notanarticle' ),
array( 'invalidtitle', 'to' ),
array( 'sharedfile-exists' ),
- array( 'show' ),
) );
}
public function execute() {
global $wgUser, $wgRestrictionTypes, $wgRestrictionLevels;
$params = $this->extractRequestParams();
-
- if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
$titleObj = null;
if ( !isset( $params['title'] ) ) {
$articleObj = new Article( $titleObj );
if ( $params['watch'] ) {
$articleObj->doWatch();
- } elseif ( $params['unwatch'] ) {
- $articleObj->doUnwatch();
}
-
if ( $titleObj->exists() ) {
$ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
} else {
'reason' => '',
'cascade' => false,
'watch' => false,
- 'unwatch' => false,
);
}
'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
'watch' => 'If set, add the page being (un)protected to your watchlist',
- 'unwatch' => 'Remove the page being (un)protected from your watchlist',
);
}
array( 'protect-invalidlevel', 'level' ),
array( 'invalidexpiry', 'expiry' ),
array( 'pastexpiry', 'expiry' ),
- array( 'show' ),
) );
}
public function execute() {
$params = $this->extractRequestParams();
-
- if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
$titleObj = null;
if ( !isset( $params['title'] ) ) {
// We don't care about multiple errors, just report one of them
$this->dieUsageMsg( reset( $retval ) );
}
-
- if ( $params['watch'] || $wgUser->getOption( 'watchdeletion' ) ) {
- $articleObj->doWatch();
- } elseif ( $params['unwatch'] ) {
- $articleObj->doUnwatch();
- }
$info = array(
'title' => $titleObj->getPrefixedText(),
'user' => null,
'token' => null,
'summary' => null,
- 'markbot' => false,
- 'watch' => false,
- 'unwatch' => false,
+ 'markbot' => false
);
}
'user' => 'Name of the user whose edits are to be rolled back. If set incorrectly, you\'ll get a badtoken error.',
'token' => 'A rollback token previously retrieved through prop=revisions',
'summary' => 'Custom edit summary. If not set, default summary will be used.',
- 'markbot' => 'Mark the reverted edits and the revert as bot edits',
- 'watch' => 'Add the page to your watchlist',
- 'unwatch' => 'Remove the page from your watchlist',
+ 'markbot' => 'Mark the reverted edits and the revert as bot edits'
);
}
array( 'invalidtitle', 'title' ),
array( 'notanarticle' ),
array( 'invaliduser', 'user' ),
- array( 'show' ),
) );
}
public function execute() {
global $wgUser;
$params = $this->extractRequestParams();
-
- if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
$titleObj = null;
if ( !isset( $params['title'] ) ) {
$this->dieUsageMsg( array( 'cannotundelete' ) );
}
- if ( $params['watch'] ) {
- $articleObj = new Article( $titleObj );
- $articleObj->doWatch();
- } elseif ( $params['unwatch'] ) {
- $articleObj = new Article( $titleObj );
- $articleObj->doUnwatch();
- }
-
if ( $retval[1] ) {
wfRunHooks( 'FileUndeleteComplete',
array( $titleObj, array(), $wgUser, $params['reason'] ) );
'reason' => '',
'timestamps' => array(
ApiBase::PARAM_ISMULTI => true
- ),
- 'watch' => false,
- 'unwatch' => false,
+ )
);
}
'title' => 'Title of the page you want to restore.',
'token' => 'An undelete token previously retrieved through list=deletedrevs',
'reason' => 'Reason for restoring (optional)',
- 'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.',
- 'watch' => 'Add the page to your watchlist',
- 'unwatch' => 'Remove the page from your watchlist',
+ 'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.'
);
}
array( 'blockedtext' ),
array( 'invalidtitle', 'title' ),
array( 'cannotundelete' ),
- array( 'show' ),
) );
}
$this->mParams = $this->extractRequestParams();
$request = $this->getMain()->getRequest();
-
- if ( isset( $this->mParams['watch'] ) && isset( $this->mParams['unwatch'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
- }
// Add the uploaded file to the params array
$this->mParams['file'] = $request->getFileName( 'file' );
// No errors, no warnings: do the upload
$status = $this->mUpload->performUpload( $this->mParams['comment'],
$this->mParams['text'], $this->mParams['watch'], $wgUser );
-
- if ( $this->mParams['unwatch'] ) {
- $wgUser->removeWatch( $file->getTitle() );
- }
if ( !$status->isGood() ) {
$error = $status->getErrorsArray();
'text' => null,
'token' => null,
'watch' => false,
- 'unwatch' => false,
'ignorewarnings' => false,
'file' => null,
'url' => null,
'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
'text' => 'Initial page text for new files',
'watch' => 'Watch the page',
- 'watch' => 'Unwatch the page',
'ignorewarnings' => 'Ignore any warnings',
'file' => 'File contents',
'url' => 'Url to fetch the file from',
array( 'mustbeloggedin', 'upload' ),
array( 'badaccess-groups' ),
array( 'badaccess-groups' ),
- array( 'show' ),
array( 'code' => 'fetchfileerror', 'info' => '' ),
array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),