Go to the documentation of this file.
64 final private static function getClass( $action,
array $overrides ) {
66 $action = strtolower( $action );
68 if ( !isset( $wgActions[$action] ) ) {
72 if ( $wgActions[$action] ===
false ) {
74 } elseif ( $wgActions[$action] ===
true && isset( $overrides[$action] ) ) {
75 return $overrides[$action];
76 } elseif ( $wgActions[$action] ===
true ) {
77 return ucfirst( $action ) .
'Action';
79 return $wgActions[$action];
94 if ( is_string( $classOrCallable ) ) {
99 if ( is_callable( $classOrCallable ) ) {
103 return $classOrCallable;
119 $actionName = $request->getVal(
'action',
'view' );
122 if ( isset( $wgActions[$actionName] ) && $wgActions[$actionName] ===
false ) {
123 $actionName =
'nosuchaction';
128 if ( $actionName ===
'historysubmit' ) {
129 if ( $request->getBool(
'revisiondelete' ) ) {
130 $actionName =
'revisiondelete';
132 $actionName =
'view';
134 } elseif ( $actionName ==
'editredlink' ) {
135 $actionName =
'edit';
146 if ( $action instanceof
Action ) {
147 return $action->getName();
150 return 'nosuchaction';
172 wfDebug( __METHOD__ .
": no context known, falling back to Article's context.\n" );
173 return $this->
page->getContext();
176 wfWarn( __METHOD__ .
': no context known, falling back to RequestContext::getMain().' );
203 final public function getUser() {
212 final public function getSkin() {
231 final public function getLang() {
241 return $this->
page->getTitle();
250 final public function msg() {
265 wfWarn( __METHOD__ .
' called without providing a Context object.' );
278 abstract public function getName();
301 $errors = $this->
getTitle()->getUserPermissionsErrors(
$right, $user );
302 if ( count( $errors ) ) {
308 $block =
$user->getBlock();
343 $out->setRobotPolicy(
"noindex,nofollow" );
346 $out->setArticleRelated(
true );
355 return $this->
getTitle()->getPrefixedText();
364 return $this->
msg( strtolower( $this->
getName() ) )->escaped();
373 abstract public function show();
379 abstract public function execute();
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
Abstract class for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
__construct(Page $page, IContextSource $context=null)
Constructor.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Show an error when the user tries to do something whilst blocked.
getDescription()
Returns the description that goes below the <h1> tag.
setHeaders()
Set output headers for noindexing etc.
getRequest()
Get the WebRequest being used for this instance.
Special handling for category description pages, showing pages, subcategories and file that belong to...
Class representing a MediaWiki article and history.
return false if a UserGetRights hook might remove the named right $right
getName()
Return the name of the action this object responds to.
wfReadOnly()
Check whether the wiki is in read-only mode.
Class for viewing MediaWiki file description pages.
Show an error when a user tries to do something they do not have the necessary permissions for.
getActionOverrides()
Returns overrides for action handlers.
Actions are things which can be done to pages (edit, delete, rollback, etc).
getContext()
Get the IContextSource in use here.
canUseWikiPage()
Check whether a WikiPage object can be get with getWikiPage().
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
getWikiPage()
Get the WikiPage object.
checkCanExecute(User $user)
Checks if the given user (identified by an object) can perform this action.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
getUser()
Shortcut to get the User being used for this instance.
IContextSource $context
IContextSource if specified; otherwise we'll use the Context from the Page $context.
Allows to change the fields on the form that will be generated $name
getTitle()
Shortcut to get the Title object from the page.
requiresUnblock()
Whether this action can still be executed by a blocked user.
show()
The main action entry point.
static getMain()
Static methods.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Interface for objects which can provide a context on request.
getLang()
Shortcut to get the user Language being used for this instance.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
static exists( $name)
Check if a given action is recognised, even if it's disabled.
getSkin()
Shortcut to get the Skin being used for this instance.
WikiPage Article ImagePage CategoryPage Page $page
Page on which we're performing the action $page.
static getClass( $action, array $overrides)
Get the Action subclass which should be used to handle this action, false if the action is disabled,...
getLanguage()
Shortcut to get the user Language being used for this instance.
requiresWrite()
Whether this action requires the wiki not to be locked.
array $fields
The fields used to create the HTMLForm $fields.
getPageTitle()
Returns the name that goes in the <h1> page title.
getRestriction()
Get the permission required to perform this action.
getOutput()
Get the OutputPage being used for this instance.
getRequest()
Get the WebRequest object.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
execute()
Execute the action in a silent fashion: do not display anything or release any errors.
Class for viewing MediaWiki article and history.
isBlocked( $bFromSlave=true)
Check if user is blocked.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk page