BlueSpice MediaWiki master
|
Public Member Functions | |
getContext () | |
getRequest () | |
getOutput () | |
getUser () | |
getSkin () | |
getLanguage () | |
getTitle () | |
msg ($key) | |
__construct (Page $page, IContextSource $context=null) | |
getName () | |
getRestriction () | |
requiresWrite () | |
requiresUnblock () | |
addHelpLink ($to, $overrideBaseUrl=false) | |
show () | |
doesWrites () | |
Static Public Member Functions | |
static | factory ($action, Page $page, IContextSource $context=null) |
static | getActionName (IContextSource $context) |
static | exists ($name) |
Protected Member Functions | |
checkCanExecute (User $user) | |
setHeaders () | |
getPageTitle () | |
getDescription () | |
useTransactionalTimeLimit () | |
Protected Attributes | |
$page | |
$context | |
$fields | |
Actions are things which can be done to pages (edit, delete, rollback, etc). They are distinct from Special Pages because an action must apply to exactly one page.
To add an action in an extension, create a subclass of Action, and add the key to $wgActions. There is also the deprecated UnknownAction hook
Actions generally fall into two groups: the show-a-form-then-do-something-with-the-input format (protect, delete, move, etc), and the just-do-something format (watch, rollback, patrol, etc). The FormAction and FormlessAction classes represent these two groups.
Action::__construct | ( | Page | $page, |
IContextSource | $context = null |
||
) |
Only public since 1.21
Page | $page | |
IContextSource | null | $context |
Action::addHelpLink | ( | $to, | |
$overrideBaseUrl = false |
|||
) |
Adds help link with an icon via page indicators. Link target can be overridden by a local message containing a wikilink: the message key is: lowercase action name + '-helppage'.
string | $to | Target MediaWiki.org page title or encoded URL. |
bool | $overrideBaseUrl | Whether $url is a full URL, to avoid MW.o. |
|
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 |
Action::doesWrites | ( | ) |
Indicates whether this action may perform database writes
|
staticfinal |
Check if a given action is recognised, even if it's disabled
string | $name | Name of an action |
|
staticfinal |
Get an appropriate Action subclass for the given action
string | $action | |
Page | $page | |
IContextSource | null | $context |
|
staticfinal |
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".
IContextSource | $context |
|
final |
|
protected |
Returns the description that goes below the <h1> tag
|
final |
|
abstract |
Return the name of the action this object responds to
|
final |
|
protected |
Returns the name that goes in the <h1> page title
|
final |
Action::getRestriction | ( | ) |
Get the permission required to perform this action. Often, but not always, the same as the action name
|
final |
|
final |
|
final |
Get a Message object with context set Parameters are the same as wfMessage()
Implements MessageLocalizer.
Action::requiresUnblock | ( | ) |
Whether this action can still be executed by a blocked user
Action::requiresWrite | ( | ) |
Whether this action requires the wiki not to be locked
|
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.
|
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 |
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed
|
protected |
IContextSource if specified; otherwise we'll use the Context from the Page
|
protected |
The fields used to create the HTMLForm
|
protected |
Page on which we're performing the action