MediaWiki
REL1_20
|
The main skin class that provide methods and properties for all other skins. More...
Public Member Functions | |
__call ($fname, $args) | |
Use PHP's magic __call handler to intercept legacy calls to the linker for backwards compatibility. | |
aboutLink () | |
Gets the link to the wiki's about page. | |
addToBodyAttributes ($out, &$bodyAttrs) | |
This will be called by OutputPage::headElement when it is creating the "<body>" tag, skins can override it if they have a need to add in any body attributes or classes of their own. | |
addToSidebar (&$bar, $message) | |
Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used by Extensions) | |
addToSidebarPlain (&$bar, $text) | |
Add content from plain text. | |
bottomScripts () | |
This gets called shortly before the "</body>" tag. | |
buildSidebar () | |
Build an array that represents the sidebar(s), the navigation bar among them. | |
commonPrintStylesheet () | |
Should we load mediawiki.legacy.wikiprintable? Skins that have their own print stylesheet should override this and return false. | |
disclaimerLink () | |
Gets the link to the wiki's general disclaimers page. | |
doEditSectionLink (Title $nt, $section, $tooltip=null, $lang=false) | |
Create a section edit link. | |
drawCategoryBrowser ($tree) | |
Render the array as a serie of links. | |
editUrlOptions () | |
Return URL options for the 'edit page' link. | |
escapeSearchLink () | |
footerLink ($desc, $page) | |
getCategories () | |
getCategoryLinks () | |
getCommonStylePath ($name) | |
Return a fully resolved style path url to images or styles stored in the common folder. | |
getCopyright ($type= 'detect') | |
getCopyrightIcon () | |
getLogo () | |
URL to the logo. | |
getNamespaceNotice () | |
Get a notice based on page's namespace. | |
getNewtalks () | |
Gets new talk page messages for the current user. | |
getPageClasses ($title) | |
TODO: document. | |
getPoweredBy () | |
Gets the powered by MediaWiki icon. | |
getRelevantTitle () | |
Return the "relevant" title. | |
getRelevantUser () | |
Return the "relevant" user. | |
getRevisionId () | |
Get the current revision ID. | |
getSearchLink () | |
getSiteNotice () | |
Get the site notice. | |
getSkinName () | |
getSkinStylePath ($name) | |
Return a fully resolved style path url to images or styles stored in the curent skins's folder. | |
getUndeleteLink () | |
initPage (OutputPage $out) | |
isRevisionCurrent () | |
Whether the revision displayed is the latest revision of the page. | |
logoText ($align= '') | |
mainPageLink () | |
Gets the link to the wiki's main page. | |
makeFooterIcon ($icon, $withImage= 'withImage') | |
Renders a $wgFooterIcons icon acording to the method's arguments. | |
outputPage (OutputPage $out=null) | |
Outputs the HTML generated by other functions. | |
preloadExistence () | |
Preload the existence of three commonly-requested pages in a single query. | |
printSource () | |
Text with the permalink to the source page, usually shown on the footer of a printed page. | |
privacyLink () | |
Gets the link to the wiki's privacy policy page. | |
setRelevantTitle ($t) | |
Set the "relevant" title. | |
setRelevantUser ($u) | |
Set the "relevant" user. | |
setupSkinUserCss (OutputPage $out) | |
Add skin specific stylesheets Calling this method with an $out of anything but the same OutputPage inside ->getOutput() is deprecated. | |
showEmailUser ($id) | |
showIPinHeader () | |
Returns true if the IP should be shown in the header. | |
subPageSubtitle () | |
Static Public Member Functions | |
static | checkTitle (&$title, $name) |
make sure we have some title to operate on | |
static | getDynamicStylesheetQuery () |
Get the query to generate a dynamic stylesheet. | |
static | getSkinNameMessages () |
Fetch the skinname messages for available skins. | |
static | getSkinNames () |
Fetch the set of available skins. | |
static | getUsableSkins () |
Fetch the list of usable skins in regards to $wgSkipSkins. | |
static | makeGlobalVariablesScript ($unused) |
Make a "<script>" tag containing global variables. | |
static | makeI18nUrl ($name, $urlaction= '') |
static | makeInternalOrExternalUrl ($name) |
If url string starts with http, consider as external URL, else internal. | |
static | makeKnownUrlDetails ($name, $urlaction= '') |
Make URL details where the article exists (or at least it's convenient to think so) | |
static | makeMainPageUrl ($urlaction= '') |
static | makeNSUrl ($name, $urlaction= '', $namespace=NS_MAIN) |
this can be passed the NS number as defined in Language.php | |
static | makeSpecialUrl ($name, $urlaction= '', $proto=null) |
Make a URL for a Special Page using the given query and protocol. | |
static | makeSpecialUrlSubpage ($name, $subpage, $urlaction= '') |
static | makeUrl ($name, $urlaction= '') |
static | makeUrlDetails ($name, $urlaction= '') |
these return an array with the 'href' and boolean 'exists' | |
static | makeVariablesScript ($data) |
static & | newFromKey ($key) |
Factory method for loading a skin of a given type. | |
static | normalizeKey ($key) |
Normalize a skin preference value to a form that can be loaded. | |
Protected Member Functions | |
afterContentHook () | |
This runs a hook to allow extensions placing their stuff after content and article metadata (e.g. | |
generateDebugHTML () | |
Generate debug data HTML for displaying at the bottom of the main content area. | |
lastModified () | |
Get the timestamp of the latest revision, formatted in user language. | |
Protected Attributes | |
$mRelevantTitle = null | |
$mRelevantUser = null | |
$skinname = 'standard' | |
Private Member Functions | |
getCachedNotice ($name) | |
Get a cached notice. |
The main skin class that provide methods and properties for all other skins.
This base class is also the "Standard" skin.
See docs/skin.txt for more information.
Skin::__call | ( | $ | fname, |
$ | args | ||
) |
Skin::aboutLink | ( | ) |
Gets the link to the wiki's about page.
Definition at line 925 of file Skin.php.
References footerLink().
Referenced by SkinTemplate\outputPage().
Skin::addToBodyAttributes | ( | $ | out, |
&$ | bodyAttrs | ||
) |
This will be called by OutputPage::headElement when it is creating the "<body>" tag, skins can override it if they have a need to add in any body attributes or classes of their own.
$out | OutputPage |
$bodyAttrs | Array |
Reimplemented in SkinVector.
Skin::addToSidebar | ( | &$ | bar, |
$ | message | ||
) |
Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
This is just a wrapper around addToSidebarPlain() for backwards compatibility
$bar | array |
$message | String |
Definition at line 1173 of file Skin.php.
References addToSidebarPlain(), and wfMessage().
Referenced by buildSidebar().
Skin::addToSidebarPlain | ( | &$ | bar, |
$ | text | ||
) |
Add content from plain text.
$bar | array |
$text | string |
Definition at line 1184 of file Skin.php.
References $lines, $title, Sanitizer\escapeId(), ContextSource\getTitle(), ContextSource\msg(), Title\newFromText(), MessageCache\singleton(), wfMatchesDomainList(), and wfUrlProtocols().
Referenced by addToSidebar().
Skin::afterContentHook | ( | ) | [protected] |
This runs a hook to allow extensions placing their stuff after content and article metadata (e.g.
categories). Note: This function has nothing to do with afterContent().
This hook is placed here in order to allow using the same hook for all skins, both the SkinTemplate based ones and the older ones, which directly use this class to get their data.
The output of this function gets processed in SkinTemplate::outputPage() for the SkinTemplate based skins, all other skins should directly echo it.
Definition at line 544 of file Skin.php.
References wfDebug(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
This gets called shortly before the "</body>" tag.
Definition at line 579 of file Skin.php.
References ContextSource\getOutput(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
Build an array that represents the sidebar(s), the navigation bar among them.
Definition at line 1139 of file Skin.php.
References $wgMemc, addToSidebar(), ContextSource\getLanguage(), wfMemcKey(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
static Skin::checkTitle | ( | &$ | title, |
$ | name | ||
) | [static] |
make sure we have some title to operate on
$title | Title |
$name | string |
Definition at line 1125 of file Skin.php.
References $title, and Title\newFromText().
Referenced by SkinTemplate\makeArticleUrlDetails(), makeI18nUrl(), makeKnownUrlDetails(), makeMainPageUrl(), makeNSUrl(), SkinTemplate\makeTalkUrlDetails(), makeUrl(), and makeUrlDetails().
Should we load mediawiki.legacy.wikiprintable? Skins that have their own print stylesheet should override this and return false.
(This is an ugly hack to get Monobook to play nicely with OutputPage::headElement().)
Reimplemented in SkinTemplate, and SkinLegacy.
Gets the link to the wiki's general disclaimers page.
Definition at line 933 of file Skin.php.
References footerLink().
Referenced by SkinTemplate\outputPage().
Skin::doEditSectionLink | ( | Title $ | nt, |
$ | section, | ||
$ | tooltip = null , |
||
$ | lang = false |
||
) |
Create a section edit link.
This supersedes editSectionLink() and editSectionLinkForOther().
$nt | Title The title being linked to (may not be the same as $wgTitle, if the section is included from a template) |
$section | string The designation of the section being pointed to, to be included in the link, like "§ion=$section" |
$tooltip | string The tooltip to use for the link: will be escaped and wrapped in the 'editsectionhint' message |
$lang | string Language code |
Definition at line 1484 of file Skin.php.
References $result, $section, Sanitizer\decodeCharReferences(), Linker\link(), wfGetLangObj(), wfMessage(), and wfRunHooks().
Skin::drawCategoryBrowser | ( | $ | tree | ) |
Render the array as a serie of links.
$tree | Array: categories tree returned by Title::getParentCategoryTree |
Definition at line 488 of file Skin.php.
References Linker\link(), and Title\newFromText().
Referenced by getCategoryLinks().
Return URL options for the 'edit page' link.
This may include an 'oldid' specifier, if the current page view is such.
Definition at line 944 of file Skin.php.
References $options, getRevisionId(), and isRevisionCurrent().
Definition at line 708 of file Skin.php.
References getSearchLink().
Referenced by SkinTemplate\outputPage().
Skin::footerLink | ( | $ | desc, |
$ | page | ||
) |
$desc | |
$page |
Definition at line 895 of file Skin.php.
References $page, $title, Linker\linkKnown(), ContextSource\msg(), and Title\newFromText().
Referenced by aboutLink(), disclaimerLink(), and privacyLink().
Skin::generateDebugHTML | ( | ) | [protected] |
Generate debug data HTML for displaying at the bottom of the main content area.
Definition at line 570 of file Skin.php.
References MWDebug\getHTMLDebugLog().
Referenced by SkinTemplate\outputPage().
Skin::getCachedNotice | ( | $ | name | ) | [private] |
Get a cached notice.
$name | String: message name, or 'default' for $wgSiteNotice |
Definition at line 1372 of file Skin.php.
References $parserMemc, $wgContLang, ContextSource\getOutput(), ContextSource\msg(), Html\rawElement(), wfMemcKey(), wfProfileIn(), and wfProfileOut().
Referenced by getNamespaceNotice(), and getSiteNotice().
Definition at line 511 of file Skin.php.
References $out, getCategoryLinks(), ContextSource\getOutput(), ContextSource\getTitle(), and ContextSource\getUser().
Referenced by SkinTemplate\outputPage().
Definition at line 421 of file Skin.php.
References $out, $s, $t, drawCategoryBrowser(), ContextSource\getOutput(), ContextSource\getTitle(), ContextSource\getUser(), Linker\link(), ContextSource\msg(), Title\newFromText(), and wfMessage().
Referenced by getCategories().
Skin::getCommonStylePath | ( | $ | name | ) |
Return a fully resolved style path url to images or styles stored in the common folder.
This method returns a url resolved using the configured skin style path and includes the style version inside of the url.
$name | String: The name or path of a skin resource file |
Skin::getCopyright | ( | $ | type = 'detect' | ) |
$type | string |
Definition at line 716 of file Skin.php.
References $title, $wgContLang, ContextSource\getLanguage(), ContextSource\getTitle(), isRevisionCurrent(), Linker\linkKnown(), Linker\makeExternalLink(), ContextSource\msg(), Title\newFromText(), Html\rawElement(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
Definition at line 765 of file Skin.php.
Referenced by SkinTemplate\outputPage().
static Skin::getDynamicStylesheetQuery | ( | ) | [static] |
Skin::getLogo | ( | ) |
Get a notice based on page's namespace.
Definition at line 1426 of file Skin.php.
References getCachedNotice(), ContextSource\getTitle(), wfProfileIn(), and wfProfileOut().
Gets new talk page messages for the current user.
Definition at line 1284 of file Skin.php.
References $out, Xml\element(), ContextSource\getOutput(), ContextSource\getUser(), Linker\linkKnown(), ContextSource\msg(), Revision\newFromTitle(), IDBAccessObject\READ_NORMAL, and wfWikiID().
Referenced by SkinTemplate\outputPage().
Skin::getPageClasses | ( | $ | title | ) |
TODO: document.
$title | Title |
Definition at line 375 of file Skin.php.
References $title, Sanitizer\escapeClass(), and SpecialPageFactory\resolveAlias().
Referenced by SkinTemplate\outputPage().
Gets the powered by MediaWiki icon.
Definition at line 795 of file Skin.php.
References $url, and wfRunHooks().
Referenced by SkinTemplate\outputPage().
Return the "relevant" title.
A "relevant" title is not necessarily the actual title of the page. Special pages like Special:MovePage use set the page they are acting on as their "relevant" title, this allows the skin system to display things such as content tabs which belong to to that page instead of displaying a basic special page tab which has almost no meaning.
Definition at line 264 of file Skin.php.
References ContextSource\getTitle().
Referenced by SkinTemplate\buildContentNavigationUrls(), and getRelevantUser().
Return the "relevant" user.
A "relevant" user is similar to a relevant title. Special pages like Special:Contributions mark the user which they are relevant to so that things like the toolbox can display the information they usually are only able to display on a user's userpage and talkpage.
Definition at line 288 of file Skin.php.
References $title, $user, getRelevantTitle(), User\isIP(), and User\newFromName().
Referenced by SkinTemplate\buildNavUrls().
Get the current revision ID.
Definition at line 231 of file Skin.php.
References ContextSource\getOutput().
Referenced by SkinTemplate\buildNavUrls(), editUrlOptions(), isRevisionCurrent(), lastModified(), and printSource().
Definition at line 700 of file Skin.php.
References $searchPage, and SpecialPage\getTitleFor().
Referenced by escapeSearchLink().
Get the site notice.
Definition at line 1446 of file Skin.php.
References getCachedNotice(), ContextSource\getUser(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
Definition at line 188 of file Skin.php.
Referenced by SkinTemplate\outputPage().
static Skin::getSkinNameMessages | ( | ) | [static] |
static Skin::getSkinNames | ( | ) | [static] |
Fetch the set of available skins.
Definition at line 44 of file Skin.php.
References $file, $matches, wfProfileIn(), and wfProfileOut().
Referenced by ResourceLoaderContext\__construct(), ApiQuerySiteinfo\appendSkins(), ResourceLoaderStartUpModule\getConfig(), getUsableSkins(), newFromKey(), and normalizeKey().
Skin::getSkinStylePath | ( | $ | name | ) |
Return a fully resolved style path url to images or styles stored in the curent skins's folder.
This method returns a url resolved using the configured skin style path and includes the style version inside of the url.
$name | String: The name or path of a skin resource file |
Definition at line 609 of file Skin.php.
References $n, ContextSource\getRequest(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), Linker\linkKnown(), and ContextSource\msg().
Referenced by SkinTemplate\outputPage().
static Skin::getUsableSkins | ( | ) | [static] |
Fetch the list of usable skins in regards to $wgSkipSkins.
Useful for Special:Preferences and other places where you only want to show skins users _can_ use.
Definition at line 94 of file Skin.php.
References getSkinNames().
Referenced by Preferences\generateSkinOptions().
Skin::initPage | ( | OutputPage $ | out | ) |
$out | OutputPage |
Reimplemented in SkinVector.
Definition at line 195 of file Skin.php.
References preloadExistence(), wfProfileIn(), and wfProfileOut().
Referenced by SkinTemplate\outputPage().
Whether the revision displayed is the latest revision of the page.
Definition at line 240 of file Skin.php.
References getRevisionId(), and ContextSource\getTitle().
Referenced by SkinTemplate\buildContentNavigationUrls(), editUrlOptions(), getCopyright(), and SkinTemplate\outputPage().
Skin::lastModified | ( | ) | [protected] |
Get the timestamp of the latest revision, formatted in user language.
Definition at line 809 of file Skin.php.
References $s, $t, ContextSource\getLanguage(), ContextSource\getOutput(), getRevisionId(), Revision\getTimestampFromId(), ContextSource\getTitle(), ContextSource\getUser(), ContextSource\msg(), and wfGetLB().
Referenced by SkinTemplate\outputPage().
Skin::logoText | ( | $ | align = '' | ) |
$align | string |
Definition at line 836 of file Skin.php.
References $s, $url, getLogo(), ContextSource\msg(), and Title\newMainPage().
Referenced by SkinTemplate\outputPage().
Gets the link to the wiki's main page.
Definition at line 881 of file Skin.php.
References $s, Linker\linkKnown(), ContextSource\msg(), and Title\newMainPage().
Skin::makeFooterIcon | ( | $ | icon, |
$ | withImage = 'withImage' |
||
) |
Renders a $wgFooterIcons icon acording to the method's arguments.
$icon | Array: The icon to build the html for, see $wgFooterIcons for the format of this array |
$withImage | Bool|String: Whether to use the icon's image or output a text-only footericon |
Definition at line 859 of file Skin.php.
References $url, Html\element(), and Html\rawElement().
static Skin::makeGlobalVariablesScript | ( | $ | unused | ) | [static] |
Make a "<script>" tag containing global variables.
$unused |
Definition at line 335 of file Skin.php.
References $wgOut, makeVariablesScript(), and wfDeprecated().
static Skin::makeI18nUrl | ( | $ | name, |
$ | urlaction = '' |
||
) | [static] |
$name | string |
$urlaction | string |
Definition at line 1041 of file Skin.php.
References $title, checkTitle(), Title\newFromText(), and wfMessage().
static Skin::makeInternalOrExternalUrl | ( | $ | name | ) | [static] |
If url string starts with http, consider as external URL, else internal.
$name | String |
Definition at line 1065 of file Skin.php.
References makeUrl(), and wfUrlProtocols().
static Skin::makeKnownUrlDetails | ( | $ | name, |
$ | urlaction = '' |
||
) | [static] |
Make URL details where the article exists (or at least it's convenient to think so)
$name | String Article name |
$urlaction | String |
Definition at line 1109 of file Skin.php.
References $title, checkTitle(), and Title\newFromText().
Referenced by SkinTemplate\outputPage().
static Skin::makeMainPageUrl | ( | $ | urlaction = '' | ) | [static] |
$urlaction | string |
Definition at line 998 of file Skin.php.
References $title, checkTitle(), and Title\newMainPage().
static Skin::makeNSUrl | ( | $ | name, |
$ | urlaction = '' , |
||
$ | namespace = NS_MAIN |
||
) | [static] |
this can be passed the NS number as defined in Language.php
$name | |
$urlaction | string |
$namespace | int |
Definition at line 1080 of file Skin.php.
References $title, checkTitle(), and Title\makeTitleSafe().
static Skin::makeSpecialUrl | ( | $ | name, |
$ | urlaction = '' , |
||
$ | proto = null |
||
) | [static] |
Make a URL for a Special Page using the given query and protocol.
If $proto is set to null, make a local URL. Otherwise, make a full URL with the protocol specified.
$name | string Name of the Special page |
$urlaction | string Query to append |
$proto | Protocol to use or null for a local URL |
Definition at line 1016 of file Skin.php.
References $title, and SpecialPage\getSafeTitleFor().
Referenced by SkinTemplate\buildPersonalUrls().
static Skin::makeSpecialUrlSubpage | ( | $ | name, |
$ | subpage, | ||
$ | urlaction = '' |
||
) | [static] |
$name | string |
$subpage | string |
$urlaction | string |
Definition at line 1031 of file Skin.php.
References $title, and SpecialPage\getSafeTitleFor().
Referenced by SkinTemplate\buildPersonalUrls().
static Skin::makeUrl | ( | $ | name, |
$ | urlaction = '' |
||
) | [static] |
$name | string |
$urlaction | string |
Definition at line 1052 of file Skin.php.
References $title, checkTitle(), and Title\newFromText().
Referenced by makeInternalOrExternalUrl().
static Skin::makeUrlDetails | ( | $ | name, |
$ | urlaction = '' |
||
) | [static] |
these return an array with the 'href' and boolean 'exists'
$name | |
$urlaction | string |
Definition at line 1093 of file Skin.php.
References $title, checkTitle(), and Title\newFromText().
Referenced by SkinTemplate\outputPage().
static Skin::makeVariablesScript | ( | $ | data | ) | [static] |
$data | array |
Definition at line 318 of file Skin.php.
References Html\inlineScript(), ResourceLoader\makeConfigSetScript(), and ResourceLoader\makeLoaderConditionalScript().
Referenced by makeGlobalVariablesScript().
static& Skin::newFromKey | ( | $ | key | ) | [static] |
Factory method for loading a skin of a given type.
$key | String: 'monobook', 'standard', etc. |
Definition at line 154 of file Skin.php.
References MWInit\classExists(), getSkinNames(), normalizeKey(), and wfDebug().
static Skin::normalizeKey | ( | $ | key | ) | [static] |
Normalize a skin preference value to a form that can be loaded.
If a skin can't be found, it will fall back to the configured default (or the old 'Classic' skin if that's broken).
$key | String: 'monobook', 'standard', etc. |
Definition at line 113 of file Skin.php.
References $fallback, and getSkinNames().
Referenced by newFromKey().
Skin::outputPage | ( | OutputPage $ | out = null | ) | [abstract] |
Outputs the HTML generated by other functions.
$out | OutputPage |
Reimplemented in SkinTemplate.
Preload the existence of three commonly-requested pages in a single query.
Definition at line 206 of file Skin.php.
References $lb, $user, ContextSource\getTitle(), and ContextSource\getUser().
Referenced by initPage().
Text with the permalink to the source page, usually shown on the footer of a printed page.
Definition at line 595 of file Skin.php.
References $url, getRevisionId(), ContextSource\getTitle(), ContextSource\msg(), and wfExpandIRI().
Referenced by SkinTemplate\outputPage().
Gets the link to the wiki's privacy policy page.
Definition at line 917 of file Skin.php.
References footerLink().
Referenced by SkinTemplate\outputPage().
Skin::setRelevantTitle | ( | $ | t | ) |
Skin::setRelevantUser | ( | $ | u | ) |
Skin::setupSkinUserCss | ( | OutputPage $ | out | ) | [abstract] |
Add skin specific stylesheets Calling this method with an $out of anything but the same OutputPage inside ->getOutput() is deprecated.
The $out arg is kept for compatibility purposes with skins.
$out | OutputPage |
Reimplemented in SkinTemplate, SkinVector, SkinMonoBook, SkinSimple, SkinCologneBlue, SkinModern, SkinChick, SkinNostalgia, SkinLegacy, and SkinStandard.
Skin::showEmailUser | ( | $ | id | ) |
$id | User|int |
Definition at line 958 of file Skin.php.
References ContextSource\getUser(), and User\newFromId().
Referenced by SkinTemplate\buildNavUrls().
Returns true if the IP should be shown in the header.
Definition at line 692 of file Skin.php.
Referenced by SkinTemplate\buildPersonalUrls(), and SkinTemplate\outputPage().
Definition at line 638 of file Skin.php.
References $out, $wgLang, ContextSource\getOutput(), ContextSource\getTitle(), MWNamespace\hasSubpages(), Linker\linkKnown(), ContextSource\msg(), Title\newFromText(), and wfRunHooks().
Referenced by SkinTemplate\outputPage().
Skin::$skinname = 'standard' [protected] |
Reimplemented in SkinTemplate, SkinMonoBook, SkinVector, SkinSimple, SkinCologneBlue, SkinModern, SkinChick, SkinMySkin, SkinNostalgia, and SkinStandard.