BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
SkinTemplate Class Reference
Inheritance diagram for SkinTemplate:
Collaboration diagram for SkinTemplate:

Public Member Functions

 setupSkinUserCss (OutputPage $out)
 
 getLanguages ()
 
 outputPage (OutputPage $out=null)
 
 getPersonalToolsList ()
 
 makePersonalToolsList ($personalTools=null, $options=[])
 
 getStructuredPersonalTools ()
 
 useCombinedLoginLink ()
 
 tabAction ($title, $message, $selected, $query= '', $checkEdit=false)
 
 makeTalkUrlDetails ($name, $urlaction= '')
 
 makeArticleUrlDetails ($name, $urlaction= '')
 
- Public Member Functions inherited from Skin
 __construct ($skinname=null)
 
 getSkinName ()
 
 initPage (OutputPage $out)
 
 getDefaultModules ()
 
 getRevisionId ()
 
 isRevisionCurrent ()
 
 setRelevantTitle ($t)
 
 getRelevantTitle ()
 
 setRelevantUser ($u)
 
 getRelevantUser ()
 
 outputPage (OutputPage $out=null)
 
 setupSkinUserCss (OutputPage $out)
 
 getPageClasses ($title)
 
 getHtmlElementAttributes ()
 
 addToBodyAttributes ($out, &$bodyAttrs)
 
 getLogo ()
 
 shouldPreloadLogo ()
 
 getCategoryLinks ()
 
 drawCategoryBrowser ($tree)
 
 getCategories ()
 
 bottomScripts ()
 
 printSource ()
 
 getUndeleteLink ()
 
 subPageSubtitle ($out=null)
 
 getSearchLink ()
 
 escapeSearchLink ()
 
 getCopyright ($type= 'detect')
 
 getCopyrightIcon ()
 
 getPoweredBy ()
 
 logoText ($align= '')
 
 makeFooterIcon ($icon, $withImage= 'withImage')
 
 mainPageLink ()
 
 footerLink ($desc, $page)
 
 privacyLink ()
 
 aboutLink ()
 
 disclaimerLink ()
 
 showEmailUser ($id)
 
 getSkinStylePath ($name)
 
 buildSidebar ()
 
 addToSidebar (&$bar, $message)
 
 addToSidebarPlain (&$bar, $text)
 
 getNewtalks ()
 
 getSiteNotice ()
 
 doEditSectionLink (Title $nt, $section, $tooltip=null, $lang=false)
 
- Public Member Functions inherited from ContextSource
 getContext ()
 
 setContext (IContextSource $context)
 
 getConfig ()
 
 getRequest ()
 
 getTitle ()
 
 canUseWikiPage ()
 
 getWikiPage ()
 
 getOutput ()
 
 getUser ()
 
 getLanguage ()
 
 getSkin ()
 
 getTiming ()
 
 getStats ()
 
 msg ($key)
 
 exportSession ()
 

Public Attributes

 $skinname = 'monobook'
 
 $template = QuickTemplate::class
 
 $thispage
 
 $titletxt
 
 $userpage
 
 $thisquery
 
 $loggedin
 
 $username
 
 $userpageUrlDetails
 
- Public Attributes inherited from Skin
 $stylename = null
 

Protected Member Functions

 setupTemplateForOutput ()
 
 wrapHTML ($title, $html)
 
 prepareQuickTemplate ()
 
 buildPersonalUrls ()
 
 buildContentNavigationUrls ()
 
 buildNavUrls ()
 
 getNameSpaceKey ()
 
- Protected Member Functions inherited from Skin
 preloadExistence ()
 
 afterContentHook ()
 
 generateDebugHTML ()
 
 lastModified ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Skin
static getSkinNames ()
 
static getSkinNameMessages ()
 
static getAllowedSkins ()
 
static normalizeKey ($key)
 
static makeVariablesScript ($data)
 
static getDynamicStylesheetQuery ()
 
static makeMainPageUrl ($urlaction= '')
 
static makeSpecialUrl ($name, $urlaction= '', $proto=null)
 
static makeSpecialUrlSubpage ($name, $subpage, $urlaction= '')
 
static makeI18nUrl ($name, $urlaction= '')
 
static makeUrl ($name, $urlaction= '')
 
static makeInternalOrExternalUrl ($name)
 
static makeNSUrl ($name, $urlaction= '', $namespace=NS_MAIN)
 
static makeUrlDetails ($name, $urlaction= '')
 
static makeKnownUrlDetails ($name, $urlaction= '')
 
static checkTitle (&$title, $name)
 
- Protected Attributes inherited from Skin
 $skinname = null
 
 $mRelevantTitle = null
 
 $mRelevantUser = null
 

Detailed Description

Base class for template-based skins.

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

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.

Member Function Documentation

SkinTemplate::buildContentNavigationUrls ( )
protected

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

The following actions use messages which, if made particular to the any specific skins, would break the Ajax code which makes this action happen entirely inline. OutputPage::getJSVars defines a set of messages in a javascript object - and these messages are assumed to be global for all skins. Without making a change to that procedure these messages will have to remain as the global versions.

SkinTemplate::buildNavUrls ( )
protected

build array of common navigation links

Returns
array
SkinTemplate::buildPersonalUrls ( )
protected

build array of urls for personal toolbar

Returns
array
SkinTemplate::getLanguages ( )

Generates array of language links for the current page

Returns
array
SkinTemplate::getNameSpaceKey ( )
protected

Generate strings used for xml 'id' names

Returns
string
SkinTemplate::getPersonalToolsList ( )

Get the HTML for the p-personal list

Returns
string
SkinTemplate::getStructuredPersonalTools ( )

Get personal tools for the user

Since
1.31
Returns
array Array of personal tools
SkinTemplate::makeArticleUrlDetails (   $name,
  $urlaction = '' 
)
Todo:
is this even used?
Parameters
string$name
string$urlaction
Returns
array
SkinTemplate::makePersonalToolsList (   $personalTools = null,
  $options = [] 
)

Get the HTML for the personal tools list

Since
1.31
Parameters
array$personalTools
array$options
Returns
string
SkinTemplate::outputPage ( OutputPage  $out = null)

initialize various variables and generate the template

Parameters
OutputPage$out
SkinTemplate::prepareQuickTemplate ( )
protected

initialize various variables and generate the template

Since
1.23
Returns
QuickTemplate The template to be executed by outputPage
SkinTemplate::setupSkinUserCss ( OutputPage  $out)

Add specific styles for this skin

Parameters
OutputPage$out
SkinTemplate::tabAction (   $title,
  $message,
  $selected,
  $query = '',
  $checkEdit = false 
)

Builds an array with tab definition

Parameters
Title$titlePage Where the tab links to
string | array$messageMessage key or an array of message keys (will fall back)
bool$selectedDisplay the tab as selected
string$queryQuery string attached to tab URL
bool$checkEditCheck if $title exists and mark with .new if one doesn't
Returns
array
SkinTemplate::useCombinedLoginLink ( )

Output a boolean indicating 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.

Returns
bool
SkinTemplate::wrapHTML (   $title,
  $html 
)
protected

Wrap the body text with language information and identifiable element

Parameters
Title$title
string$htmlbody text
Returns
string html

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