MediaWiki master
MediaWiki\Skin\BaseTemplate Class Reference

Extended QuickTemplate with additional MediaWiki-specific helper methods. More...

Inherits MediaWiki\Skin\QuickTemplate.

Collaboration diagram for MediaWiki\Skin\BaseTemplate:

Public Member Functions

 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.
 
 getMsg ( $name,... $params)
 Get a Message object with its context set.
 
 getPersonalTools ()
 
 makeListItem ( $key, $item, $options=[])
 Wrapper for Skin method.
 
 msg ( $str)
 
- Public Member Functions inherited from MediaWiki\Skin\QuickTemplate
 __construct (?Config $config=null)
 
 deprecate (string $name, string $version)
 Sets a template key as deprecated.
 
 execute ()
 Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
 
 extend ( $name, $value)
 extends the value of data with name $name with the value $value
 
 get ( $name, $default=null)
 Gets the template data requested.
 
 getHTML ()
 Fetch the output of a QuickTemplate and return it.
 
 getSkin ()
 Get the Skin object related to this object.
 
 html ( $str)
 
 set ( $name, $value)
 Sets the value $value to $name.
 

Protected Member Functions

 getClear ()
 Get a div with the core visualClear class, for clearing floats.
 
 getFooter ( $iconStyle='icononly', $linkStyle='flat')
 Renderer for getFooterLinks.
 
 getFooterLinks ( $option=null)
 Returns an array of footerlinks trimmed down to only those footer links that are valid.
 
 getSidebar ( $options=[])
 
 makeLink ( $key, $item, $options=[])
 Wrapper for Skin method.
 
 makeSearchButton ( $mode, $attrs=[])
 Wrapper for Skin method.
 
 makeSearchInput ( $attrs=[])
 Wrapper for Skin method.
 
- Protected Member Functions inherited from MediaWiki\Skin\QuickTemplate
 haveMsg ( $msgKey)
 
 text ( $str)
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Skin\QuickTemplate
array $data
 
- Protected Attributes inherited from MediaWiki\Skin\QuickTemplate
Config $config
 

Detailed Description

Extended QuickTemplate with additional MediaWiki-specific helper methods.

Todo
Phase this class out and make it an alias for QuickTemplate. Move methods individually as-appropriate either down to QuickTemplate, or (with deprecation) up to SkinTemplate.
Stability: stable
to extend

Definition at line 24 of file BaseTemplate.php.

Member Function Documentation

◆ getClear()

MediaWiki\Skin\BaseTemplate::getClear ( )
protected

Get a div with the core visualClear class, for clearing floats.

Returns
string html
Since
1.29

Definition at line 306 of file BaseTemplate.php.

References MediaWiki\Html\element().

Referenced by MediaWiki\Skin\BaseTemplate\getFooter().

◆ getFooter()

MediaWiki\Skin\BaseTemplate::getFooter ( $iconStyle = 'icononly',
$linkStyle = 'flat' )
protected

Renderer for getFooterLinks.

Parameters
string$iconStyle$option when set to "icononly" will not display any icons which do not have images.
string$linkStyle$option for getFooterLinks: "flat"
Returns
string html
Since
1.29

Definition at line 252 of file BaseTemplate.php.

References MediaWiki\Skin\BaseTemplate\getClear(), MediaWiki\Skin\BaseTemplate\getFooterLinks(), and MediaWiki\Skin\QuickTemplate\getSkin().

◆ getFooterLinks()

MediaWiki\Skin\BaseTemplate::getFooterLinks ( $option = null)
protected

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 | null$option
Returns
array

Definition at line 199 of file BaseTemplate.php.

Referenced by MediaWiki\Skin\BaseTemplate\getFooter().

◆ getIndicators()

MediaWiki\Skin\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

Definition at line 325 of file BaseTemplate.php.

◆ getMsg()

MediaWiki\Skin\BaseTemplate::getMsg ( $name,
$params )

Get a Message object with its context set.

Parameters
string$nameMessage name
MessageParam|MessageSpecifier|string|int|float|list<MessageParam|MessageSpecifier|string|int|float>...$params See Message::params()
Returns
Message

Definition at line 35 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

Referenced by MediaWiki\Skin\BaseTemplate\getSidebar(), and MediaWiki\Skin\BaseTemplate\msg().

◆ getPersonalTools()

MediaWiki\Skin\BaseTemplate::getPersonalTools ( )
Returns
array

Definition at line 49 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

◆ getSidebar()

MediaWiki\Skin\BaseTemplate::getSidebar ( $options = [])
protected
Parameters
array$options(optional) allows disabling certain sidebar elements. The keys search, toolbox and languages are accepted.
Returns
array representing the sidebar

Definition at line 58 of file BaseTemplate.php.

References MediaWiki\Skin\BaseTemplate\getMsg(), and MediaWiki\Skin\QuickTemplate\getSkin().

◆ makeLink()

MediaWiki\Skin\BaseTemplate::makeLink ( $key,
$item,
$options = [] )
protected

Wrapper for Skin method.

Parameters
string$keyof link
array$itemto render
array$optionsfor link
Returns
string

Definition at line 153 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

◆ makeListItem()

MediaWiki\Skin\BaseTemplate::makeListItem ( $key,
$item,
$options = [] )

Wrapper for Skin method.

Parameters
string$keyof list item
array$itemto render
array$optionsfor list item
Returns
string

Definition at line 165 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

◆ makeSearchButton()

MediaWiki\Skin\BaseTemplate::makeSearchButton ( $mode,
$attrs = [] )
protected

Wrapper for Skin method.

Parameters
string$mode
array$attrs
Returns
string

Definition at line 186 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

◆ makeSearchInput()

MediaWiki\Skin\BaseTemplate::makeSearchInput ( $attrs = [])
protected

Wrapper for Skin method.

Parameters
array$attrs
Returns
string

Definition at line 175 of file BaseTemplate.php.

References MediaWiki\Skin\QuickTemplate\getSkin().

◆ msg()

MediaWiki\Skin\BaseTemplate::msg ( $str)
Parameters
string$str

Reimplemented from MediaWiki\Skin\QuickTemplate.

Definition at line 42 of file BaseTemplate.php.

References MediaWiki\Skin\BaseTemplate\getMsg().


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