MediaWiki
REL1_21
|
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. More...
Public Member Functions | |
getFooterIcons ($option=null) | |
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display them. | |
getFooterLinks ($option=null) | |
Returns an array of footerlinks trimmed down to only those footer links that are valid. | |
getMsg ($name) | |
Get a Message object with its context set. | |
getPersonalTools () | |
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate. | |
getSidebar ($options=array()) | |
getToolbox () | |
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate. | |
makeLink ($key, $item, $options=array()) | |
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... | |
makeListItem ($key, $item, $options=array()) | |
Generates a list item for a navigation, portlet, portal, sidebar... | |
makeSearchButton ($mode, $attrs=array()) | |
makeSearchInput ($attrs=array()) | |
msg ($str) | |
msgHtml ($str) | |
msgWiki ($str) | |
An ugly, ugly hack. | |
printTrail () | |
Output the basic end-page trail including bottomscripts, reporttime, and debug stuff. |
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.
Definition at line 1395 of file SkinTemplate.php.
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.
Definition at line 1908 of file SkinTemplate.php.
Referenced by ModernTemplate\execute(), MonoBookTemplate\execute(), and VectorTemplate\execute().
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.
Definition at line 1869 of file SkinTemplate.php.
References $link, array(), as, and data.
Referenced by CologneBlueTemplate\afterContent(), ModernTemplate\execute(), MonoBookTemplate\execute(), VectorTemplate\execute(), and CologneBlueTemplate\pageTitleLinks().
BaseTemplate::getMsg | ( | $ | name | ) |
Get a Message object with its context set.
string | $name | message name |
Definition at line 1403 of file SkinTemplate.php.
References $name, and QuickTemplate\getSkin().
Referenced by getSidebar(), msg(), msgHtml(), and msgWiki().
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.
Definition at line 1493 of file SkinTemplate.php.
References array(), as, and data.
Referenced by ModernTemplate\execute(), MonoBookTemplate\execute(), VectorTemplate\renderNavigation(), CologneBlueTemplate\sidebarAdditions(), and CologneBlueTemplate\sysLinks().
BaseTemplate::getSidebar | ( | $ | options = array() | ) |
Definition at line 1517 of file SkinTemplate.php.
References $options, array(), as, data, getMsg(), getToolbox(), makeListItem(), QuickTemplate\text(), and wfRunHooks().
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.
Definition at line 1426 of file SkinTemplate.php.
References array(), as, data, wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by CologneBlueTemplate\bottomLinks(), getSidebar(), CologneBlueTemplate\quickBar(), VectorTemplate\renderPortals(), and MonoBookTemplate\toolbox().
BaseTemplate::makeLink | ( | $ | key, |
$ | item, | ||
$ | options = array() |
||
) |
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...
string | $key | usually a key from the list you are generating this link from. |
array | $item | contains 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.
If you don't want an accesskey, set $item['tooltiponly'] = true;
array | $options | can be used to affect the output of a link. Possible options are:
|
Definition at line 1684 of file SkinTemplate.php.
References $html, $options, $title, array(), as, Html\rawElement(), Linker\titleAttrib(), and Linker\tooltipAndAccesskeyAttribs().
Referenced by makeListItem().
BaseTemplate::makeListItem | ( | $ | key, |
$ | item, | ||
$ | options = array() |
||
) |
Generates a list item for a navigation, portlet, portal, sidebar...
list
$key | string, usually a key from the list you are generating this link from. |
$item | array, of list item data containing some of a specific set of keys. The "id" and "class" 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. |
$options | array |
If 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. $options is also passed on to makeLink calls
Definition at line 1769 of file SkinTemplate.php.
References $html, $link, $options, array(), as, makeLink(), and Html\rawElement().
Referenced by MonoBookTemplate\cactions(), MonoBookTemplate\customBox(), ModernTemplate\execute(), MonoBookTemplate\execute(), getSidebar(), MonoBookTemplate\languageBox(), CologneBlueTemplate\otherLanguages(), CologneBlueTemplate\processBottomLink(), CologneBlueTemplate\quickBar(), VectorTemplate\renderNavigation(), VectorTemplate\renderPortal(), CologneBlueTemplate\sysLinks(), MonoBookTemplate\toolbox(), and CologneBlueTemplate\variantLinks().
BaseTemplate::makeSearchButton | ( | $ | mode, |
$ | attrs = array() |
||
) |
Definition at line 1817 of file SkinTemplate.php.
References array(), Html\element(), Html\rawElement(), and Linker\tooltipAndAccesskeyAttribs().
Referenced by VectorTemplate\renderNavigation(), and MonoBookTemplate\searchBox().
BaseTemplate::makeSearchInput | ( | $ | attrs = array() | ) |
Definition at line 1807 of file SkinTemplate.php.
References array(), data, Html\element(), and Linker\tooltipAndAccesskeyAttribs().
Referenced by VectorTemplate\renderNavigation(), and MonoBookTemplate\searchBox().
BaseTemplate::msg | ( | $ | str | ) |
Reimplemented from QuickTemplate.
Definition at line 1407 of file SkinTemplate.php.
References echo, and getMsg().
Referenced by MonoBookTemplate\cactions(), ModernTemplate\execute(), MonoBookTemplate\execute(), VectorTemplate\execute(), MonoBookTemplate\languageBox(), VectorTemplate\renderNavigation(), MonoBookTemplate\searchBox(), and MonoBookTemplate\toolbox().
BaseTemplate::msgHtml | ( | $ | str | ) |
BaseTemplate::msgWiki | ( | $ | str | ) |
An ugly, ugly hack.
Reimplemented from QuickTemplate.
Definition at line 1415 of file SkinTemplate.php.
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.
Definition at line 1942 of file SkinTemplate.php.
References echo, MWDebug\getDebugHTML(), QuickTemplate\getSkin(), QuickTemplate\html(), and php.
Referenced by CologneBlueTemplate\execute(), ModernTemplate\execute(), MonoBookTemplate\execute(), LegacyTemplate\execute(), and VectorTemplate\execute().