);
}
+ $this->logFeatureUsage( 'action=watch&title' );
$title = Title::newFromText( $params['title'] );
if ( !$title || !$title->isWatchable() ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
}
public function needsToken() {
- return true;
- }
-
- public function getTokenSalt() {
return 'watch';
}
),
'unwatch' => false,
'uselang' => null,
- 'token' => array(
- ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => true
- ),
'continue' => '',
);
if ( $flags ) {
'title' => 'The page to (un)watch. use titles instead',
'unwatch' => 'If set the page will be unwatched rather than watched',
'uselang' => 'Language to show the message in',
- 'token' => 'A token previously acquired via prop=info',
'continue' => 'When more results are available, use this to continue',
);
}
- public function getResultProperties() {
- return array(
- '' => array(
- 'title' => 'string',
- 'unwatched' => 'boolean',
- 'watched' => 'boolean',
- 'message' => 'string'
- )
- );
- }
-
public function getDescription() {
return 'Add or remove pages from/to the current user\'s watchlist.';
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
- array( 'invalidtitle', 'title' ),
- array( 'hookaborted' ),
- ) );
- }
-
public function getExamples() {
return array(
'api.php?action=watch&titles=Main_Page' => 'Watch the page "Main Page"',