MediaWiki
1.23.2
|
Factory for handling the special page list and generating SpecialPage objects. More...
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. More... | |
static | executePath (Title &$title, IContextSource &$context, $including=false) |
Execute a special page path. More... | |
static | exists ( $name) |
Check if a given name exist as a special page or as a special page alias. More... | |
static | getAliasList () |
Initialise and return the list of special page aliases. More... | |
static | getGroup (&$page) |
Get the group that the special page belongs in on Special:SpecialPage. More... | |
static | getList () |
Get the special page list. More... | |
static | getLocalNameFor ( $name, $subpage=false) |
Get the local name for a specified canonical name. More... | |
static | getPage ( $name) |
Find the object with a given name and return it (or NULL) More... | |
static | getRegularPages () |
Return categorised listable special pages for all users. More... | |
static | getRestrictedPages () |
Return categorised listable special pages which are available for the current user, but not for everyone. More... | |
static | getTitleForAlias ( $alias) |
Get a title for a given alias. More... | |
static | getUsablePages (User $user=null) |
Return categorised listable special pages which are available for the current user, and everyone. More... | |
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. More... | |
static | setGroup ( $page, $group) |
Add a page to a certain display group for Special:SpecialPages. More... | |
Static Private Attributes | |
static | $aliases |
static | $list |
List of special page names to the subclass of SpecialPage which handles them. More... | |
Factory for handling the special page list and generating SpecialPage objects.
To add a special page in an extension, add to $wgSpecialPages either an object instance or an array containing the name and constructor parameters. The latter is preferred for performance reasons.
The object instantiated must be either an instance of SpecialPage or a sub-class thereof. It must have an execute() method, which sends the HTML for the special page to $wgOut. The parent class has an execute() method which distributes the call to the historical global functions. Additionally, execute() also checks if the user has the necessary access privileges and bails out if not.
To add a core special page, use the similar static list in SpecialPageFactory::$list. To remove a core static special page at runtime, use a SpecialPage_initList hook.
Definition at line 46 of file SpecialPageFactory.php.
|
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.
Title | $title | |
IContextSource | $context |
Definition at line 524 of file SpecialPageFactory.php.
References $oldTitle, $ret, $title, $wgLang, $wgOut, $wgTitle, $wgUser, executePath(), IContextSource\getLanguage(), IContextSource\getOutput(), IContextSource\getRequest(), IContextSource\getUser(), and global.
|
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.
Title | $title | |
IContextSource | $context | |
bool | $including | Bool output is being captured for use in {{special:whatever}} |
Definition at line 443 of file SpecialPageFactory.php.
References $name, $query, $title, IContextSource\getOutput(), getPage(), IContextSource\getRequest(), global, wfProfileIn(), and wfProfileOut().
Referenced by capturePath(), and MediaWiki\performRequest().
|
static |
Check if a given name exist as a special page or as a special page alias.
string | $name | Name of a special page |
Definition at line 326 of file SpecialPageFactory.php.
References $name, $title, list, and resolveAlias().
Referenced by Title\isAlwaysKnown(), and ApiQuery\outputGeneralPageInfo().
|
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 canonical 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).
Definition at line 237 of file SpecialPageFactory.php.
References $aliases, $name, $wgContLang, array(), as, getList(), global, and object.
Referenced by resolveAlias().
|
static |
Get the group that the special page belongs in on Special:SpecialPage.
SpecialPage | $page |
Definition at line 314 of file SpecialPageFactory.php.
References wfDeprecated().
|
static |
Get the special page list.
Definition at line 182 of file SpecialPageFactory.php.
References $list, array(), global, wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by getAliasList(), getPage(), and PrefixSearch\specialSearch().
|
static |
Get the local name for a specified canonical name.
string | $name | |
string | bool | $subpage |
Definition at line 561 of file SpecialPageFactory.php.
References $aliases, $n, $name, $wgContLang, as, global, and wfWarn().
Referenced by Title\fixSpecialName(), SpecialPage\getLocalName(), SpecialPage\getSafeTitleFor(), and SpecialPage\getTitleFor().
|
static |
Find the object with a given name and return it (or NULL)
string | $name | Special page name, may be localised and/or an alias |
Definition at line 338 of file SpecialPageFactory.php.
References $name, getList(), list, MWFunction\newObj(), resolveAlias(), and wfDebug().
Referenced by UpdateSpecialPages\execute(), executePath(), getRegularPages(), getRestrictedPages(), getUsablePages(), and RevisiondeleteAction\show().
|
static |
|
static |
|
static |
Get a title for a given alias.
string | $alias |
Definition at line 597 of file SpecialPageFactory.php.
References $name, SpecialPage\getTitleFor(), and resolveAlias().
|
static |
Return categorised listable special pages which are available for the current user, and everyone.
$user | User object to check permissions, $wgUser will be used if if not provided |
Definition at line 368 of file SpecialPageFactory.php.
References $name, $user, $wgUser, array(), as, RequestContext\getMain(), getPage(), and global.
Referenced by SpecialSpecialpages\getPageGroups().
|
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.
string | $alias |
Definition at line 271 of file SpecialPageFactory.php.
References $name, $wgContLang, array(), getAliasList(), and global.
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().
|
static |
Add a page to a certain display group for Special:SpecialPages.
SpecialPage | string | $page | |
string | $group |
Definition at line 299 of file SpecialPageFactory.php.
References $name, global, and wfDeprecated().
|
staticprivate |
Definition at line 175 of file SpecialPageFactory.php.
Referenced by getAliasList(), and getLocalNameFor().
|
staticprivate |
List of special page names to the subclass of SpecialPage which handles them.
Definition at line 50 of file SpecialPageFactory.php.
Referenced by getList().