$this->dieUsageMsg( reset( $retval ) );
}
- $this->setWatch( $params['watchlist'], $titleObj );
+ $watch = 'preferences';
+ if ( isset( $params['watchlist'] ) ) {
+ $watch = $params['watchlist'];
+ }
+
+ // Watch pages
+ $this->setWatch( $watch, $titleObj, 'watchrollback' );
$info = array(
'title' => $titleObj->getPrefixedText(),
$p = $this->getModulePrefix();
return array(
- 'title' => "Title of the page you want to delete. Cannot be used together with {$p}pageid",
- 'pageid' => "Page ID of the page you want to delete. Cannot be used together with {$p}title",
+ 'title' => "Title of the page you want to roll back. Cannot be used together with {$p}pageid",
+ 'pageid' => "Page ID of the page you want to roll back. Cannot be used together with {$p}title",
'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 ' .
);
}
- public function getResultProperties() {
- return array(
- '' => array(
- 'title' => 'string',
- 'pageid' => 'integer',
- 'summary' => 'string',
- 'revid' => 'integer',
- 'old_revid' => 'integer',
- 'last_revid' => 'integer'
- )
- );
- }
-
public function getDescription() {
return array(
'Undo the last edit to the page. If the last user who edited the page made',
);
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'invalidtitle', 'title' ),
- array( 'notanarticle' ),
- array( 'nosuchpageid', 'pageid' ),
- array( 'invaliduser', 'user' ),
- ) );
- }
-
public function needsToken() {
return true;
}