Go to the documentation of this file.
75 public static function getTitleFor(
$name, $subpage =
false, $fragment =
'' ) {
117 $name =
'', $restriction =
'', $listed =
true,
118 $function =
false,
$file =
'default', $includable =
false
120 $this->mName =
$name;
121 $this->mRestriction = $restriction;
122 $this->mListed = $listed;
123 $this->mIncludable = $includable;
125 $this->mFunction =
'wfSpecial' .
$name;
127 $this->mFunction = $function;
129 if (
$file ===
'default' ) {
130 $this->mFile = __DIR__ .
"/specials/Special$name.php";
132 $this->mFile =
$file;
182 return wfSetVar( $this->mListed, $listed );
191 function listed( $x =
null ) {
192 return wfSetVar( $this->mListed, $x );
209 return wfSetVar( $this->mIncluding, $x );
217 if ( !isset( $this->mLocalName ) ) {
270 return $user->isAllowed( $this->mRestriction );
322 public function requireLogin( $reasonMsg =
null, $titleMsg =
null ) {
323 if ( $this->
getUser()->isAnon() ) {
326 $reasonMsg =
'exception-nologin-text-manual';
329 $titleMsg =
'exception-nologin';
333 if ( is_string( $reasonMsg ) ) {
336 $this->
msg(
'loginreqlink' )->escaped(),
340 $reasonMsg = $this->
msg( $reasonMsg )->rawParams( $loginreqlink );
342 if ( is_string( $titleMsg ) ) {
343 $titleMsg = $this->
msg( $titleMsg );
355 $out->setArticleRelated(
false );
367 final public function run( $subPage ) {
423 public function execute( $subPage ) {
429 if ( !is_callable( $func ) && $this->mFile ) {
433 call_user_func( $func, $subPage, $this );
447 if ( $summaryMessageKey ==
'' ) {
450 $msg = $summaryMessageKey;
452 if ( !$this->
msg( $msg )->isDisabled() && !$this->
including() ) {
454 "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
468 return $this->
msg( strtolower( $this->mName ) )->text();
478 function getTitle( $subpage =
false ) {
500 $this->mContext = $context;
513 wfDebug( __METHOD__ .
" called and \$mContext is null. " .
514 "Return RequestContext::getMain(); for sanity\n" );
601 return 'noindex,nofollow';
610 public function msg( ) {
611 $message = call_user_func_array(
620 $message->setInterfaceMessageFlag(
false );
636 foreach ( $wgFeedClasses
as $format => $class ) {
637 $theseParams =
$params +
array(
'feedformat' => $format );
639 $this->
getOutput()->addFeedLink( $format, $url );
652 global $wgSpecialPageGroups;
656 $msg = $this->
msg(
'specialpages-specialpagegroup-' . strtolower(
$name ) )->inContentLanguage();
657 if ( !$msg->isBlank() ) {
658 $group = $msg->text();
666 if ( $group ===
'-' && isset( $wgSpecialPageGroups[
$name] ) ) {
667 $group = $wgSpecialPageGroups[
$name];
672 if ( $group ===
'-' ) {
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
getPageTitle( $subpage=false)
Get a self-referential title object.
getFinalGroupName()
Get the group that the special page belongs in on Special:SpecialPage Use this method,...
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
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
getOutput()
Get the OutputPage being used for this instance.
isExpensive()
Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in ...
getTitle( $subpage=false)
Get a self-referential title object.
getLang()
Shortcut to get user's language.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
Shows a generic "user is not logged in" error page.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
displayRestrictionError()
Output an error message telling the user what access level they have to have.
setListed( $listed)
Set whether this page is listed in Special:Specialpages, at run-time.
wfReadOnly()
Check whether the wiki is in read-only mode.
getLocalName()
Get the localised name of the special page.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
IContextSource $mContext
Current request context.
getSkin()
Shortcut to get the skin being used for this instance.
Show an error when a user tries to do something they do not have the necessary permissions for.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
getLanguage()
Shortcut to get user's language.
__construct( $name='', $restriction='', $listed=true, $function=false, $file='default', $includable=false)
Default constructor for special pages Derivative classes should call this from their constructor Note...
static groupHasPermission( $group, $role)
Check, if the given group has the given permission.
getName()
Get the name of this Special Page.
requireLogin( $reasonMsg=null, $titleMsg=null)
If the user is not logged in, throws UserNotLoggedIn error.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
isListed()
Whether this special page is listed in Special:SpecialPages.
getRestriction()
Get the permission that a user must have to execute this page.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be lis...
addFeedLinks( $params)
Adds RSS/atom links.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
getFullTitle()
Return the full title, including $par.
isRestricted()
Can be overridden by subclasses with more complicated permissions schemes.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
isIncludable()
Whether it's allowed to transclude the special page via {{Special:Foo/params}}.
afterExecute( $subPage)
Gets called after.
when a variable name is used in a it is silently declared as a new masking the global
getFile()
Get the file which will be included by SpecialPage::execute() if your extension is still stuck in the...
beforeExecute( $subPage)
Gets called before.
getContext()
Gets the context this SpecialPage is executed in.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
userCanExecute(User $user)
Checks if the given user (identified by an object) can execute this special page (as defined by $mRes...
Allows to change the fields on the form that will be generated $name
getRobotPolicy()
Return the robot policy.
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
listed( $x=null)
Get or set whether this special page is listed in Special:SpecialPages.
isCached()
Is this page cached? Expensive pages are cached or disabled in miser mode.
getRequest()
Get the WebRequest being used for this instance.
static getLocalNameFor( $name, $subpage=false)
Get the local name for a specified canonical name.
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
run( $subPage)
Entry point.
execute( $subPage)
Default execute method Checks user permissions, calls the function given in mFunction.
Interface for objects which can provide a context on request.
if(PHP_SAPI !='cli') $file
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
setContext( $context)
Sets the context this SpecialPage is executed in.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
including( $x=null)
Whether the special page is being evaluated via transclusion.