MediaWiki fundraising/REL1_35
VectorTemplate Class Reference

QuickTemplate subclass for Vector. More...

Inheritance diagram for VectorTemplate:
Collaboration diagram for VectorTemplate:

Public Member Functions

 __construct (Config $config, TemplateParser $templateParser, bool $isLegacy)
 
 execute ()
 Renders the entire contents of the HTML page.
 
- Public Member Functions inherited from 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.
 
 getMsg ( $name,... $params)
 Get a Message object with its context set.
 
 getPersonalTools ()
 
 getToolbox ()
 Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate and items added by hook to the 'toolbox' section.
 
 getTrail ()
 Get the basic end-page trail including bottomscripts, reporttime, and debug stuff.
 
 makeListItem ( $key, $item, $options=[])
 
 msg ( $str)
 
- Public Member Functions inherited from QuickTemplate
 __construct (Config $config=null)
 
 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

 getTemplateParser ()
 The template parser might be undefined.
 
- Protected Member Functions inherited from BaseTemplate
 getAfterPortlet ( $name)
 Allows extensions to hook into known portlets and add stuff to them.
 
 getClear ()
 Get a div with the core visualClear class, for clearing floats.
 
 getFooter ( $iconStyle='icononly', $linkStyle='flat')
 Renderer for getFooterIcons and getFooterLinks.
 
 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.
 
 getSidebar ( $options=[])
 
 makeLink ( $key, $item, $options=[])
 
 makeSearchButton ( $mode, $attrs=[])
 
 makeSearchInput ( $attrs=[])
 
 printTrail ()
 Output getTrail.
 
 renderAfterPortlet ( $name)
 
- Protected Member Functions inherited from QuickTemplate
 haveMsg ( $msgKey)
 
 text ( $str)
 

Private Member Functions

 buildSearchProps ()
 
 buildSidebar ()
 Render a series of portals.
 
 getConfig ()
 
 getFooterData ()
 Get rows that make up the footer.
 
 getMenuData (string $label, array $urls=[], int $type=self::MENU_TYPE_DEFAULT, array $options=[], bool $setLabelToSelected=false)
 
 getMenuProps ()
 
 getSkinData ()
 
 isSidebarVisible ()
 Determines wheather the initial state of sidebar is visible on not.
 

Private Attributes

bool $isLegacy
 
TemplateParser $templateParser
 
string $templateRoot
 File name of the root (master) template without folder path and extension.
 
const MENU_TYPE_PORTAL = 3
 

Additional Inherited Members

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

Detailed Description

QuickTemplate subclass for Vector.

Deprecated
Since 1.35, duplicate class locally if its functionality is needed. Extensions or skins should extend it under no circumstances.

Definition at line 33 of file VectorTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

VectorTemplate::__construct ( Config $config,
TemplateParser $templateParser,
bool $isLegacy )
Parameters
Config$config
TemplateParser$templateParser
bool$isLegacy

Definition at line 74 of file VectorTemplate.php.

References $templateParser.

Member Function Documentation

◆ buildSearchProps()

VectorTemplate::buildSearchProps ( )
private
Returns
array

Definition at line 522 of file VectorTemplate.php.

Referenced by getSkinData().

◆ buildSidebar()

VectorTemplate::buildSidebar ( )
private

Render a series of portals.

Returns
array

Definition at line 289 of file VectorTemplate.php.

References $content, and wfDeprecated().

Referenced by getSkinData().

◆ execute()

VectorTemplate::execute ( )

Renders the entire contents of the HTML page.

Reimplemented from QuickTemplate.

Definition at line 192 of file VectorTemplate.php.

◆ getConfig()

VectorTemplate::getConfig ( )
private
Returns
Config

Definition at line 89 of file VectorTemplate.php.

Referenced by getSkinData().

◆ getFooterData()

VectorTemplate::getFooterData ( )
private

Get rows that make up the footer.

Returns
array for use in Mustache template describing the footer elements.

Definition at line 201 of file VectorTemplate.php.

Referenced by getSkinData().

◆ getMenuData()

VectorTemplate::getMenuData ( string $label,
array $urls = [],
int $type = self::MENU_TYPE_DEFAULT,
array $options = [],
bool $setLabelToSelected = false )
private
Parameters
string$labelto be used to derive the id and human readable label of the menu If the key has an entry in the constant MENU_LABEL_KEYS then that message will be used for the human readable text instead.
array$urlsto convert to list items stored as string in html-items key
int$typeof menu (optional) - a plain list (MENU_TYPE_DEFAULT), a tab (MENU_TYPE_TABS) or a dropdown (MENU_TYPE_DROPDOWN)
array$options(optional) to be passed to makeListItem
bool$setLabelToSelected(optional) the menu label will take the value of the selected item if found.
Returns
array

Definition at line 388 of file VectorTemplate.php.

◆ getMenuProps()

VectorTemplate::getMenuProps ( )
private
Returns
array

Definition at line 457 of file VectorTemplate.php.

Referenced by getSkinData().

◆ getSkinData()

VectorTemplate::getSkinData ( )
private
Deprecated
Please use Skin::getTemplateData instead
Returns
array Returns an array of data shared between Vector and legacy Vector.

Definition at line 112 of file VectorTemplate.php.

References buildSearchProps(), buildSidebar(), getConfig(), getFooterData(), getMenuProps(), QuickTemplate\getSkin(), and isSidebarVisible().

◆ getTemplateParser()

VectorTemplate::getTemplateParser ( )
protected

The template parser might be undefined.

This function will check if it set first

Returns
TemplateParser

Definition at line 98 of file VectorTemplate.php.

References $templateParser.

◆ isSidebarVisible()

VectorTemplate::isSidebarVisible ( )
private

Determines wheather the initial state of sidebar is visible on not.

Returns
bool

Definition at line 262 of file VectorTemplate.php.

Referenced by getSkinData().

Member Data Documentation

◆ $isLegacy

bool VectorTemplate::$isLegacy
private

Definition at line 67 of file VectorTemplate.php.

◆ $templateParser

TemplateParser VectorTemplate::$templateParser
private
Initial value:
=
private const OPT_OUT_LINK_TRACKING_CODE 'vctw1'

Definition at line 62 of file VectorTemplate.php.

◆ $templateRoot

string VectorTemplate::$templateRoot
private

File name of the root (master) template without folder path and extension.

Definition at line 64 of file VectorTemplate.php.

◆ MENU_TYPE_PORTAL

const VectorTemplate::MENU_TYPE_PORTAL = 3
private

Definition at line 47 of file VectorTemplate.php.


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