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

Public Member Functions

 getMsg ($name)
 
 msg ($str)
 
 msgHtml ($str)
 
 msgWiki ($str)
 
 getToolbox ()
 
 getPersonalTools ()
 
 getSidebar ($options=[])
 
 makeLink ($key, $item, $options=[])
 
 makeListItem ($key, $item, $options=[])
 
 makeSearchInput ($attrs=[])
 
 makeSearchButton ($mode, $attrs=[])
 
 getFooterLinks ($option=null)
 
 getFooterIcons ($option=null)
 
 getIndicators ()
 
 printTrail ()
 
- Public Member Functions inherited from QuickTemplate
 __construct (Config $config=null)
 
 set ($name, $value)
 
 extend ($name, $value)
 
 get ($name, $default=null)
 
 setRef ($name, &$value)
 
 setTranslator (&$t)
 
 execute ()
 
 getSkin ()
 
 getHTML ()
 

Protected Member Functions

 renderAfterPortlet ($name)
 

Additional Inherited Members

- Protected Attributes inherited from QuickTemplate
 $config
 

Detailed Description

New base template for a skin's template extended from QuickTemplate this class features helper methods that provide common ways of interacting with the data stored in the QuickTemplate

Member Function Documentation

BaseTemplate::getFooterIcons (   $option = null)

Returns an array of footer icons filtered down by options relevant to how the skin wishes to display them. If you pass "icononly" as the option all footer icons which do not have an image icon set will be filtered out. If you pass "nocopyright" then MediaWiki's copyright icon will not be included in the list of footer icons. This is mostly useful for skins which only display the text from footericons instead of the images and don't want a duplicate copyright statement because footerlinks already rendered one.

Parameters
string$option
Returns
array
BaseTemplate::getFooterLinks (   $option = null)

Returns an array of footerlinks trimmed down to only those footer links that are valid. If you pass "flat" as an option then the returned array will be a flat array of footer icons instead of a key/value array of footerlinks arrays broken up into categories.

Parameters
string$option
Returns
array|mixed
BaseTemplate::getIndicators ( )

Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed in the top-right corner of the page, outside of the main content.

Your skin may implement this differently, for example by handling some indicator names specially with a different UI. However, it is recommended to use a <div class="mw-indicator" id="mw-indicator-\<id\>" /> as a wrapper element for each indicator, for better compatibility with extensions and user scripts.

The raw data is available in `$this->data['indicators']` as an associative array (keys: identifiers, values: contents) internally ordered by keys.

Returns
string HTML
Since
1.25
BaseTemplate::getMsg (   $name)

Get a Message object with its context set

Parameters
string$nameMessage name
Returns
Message
BaseTemplate::getPersonalTools ( )

Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate. The resulting array is built according to a format intended to be passed through makeListItem to generate the html. This is in reality the same list as already stored in personal_urls however it is reformatted so that you can just pass the individual items to makeListItem instead of hardcoding the element creation boilerplate.

Returns
array
BaseTemplate::getToolbox ( )

Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate. The resulting array is built according to a format intended to be passed through makeListItem to generate the html.

Returns
array
BaseTemplate::makeLink (   $key,
  $item,
  $options = [] 
)

Makes a link, usually used by makeListItem to generate a link for an item in a list used in navigation lists, portlets, portals, sidebars, etc...

Parameters
string$keyUsually a key from the list you are generating this link from.
array$itemContains some of a specific set of keys.

The text of the link will be generated either from the contents of the "text" key in the $item array, if a "msg" key is present a message by that name will be used, and if neither of those are set the $key will be used as a message name.

If a "href" key is not present makeLink will just output htmlescaped text. The "href", "id", "class", "rel", and "type" keys are used as attributes for the link if present.

If an "id" or "single-id" (if you don't want the actual id to be output on the link) is present it will be used to generate a tooltip and accesskey for the link.

The keys "context" and "primary" are ignored; these keys are used internally by skins and are not supposed to be included in the HTML output.

If you don't want an accesskey, set $item['tooltiponly'] = true;

Parameters
array$optionsCan be used to affect the output of a link. Possible options are:
  • 'text-wrapper' key to specify a list of elements to wrap the text of a link in. This should be an array of arrays containing a 'tag' and optionally an 'attributes' key. If you only have one element you don't need to wrap it in another array. eg: To use ... in all links use array( 'text-wrapper' => array( 'tag' => 'span' ) ) for your options.
  • 'link-class' key can be used to specify additional classes to apply to all links.
  • 'link-fallback' can be used to specify a tag to use instead of "<a>" if there is no link. eg: If you specify 'link-fallback' => 'span' than any non-link will output a "<span>" instead of just text.
Returns
string
BaseTemplate::makeListItem (   $key,
  $item,
  $options = [] 
)

Generates a list item for a navigation, portlet, portal, sidebar... list

Parameters
string$keyUsually a key from the list you are generating this link from.
array$itemArray of list item data containing some of a specific set of keys. The "id", "class" and "itemtitle" keys will be used as attributes for the list item, if "active" contains a value of true a "active" class will also be appended to class.
array$optionsIf you want something other than a "<li>" you can pass a tag name such as "tag" => "span" in the $options array to change the tag used. link/content data for the list item may come in one of two forms A "links" key may be used, in which case it should contain an array with a list of links to include inside the list item, see makeLink for the format of individual links array items.

Otherwise the relevant keys from the list item $item array will be passed to makeLink instead. Note however that "id" and "class" are used by the list item directly so they will not be passed to makeLink (however the link will still support a tooltip and accesskey from it) If you need an id or class on a single link you should include a "links" array with just one link item inside of it. If you want to add a title to the list item itself, you can set "itemtitle" to the value. $options is also passed on to makeLink calls

Returns
string
BaseTemplate::printTrail ( )

Output the basic end-page trail including bottomscripts, reporttime, and debug stuff. This should be called right before outputting the closing body and html tags.

BaseTemplate::renderAfterPortlet (   $name)
protected
Parameters
string$name

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