80 return $overrides[$action];
82 return ucfirst( $action ) .
'Action';
98 $classOrCallable = self::getClass( $action, $page->getActionOverrides() );
127 $actionName =
$request->getVal(
'action',
'view' );
131 $actionName =
'nosuchaction';
136 if ( $actionName ===
'historysubmit' ) {
137 if (
$request->getBool(
'revisiondelete' ) ) {
138 $actionName =
'revisiondelete';
140 $actionName =
'editchangetags';
142 $actionName =
'view';
144 }
elseif ( $actionName ===
'editredlink' ) {
145 $actionName =
'edit';
151 if ( !
$context->canUseWikiPage() ) {
156 if ( $action instanceof
Action ) {
157 return $action->getName();
160 return 'nosuchaction';
170 final public static function exists( $name ) {
171 return self::getClass( $name, [] ) !==
null;
184 wfDebug( __METHOD__ .
": no context known, falling back to Article's context.\n" );
185 return $this->page->getContext();
188 wfWarn( __METHOD__ .
': no context known, falling back to RequestContext::getMain().' );
189 return RequestContext::getMain();
248 return $this->page->getTitle();
257 final public function msg( $key ) {
270 wfWarn( __METHOD__ .
' called without providing a Context object.' );
309 if ( $right !==
null ) {
310 $errors = $this->
getTitle()->getUserPermissionsErrors( $right, $user );
311 if ( count( $errors ) ) {
317 if ( $this->
requiresUnblock() && $user->isBlockedFrom( $this->getTitle() ) ) {
318 $block = $user->getBlock();
361 $out->setRobotPolicy(
'noindex,nofollow' );
364 $out->setArticleRelated(
true );
373 return $this->
getTitle()->getPrefixedText();
395 $msg =
wfMessage( MediaWikiServices::getInstance()->getContentLanguage()->lc(
399 if ( !$msg->isDisabled() ) {
400 $helpUrl = Skin::makeUrl( $msg->plain() );
401 $this->
getOutput()->addHelpLink( $helpUrl,
true );
403 $this->
getOutput()->addHelpLink( $to, $overrideBaseUrl );
415 abstract public function show();
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgActions
Array of allowed values for the "title=foo&action=<action>" parameter.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfReadOnly()
Check whether the wiki is in read-only mode.
wfTransactionalTimeLimit()
Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit.
Actions are things which can be done to pages (edit, delete, rollback, etc).
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
doesWrites()
Indicates whether this action may perform database writes.
checkCanExecute(User $user)
Checks if the given user (identified by an object) can perform this action.
getName()
Return the name of the action this object responds to.
$page
Page on which we're performing the action.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
requiresWrite()
Whether this action requires the wiki not to be locked.
getDescription()
Returns the description that goes below the <h1> tag.
static getClass( $action, array $overrides)
Get the Action subclass which should be used to handle this action, false if the action is disabled,...
getPageTitle()
Returns the name that goes in the <h1> page title.
getTitle()
Shortcut to get the Title object from the page.
getContext()
Get the IContextSource in use here.
requiresUnblock()
Whether this action can still be executed by a blocked user.
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
$context
IContextSource if specified; otherwise we'll use the Context from the Page.
setHeaders()
Set output headers for noindexing etc.
getRestriction()
Get the permission required to perform this action.
getSkin()
Shortcut to get the Skin being used for this instance.
show()
The main action entry point.
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
static exists( $name)
Check if a given action is recognised, even if it's disabled.
$fields
The fields used to create the HTMLForm.
getLanguage()
Shortcut to get the user Language being used for this instance.
__construct(Page $page, IContextSource $context=null)
Only public since 1.21.
getRequest()
Get the WebRequest being used for this instance.
Class for viewing MediaWiki article and history.
Show an error when a user tries to do something they do not have the necessary permissions for.
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
Show an error when the user tries to do something whilst blocked.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
Interface for objects which can provide a MediaWiki context on request.
Interface for localizing messages in MediaWiki.
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))