MediaWiki
REL1_24
|
Page addition to a user's watchlist. More...
Public Member Functions | |
getName () | |
Return the name of the action this object responds to. | |
onSubmit ($data) | |
Process the form on POST submission. | |
onSuccess () | |
Do something exciting on successful processing of the form. | |
requiresUnblock () | |
Whether this action can still be executed by a blocked user. | |
show () | |
This can be either formed or formless depending on the session token given. | |
Static Public Member Functions | |
static | doUnwatch (Title $title, User $user) |
Unwatch a page. | |
static | doWatch (Title $title, User $user, $checkRights=WatchedItem::CHECK_USER_RIGHTS) |
Watch a page. | |
static | doWatchOrUnwatch ($watch, Title $title, User $user) |
Watch or unwatch a page. | |
static | getUnwatchToken (Title $title, User $user, $action= 'unwatch') |
Get token to unwatch (or watch) a page for a user. | |
static | getWatchToken (Title $title, User $user, $action= 'watch') |
Get token to watch (or unwatch) a page for a user. | |
Protected Member Functions | |
alterForm (HTMLForm $form) | |
Play with the HTMLForm if you need to more substantially. | |
checkCanExecute (User $user) | |
Checks if the given user (identified by an object) can perform this action. | |
getDescription () | |
Returns the description that goes below the <h1> tag. | |
getFormFields () | |
Just get an empty form with a single submit button. | |
preText () | |
Add pre- or post-text to the form. |
Page addition to a user's watchlist.
Definition at line 28 of file WatchAction.php.
WatchAction::alterForm | ( | HTMLForm $ | form | ) | [protected] |
Play with the HTMLForm if you need to more substantially.
HTMLForm | $form |
Reimplemented from FormAction.
Reimplemented in UnwatchAction.
Definition at line 201 of file WatchAction.php.
References HTMLForm\setSubmitTextMsg().
WatchAction::checkCanExecute | ( | User $ | user | ) | [protected] |
Checks if the given user (identified by an object) can perform this action.
Can be overridden by sub-classes with more complicated permissions schemes. Failures here must throw subclasses of ErrorPageError
User | $user | The user to check, or null to use the context user |
UserBlockedError|ReadOnlyError|PermissionsError |
Reimplemented from Action.
Definition at line 82 of file WatchAction.php.
References User\isAnon().
Referenced by show().
static WatchAction::doUnwatch | ( | Title $ | title, |
User $ | user | ||
) | [static] |
Unwatch a page.
Definition at line 151 of file WatchAction.php.
References Action\$page, array(), Action\factory(), User\isAllowed(), Status\newFatal(), User\newFatalPermissionDeniedStatus(), Status\newGood(), User\removeWatch(), and wfRunHooks().
Referenced by doWatchOrUnwatch(), UnwatchAction\onSubmit(), and ApiWatch\watchTitle().
static WatchAction::doWatch | ( | Title $ | title, |
User $ | user, | ||
$ | checkRights = WatchedItem::CHECK_USER_RIGHTS |
||
) | [static] |
Watch a page.
Title | $title | Page to watch/unwatch |
User | $user | User who is watching/unwatching |
int | $checkRights | Passed through to $user->addWatch() |
Definition at line 123 of file WatchAction.php.
References Action\$page, User\addWatch(), array(), Action\factory(), WatchedItem\IGNORE_USER_RIGHTS, User\isAllowed(), Status\newFatal(), User\newFatalPermissionDeniedStatus(), Status\newGood(), and wfRunHooks().
Referenced by doWatchOrUnwatch(), onSubmit(), UploadBase\performUpload(), and ApiWatch\watchTitle().
static WatchAction::doWatchOrUnwatch | ( | $ | watch, |
Title $ | title, | ||
User $ | user | ||
) | [static] |
Watch or unwatch a page.
bool | $watch | Whether to watch or unwatch the page |
Title | $title | Page to watch/unwatch |
User | $user | User who is watching/unwatching |
Definition at line 99 of file WatchAction.php.
References doUnwatch(), doWatch(), WatchedItem\IGNORE_USER_RIGHTS, User\isLoggedIn(), User\isWatched(), and Status\newGood().
WatchAction::getDescription | ( | ) | [protected] |
Returns the description that goes below the <h1> tag.
Reimplemented from Action.
Reimplemented in UnwatchAction.
Definition at line 38 of file WatchAction.php.
References Action\msg().
WatchAction::getFormFields | ( | ) | [protected] |
Just get an empty form with a single submit button.
Reimplemented from FormAction.
Definition at line 46 of file WatchAction.php.
References array().
Return the name of the action this object responds to.
Reimplemented from Action.
Reimplemented in UnwatchAction.
Definition at line 30 of file WatchAction.php.
Referenced by show().
static WatchAction::getUnwatchToken | ( | Title $ | title, |
User $ | user, | ||
$ | action = 'unwatch' |
||
) | [static] |
Get token to unwatch (or watch) a page for a user.
Title | $title | Title object of page to unwatch |
User | $user | User for whom the action is going to be performed |
string | $action | Optionally override the action to 'watch' |
Definition at line 197 of file WatchAction.php.
References getWatchToken().
static WatchAction::getWatchToken | ( | Title $ | title, |
User $ | user, | ||
$ | action = 'watch' |
||
) | [static] |
Get token to watch (or unwatch) a page for a user.
Title | $title | Title object of page to watch |
User | $user | User for whom the action is going to be performed |
string | $action | Optionally override the action to 'unwatch' |
Definition at line 177 of file WatchAction.php.
References array(), User\getEditToken(), and Title\getPrefixedDBkey().
Referenced by UnwatchedpagesPage\formatResult(), and getUnwatchToken().
WatchAction::onSubmit | ( | $ | data | ) |
Process the form on POST submission.
If you return false from getFormFields(), this will obviously never be reached. If you don't want to do anything with the form, just return false here
array | $data |
Reimplemented from FormAction.
Reimplemented in UnwatchAction.
Definition at line 50 of file WatchAction.php.
References doWatch(), Action\getTitle(), Action\getUser(), wfProfileIn(), and wfProfileOut().
Referenced by show().
Do something exciting on successful processing of the form.
This might be to show a confirmation message (watch, rollback, etc) or to redirect somewhere else (edit, protect, etc).
Reimplemented from FormAction.
Reimplemented in UnwatchAction.
Definition at line 209 of file WatchAction.php.
References Action\getOutput(), and Action\getTitle().
Referenced by show().
WatchAction::preText | ( | ) | [protected] |
Add pre- or post-text to the form.
Reimplemented from FormAction.
Reimplemented in UnwatchAction.
Definition at line 205 of file WatchAction.php.
References Action\msg().
Whether this action can still be executed by a blocked user.
Reimplemented from Action.
Definition at line 34 of file WatchAction.php.
This can be either formed or formless depending on the session token given.
Reimplemented from FormAction.
Definition at line 61 of file WatchAction.php.
References $form, $user, array(), checkCanExecute(), FormAction\getForm(), getName(), Action\getTitle(), Action\getUser(), onSubmit(), onSuccess(), and Action\setHeaders().