MediaWiki  REL1_19
WatchAction Class Reference
Inheritance diagram for WatchAction:
Collaboration diagram for WatchAction:

List of all members.

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)
static doWatch (Title $title, User $user)
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.

Detailed Description

Definition at line 23 of file WatchAction.php.


Member Function Documentation

WatchAction::alterForm ( HTMLForm form) [protected]

Play with the HTMLForm if you need to more substantially.

Parameters:
$formHTMLForm

Reimplemented from FormAction.

Reimplemented in UnwatchAction.

Definition at line 138 of file WatchAction.php.

References HTMLForm\setSubmitText(), and wfMsg().

Here is the call graph for this function:

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

Parameters:
$userUser: the user to check, or null to use the context user
Exceptions:
ErrorPageError

Reimplemented from Action.

Definition at line 76 of file WatchAction.php.

References User\isAnon().

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

static WatchAction::doUnwatch ( Title title,
User user 
) [static]

Definition at line 95 of file WatchAction.php.

References Action\$page, Action\factory(), User\removeWatch(), and wfRunHooks().

Referenced by EditPage\commitWatch(), ApiWatch\execute(), FileDeleteForm\execute(), UnwatchAction\onSubmit(), ProtectionForm\save(), and ApiBase\setWatch().

Here is the call graph for this function:

Here is the caller graph for this function:

static WatchAction::doWatch ( Title title,
User user 
) [static]

Definition at line 85 of file WatchAction.php.

References Action\$page, User\addWatch(), Action\factory(), and wfRunHooks().

Referenced by EditPage\commitWatch(), ApiWatch\execute(), FileDeleteForm\execute(), onSubmit(), ProtectionForm\save(), and ApiBase\setWatch().

Here is the call graph for this function:

Here is the caller graph for this function:

WatchAction::getDescription ( ) [protected]

Returns the description that goes below the <h1> tag.

Returns:
String

Reimplemented from Action.

Reimplemented in UnwatchAction.

Definition at line 33 of file WatchAction.php.

References wfMsgHtml().

Here is the call graph for this function:

WatchAction::getFormFields ( ) [protected]

Just get an empty form with a single submit button.

Returns:
array

Reimplemented from FormAction.

Definition at line 41 of file WatchAction.php.

Return the name of the action this object responds to.

Returns:
String lowercase

Reimplemented from Action.

Reimplemented in UnwatchAction.

Definition at line 25 of file WatchAction.php.

Referenced by show().

Here is the caller graph for this function:

static WatchAction::getUnwatchToken ( Title title,
User user,
action = 'unwatch' 
) [static]

Get token to unwatch (or watch) a page for a user.

Parameters:
Title$titleTitle object of page to unwatch
User$userUser for whom the action is going to be performed
string$actionOptionally override the action to 'watch'
Returns:
string Token
Since:
1.18

Definition at line 134 of file WatchAction.php.

References getWatchToken().

Referenced by LegacyTemplate\watchThisPage().

Here is the call graph for this function:

Here is the caller graph for this function:

static WatchAction::getWatchToken ( Title title,
User user,
action = 'watch' 
) [static]

Get token to watch (or unwatch) a page for a user.

Parameters:
Title$titleTitle object of page to watch
User$userUser for whom the action is going to be performed
string$actionOptionally override the action to 'unwatch'
Returns:
string Token
Since:
1.18

Definition at line 114 of file WatchAction.php.

References Title\getDBkey(), and User\getEditToken().

Referenced by SkinTemplate\buildContentNavigationUrls(), UnwatchedpagesPage\formatResult(), getUnwatchToken(), and LegacyTemplate\watchThisPage().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
$dataArray
Returns:
Bool|Array true for success, false for didn't-try, array of errors on failure

Reimplemented from FormAction.

Reimplemented in UnwatchAction.

Definition at line 45 of file WatchAction.php.

References doWatch(), Action\getTitle(), Action\getUser(), wfProfileIn(), and wfProfileOut().

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

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 146 of file WatchAction.php.

References Action\getOutput(), and Action\getTitle().

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

WatchAction::preText ( ) [protected]

Add pre- or post-text to the form.

Returns:
String HTML which will be sent to $form->addPreText()

Reimplemented from FormAction.

Reimplemented in UnwatchAction.

Definition at line 142 of file WatchAction.php.

References wfMessage().

Here is the call graph for this function:

Whether this action can still be executed by a blocked user.

Returns:
Bool

Reimplemented from Action.

Definition at line 29 of file WatchAction.php.

This can be either formed or formless depending on the session token given.

Reimplemented from FormAction.

Definition at line 55 of file WatchAction.php.

References $user, checkCanExecute(), FormAction\getForm(), getName(), Action\getTitle(), Action\getUser(), onSubmit(), onSuccess(), and Action\setHeaders().

Here is the call graph for this function:


The documentation for this class was generated from the following file: