MediaWiki  REL1_19
SpecialPageFactory Class Reference

Factory for handling the special page list and generating SpecialPage objects. More...

List of all members.

Static Public Member Functions

static capturePath (Title $title, IContextSource $context)
 Just like executePath() but will override global variables and execute the page in "inclusion" mode.
static executePath (Title &$title, IContextSource &$context, $including=false)
 Execute a special page path.
static exists ($name)
 Check if a given name exist as a special page or as a special page alias.
static getAliasList ()
 Initialise and return the list of special page aliases.
static getGroup (&$page)
 Get the group that the special page belongs in on Special:SpecialPage.
static getList ()
 Initialise the special page list This must be called before accessing SpecialPage::$mList.
static getLocalNameFor ($name, $subpage=false)
 Get the local name for a specified canonical name.
static getPage ($name)
 Find the object with a given name and return it (or NULL)
static getRegularPages ()
 Return categorised listable special pages for all users.
static getRestrictedPages ()
 Return categorised listable special pages which are available for the current user, but not for everyone.
static getTitleForAlias ($alias)
 Get a title for a given alias.
static getUsablePages (User $user=null)
 Return categorised listable special pages which are available for the current user, and everyone.
static resolveAlias ($alias)
 Given a special page name with a possible subpage, return an array where the first element is the special page name and the second is the subpage.
static setGroup ($page, $group)
 Add a page to a certain display group for Special:SpecialPages.

Static Private Attributes

static $mAliases
static $mList
 List of special page names to the subclass of SpecialPage which handles them.

Detailed Description

Factory for handling the special page list and generating SpecialPage objects.

Since:
1.17

Definition at line 30 of file SpecialPageFactory.php.


Member Function Documentation

static SpecialPageFactory::capturePath ( Title title,
IContextSource context 
) [static]

Just like executePath() but will override global variables and execute the page in "inclusion" mode.

Returns true if the execution was successful or false if there was no such special page, or a title object if it was a redirect.

Also saves the current $wgTitle, $wgOut, $wgRequest, $wgUser and $wgLang variables so that the special page will get the context it'd expect on a normal request, and then restores them to their previous values after.

Parameters:
$titleTitle
$contextIContextSource
Returns:
String: HTML fragment

Definition at line 497 of file SpecialPageFactory.php.

References $title, $wgLang, $wgOut, $wgTitle, $wgUser, executePath(), IContextSource\getLanguage(), IContextSource\getOutput(), IContextSource\getRequest(), and IContextSource\getUser().

Referenced by Parser\braceSubstitution().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::executePath ( Title &$  title,
IContextSource &$  context,
including = false 
) [static]

Execute a special page path.

The path may contain parameters, e.g. Special:Name/Params Extracts the special page name and call the execute method, passing the parameters

Returns a title object if the page is redirected, false if there was no such special page, and true if it was successful.

Parameters:
$titleTitle object
$contextIContextSource
$includingBool output is being captured for use in {{special:whatever}}
Returns:
bool

Definition at line 417 of file SpecialPageFactory.php.

References $page, $title, $url, $wgSend404Code, Title\getDBkey(), IContextSource\getOutput(), getPage(), IContextSource\getRequest(), wfArrayToCGI(), wfProfileIn(), and wfProfileOut().

Referenced by capturePath(), SpecialPage\executePath(), and MediaWiki\performRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::exists ( name) [static]

Check if a given name exist as a special page or as a special page alias.

Parameters:
$nameString: name of a special page
Returns:
Boolean: true if a special page exists with this name

Definition at line 309 of file SpecialPageFactory.php.

References $title, and resolveAlias().

Referenced by SpecialPage\exists(), and ApiQuery\outputGeneralPageInfo().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getAliasList ( ) [static]

Initialise and return the list of special page aliases.

Returns an object with properties which can be accessed $obj->pagename - each property is an array of aliases; the first in the array is the cannonical alias. All registered special pages are guaranteed to have a property entry, and for that property array to contain at least one entry (English fallbacks will be added if necessary).

Returns:
Object

Definition at line 209 of file SpecialPageFactory.php.

References $mAliases, $wgContLang, and getList().

Referenced by resolveAlias().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getGroup ( &$  page) [static]

Get the group that the special page belongs in on Special:SpecialPage.

Parameters:
$pageSpecialPage

Definition at line 280 of file SpecialPageFactory.php.

References $page, $wgSpecialPageGroups, and wfMessage().

Referenced by SpecialPage\getGroup().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getList ( ) [static]

Initialise the special page list This must be called before accessing SpecialPage::$mList.

Returns:
array

Definition at line 161 of file SpecialPageFactory.php.

References $mList, $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication, $wgEnableEmail, $wgSpecialPages, wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by SpecialPage\addPage(), getAliasList(), getPage(), SpecialPage\removePage(), and PrefixSearch\specialSearch().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getLocalNameFor ( name,
subpage = false 
) [static]

Get the local name for a specified canonical name.

Parameters:
$nameString
$subpageString|Bool
Returns:
String

Definition at line 535 of file SpecialPageFactory.php.

References $n, $wgContLang, and wfWarn().

Referenced by Title\fixSpecialName(), SpecialPage\getLocalName(), SpecialPage\getLocalNameFor(), SpecialPage\getSafeTitleFor(), and SpecialPage\getTitleFor().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getPage ( name) [static]

Find the object with a given name and return it (or NULL)

Parameters:
$nameString Special page name, may be localised and/or an alias
Returns:
SpecialPage object or null if the page doesn't exist

Definition at line 320 of file SpecialPageFactory.php.

References getList(), MWFunction\newObj(), resolveAlias(), and wfDebug().

Referenced by UpdateSpecialPages\execute(), executePath(), SpecialPage\getPage(), SpecialPage\getPageByAlias(), getRegularPages(), getRestrictedPages(), getUsablePages(), RevisiondeleteAction\show(), and LegacyTemplate\specialPagesList().

Here is the call graph for this function:

Here is the caller graph for this function:

Return categorised listable special pages for all users.

Returns:
Array( String => Specialpage )

Definition at line 370 of file SpecialPageFactory.php.

References $page, and getPage().

Referenced by SpecialPage\getRegularPages().

Here is the call graph for this function:

Here is the caller graph for this function:

Return categorised listable special pages which are available for the current user, but not for everyone.

Returns:
Array( String => Specialpage )

Definition at line 387 of file SpecialPageFactory.php.

References $page, $wgUser, and getPage().

Referenced by SpecialPage\getRestrictedPages().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getTitleForAlias ( alias) [static]

Get a title for a given alias.

Parameters:
$aliasString
Returns:
Title or null if there is no such alias

Definition at line 571 of file SpecialPageFactory.php.

References SpecialPage\getTitleFor(), and resolveAlias().

Referenced by SpecialPage\getTitleForAlias().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::getUsablePages ( User user = null) [static]

Return categorised listable special pages which are available for the current user, and everyone.

Parameters:
$userUser object to check permissions, $wgUser will be used if not provided
Returns:
Array( String => Specialpage )

Definition at line 347 of file SpecialPageFactory.php.

References $page, $user, $wgUser, and getPage().

Referenced by SpecialPage\getUsablePages(), and LegacyTemplate\specialPagesList().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::resolveAlias ( alias) [static]

Given a special page name with a possible subpage, return an array where the first element is the special page name and the second is the subpage.

Parameters:
$aliasString
Returns:
Array( String, String|null ), or array( null, null ) if the page is invalid

Definition at line 242 of file SpecialPageFactory.php.

References $wgContLang, and getAliasList().

Referenced by SkinTemplate\buildPersonalUrls(), Title\checkReadPermissions(), exists(), Title\fixSpecialName(), OutputPage\getJSVars(), getPage(), Skin\getPageClasses(), getTitleForAlias(), LogPage\getTitleLink(), Title\isSpecial(), Linker\normaliseSpecialPage(), MediaWiki\performRequest(), OldChangesList\recentChangesLine(), and CoreParserFunctions\special().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialPageFactory::setGroup ( page,
group 
) [static]

Add a page to a certain display group for Special:SpecialPages.

Parameters:
$pageMixed: SpecialPage or string
$groupString

Definition at line 269 of file SpecialPageFactory.php.

References $page, and $wgSpecialPageGroups.

Referenced by SpecialPage\setGroup().

Here is the caller graph for this function:


Member Data Documentation

SpecialPageFactory::$mAliases [static, private]

Definition at line 153 of file SpecialPageFactory.php.

Referenced by getAliasList().

SpecialPageFactory::$mList [static, private]

List of special page names to the subclass of SpecialPage which handles them.

Definition at line 35 of file SpecialPageFactory.php.

Referenced by getList().


The documentation for this class was generated from the following file: