MediaWiki REL1_32
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

 __construct ( $skinname=null)
 
 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.
 
 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 series of links.
 
 editUrlOptions ()
 Return URL options for the 'edit page' link.
 
 escapeSearchLink ()
 
 footerLink ( $desc, $page)
 Returns an HTML link for use in the footer.
 
 getCategories ()
 
 getCategoryLinks ()
 
 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.
 
 getHtmlElementAttributes ()
 Return values for <html> element.
 
 getLogo ()
 URL to the logo.
 
 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)
 
 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 current skin'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 according to the method's arguments.
 
 outputPage (OutputPage $out=null)
 Outputs the HTML generated by other functions.
 
 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)
 Hook point for adding style modules to OutputPage.
 
 shouldPreloadLogo ()
 Whether the logo should be preloaded with an HTTP link header or not.
 
 showEmailUser ( $id)
 
 subPageSubtitle ( $out=null)
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage().
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID.
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object.
 
 getLanguage ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object.
 
 msg ( $key)
 Get a Message object with context set Parameters are the same as wfMessage()
 
 setContext (IContextSource $context)
 

Static Public Member Functions

static checkTitle (&$title, $name)
 make sure we have some title to operate on
 
static getAllowedSkins ()
 Fetch the list of user-selectable skins in regards to $wgSkipSkins.
 
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 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, $nonce=null)
 
static normalizeKey ( $key)
 Normalize a skin preference value to a form that can be loaded.
 

Public Attributes

string $stylename = null
 Stylesheets set to use.
 

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.
 
 preloadExistence ()
 Preload the existence of three commonly-requested pages in a single query.
 

Protected Attributes

 $mRelevantTitle = null
 
 $mRelevantUser = null
 
string null $skinname = null
 

Private Member Functions

 footerLinkTitle ( $desc, $page)
 
 getCachedNotice ( $name)
 Get a cached notice.
 

Detailed Description

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

See docs/skin.txt for more information.

Definition at line 38 of file Skin.php.

Constructor & Destructor Documentation

◆ __construct()

Skin::__construct (   $skinname = null)
Since
1.31
Parameters
string | null$skinname

Definition at line 146 of file Skin.php.

References $skinname.

Member Function Documentation

◆ aboutLink()

Skin::aboutLink ( )

Gets the link to the wiki's about page.

Returns
string HTML

Definition at line 1054 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
OutputPage$out
array&$bodyAttrs

Definition at line 487 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
array&$bar
string$message

Definition at line 1333 of file Skin.php.

References addToSidebarPlain(), ContextSource\msg(), and plain.

Referenced by buildSidebar().

◆ addToSidebarPlain()

Skin::addToSidebarPlain ( $bar,
  $text 
)

Add content from plain text.

Since
1.17
Parameters
array&$bar
string$text
Returns
array

Definition at line 1344 of file Skin.php.

References $line, $lines, $link, $title, $wgExternalLinkTarget, $wgNoFollowDomainExceptions, $wgNoFollowLinks, as, ContextSource\getConfig(), ContextSource\getTitle(), ContextSource\msg(), wfMatchesDomainList(), and wfUrlProtocols().

Referenced by addToSidebar().

◆ 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 642 of file Skin.php.

References wfDebug().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ bottomScripts()

Skin::bottomScripts ( )

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

Returns
string|WrappedStringList HTML containing scripts to put before </body>

Definition at line 677 of file Skin.php.

References ContextSource\getOutput().

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 [ 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

Reimplemented in SkinApi.

Definition at line 1285 of file Skin.php.

References $wgEnableSidebarCache, $wgSidebarCacheExpiry, and addToSidebar().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ checkTitle()

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

make sure we have some title to operate on

Parameters
Title&$title
string$name

Definition at line 1255 of file Skin.php.

References $name, and $title.

Referenced by SkinTemplate\makeArticleUrlDetails(), and SkinTemplate\makeTalkUrlDetails().

◆ disclaimerLink()

Skin::disclaimerLink ( )

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

Returns
string HTML

Definition at line 1062 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.

@suppress SecurityCheck-XSS $links has keys of different taint types

Parameters
Title$ntThe 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 | null$tooltipThe tooltip to use for the link: will be escaped and wrapped in the 'editsectionhint' message. Not setting this parameter is deprecated.
Language | string$langLanguage object or language code string. Type string is deprecated. Not setting this parameter is deprecated.
Returns
string HTML to use for edit link

Definition at line 1619 of file Skin.php.

References $attribs, $lang, $section, as, Linker\link(), ContextSource\msg(), wfDeprecated(), and wfGetLangObj().

◆ 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 584 of file Skin.php.

References $parent, as, drawCategoryBrowser(), and Linker\link().

Referenced by drawCategoryBrowser(), and 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 1073 of file Skin.php.

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

Referenced by SkinTemplate\buildContentNavigationUrls().

◆ escapeSearchLink()

Skin::escapeSearchLink ( )
Returns
string

Definition at line 810 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$descThe i18n message key for the link text
string$pageThe i18n message key for the page to link to
Returns
string HTML anchor

Definition at line 1011 of file Skin.php.

References $title, footerLinkTitle(), Linker\linkKnown(), and ContextSource\msg().

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

◆ footerLinkTitle()

Skin::footerLinkTitle (   $desc,
  $page 
)
private
Parameters
string$desc
string$page
Returns
Title|null

Definition at line 1028 of file Skin.php.

References $title, ContextSource\msg(), and text.

Referenced by footerLink(), and preloadExistence().

◆ 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 668 of file Skin.php.

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 80 of file Skin.php.

References $wgSkipSkins, and as.

Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions().

◆ getCachedNotice()

Skin::getCachedNotice (   $name)
private

Get a cached notice.

Parameters
string$nameMessage name, or 'default' for $wgSiteNotice
Returns
string|bool HTML fragment, or false to indicate that the caller should fall back to the next notice in its sequence

Definition at line 1529 of file Skin.php.

References $cache, $name, $services, $wgRenderHashAppend, $wgSiteNotice, ContextSource\getOutput(), ContextSource\msg(), and use.

Referenced by getSiteNotice().

◆ getCategories()

Skin::getCategories ( )

◆ getCategoryLinks()

◆ getCopyright()

Skin::getCopyright (   $type = 'detect')

◆ getCopyrightIcon()

Skin::getCopyrightIcon ( )
Returns
null|string

Definition at line 864 of file Skin.php.

References $out, $wgFooterIcons, $wgRightsIcon, $wgRightsText, and $wgRightsUrl.

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.

Any modules defined with the 'styles' key will be added as render blocking CSS via Output::addModuleStyles. Similarly, each key should refer to a list of modules

Returns
array Array of modules with helper keys for easy overriding

Reimplemented in SkinApi, and SkinFallback.

Definition at line 176 of file Skin.php.

References $modules, $out, $user, ContextSource\getConfig(), ContextSource\getOutput(), and ContextSource\getUser().

◆ getDynamicStylesheetQuery()

static Skin::getDynamicStylesheetQuery ( )
static

Get the query to generate a dynamic stylesheet.

Deprecated:
since 1.32 Use action=raw&ctype=text/css directly.
Returns
array

Definition at line 420 of file Skin.php.

◆ getHtmlElementAttributes()

Skin::getHtmlElementAttributes ( )

Return values for <html> element.

Returns
array Array of associative name-to-value elements for <html> element

Definition at line 471 of file Skin.php.

References $lang, and ContextSource\getLanguage().

Referenced by OutputPage\headElement().

◆ getLogo()

Skin::getLogo ( )

URL to the logo.

Returns
string

Definition at line 495 of file Skin.php.

References $wgLogo.

Referenced by logoText().

◆ 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

Reimplemented in SkinApi.

Definition at line 1436 of file Skin.php.

References $newtalks, $out, $user, as, ContextSource\getOutput(), ContextSource\getUser(), Linker\linkKnown(), ContextSource\msg(), Revision\newFromTitle(), and wfWikiID().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getPageClasses()

Skin::getPageClasses (   $title)

TODO: document.

Parameters
Title$title
Returns
string

Definition at line 442 of file Skin.php.

References $name, $title, $type, and list.

Referenced by OutputPage\headElement().

◆ getPoweredBy()

Skin::getPoweredBy ( )

Gets the powered by MediaWiki icon.

Returns
string

Definition at line 894 of file Skin.php.

References $wgResourceBasePath.

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 ContextSource\getTitle().

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

◆ 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 $title, $user, getRelevantTitle(), User\isIP(), User\newFromName(), and NS_USER.

Referenced by SkinTemplate\buildNavUrls().

◆ getRevisionId()

Skin::getRevisionId ( )

Get the current revision ID.

Returns
int

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 802 of file Skin.php.

References $searchPage.

Referenced by escapeSearchLink().

◆ getSiteNotice()

Skin::getSiteNotice ( )

Get the site notice.

Returns
string HTML fragment

Reimplemented in SkinApi.

Definition at line 1581 of file Skin.php.

References getCachedNotice(), and ContextSource\getUser().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ getSkinName()

Skin::getSkinName ( )
Returns
string|null Skin name

Definition at line 155 of file Skin.php.

Referenced by OutputPage\headElement().

◆ getSkinNameMessages()

static Skin::getSkinNameMessages ( )
static

Fetch the skinname messages for available skins.

Returns
string[]

Definition at line 65 of file Skin.php.

References $messages, and as.

◆ getSkinNames()

static Skin::getSkinNames ( )
static

Fetch the set of available skins.

Returns
array Associative array of strings

Definition at line 57 of file Skin.php.

◆ getSkinStylePath()

Skin::getSkinStylePath (   $name)

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

This method returns a URL resolved using the configured skin style path.

Requires $stylename to be set, otherwise throws MWException.

Parameters
string$nameThe name or path of a skin resource file
Returns
string The fully resolved style path URL
Exceptions
MWException

Definition at line 1111 of file Skin.php.

References $wgStylePath.

◆ getUndeleteLink()

Skin::getUndeleteLink ( )

◆ initPage()

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

Reimplemented in SkinFallback.

Definition at line 162 of file Skin.php.

References preloadExistence().

Referenced by SkinTemplate\outputPage().

◆ isRevisionCurrent()

Skin::isRevisionCurrent ( )

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

Returns
bool

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 918 of file Skin.php.

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

Referenced by SkinTemplate\prepareQuickTemplate().

◆ logoText()

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

Definition at line 945 of file Skin.php.

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

Referenced by SkinTemplate\prepareQuickTemplate().

◆ mainPageLink()

Skin::mainPageLink ( )

Gets the link to the wiki's main page.

Returns
string

Definition at line 996 of file Skin.php.

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

◆ 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 970 of file Skin.php.

References $html, and $wgExternalLinkTarget.

◆ makeI18nUrl()

static Skin::makeI18nUrl (   $name,
  $urlaction = '' 
)
static
Parameters
string$name
string | string[]$urlaction
Returns
string

Definition at line 1171 of file Skin.php.

References $name, $title, text, and wfMessage().

◆ makeInternalOrExternalUrl()

static Skin::makeInternalOrExternalUrl (   $name)
static

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

Parameters
string$name
Returns
string URL

Definition at line 1195 of file Skin.php.

References $name, and wfUrlProtocols().

◆ 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
string | string[]$urlaction
Returns
array

Definition at line 1239 of file Skin.php.

References $name, $title, and true.

Referenced by SkinTemplate\setupTemplateForOutput().

◆ makeMainPageUrl()

static Skin::makeMainPageUrl (   $urlaction = '')
static
Parameters
string | string[]$urlaction
Returns
string

Definition at line 1128 of file Skin.php.

References $title.

Referenced by SkinTemplate\buildNavUrls().

◆ makeNSUrl()

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

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

Parameters
string$name
string | string[]$urlaction
int$namespace
Returns
string

Definition at line 1210 of file Skin.php.

References $name, and $title.

◆ 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 | string[]$urlactionQuery to append
string | null$protoProtocol to use or null for a local URL
Returns
string

Definition at line 1146 of file Skin.php.

References $name, and $title.

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

◆ makeSpecialUrlSubpage()

static Skin::makeSpecialUrlSubpage (   $name,
  $subpage,
  $urlaction = '' 
)
static
Parameters
string$name
string$subpage
string | string[]$urlaction
Returns
string

Definition at line 1161 of file Skin.php.

References $name, and $title.

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

◆ makeUrl()

static Skin::makeUrl (   $name,
  $urlaction = '' 
)
static
Parameters
string$name
string | string[]$urlaction
Returns
string

Definition at line 1182 of file Skin.php.

References $name, and $title.

◆ makeUrlDetails()

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

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

Parameters
string$name
string | string[]$urlaction
Returns
array

Definition at line 1223 of file Skin.php.

References $name, and $title.

Referenced by SkinTemplate\setupTemplateForOutput().

◆ makeVariablesScript()

static Skin::makeVariablesScript (   $data,
  $nonce = null 
)
static
Parameters
array$data
string | null$nonceOutputPage::getCSPNonce()
Returns
string|WrappedString HTML

Definition at line 404 of file Skin.php.

References ResourceLoader\makeConfigSetScript(), and ResourceLoader\makeInlineScript().

◆ 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 ($wgDefaultSkin), or the hardcoded default ($wgFallbackSkin) if the default skin is unavailable too.

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

Definition at line 101 of file Skin.php.

References $fallback, $wgDefaultSkin, and $wgFallbackSkin.

◆ outputPage()

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

Outputs the HTML generated by other functions.

Parameters
OutputPage | null$out

Reimplemented in SkinTemplate.

◆ preloadExistence()

Skin::preloadExistence ( )
protected

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

Definition at line 266 of file Skin.php.

References $title, $titles, $user, as, footerLinkTitle(), getRelevantTitle(), 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 699 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 1046 of file Skin.php.

References footerLink().

Referenced by SkinTemplate\prepareQuickTemplate().

◆ setRelevantTitle()

Skin::setRelevantTitle (   $t)

Set the "relevant" title.

See also
self::getRelevantTitle()
Parameters
Title$t

Definition at line 330 of file Skin.php.

References $t.

◆ setRelevantUser()

Skin::setRelevantUser (   $u)

Set the "relevant" user.

See also
self::getRelevantUser()
Parameters
User$u

Definition at line 356 of file Skin.php.

◆ setupSkinUserCss()

Skin::setupSkinUserCss ( OutputPage  $out)

Hook point for adding style modules to OutputPage.

Deprecated:
since 1.32 Use getDefaultModules() instead.
Parameters
OutputPage$outLegacy parameter, identical to $this->getOutput()

Definition at line 433 of file Skin.php.

◆ shouldPreloadLogo()

Skin::shouldPreloadLogo ( )

Whether the logo should be preloaded with an HTTP link header or not.

Deprecated:
since 1.32 Redundant. It now happens automatically based on whether the skin loads a stylesheet based on ResourceLoaderSkinModule, which all skins that use wgLogo in CSS do, and other's would not.
Since
1.29
Returns
bool

Definition at line 509 of file Skin.php.

◆ showEmailUser()

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

Definition at line 1087 of file Skin.php.

References ContextSource\getUser(), User\newFromId(), and SpecialEmailUser\validateTarget().

Referenced by SkinTemplate\buildNavUrls().

◆ subPageSubtitle()

Skin::subPageSubtitle (   $out = null)
Parameters
OutputPage | null$outDefaults to $this->getOutput() if left as null
Returns
string

Definition at line 746 of file Skin.php.

References $lang, $link, $out, $title, as, ContextSource\getLanguage(), ContextSource\getOutput(), Linker\linkKnown(), and ContextSource\msg().

Referenced by SkinTemplate\prepareQuickTemplate().

Member Data Documentation

◆ $mRelevantTitle

Skin::$mRelevantTitle = null
protected

Definition at line 44 of file Skin.php.

◆ $mRelevantUser

Skin::$mRelevantUser = null
protected

Definition at line 45 of file Skin.php.

◆ $skinname

string null Skin::$skinname = null
protected

Definition at line 42 of file Skin.php.

Referenced by __construct().

◆ $stylename

string Skin::$stylename = null

Stylesheets set to use.

Subdirectory in skins/ where various stylesheets are located. Only needs to be set if you intend to use the getSkinStylePath() method.

Definition at line 51 of file Skin.php.


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