MediaWiki
REL1_19
|
Public Member Functions | |
execute () | |
Execute the action in a silent fashion: do not display anything or release any errors. | |
getContext () | |
Get the IContextSource in use here. | |
getLang () | |
Shortcut to get the user Language being used for this instance. | |
getLanguage () | |
Shortcut to get the user Language being used for this instance. | |
getName () | |
Return the name of the action this object responds to. | |
getOutput () | |
Get the OutputPage being used for this instance. | |
getRequest () | |
Get the WebRequest being used for this instance. | |
getRestriction () | |
Get the permission required to perform this action. | |
getSkin () | |
Shortcut to get the Skin being used for this instance. | |
getTitle () | |
Shortcut to get the Title object from the page. | |
getUser () | |
Shortcut to get the User being used for this instance. | |
msg () | |
Get a Message object with context set Parameters are the same as wfMessage() | |
requiresUnblock () | |
Whether this action can still be executed by a blocked user. | |
requiresWrite () | |
Whether this action requires the wiki not to be locked. | |
show () | |
The main action entry point. | |
Static Public Member Functions | |
static | exists ($name) |
Check if a given action is recognised, even if it's disabled. | |
static | factory ($action, Page $page, IContextSource $context=null) |
Get an appropriate Action subclass for the given action. | |
static | getActionName (IContextSource $context) |
Get the action that will be executed, not necessarily the one passed passed through the "action" request parameter. | |
Protected Member Functions | |
__construct (Page $page, IContextSource $context=null) | |
Protected constructor: use Action::factory( $action, $page ) to actually build these things in the real world. | |
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. | |
getPageTitle () | |
Returns the name that goes in the <h1> page title. | |
setHeaders () | |
Set output headers for noindexing etc. | |
Protected Attributes | |
$context | |
$fields | |
$page | |
Static Private Member Functions | |
static | getClass ($action, array $overrides) |
Get the Action subclass which should be used to handle this action, false if the action is disabled, or null if it's not recognised. |
Definition at line 30 of file Action.php.
Action::__construct | ( | Page $ | page, |
IContextSource $ | context = null |
||
) | [protected] |
Protected constructor: use Action::factory( $action, $page ) to actually build these things in the real world.
$page | Page |
$context | IContextSource |
Definition at line 242 of file Action.php.
Action::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 |
ErrorPageError |
Reimplemented in WatchAction, and RevertFileAction.
Definition at line 270 of file Action.php.
References getRestriction(), getTitle(), User\isBlocked(), requiresUnblock(), requiresWrite(), and wfReadOnly().
Referenced by FormAction\execute(), FormlessAction\execute(), PurgeAction\show(), FormAction\show(), and FormlessAction\show().
Action::execute | ( | ) | [abstract] |
Execute the action in a silent fashion: do not display anything or release any errors.
Reimplemented in RevertAction.
static Action::exists | ( | $ | name | ) | [static, final] |
Check if a given action is recognised, even if it's disabled.
$name | String: name of an action |
Definition at line 146 of file Action.php.
References getClass().
static Action::factory | ( | $ | action, |
Page $ | page, | ||
IContextSource $ | context = null |
||
) | [static, final] |
Get an appropriate Action subclass for the given action.
$action | String |
$page | Page |
$context | IContextSource |
Definition at line 84 of file Action.php.
References $context, and getClass().
Referenced by WatchAction\doUnwatch(), WatchAction\doWatch(), getActionName(), Article\info(), Article\markpatrolled(), SkinTemplate\outputPage(), MediaWiki\performAction(), Article\purge(), Article\revert(), Article\rollback(), Article\unwatch(), and Article\watch().
static Action::getActionName | ( | IContextSource $ | context | ) | [static, final] |
Get the action that will be executed, not necessarily the one passed passed through the "action" request parameter.
Actions disabled in $wgActions will be replaced by "nosuchaction".
$context | IContextSource |
Definition at line 102 of file Action.php.
References $wgActions, IContextSource\canUseWikiPage(), factory(), IContextSource\getRequest(), and IContextSource\getWikiPage().
Referenced by MediaWiki\getAction(), OutputPage\getJSVars(), and OutputPage\headElement().
static Action::getClass | ( | $ | action, |
array $ | overrides | ||
) | [static, final, private] |
Get the Action subclass which should be used to handle this action, false if the action is disabled, or null if it's not recognised.
$action | String |
$overrides | Array |
Definition at line 57 of file Action.php.
References $wgActions.
Referenced by exists(), and factory().
Action::getContext | ( | ) | [final] |
Get the IContextSource in use here.
Definition at line 154 of file Action.php.
Referenced by RawPage\__construct(), FormAction\getForm(), getLanguage(), getOutput(), RawAction\getRawText(), getRequest(), getSkin(), getUser(), msg(), RollbackAction\onView(), HistoryAction\onView(), EditAction\show(), and RevisiondeleteAction\show().
Action::getDescription | ( | ) | [protected] |
Returns the description that goes below the <h1> tag.
Reimplemented in UnwatchAction, RevertFileAction, RollbackAction, HistoryAction, PurgeAction, RevisiondeleteAction, WatchAction, CreditsAction, InfoAction, and MarkpatrolledAction.
Definition at line 334 of file Action.php.
References getName(), and wfMsgHtml().
Referenced by setHeaders().
Action::getLang | ( | ) | [final] |
Shortcut to get the user Language being used for this instance.
Definition at line 212 of file Action.php.
References getLanguage(), and wfDeprecated().
Action::getLanguage | ( | ) | [final] |
Shortcut to get the user Language being used for this instance.
Definition at line 202 of file Action.php.
References getContext().
Referenced by CreditsAction\getAuthor(), CreditsAction\getContributors(), RevertFileAction\getFormFields(), getLang(), RevertFileAction\onSuccess(), and InfoAction\onView().
Action::getName | ( | ) | [abstract] |
Return the name of the action this object responds to.
Reimplemented in UnwatchAction, SubmitAction, RevertFileAction, UnprotectAction, RevertAction, PurgeAction, RollbackAction, CreditsAction, DeleteAction, EditAction, InfoAction, ProtectAction, RenderAction, RevisiondeleteAction, ViewAction, MarkpatrolledAction, WatchAction, RawAction, and HistoryAction.
Referenced by getDescription(), and FormAction\getForm().
Action::getOutput | ( | ) | [final] |
Get the OutputPage being used for this instance.
Definition at line 175 of file Action.php.
References getContext().
Referenced by HistoryAction\feedEmpty(), RevertFileAction\getDescription(), PurgeAction\onSuccess(), RevertFileAction\onSuccess(), WatchAction\onSuccess(), UnwatchAction\onSuccess(), MarkpatrolledAction\onView(), RawAction\onView(), RollbackAction\onView(), HistoryAction\onView(), setHeaders(), ViewAction\show(), RevertAction\show(), and FormlessAction\show().
Action::getPageTitle | ( | ) | [protected] |
Returns the name that goes in the <h1> page title.
Reimplemented in RevertFileAction, InfoAction, and HistoryAction.
Definition at line 325 of file Action.php.
References getTitle().
Referenced by setHeaders().
Action::getRequest | ( | ) | [final] |
Get the WebRequest being used for this instance.
Definition at line 166 of file Action.php.
References getContext().
Referenced by RevertFileAction\alterForm(), RevertFileAction\checkCanExecute(), HistoryAction\feed(), RawAction\getContentType(), FormAction\getForm(), RevertFileAction\getFormFields(), RawAction\getOldId(), RawAction\getRawText(), RevertFileAction\onSubmit(), RevertFileAction\onSuccess(), MarkpatrolledAction\onView(), RawAction\onView(), RollbackAction\onView(), HistoryAction\onView(), EditAction\show(), and PurgeAction\show().
Get the permission required to perform this action.
Often, but not always, the same as the action name
Reimplemented in RevertFileAction, and RollbackAction.
Definition at line 258 of file Action.php.
Referenced by checkCanExecute().
Action::getSkin | ( | ) | [final] |
Shortcut to get the Skin being used for this instance.
Definition at line 193 of file Action.php.
References getContext().
Action::getTitle | ( | ) | [final] |
Shortcut to get the Title object from the page.
Definition at line 221 of file Action.php.
Referenced by RevertFileAction\checkCanExecute(), checkCanExecute(), HistoryAction\feed(), HistoryAction\feedEmpty(), HistoryAction\feedItem(), HistoryAction\getDescription(), RevertFileAction\getDescription(), RevertFileAction\getFormFields(), RawAction\getOldId(), HistoryAction\getPageTitle(), InfoAction\getPageTitle(), RevertFileAction\getPageTitle(), getPageTitle(), RawAction\getRawText(), WatchAction\onSubmit(), UnwatchAction\onSubmit(), PurgeAction\onSuccess(), RevertFileAction\onSuccess(), WatchAction\onSuccess(), UnwatchAction\onSuccess(), RollbackAction\onView(), InfoAction\onView(), HistoryAction\onView(), CreditsAction\othersLink(), and WatchAction\show().
Action::getUser | ( | ) | [final] |
Shortcut to get the User being used for this instance.
Definition at line 184 of file Action.php.
References getContext().
Referenced by FormAction\execute(), FormlessAction\execute(), WatchAction\onSubmit(), UnwatchAction\onSubmit(), RawAction\onView(), MarkpatrolledAction\onView(), RollbackAction\onView(), InfoAction\onView(), EditAction\show(), WatchAction\show(), PurgeAction\show(), FormAction\show(), and FormlessAction\show().
Action::msg | ( | ) | [final] |
Get a Message object with context set Parameters are the same as wfMessage()
Definition at line 231 of file Action.php.
References getContext().
Referenced by CreditsAction\getAuthor(), CreditsAction\getContributors(), HistoryAction\getDescription(), HistoryAction\getPageTitle(), InfoAction\getPageTitle(), MarkpatrolledAction\onView(), RollbackAction\onView(), CreditsAction\onView(), InfoAction\onView(), HistoryAction\onView(), CreditsAction\othersLink(), HistoryAction\preCacheMessages(), and CreditsAction\userLink().
Whether this action can still be executed by a blocked user.
Reimplemented in InfoAction, PurgeAction, RevisiondeleteAction, RawAction, HistoryAction, and WatchAction.
Definition at line 304 of file Action.php.
Referenced by checkCanExecute().
Whether this action requires the wiki not to be locked.
Reimplemented in InfoAction, RawAction, and HistoryAction.
Definition at line 296 of file Action.php.
Referenced by checkCanExecute().
Action::setHeaders | ( | ) | [protected] |
Set output headers for noindexing etc.
This function will not be called through the execute() entry point, so only put UI-related stuff in here.
Definition at line 312 of file Action.php.
References $out, getDescription(), getOutput(), and getPageTitle().
Referenced by WatchAction\show(), PurgeAction\show(), FormAction\show(), and FormlessAction\show().
Action::show | ( | ) | [abstract] |
The main action entry point.
Do all output for display and send it to the context output. Do not use globals $wgOut, $wgRequest, etc, in implementations; use $this->getOutput(), etc.
ErrorPageError |
Reimplemented in FormlessAction, FormAction, SubmitAction, PurgeAction, WatchAction, UnprotectAction, RevisiondeleteAction, RevertAction, DeleteAction, EditAction, ProtectAction, RenderAction, and ViewAction.
Action::$context [protected] |
Definition at line 42 of file Action.php.
Referenced by RawPage\__construct(), __construct(), factory(), and EditAction\show().
Action::$fields [protected] |
Definition at line 48 of file Action.php.
Referenced by FormAction\execute().
Action::$page [protected] |
Definition at line 36 of file Action.php.
Referenced by __construct(), WatchAction\doUnwatch(), WatchAction\doWatch(), CreditsAction\link(), and EditAction\show().