MediaWiki  1.23.2
Skin Class Reference

The main skin class which provides methods and properties for all other skins. More...

Inheritance diagram for Skin:
Collaboration diagram for Skin:

Public Member Functions

 __call ( $fname, $args)
 Use PHP's magic __call handler to intercept legacy calls to the linker for backwards compatibility. More...
 
 aboutLink ()
 Gets the link to the wiki's about page. More...
 
 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. More...
 
 addToSidebar (&$bar, $message)
 Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used by Extensions) More...
 
 addToSidebarPlain (&$bar, $text)
 Add content from plain text. More...
 
 bottomScripts ()
 This gets called shortly before the "</body>" tag. More...
 
 buildSidebar ()
 Build an array that represents the sidebar(s), the navigation bar among them. More...
 
 commonPrintStylesheet ()
 This function previously controlled whether the 'mediawiki.legacy.wikiprintable' module should be loaded by OutputPage. More...
 
 disclaimerLink ()
 Gets the link to the wiki's general disclaimers page. More...
 
 doEditSectionLink (Title $nt, $section, $tooltip=null, $lang=false)
 Create a section edit link. More...
 
 drawCategoryBrowser ( $tree)
 Render the array as a series of links. More...
 
 editUrlOptions ()
 Return URL options for the 'edit page' link. More...
 
 escapeSearchLink ()
 
 footerLink ( $desc, $page)
 Returns an HTML link for use in the footer. More...
 
 getCategories ()
 
 getCategoryLinks ()
 
 getCommonStylePath ( $name)
 Return a fully resolved style path url to images or styles stored in the common folder. More...
 
 getCopyright ( $type='detect')
 
 getCopyrightIcon ()
 
 getDefaultModules ()
 Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wishing to override call parent::getDefaultModules() and substitute out any modules they wish to change by using a key to look them up. More...
 
 getHtmlElementAttributes ()
 
 getLogo ()
 URL to the logo. More...
 
 getNamespaceNotice ()
 Get a notice based on page's namespace. More...
 
 getNewtalks ()
 Gets new talk page messages for the current user and returns an appropriate alert message (or an empty string if there are no messages) More...
 
 getPageClasses ( $title)
 TODO: document. More...
 
 getPoweredBy ()
 Gets the powered by MediaWiki icon. More...
 
 getRelevantTitle ()
 Return the "relevant" title. More...
 
 getRelevantUser ()
 Return the "relevant" user. More...
 
 getRevisionId ()
 Get the current revision ID. More...
 
 getSearchLink ()
 
 getSiteNotice ()
 Get the site notice. More...
 
 getSkinName ()
 
 getSkinStylePath ( $name)
 Return a fully resolved style path url to images or styles stored in the current skins's folder. More...
 
 getUndeleteLink ()
 
 initPage (OutputPage $out)
 
 isRevisionCurrent ()
 Whether the revision displayed is the latest revision of the page. More...
 
 logoText ( $align='')
 
 mainPageLink ()
 Gets the link to the wiki's main page. More...
 
 makeFooterIcon ( $icon, $withImage='withImage')
 Renders a $wgFooterIcons icon according to the method's arguments. More...
 
 outputPage (OutputPage $out=null)
 Outputs the HTML generated by other functions. More...
 
 preloadExistence ()
 Preload the existence of three commonly-requested pages in a single query. More...
 
 printSource ()
 Text with the permalink to the source page, usually shown on the footer of a printed page. More...
 
 privacyLink ()
 Gets the link to the wiki's privacy policy page. More...
 
 setRelevantTitle ( $t)
 Set the "relevant" title. More...
 
 setRelevantUser ( $u)
 Set the "relevant" user. More...
 
 setupSkinUserCss (OutputPage $out)
 Add skin specific stylesheets Calling this method with an $out of anything but the same OutputPage inside ->getOutput() is deprecated. More...
 
 showEmailUser ( $id)
 
 showIPinHeader ()
 Returns true if the IP should be shown in the header. More...
 
 subPageSubtitle ()
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 Get the Config object. More...
 
 getContext ()
 Get the RequestContext object. More...
 
 getLang ()
 Get the Language object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getTitle ()
 Get the Title object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 Set the IContextSource object. More...
 

Static Public Member Functions

static checkTitle (&$title, $name)
 make sure we have some title to operate on More...
 
static getAllowedSkins ()
 Fetch the list of user-selectable skins in regards to $wgSkipSkins. More...
 
static getDynamicStylesheetQuery ()
 Get the query to generate a dynamic stylesheet. More...
 
static getSkinNameMessages ()
 Fetch the skinname messages for available skins. More...
 
static getSkinNames ()
 Fetch the set of available skins. More...
 
static getUsableSkins ()
 
static makeGlobalVariablesScript ( $unused)
 Make a "<script>" tag containing global variables. More...
 
static makeI18nUrl ( $name, $urlaction='')
 
static makeInternalOrExternalUrl ( $name)
 If url string starts with http, consider as external URL, else internal. More...
 
static makeKnownUrlDetails ( $name, $urlaction='')
 Make URL details where the article exists (or at least it's convenient to think so) More...
 
static makeMainPageUrl ( $urlaction='')
 
static makeNSUrl ( $name, $urlaction='', $namespace=NS_MAIN)
 this can be passed the NS number as defined in Language.php More...
 
static makeSpecialUrl ( $name, $urlaction='', $proto=null)
 Make a URL for a Special Page using the given query and protocol. More...
 
static makeSpecialUrlSubpage ( $name, $subpage, $urlaction='')
 
static makeUrl ( $name, $urlaction='')
 
static makeUrlDetails ( $name, $urlaction='')
 these return an array with the 'href' and boolean 'exists' More...
 
static makeVariablesScript ( $data)
 
static & newFromKey ( $key)
 Factory method for loading a skin of a given type. More...
 
static normalizeKey ( $key)
 Normalize a skin preference value to a form that can be loaded. More...
 

Protected Member Functions

 afterContentHook ()
 This runs a hook to allow extensions placing their stuff after content and article metadata (e.g. More...
 
 generateDebugHTML ()
 Generate debug data HTML for displaying at the bottom of the main content area. More...
 
 lastModified ()
 Get the timestamp of the latest revision, formatted in user language. More...
 

Protected Attributes

 $mRelevantTitle = null
 
 $mRelevantUser = null
 
 $skinname = 'standard'
 

Private Member Functions

 getCachedNotice ( $name)
 Get a cached notice. More...
 

Detailed Description

The main skin class which provides methods and properties for all other skins.

This base class is also the "Standard" skin.

See docs/skin.txt for more information.

Definition at line 35 of file Skin.php.

Member Function Documentation

◆ __call()

Skin::__call (   $fname,
  $args 
)

Use PHP's magic __call handler to intercept legacy calls to the linker for backwards compatibility.

Parameters
string$fnameName of called method
array$argsArguments to the method
Exceptions
MWException
Returns
mixed

Definition at line 1644 of file Skin.php.

References $args, $fname, array(), and wfDeprecated().

◆ aboutLink()

Skin::aboutLink ( )

Gets the link to the wiki's about page.

Returns
String HTML

Definition at line 1018 of file Skin.php.

References footerLink().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ addToBodyAttributes()

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.

Parameters
$outOutputPage
$bodyAttrsArray

Reimplemented in SkinVector.

Definition at line 498 of file Skin.php.

Referenced by OutputPage\headElement().

◆ addToSidebar()

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

Parameters
$bararray
$messageString

Definition at line 1283 of file Skin.php.

References addToSidebarPlain(), and wfMessage().

Referenced by buildSidebar().

◆ addToSidebarPlain()

Skin::addToSidebarPlain ( $bar,
  $text 
)

Add content from plain text.

Since
1.17
Parameters
$bararray
$textstring
Returns
Array

Definition at line 1294 of file Skin.php.

References $line, $lines, $link, $title, array(), as, Sanitizer\escapeId(), ContextSource\getTitle(), global, ContextSource\msg(), Title\newFromText(), MessageCache\singleton(), wfMatchesDomainList(), and wfUrlProtocols().

Referenced by addToSidebar(), and SideBarTest\assertSideBar().

◆ afterContentHook()

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.

Returns
String, empty by default, if not changed by any hook function.

Definition at line 637 of file Skin.php.

References array(), wfDebug(), and wfRunHooks().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ bottomScripts()

Skin::bottomScripts ( )

This gets called shortly before the "</body>" tag.

Returns
String HTML-wrapped JS code to be put before "</body>"

Definition at line 672 of file Skin.php.

References array(), ContextSource\getOutput(), and wfRunHooks().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ buildSidebar()

Skin::buildSidebar ( )

Build an array that represents the sidebar(s), the navigation bar among them.

BaseTemplate::getSidebar can be used to simplify the format and id generation in new skins.

The format of the returned array is array( heading => content, ... ), where:

  • heading is the heading of a navigation portlet. It is either:
    • magic string to be handled by the skins ('SEARCH' / 'LANGUAGES' / 'TOOLBOX' / ...)
    • a message name (e.g. 'navigation'), the message should be HTML-escaped by the skin
    • plain text, which should be HTML-escaped by the skin
  • content is the contents of the portlet. It is either:

Note that extensions can control the sidebar contents using the SkinBuildSidebar hook and can technically insert anything in here; skin creators are expected to handle values described above.

Returns
array

Definition at line 1248 of file Skin.php.

References $wgMemc, addToSidebar(), array(), ContextSource\getLanguage(), global, wfMemcKey(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ checkTitle()

static Skin::checkTitle ( $title,
  $name 
)
static

make sure we have some title to operate on

Parameters
$titleTitle
$namestring

Definition at line 1218 of file Skin.php.

References $name, $title, and Title\newFromText().

Referenced by SkinTemplate\makeArticleUrlDetails(), makeI18nUrl(), makeKnownUrlDetails(), makeMainPageUrl(), makeNSUrl(), SkinTemplate\makeTalkUrlDetails(), makeUrl(), and makeUrlDetails().

◆ commonPrintStylesheet()

Skin::commonPrintStylesheet ( )

This function previously controlled whether the 'mediawiki.legacy.wikiprintable' module should be loaded by OutputPage.

That module no longer exists and the return value of this method is ignored.

If your skin doesn't provide its own print styles, the 'mediawiki.legacy.commonPrint' module can be used instead (SkinTemplate-based skins do it automatically).

Deprecated:
since 1.22
Returns
bool

Definition at line 1390 of file Skin.php.

References wfDeprecated().

◆ disclaimerLink()

Skin::disclaimerLink ( )

Gets the link to the wiki's general disclaimers page.

Returns
String HTML

Definition at line 1026 of file Skin.php.

References footerLink().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ doEditSectionLink()

Skin::doEditSectionLink ( Title  $nt,
  $section,
  $tooltip = null,
  $lang = false 
)

Create a section edit link.

This supersedes editSectionLink() and editSectionLinkForOther().

Parameters
$ntTitle The title being linked to (may not be the same as the current page, if the section is included from a template)
string$sectionThe designation of the section being pointed to, to be included in the link, like "&section=$section"
string$tooltipThe tooltip to use for the link: will be escaped and wrapped in the 'editsectionhint' message
$langstring Language code
Returns
string HTML to use for edit link

Definition at line 1605 of file Skin.php.

References $attribs, $link, $section, array(), Sanitizer\decodeCharReferences(), Linker\link(), text, wfGetLangObj(), wfMessage(), and wfRunHooks().

◆ drawCategoryBrowser()

Skin::drawCategoryBrowser (   $tree)

Render the array as a series of links.

Parameters
array$treecategories tree returned by Title::getParentCategoryTree
Returns
String separated by >, terminate with "\n"

Definition at line 581 of file Skin.php.

References as, Linker\link(), and Title\newFromText().

Referenced by getCategoryLinks().

◆ editUrlOptions()

Skin::editUrlOptions ( )

Return URL options for the 'edit page' link.

This may include an 'oldid' specifier, if the current page view is such.

Returns
array
Access:\n private

Definition at line 1037 of file Skin.php.

References $options, array(), getRevisionId(), and isRevisionCurrent().

◆ escapeSearchLink()

Skin::escapeSearchLink ( )
Returns
string

Definition at line 800 of file Skin.php.

References getSearchLink().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ footerLink()

Skin::footerLink (   $desc,
  $page 
)

Returns an HTML link for use in the footer.

Parameters
string$desci18n message key for the link text
string$pagei18n message key for the page to link to
Returns
string HTML anchor

Definition at line 988 of file Skin.php.

References $title, Linker\linkKnown(), ContextSource\msg(), Title\newFromText(), and text.

Referenced by aboutLink(), disclaimerLink(), and privacyLink().

◆ generateDebugHTML()

Skin::generateDebugHTML ( )
protected

Generate debug data HTML for displaying at the bottom of the main content area.

Returns
String HTML containing debug data, if enabled (otherwise empty).

Definition at line 663 of file Skin.php.

References MWDebug\getHTMLDebugLog().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getAllowedSkins()

static Skin::getAllowedSkins ( )
static

Fetch the list of user-selectable skins in regards to $wgSkipSkins.

Useful for Special:Preferences and other places where you only want to show skins users can use.

Returns
string[]
Since
1.23

Definition at line 108 of file Skin.php.

References as, getSkinNames(), and global.

Referenced by Preferences\generateSkinOptions(), and getUsableSkins().

◆ getCachedNotice()

Skin::getCachedNotice (   $name)
private

Get a cached notice.

Parameters
string$namemessage name, or 'default' for $wgSiteNotice
Returns
String: HTML fragment

Definition at line 1493 of file Skin.php.

References $name, $parserMemc, $wgContLang, array(), ContextSource\getOutput(), global, ContextSource\msg(), Html\rawElement(), wfMemcKey(), wfProfileIn(), and wfProfileOut().

Referenced by getNamespaceNotice(), and getSiteNotice().

◆ getCategories()

Skin::getCategories ( )

◆ getCategoryLinks()

◆ getCommonStylePath()

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.

Parameters
string$nameThe name or path of a skin resource file
Returns
String The fully resolved style path url including styleversion

Definition at line 1068 of file Skin.php.

References global.

◆ getCopyright()

◆ getCopyrightIcon()

Skin::getCopyrightIcon ( )
Returns
null|string

Definition at line 857 of file Skin.php.

References $out, and global.

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getDefaultModules()

Skin::getDefaultModules ( )

Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wishing to override call parent::getDefaultModules() and substitute out any modules they wish to change by using a key to look them up.

Returns
Array of modules with helper keys for easy overriding

Definition at line 229 of file Skin.php.

References $out, $user, array(), ContextSource\getOutput(), and global.

◆ getDynamicStylesheetQuery()

static Skin::getDynamicStylesheetQuery ( )
static

Get the query to generate a dynamic stylesheet.

Returns
array

Definition at line 428 of file Skin.php.

References array(), and global.

Referenced by FileRepo\getDescriptionStylesheetUrl().

◆ getHtmlElementAttributes()

Skin::getHtmlElementAttributes ( )

Definition at line 482 of file Skin.php.

References array(), and ContextSource\getLanguage().

Referenced by OutputPage\headElement().

◆ getLogo()

Skin::getLogo ( )

URL to the logo.

Returns
String

Definition at line 506 of file Skin.php.

References global.

Referenced by logoText().

◆ getNamespaceNotice()

Skin::getNamespaceNotice ( )

Get a notice based on page's namespace.

Returns
String: HTML fragment

Definition at line 1547 of file Skin.php.

References getCachedNotice(), ContextSource\getTitle(), wfProfileIn(), and wfProfileOut().

◆ getNewtalks()

Skin::getNewtalks ( )

Gets new talk page messages for the current user and returns an appropriate alert message (or an empty string if there are no messages)

Returns
String

Definition at line 1400 of file Skin.php.

References $newtalks, $out, $user, array(), as, Xml\element(), ContextSource\getOutput(), ContextSource\getUser(), Linker\linkKnown(), ContextSource\msg(), Revision\newFromTitle(), IDBAccessObject\READ_NORMAL, wfRunHooks(), and wfWikiID().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getPageClasses()

Skin::getPageClasses (   $title)

TODO: document.

Parameters
$titleTitle
Returns
String

Definition at line 455 of file Skin.php.

References $name, $title, $type, Sanitizer\escapeClass(), list, and SpecialPageFactory\resolveAlias().

Referenced by OutputPage\headElement(), and SkinTemplate\prepareQuickTemplate().

◆ getPoweredBy()

Skin::getPoweredBy ( )

Gets the powered by MediaWiki icon.

Returns
string

Definition at line 887 of file Skin.php.

References array(), global, and wfRunHooks().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getRelevantTitle()

Skin::getRelevantTitle ( )

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.

Returns
Title

Definition at line 344 of file Skin.php.

References $mRelevantTitle, and ContextSource\getTitle().

Referenced by SkinTemplate\buildContentNavigationUrls(), and getRelevantUser().

◆ getRelevantUser()

Skin::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.

Returns
User

Definition at line 368 of file Skin.php.

References $mRelevantUser, $title, $user, getRelevantTitle(), User\isIP(), User\newFromName(), and NS_USER.

Referenced by SkinTemplate\buildNavUrls().

◆ getRevisionId()

Skin::getRevisionId ( )

Get the current revision ID.

Returns
Integer

Definition at line 311 of file Skin.php.

References ContextSource\getOutput().

Referenced by SkinTemplate\buildNavUrls(), editUrlOptions(), isRevisionCurrent(), lastModified(), and printSource().

◆ getSearchLink()

Skin::getSearchLink ( )
Returns
String

Definition at line 792 of file Skin.php.

References SpecialPage\getTitleFor().

Referenced by escapeSearchLink().

◆ getSiteNotice()

Skin::getSiteNotice ( )

Get the site notice.

Returns
String: HTML fragment

Definition at line 1567 of file Skin.php.

References $siteNotice, array(), getCachedNotice(), ContextSource\getUser(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getSkinName()

Skin::getSkinName ( )
Returns
string skin name

Definition at line 208 of file Skin.php.

References $skinname.

Referenced by OutputPage\headElement(), and SkinTemplate\prepareQuickTemplate().

◆ getSkinNameMessages()

static Skin::getSkinNameMessages ( )
static

Fetch the skinname messages for available skins.

Returns
array of strings

Definition at line 92 of file Skin.php.

References $messages, array(), and as.

◆ getSkinNames()

static Skin::getSkinNames ( )
static

Fetch the set of available skins.

Returns
array associative array of strings

Definition at line 44 of file Skin.php.

References $file, $matches, $wgValidSkinNames, array(), global, wfLogWarning(), wfProfileIn(), and wfProfileOut().

Referenced by ResourceLoaderContext\__construct(), getAllowedSkins(), ResourceLoaderStartUpModule\getConfig(), newFromKey(), and normalizeKey().

◆ getSkinStylePath()

Skin::getSkinStylePath (   $name)

Return a fully resolved style path url to images or styles stored in the current skins's folder.

This method returns a url resolved using the configured skin style path and includes the style version inside of the url.

Parameters
string$nameThe name or path of a skin resource file
Returns
String The fully resolved style path url including styleversion

Definition at line 1080 of file Skin.php.

References global.

◆ getUndeleteLink()

◆ getUsableSkins()

static Skin::getUsableSkins ( )
static
Deprecated:
since 1.23, use getAllowedSkins
Returns
string[]

Definition at line 124 of file Skin.php.

References getAllowedSkins(), and wfDeprecated().

◆ initPage()

Skin::initPage ( OutputPage  $out)
Parameters
$outOutputPage

Reimplemented in SkinVector.

Definition at line 215 of file Skin.php.

References preloadExistence(), wfProfileIn(), and wfProfileOut().

Referenced by SkinTemplate\outputPage().

◆ isRevisionCurrent()

Skin::isRevisionCurrent ( )

Whether the revision displayed is the latest revision of the page.

Returns
Boolean

Definition at line 320 of file Skin.php.

References getRevisionId(), and ContextSource\getTitle().

Referenced by SkinTemplate\buildContentNavigationUrls(), editUrlOptions(), getCopyright(), and SkinTemplate\prepareQuickTemplate().

◆ lastModified()

Skin::lastModified ( )
protected

Get the timestamp of the latest revision, formatted in user language.

Returns
String

Definition at line 901 of file Skin.php.

References $s, $t, $timestamp, ContextSource\getLanguage(), ContextSource\getOutput(), getRevisionId(), Revision\getTimestampFromId(), ContextSource\getTitle(), ContextSource\getUser(), ContextSource\msg(), and wfGetLB().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ logoText()

Skin::logoText (   $align = '')
Parameters
$alignstring
Returns
string

Definition at line 928 of file Skin.php.

References $s, getLogo(), ContextSource\msg(), and Title\newMainPage().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ mainPageLink()

Skin::mainPageLink ( )

Gets the link to the wiki's main page.

Returns
string

Definition at line 973 of file Skin.php.

References $s, Linker\linkKnown(), ContextSource\msg(), and Title\newMainPage().

◆ makeFooterIcon()

Skin::makeFooterIcon (   $icon,
  $withImage = 'withImage' 
)

Renders a $wgFooterIcons icon according to the method's arguments.

Parameters
array$iconThe icon to build the html for, see $wgFooterIcons for the format of this array
bool | String$withImageWhether to use the icon's image or output a text-only footericon
Returns
String HTML

Definition at line 951 of file Skin.php.

References $html, array(), Html\element(), and Html\rawElement().

◆ makeGlobalVariablesScript()

static Skin::makeGlobalVariablesScript (   $unused)
static

Make a "<script>" tag containing global variables.

Deprecated:
in 1.19
Parameters
$unused
Returns
string HTML fragment

Definition at line 415 of file Skin.php.

References $wgOut, global, makeVariablesScript(), and wfDeprecated().

◆ makeI18nUrl()

static Skin::makeI18nUrl (   $name,
  $urlaction = '' 
)
static
Parameters
$namestring
$urlactionstring
Returns
String

Definition at line 1134 of file Skin.php.

References $name, $title, checkTitle(), Title\newFromText(), text, and wfMessage().

◆ makeInternalOrExternalUrl()

static Skin::makeInternalOrExternalUrl (   $name)
static

If url string starts with http, consider as external URL, else internal.

Parameters
$nameString
Returns
String URL

Definition at line 1158 of file Skin.php.

References $name, makeUrl(), and wfUrlProtocols().

Referenced by EmailNotification\composeCommonMailtext(), and CologneBlueTemplate\sysLinks().

◆ makeKnownUrlDetails()

static Skin::makeKnownUrlDetails (   $name,
  $urlaction = '' 
)
static

Make URL details where the article exists (or at least it's convenient to think so)

Parameters
string$nameArticle name
$urlactionString
Returns
Array

Definition at line 1202 of file Skin.php.

References $name, $title, array(), checkTitle(), Title\newFromText(), and true.

Referenced by SkinTemplate\setupTemplateForOutput().

◆ makeMainPageUrl()

static Skin::makeMainPageUrl (   $urlaction = '')
static
Parameters
$urlactionstring
Returns
String

Definition at line 1091 of file Skin.php.

References $title, checkTitle(), and Title\newMainPage().

◆ makeNSUrl()

static Skin::makeNSUrl (   $name,
  $urlaction = '',
  $namespace = NS_MAIN 
)
static

this can be passed the NS number as defined in Language.php

Parameters
$name
$urlactionstring
$namespaceint
Returns
String

Definition at line 1173 of file Skin.php.

References $name, $title, checkTitle(), and Title\makeTitleSafe().

◆ makeSpecialUrl()

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.

Parameters
string$nameName of the Special page
string$urlactionQuery to append
$protoProtocol to use or null for a local URL
Returns
String

Definition at line 1109 of file Skin.php.

References $name, $title, and SpecialPage\getSafeTitleFor().

Referenced by SkinTemplate\buildPersonalUrls().

◆ makeSpecialUrlSubpage()

static Skin::makeSpecialUrlSubpage (   $name,
  $subpage,
  $urlaction = '' 
)
static
Parameters
$namestring
$subpagestring
$urlactionstring
Returns
String

Definition at line 1124 of file Skin.php.

References $name, $title, and SpecialPage\getSafeTitleFor().

Referenced by SkinTemplate\buildPersonalUrls().

◆ makeUrl()

static Skin::makeUrl (   $name,
  $urlaction = '' 
)
static
Parameters
$namestring
$urlactionstring
Returns
String

Definition at line 1145 of file Skin.php.

References $name, $title, checkTitle(), and Title\newFromText().

Referenced by makeInternalOrExternalUrl().

◆ makeUrlDetails()

static Skin::makeUrlDetails (   $name,
  $urlaction = '' 
)
static

these return an array with the 'href' and boolean 'exists'

Parameters
$name
$urlactionstring
Returns
array

Definition at line 1186 of file Skin.php.

References $name, $title, array(), checkTitle(), and Title\newFromText().

Referenced by SkinTemplate\setupTemplateForOutput().

◆ makeVariablesScript()

static Skin::makeVariablesScript (   $data)
static
Parameters
$dataarray
Returns
string

Definition at line 398 of file Skin.php.

References Html\inlineScript(), ResourceLoader\makeConfigSetScript(), and ResourceLoader\makeLoaderConditionalScript().

Referenced by makeGlobalVariablesScript().

◆ newFromKey()

static& Skin::newFromKey (   $key)
static

Factory method for loading a skin of a given type.

Parameters
string$key'monobook', 'standard', etc.
Returns
Skin

Definition at line 176 of file Skin.php.

References $skin, getSkinNames(), global, normalizeKey(), and wfDebug().

Referenced by RequestContext\getSkin().

◆ normalizeKey()

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).

Parameters
string$key'monobook', 'standard', etc.
Returns
string

Definition at line 136 of file Skin.php.

References $fallback, array(), getSkinNames(), and global.

Referenced by newFromKey().

◆ outputPage()

Skin::outputPage ( OutputPage  $out = null)
abstract

Outputs the HTML generated by other functions.

Parameters
$outOutputPage

Reimplemented in SkinTemplate.

◆ preloadExistence()

Skin::preloadExistence ( )

Preload the existence of three commonly-requested pages in a single query.

Definition at line 286 of file Skin.php.

References $lb, $titles, $user, array(), ContextSource\getTitle(), and ContextSource\getUser().

Referenced by initPage().

◆ printSource()

Skin::printSource ( )

Text with the permalink to the source page, usually shown on the footer of a printed page.

Returns
string HTML text with an URL

Definition at line 688 of file Skin.php.

References getRevisionId(), ContextSource\getTitle(), ContextSource\msg(), and wfExpandIRI().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ privacyLink()

Skin::privacyLink ( )

Gets the link to the wiki's privacy policy page.

Returns
String HTML

Definition at line 1010 of file Skin.php.

References footerLink().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ setRelevantTitle()

Skin::setRelevantTitle (   $t)

Set the "relevant" title.

See also
self::getRelevantTitle()
Parameters
$tTitle object to use

Definition at line 330 of file Skin.php.

References $t.

◆ setRelevantUser()

Skin::setRelevantUser (   $u)

Set the "relevant" user.

See also
self::getRelevantUser()
Parameters
$uUser object to use

Definition at line 356 of file Skin.php.

◆ setupSkinUserCss()

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.

Parameters
$outOutputPage
Todo:
delete

Reimplemented in SkinTemplate, SkinVector, SkinMonoBook, SkinCologneBlue, and SkinModern.

◆ showEmailUser()

Skin::showEmailUser (   $id)
Parameters
$idUser|int
Returns
bool

Definition at line 1051 of file Skin.php.

References from, ContextSource\getUser(), User\newFromId(), and user.

Referenced by SkinTemplate\buildNavUrls().

◆ showIPinHeader()

Skin::showIPinHeader ( )

Returns true if the IP should be shown in the header.

Returns
Bool

Definition at line 784 of file Skin.php.

References global.

Referenced by SkinTemplate\buildPersonalUrls(), and SkinTemplate\setupTemplateForOutput().

◆ subPageSubtitle()

Member Data Documentation

◆ $mRelevantTitle

Skin::$mRelevantTitle = null
protected

Definition at line 37 of file Skin.php.

Referenced by getRelevantTitle().

◆ $mRelevantUser

Skin::$mRelevantUser = null
protected

Definition at line 38 of file Skin.php.

Referenced by getRelevantUser().

◆ $skinname

Skin::$skinname = 'standard'
protected

Definition at line 36 of file Skin.php.

Referenced by getSkinName().


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