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

 formatLanguageName ($name)
 Format language name for use in sidebar interlanguage links list.
 getLanguages ()
 Generates array of language links for the current page.
 getPersonalToolsList ()
 Get the HTML for the p-personal list.
 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)
 Add specific styles for this skin.
 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)
 Builds an array with tab definition.
 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.

Public Attributes

string $skinname = 'monobook'
 Name of our skin, it probably needs to be all lower case.
string $template = 'QuickTemplate'
 For QuickTemplate, the name of the subclass which will actually fill the template.

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
 getNameSpaceKey ()
 Generate strings used for xml 'id' names.
 prepareQuickTemplate ()
 initialize various variables and generate the template
 setupTemplateForOutput ()

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 70 of file SkinTemplate.php.


Member Function Documentation

SkinTemplate::buildContentActionUrls ( content_navigation) [private]

an array of edit links by default used for the tabs

Parameters:
array$content_navigation
Returns:
array

Definition at line 1201 of file SkinTemplate.php.

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

Definition at line 872 of file SkinTemplate.php.

SkinTemplate::buildNavUrls ( ) [protected]

build array of common navigation links

Returns:
array

Definition at line 1245 of file SkinTemplate.php.

build array of urls for personal toolbar

Returns:
array

Definition at line 620 of file SkinTemplate.php.

Format language name for use in sidebar interlanguage links list.

By default it is capitalized.

Parameters:
string$nameLanguage name, e.g. "English" or "español"
Returns:
string
Access:
private

Definition at line 586 of file SkinTemplate.php.

Generates array of language links for the current page.

Returns:
array

Definition at line 114 of file SkinTemplate.php.

Generate strings used for xml 'id' names.

Returns:
string

Definition at line 1362 of file SkinTemplate.php.

Get the HTML for the p-personal list.

Returns:
string

Definition at line 568 of file SkinTemplate.php.

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

Definition at line 828 of file SkinTemplate.php.

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

Definition at line 815 of file SkinTemplate.php.

initialize various variables and generate the template

Parameters:
OutputPage$out

Reimplemented from Skin.

Definition at line 256 of file SkinTemplate.php.

initialize various variables and generate the template

Since:
1.23
Returns:
QuickTemplate The template to be executed by outputPage

Definition at line 294 of file SkinTemplate.php.

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:
string$str
Access:
private

Definition at line 598 of file SkinTemplate.php.

Add specific styles for this skin.

Parameters:
OutputPage$out

Reimplemented from Skin.

Reimplemented in SkinFallback.

Definition at line 86 of file SkinTemplate.php.

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:
string$classname
bool | string$repositorySubdirectory where we keep template files
bool | string$cache_dir
Returns:
QuickTemplate
Access:
private

Definition at line 105 of file SkinTemplate.php.

Definition at line 210 of file SkinTemplate.php.

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

Definition at line 772 of file SkinTemplate.php.

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

Definition at line 611 of file SkinTemplate.php.


Member Data Documentation

string SkinTemplate::$skinname = 'monobook'

Name of our skin, it probably needs to be all lower case.

Child classes should override the default.

Reimplemented from Skin.

Reimplemented in SkinFallback.

Definition at line 74 of file SkinTemplate.php.

string SkinTemplate::$template = 'QuickTemplate'

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

Child classes should override the default.

Reimplemented in SkinFallback.

Definition at line 79 of file SkinTemplate.php.


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