Skin Class Reference
[Skins]

The main skin class that provide methods and properties for all other skins. More...

Inherits Linker.

Inherited by SkinCologneBlue, SkinNostalgia, SkinStandard, and SkinTemplate.

List of all members.

Public Member Functions

 __construct ()
 Constructor, call parent constructor.
 getStylesheet ()
 getSkinName ()
 qbSetting ()
 initPage (OutputPage $out)
 preloadExistence ()
 Preload the existence of three commonly-requested pages in a single query.
 addMetadataLinks (OutputPage $out)
 Adds metadata links (Creative Commons/Dublin Core/copyright) to the HTML output.
 setTitle ($t)
 Set the title.
 getTitle ()
 Get the title.
 outputPage (OutputPage $out)
 Outputs the HTML generated by other functions.
 userCanPreview ($action)
 To make it harder for someone to slip a user a fake user-JavaScript or user-CSS preview, a random token is associated with the login session.
 generateUserJs ($skinName=null)
 Generated JavaScript action=raw&gen=js This returns MediaWiki:Common.js and MediaWiki:[Skinname].js concate- nated together.
 generateUserStylesheet ()
 Generate user stylesheet for action=raw&gen=css.

Static Public Member Functions

static getSkinNames ()
 Fetch the set of available skins.
static getUsableSkins ()
 Fetch the list of usable skins in regards to $wgSkipSkins.
static normalizeKey ($key)
 Normalize a skin preference value to a form that can be loaded.
static & newFromKey ($key)
 Factory method for loading a skin of a given type.
static makeVariablesScript ($data)
static makeGlobalVariablesScript ($skinName)
 Make a <script> tag containing global variables.

Public Attributes

 $mWatchLinkNum = 0
 #@+
stub:after
content: "!"
color __pad0__: #772233

Protected Member Functions

 setMembers ()
 Set some local variables.
 reallyGenerateUserStylesheet ()
 Split for easier subclassing in SkinSimple, SkinStandard and SkinCologneBlue.

Protected Attributes

 $searchboxes = ''
 $mRevisionId
 #@-
 $skinname = 'standard'


Detailed Description

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.

Definition at line 18 of file Skin.php.


Constructor & Destructor Documentation

Skin::__construct (  ) 

Constructor, call parent constructor.

Reimplemented from Linker.

Definition at line 32 of file Skin.php.


Member Function Documentation

Skin::addMetadataLinks ( OutputPage out  ) 

Adds metadata links (Creative Commons/Dublin Core/copyright) to the HTML output.

Parameters:
$out Object: instance of OutputPage

Definition at line 242 of file Skin.php.

References $wgEnableCreativeCommonsRdf, $wgEnableDublinCoreRdf, $wgRightsPage, $wgRightsUrl, OutputPage::addLink(), OutputPage::addMetadataLink(), OutputPage::isArticleRelated(), and Title::newFromText().

Referenced by initPage().

Skin::generateUserJs ( skinName = null  ) 

Generated JavaScript action=raw&gen=js This returns MediaWiki:Common.js and MediaWiki:[Skinname].js concate- nated together.

For some bizarre reason, it does *not* return any custom user JS from subpages. Huh?

There's absolutely no reason to have separate Monobook/Common JSes. Any JS that cares can just check the skin variable generated at the top. For now Monobook.js will be maintained, but it should be consi- dered deprecated.

Parameters:
$skinName String: If set, overrides the skin name
Returns:
string

Definition at line 508 of file Skin.php.

References $s, $wgStylePath, Xml::escapeJsString(), wfEmptyMsg(), wfMsgExt(), wfProfileIn(), and wfProfileOut().

Skin::generateUserStylesheet (  ) 

Generate user stylesheet for action=raw&gen=css.

Definition at line 541 of file Skin.php.

References $s, wfProfileIn(), and wfProfileOut().

Skin::getSkinName (  ) 

Returns:
string skin name

Reimplemented in SkinCologneBlue, and SkinNostalgia.

Definition at line 167 of file Skin.php.

Referenced by OutputPage::getHeadScripts(), and SkinTemplate::outputPage().

static Skin::getSkinNames (  )  [static]

Fetch the set of available skins.

Returns:
array of strings

Definition at line 40 of file Skin.php.

References $wgStyleDirectory, $wgValidSkinNames, wfProfileIn(), and wfProfileOut().

Referenced by getUsableSkins(), Title::isValidCssJsSubpage(), newFromKey(), and normalizeKey().

Skin::getStylesheet (  ) 

Returns:
string path to the skin stylesheet

Reimplemented in SkinCologneBlue, and SkinNostalgia.

Definition at line 162 of file Skin.php.

Skin::getTitle (  ) 

Get the title.

Definition at line 300 of file Skin.php.

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.

Returns:
array of strings

Definition at line 74 of file Skin.php.

References $wgSkipSkins, and getSkinNames().

Referenced by Preferences::generateSkinOptions().

Skin::initPage ( OutputPage out  ) 

static Skin::makeGlobalVariablesScript ( skinName  )  [static]

static Skin::makeVariablesScript ( data  )  [static]

Definition at line 341 of file Skin.php.

References $name, Xml::encodeJsVar(), and Html::inlineScript().

Referenced by UploadForm::addUploadJS().

static& Skin::newFromKey ( key  )  [static]

Factory method for loading a skin of a given type.

Parameters:
$key String: 'monobook', 'standard', etc.
Returns:
Skin

Definition at line 128 of file Skin.php.

References $wgStyleDirectory, getSkinNames(), normalizeKey(), and wfDebug().

Referenced by User::getSkin().

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:
$key String: 'monobook', 'standard', etc.
Returns:
string

Definition at line 90 of file Skin.php.

References $fallback, $wgDefaultSkin, and getSkinNames().

Referenced by newFromKey().

Skin::outputPage ( OutputPage out  ) 

Outputs the HTML generated by other functions.

Parameters:
$out Object: instance of OutputPage

Reimplemented in SkinTemplate.

Definition at line 308 of file Skin.php.

References $wgDebugComments, afterContent(), afterContentHook(), beforeContent(), bottomScripts(), OutputPage::headElement(), initPage(), OutputPage::out(), setMembers(), wfProfileIn(), wfProfileOut(), and wfReportTime().

Skin::preloadExistence (  ) 

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

Definition at line 218 of file Skin.php.

References $wgUser.

Referenced by initPage().

Skin::qbSetting (  ) 

Skin::reallyGenerateUserStylesheet (  )  [protected]

Split for easier subclassing in SkinSimple, SkinStandard and SkinCologneBlue.

Reimplemented in SkinCologneBlue, SkinSimple, and SkinStandard.

Definition at line 552 of file Skin.php.

References $s, $wgUser, and CSS.

Skin::setMembers (  )  [protected]

Set some local variables.

Definition at line 284 of file Skin.php.

References $wgUser.

Referenced by SkinTemplate::outputPage(), and outputPage().

Skin::setTitle ( t  ) 

Set the title.

Parameters:
Title $t The title to use

Definition at line 295 of file Skin.php.

References $t.

Skin::userCanPreview ( action  ) 

To make it harder for someone to slip a user a fake user-JavaScript or user-CSS preview, a random token is associated with the login session.

If it's not passed back with the preview request, we won't render the code.

Parameters:
$action String: 'edit', 'submit' etc.
Returns:
bool

Definition at line 475 of file Skin.php.

References $action, $wgRequest, and $wgUser.

Referenced by OutputPage::getHeadScripts(), and SkinTemplate::setupUserJs().


Member Data Documentation

Skin::$mRevisionId [protected]

#@-

Definition at line 26 of file Skin.php.

Skin::$mWatchLinkNum = 0

#@+

Access:
private

Definition at line 22 of file Skin.php.

Skin::$searchboxes = '' [protected]

Definition at line 24 of file Skin.php.

Skin::$skinname = 'standard' [protected]

Reimplemented in SkinTemplate, SkinChick, SkinModern, SkinMonoBook, SkinMySkin, SkinSimple, and SkinVector.

Definition at line 27 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 573 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 571 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 571 of file Skin.php.


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

Generated on Sat Apr 30 22:57:49 2011 for MediaWiki by  doxygen 1.5.9