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

 Skin ()
 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)
 setMembers ()
 outputPage (OutputPage $out)
 getHeadScripts ($allowUserJs)
 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 ()
 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 ($data)
 Make a <script> tag containing global variables.

Public Attributes

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

Protected Member Functions

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


Member Function Documentation

Skin::addMetadataLinks ( OutputPage out  ) 

Skin::generateUserJs (  ) 

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.

Returns:
string

Definition at line 479 of file Skin.php.

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

Skin::generateUserStylesheet (  ) 

generate user stylesheet for action=raw&gen=css

Definition at line 509 of file Skin.php.

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

Skin::getHeadScripts ( allowUserJs  ) 

Reimplemented in SkinStandard.

Definition at line 417 of file Skin.php.

References $wgJsMimeType, $wgStylePath, $wgStyleVersion, $wgUser, $wgUseSiteJs, and makeUrl().

Referenced by OutputPage::headElement().

Skin::getSkinName (  ) 

Returns:
string skin name

Reimplemented in SkinCologneBlue, and SkinNostalgia.

Definition at line 162 of file Skin.php.

Referenced by SkinTemplate::outputPage().

static Skin::getSkinNames (  )  [static]

Fetch the set of available skins.

Returns:
array of strings

Definition at line 36 of file Skin.php.

References $file, $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 157 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 70 of file Skin.php.

References $wgSkipSkins, and getSkinNames().

Referenced by PreferencesForm::mainPrefsForm().

Skin::initPage ( OutputPage out  ) 

static Skin::makeGlobalVariablesScript ( data  )  [static]

static Skin::makeVariablesScript ( data  )  [static]

Definition at line 313 of file Skin.php.

References $name, $wgJsMimeType, and Xml::encodeJsVar().

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

References $key, $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:
string $key
Returns:
string

Definition at line 87 of file Skin.php.

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

Referenced by PreferencesForm::__construct(), newFromKey(), and PreferencesForm::resetPrefs().

Skin::outputPage ( OutputPage out  ) 

Skin::preloadExistence (  ) 

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

Definition at line 211 of file Skin.php.

References $lb, $wgTitle, and $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 520 of file Skin.php.

References $s, $wgUser, and END.

Skin::setMembers (  ) 

Definition at line 266 of file Skin.php.

References $wgTitle, and $wgUser.

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

Skin::Skin (  ) 

Constructor, call parent constructor.

Definition at line 29 of file Skin.php.

References Linker::__construct().

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:
string $action
Returns:
bool
Access:
private

Definition at line 453 of file Skin.php.

References $action, $wgRequest, $wgTitle, and $wgUser.

Referenced by SkinMonoBookCBT::isCssPreview(), SkinMonoBookCBT::isJsPreview(), and SkinTemplate::setupUserJs().


Member Data Documentation

Skin::$mRevisionId [protected]

#@-

Definition at line 25 of file Skin.php.

Skin::$mWatchLinkNum = 0

#@+

Access:
private

Definition at line 21 of file Skin.php.

Skin::$searchboxes = '' [protected]

Definition at line 23 of file Skin.php.

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

Reimplemented in SkinTemplate.

Definition at line 26 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 541 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 539 of file Skin.php.

Reimplemented in SkinSimple.

Definition at line 539 of file Skin.php.


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

Generated on Sat Sep 5 02:08:46 2009 for MediaWiki by  doxygen 1.5.9