MediaWiki  REL1_19
SkinTemplate Class Reference

Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge.net/) skin Based on Brion's smarty skin. More...

Inheritance diagram for SkinTemplate:
Collaboration diagram for SkinTemplate:

List of all members.

Public Member Functions

 commonPrintStylesheet ()
 Should we load mediawiki.legacy.wikiprintable? Skins that have their own print stylesheet should override this and return false.
 getNameSpaceKey ()
 Generate strings used for xml 'id' names.
 makeArticleUrlDetails ($name, $urlaction= '')
 makeTalkUrlDetails ($name, $urlaction= '')
 outputPage (OutputPage $out=null)
 initialize various variables and generate the template
 printOrError ($str)
 Output the string, or print error message if it's an error object of the appropriate type.
 setupSkinUserCss (OutputPage $out)
 #@-
 setupTemplate ($classname, $repository=false, $cache_dir=false)
 Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML.
 tabAction ($title, $message, $selected, $query= '', $checkEdit=false)
 TODO document.
 useCombinedLoginLink ()
 Output a boolean indiciating if buildPersonalUrls should output separate login and create account links or output a combined link By default we simply return a global config setting that affects most skins This is setup as a method so that like with $wgLogo and getLogo() a skin can override this setting and always output one or the other if it has a reason it can't output one of the two modes.

Public Attributes

 $skinname = 'monobook'
 #@+
 $stylename = 'monobook'
 Stylesheets set to use.
 $template = 'QuickTemplate'
 For QuickTemplate, the name of the subclass which will actually fill the template.
 $useHeadElement = false
 Whether this skin use OutputPage::headElement() to generate the <head> tag.

Protected Member Functions

 buildContentNavigationUrls ()
 a structured array of links usually used for the tabs in a skin
 buildNavUrls ()
 build array of common navigation links
 buildPersonalUrls ()
 build array of urls for personal toolbar

Private Member Functions

 buildContentActionUrls ($content_navigation)
 an array of edit links by default used for the tabs

Detailed Description

Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge.net/) skin Based on Brion's smarty skin.

Note:
Copyright © Gabriel Wicke -- http://www.aulinx.de/
Todo:
Needs some serious refactoring into functions that correspond to the computations individual esi snippets need. Most importantly no body parsing for most of those of course.

Definition at line 74 of file SkinTemplate.php.


Member Function Documentation

SkinTemplate::buildContentActionUrls ( content_navigation) [private]

an array of edit links by default used for the tabs

Returns:
array

Definition at line 1072 of file SkinTemplate.php.

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

Referenced by outputPage().

Here is the call graph for this function:

Here is the caller graph for this function:

a structured array of links usually used for the tabs in a skin

There are 4 standard sections namespaces: Used for namespace tabs like special, page, and talk namespaces views: Used for primary page views like read, edit, history actions: Used for most extra page actions like deletion, protection, etc... variants: Used to list the language variants for the page

Each section's value is a key/value array of links for that section. The links themseves have these common keys:

  • class: The css classes to apply to the tab
  • text: The text to display on the tab
  • href: The href for the tab to point to
  • rel: An optional rel= for the tab's link
  • redundant: If true the tab will be dropped in skins using content_actions this is useful for tabs like "Read" which only have meaning in skins that take special meaning from the grouped structure of content_navigation

Views also have an extra key which can be used:

  • primary: If this is not true skins like vector may try to hide the tab when the user has limited space in their browser window

content_navigation using code also expects these ids to be present on the links, however these are usually automatically generated by SkinTemplate itself and are not necessary when using a hook. The only things these may matter to are people modifying content_navigation after it's initial creation:

  • id: A "preferred" id, most skins are best off outputting this preferred id for best compatibility
  • tooltiponly: This is set to true for some tabs in cases where the system believes that the accesskey should not be added to the tab.
Returns:
array

Definition at line 787 of file SkinTemplate.php.

References $n, $out, $section, $title, $user, $wgDisableLangConversion, false, ContextSource\getContext(), ContextSource\getOutput(), Skin\getRelevantTitle(), ContextSource\getRequest(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), WatchAction\getWatchToken(), Skin\isRevisionCurrent(), ContextSource\msg(), ContextSource\setContext(), tabAction(), wfMessageFallback(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by outputPage().

Here is the call graph for this function:

Here is the caller graph for this function:

SkinTemplate::buildNavUrls ( ) [protected]

build array of common navigation links

Returns:
array
Access:
private

Definition at line 1120 of file SkinTemplate.php.

References $out, $user, $wgUploadNavigationUrl, ContextSource\getOutput(), Skin\getRelevantUser(), ContextSource\getRequest(), Skin\getRevisionId(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), UploadBase\isAllowed(), UploadBase\isEnabled(), ContextSource\msg(), Skin\showEmailUser(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by outputPage().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
bool

Reimplemented from Skin.

Reimplemented in SkinLegacy.

Definition at line 1225 of file SkinTemplate.php.

Generate strings used for xml 'id' names.

Returns:
string
Access:
private

Definition at line 1221 of file SkinTemplate.php.

References ContextSource\getTitle().

Here is the call graph for this function:

SkinTemplate::makeArticleUrlDetails ( name,
urlaction = '' 
)

Definition at line 744 of file SkinTemplate.php.

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

Here is the call graph for this function:

SkinTemplate::makeTalkUrlDetails ( name,
urlaction = '' 
)

Definition at line 731 of file SkinTemplate.php.

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

Referenced by buildPersonalUrls().

Here is the call graph for this function:

Here is the caller graph for this function:

initialize various variables and generate the template

Parameters:
$outOutputPage

Reimplemented from Skin.

Definition at line 134 of file SkinTemplate.php.

References $dbr, $out, $res, $title, $user, $wgArticlePath, $wgContLang, $wgDebugComments, $wgDisableCounters, $wgFooterIcons, $wgHideInterlanguageLinks, $wgHtml5Version, $wgJsMimeType, $wgLogo, $wgMaxCredits, $wgMimeType, $wgPageShowWatchingUsers, $wgScript, $wgScriptPath, $wgServer, $wgShowCreditsIfMax, $wgSitename, $wgStylePath, $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, Skin\aboutLink(), Skin\afterContentHook(), Skin\bottomScripts(), buildContentActionUrls(), buildContentNavigationUrls(), buildNavUrls(), buildPersonalUrls(), Skin\buildSidebar(), Skin\disclaimerLink(), Sanitizer\escapeClass(), Skin\escapeSearchLink(), Action\factory(), Skin\generateDebugHTML(), Skin\getCategories(), ContextSource\getContext(), Skin\getCopyright(), Skin\getCopyrightIcon(), ContextSource\getLanguage(), Skin\getNewtalks(), ContextSource\getOutput(), Skin\getPageClasses(), Skin\getPoweredBy(), ContextSource\getRequest(), Skin\getSiteNotice(), Skin\getSkinName(), ContextSource\getTitle(), SpecialPage\getTitleFor(), Skin\getUndeleteLink(), ContextSource\getUser(), ContextSource\getWikiPage(), Skin\initPage(), Profiler\instance(), Skin\isRevisionCurrent(), Skin\lastModified(), Skin\logoText(), Skin\makeKnownUrlDetails(), Skin\makeUrlDetails(), ContextSource\msg(), Title\newFromText(), printOrError(), Skin\printSource(), Skin\privacyLink(), Html\rawElement(), ContextSource\setContext(), setupTemplate(), Skin\showIPinHeader(), Skin\subPageSubtitle(), wfArrayToCGI(), wfDebug(), wfGetDB(), wfProfileIn(), wfProfileOut(), wfReportTime(), and wfRunHooks().

Output the string, or print error message if it's an error object of the appropriate type.

For the base class, assume strings all around.

Parameters:
$strMixed
Access:
private

Definition at line 514 of file SkinTemplate.php.

References echo.

Referenced by outputPage().

Here is the caller graph for this function:

#@-

Add specific styles for this skin

Parameters:
$outOutputPage

Reimplemented from Skin.

Reimplemented in SkinVector, SkinMonoBook, SkinChick, SkinModern, SkinSimple, SkinCologneBlue, SkinNostalgia, SkinStandard, and SkinLegacy.

Definition at line 110 of file SkinTemplate.php.

References OutputPage\addModuleStyles().

Here is the call graph for this function:

SkinTemplate::setupTemplate ( classname,
repository = false,
cache_dir = false 
)

Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML.

Should have interface roughly equivalent to PHPTAL 0.7.

Parameters:
$classnameString
$repositorystring: subdirectory where we keep template files
$cache_dirstring
Returns:
QuickTemplate
Access:
private

Definition at line 125 of file SkinTemplate.php.

Referenced by outputPage().

Here is the caller graph for this function:

SkinTemplate::tabAction ( title,
message,
selected,
query = '',
checkEdit = false 
)

TODO document.

Parameters:
$titleTitle
$messageString message key
$selectedBool
$queryString
$checkEditBool
Returns:
array

Definition at line 692 of file SkinTemplate.php.

References $result, $title, $wgContLang, ContextSource\getContext(), MWNamespace\getSubject(), wfMessageFallback(), and wfRunHooks().

Referenced by buildContentNavigationUrls().

Here is the call graph for this function:

Here is the caller graph for this function:

Output a boolean indiciating if buildPersonalUrls should output separate login and create account links or output a combined link By default we simply return a global config setting that affects most skins This is setup as a method so that like with $wgLogo and getLogo() a skin can override this setting and always output one or the other if it has a reason it can't output one of the two modes.

Definition at line 526 of file SkinTemplate.php.

References $wgUseCombinedLoginLink.

Referenced by buildPersonalUrls().

Here is the caller graph for this function:


Member Data Documentation

SkinTemplate::$skinname = 'monobook'

#@+

Access:
private Name of our skin, it probably needs to be all lower case. Child classes should override the default.

Reimplemented from Skin.

Reimplemented in SkinMonoBook, SkinChick, SkinModern, SkinSimple, SkinVector, SkinCologneBlue, SkinMySkin, SkinNostalgia, and SkinStandard.

Definition at line 83 of file SkinTemplate.php.

SkinTemplate::$stylename = 'monobook'

Stylesheets set to use.

Subdirectory in skins/ where various stylesheets are located. Child classes should override the default.

Reimplemented in SkinMonoBook, SkinChick, SkinModern, SkinSimple, SkinVector, SkinCologneBlue, SkinMySkin, SkinNostalgia, and SkinStandard.

Definition at line 89 of file SkinTemplate.php.

SkinTemplate::$template = 'QuickTemplate'

For QuickTemplate, the name of the subclass which will actually fill the template.

Child classes should override the default.

Reimplemented in SkinMonoBook, SkinChick, SkinModern, SkinSimple, SkinVector, SkinCologneBlue, SkinMySkin, SkinNostalgia, and SkinStandard.

Definition at line 95 of file SkinTemplate.php.

SkinTemplate::$useHeadElement = false

Whether this skin use OutputPage::headElement() to generate the <head> tag.

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

Definition at line 101 of file SkinTemplate.php.


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