MediaWiki  master
SkinTemplate Class Reference

Base class for QuickTemplate-based skins. More...

Inheritance diagram for SkinTemplate:
Collaboration diagram for SkinTemplate:

Public Member Functions

 generateHTML ()
 Subclasses not wishing to use the QuickTemplate render method can rewrite this method, for example to use TemplateParser::processTemplate. More...
 
 getPersonalToolsList ()
 Get the HTML for the p-personal list. More...
 
 getStructuredPersonalTools ()
 Get personal tools for the user. More...
 
 getTemplateData ()
 Subclasses may extend this method to add additional template data. More...
 
 makePersonalToolsList ( $personalTools=null, $options=[])
 Get the HTML for the personal tools list Please ensure setupTemplateContext is called before calling this method. More...
 
 outputPage ()
 Initialize various variables and generate the template @stable to override. More...
 
 tabAction ( $title, $message, $selected, $query='', $checkEdit=false)
 Builds an array with tab definition. More...
 
- Public Member Functions inherited from Skin
 __construct ( $options=null)
 
 addToSidebar (&$bar, $message)
 Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used by Extensions) More...
 
 addToSidebarPlain (&$bar, $text)
 Add content from plain text. More...
 
 bottomScripts ()
 This gets called shortly before the "</body>" tag. More...
 
 buildSidebar ()
 Build an array that represents the sidebar(s), the navigation bar among them. More...
 
 doEditSectionLink (Title $nt, $section, $tooltip, Language $lang)
 Create a section edit link. More...
 
 editUrlOptions ()
 Return URL options for the 'edit page' link. More...
 
 footerLink ( $desc, $page)
 Given a pair of message keys for link and text label, return an HTML link for use in the footer. More...
 
 getAfterPortlet (string $name)
 Allows extensions to hook into known portlets and add stuff to them. More...
 
 getCategories ()
 
 getCategoryLinks ()
 
 getCopyright ( $type='detect')
 
 getDefaultModules ()
 Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wishing to override call parent::getDefaultModules() and substitute out any modules they wish to change by using a key to look them up. More...
 
 getHtmlElementAttributes ()
 Return values for <html> element. More...
 
 getLanguages ()
 Generates array of language links for the current page. More...
 
 getNewtalks ()
 Gets new talk page messages for the current user and returns an appropriate alert message (or an empty string if there are no messages) More...
 
 getOptions ()
 Returns skin options Recommended to use SkinFactory::getSkinOptions instead. More...
 
 getPageClasses ( $title)
 TODO: document. More...
 
 getPersonalToolsForMakeListItem ( $urls, $applyClassesToListItems=false)
 Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate. More...
 
 getRelevantTitle ()
 Return the "relevant" title. More...
 
 getRelevantUser ()
 Return the "relevant" user. More...
 
 getSearchPageTitle ()
 
 getSiteFooterLinks ()
 Gets the link to the wiki's privacy policy, about page, and disclaimer page. More...
 
 getSiteNotice ()
 
 getSkinName ()
 
 getSkinStylePath ( $name)
 Return a fully resolved style path URL to images or styles stored in the current skin's folder. More...
 
 getUndeleteLink ()
 
 initPage (OutputPage $out)
 
 isResponsive ()
 Indicates if this skin is responsive. More...
 
 logoText ( $align='')
 
 makeFooterIcon ( $icon, $withImage='withImage')
 Renders a $wgFooterIcons icon according to the method's arguments. More...
 
 makeLink ( $key, $item, $linkOptions=[])
 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... More...
 
 makeListItem ( $key, $item, $options=[])
 Generates a list item for a navigation, portlet, portal, sidebar... More...
 
 makeSearchButton ( $mode, $attrs=[])
 
 makeSearchInput ( $attrs=[])
 
 makeToolbox ( $navUrls, $feedUrls)
 Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate. More...
 
 mapInterwikiToLanguage ( $code)
 Allows correcting the language of interlanguage links which, mostly due to legacy reasons, do not always match the standards compliant language tag. More...
 
 prepareSubtitle ()
 Prepare the subtitle of the page for output in the skin if one has been set. More...
 
 printSource ()
 Text with the permalink to the source page, usually shown on the footer of a printed page. More...
 
 setRelevantTitle ( $t)
 
 setRelevantUser (?UserIdentity $u)
 
 setSearchPageTitle (Title $title)
 
 showEmailUser ( $id)
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getAuthority ()
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object. More...
 
 getCsrfTokenSet ()
 Get a repository to obtain and match CSRF tokens. More...
 
 getLanguage ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ( $key,... $params)
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 

Public Attributes

 $loggedin
 
string $template
 For QuickTemplate, the name of the subclass which will actually fill the template. More...
 
 $thispage
 
 $thisquery
 
 $titletxt
 
 $username
 
 $userpage
 
 $userpageUrlDetails
 
- Public Attributes inherited from Skin
string $stylename = null
 Stylesheets set to use. More...
 

Protected Member Functions

 buildContentNavigationUrls ()
 a structured array of links usually used for the tabs in a skin More...
 
 buildCreateAccountData ( $returnto)
 Build "Create Account" link. More...
 
 buildLoginData ( $returnto, $useCombinedLoginLink)
 Build "Login" link. More...
 
 buildLogoutLinkData ()
 Build data required for "Logout" link. More...
 
 buildPersonalPageItem ( $id='pt-userpage')
 Build a personal page link. More...
 
 buildPersonalUrls (bool $includeNotifications=true)
 build array of urls for personal toolbar Please ensure setupTemplateContext is called before calling this method. More...
 
 getFooterIcons ()
 Get template representation of the footer. More...
 
 getJsConfigVars ()
 Returns array of config variables that should be added only to this skin for use in JavaScript. More...
 
 getNameSpaceKey ()
 Generate strings used for xml 'id' names. More...
 
 getPortletData ( $name, array $items)
 
 getReturnToParam ()
 Builds query params for the page to return to, used when building links. More...
 
 injectLegacyMenusIntoPersonalTools (array $contentNavigation)
 Insert legacy menu items from content navigation into the personal toolbar. More...
 
 prepareQuickTemplate ()
 initialize various variables and generate the template More...
 
 prepareUndeleteLink ()
 Prepare undelete link for output in page. More...
 
 prepareUserLanguageAttributes ()
 Prepare user language attribute links. More...
 
 runOnSkinTemplateNavigationHooks (SkinTemplate $skin, &$content_navigation)
 Run hooks relating to navigation menu data. More...
 
 setupTemplate ( $classname)
 Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML. More...
 
 setupTemplateContext ()
 Setup class properties that are necessary prior to calling setupTemplateForOutput. More...
 
 setupTemplateForOutput ()
 
 useCombinedLoginLink ()
 Returns if a combined login/signup link will be used. More...
 
 wrapHTML ( $title, $html)
 Wrap the body text with language information and identifiable element. More...
 
- Protected Member Functions inherited from Skin
 afterContentHook ()
 This runs a hook to allow extensions placing their stuff after content and article metadata (e.g. More...
 
 buildFeedUrls ()
 Build data structure representing syndication links. More...
 
 buildNavUrls ()
 Build array of common navigation links. More...
 
 drawCategoryBrowser ( $tree)
 Render the array as a series of links. More...
 
 getCopyrightIcon ()
 
 getFooterLinks ()
 Get template representation of the footer containing site footer links as well as standard footer links. More...
 
 getIndicatorsData ( $indicators)
 Return an array of indicator data. More...
 
 getPoweredBy ()
 Gets the powered by MediaWiki icon. More...
 
 getSearchInputAttributes ( $attrs=[])
 
 lastModified ()
 Get the timestamp of the latest revision, formatted in user language. More...
 
 preloadExistence ()
 Preload the existence of three commonly-requested pages in a single query. More...
 

Protected Attributes

 $action
 
- Protected Attributes inherited from Skin
 $mRelevantTitle = null
 
array $options = []
 Skin options passed into constructor. More...
 
string null $skinname = null
 
const VERSION_MAJOR = 1
 The current major version of the skin specification. More...
 

Private Member Functions

 buildContentActionUrls ( $content_navigation)
 an array of edit links by default used for the tabs More...
 
 buildSearchProps ()
 
 getFooterTemplateData ()
 Get rows that make up the footer. More...
 
 getLogoData ()
 
 getPortletLabel ( $name)
 
 getPortletsTemplateData ()
 
 getWatchLinkAttrs (string $mode, Authority $performer, Title $title, ?string $action, bool $onPage)
 Get the attributes for the watch link. More...
 
 makeSkinTemplatePersonalUrls (array $contentNavigation)
 Build the personal urls array. More...
 
 makeTalkUrlDetails ( $name, $urlaction='')
 

Additional Inherited Members

- Static Public Member Functions inherited from Skin
static checkTitle (&$title, $name)
 make sure we have some title to operate on More...
 
static getPortletLinkOptions (ResourceLoaderContext $context)
 Returns skin options for portlet links, used by addPortletLink. More...
 
static getVersion ()
 Get the current major version of Skin. More...
 
static makeInternalOrExternalUrl ( $name)
 If url string starts with http, consider as external URL, else internal. More...
 
static makeMainPageUrl ( $urlaction='')
 
static makeSpecialUrl ( $name, $urlaction='', $proto=null)
 Make a URL for a Special Page using the given query and protocol. More...
 
static makeSpecialUrlSubpage ( $name, $subpage, $urlaction='')
 
static normalizeKey ( $key)
 Normalize a skin preference value to a form that can be loaded. More...
 
- Static Protected Member Functions inherited from Skin
static makeKnownUrlDetails ( $name, $urlaction='')
 Make URL details where the article exists (or at least it's convenient to think so) More...
 
static makeUrlDetails ( $name, $urlaction='')
 these return an array with the 'href' and boolean 'exists' More...
 

Detailed Description

Base class for QuickTemplate-based skins.

The template data is filled in SkinTemplate::prepareQuickTemplate.

Stability: stable
to extend

Definition at line 34 of file SkinTemplate.php.

Member Function Documentation

◆ buildContentActionUrls()

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

References wfDebug().

Referenced by prepareQuickTemplate().

◆ buildContentNavigationUrls()

SkinTemplate::buildContentNavigationUrls ( )
protected

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

References Skin\$skinname, $title, LanguageCode\bcp47(), buildPersonalPageItem(), buildPersonalUrls(), ContextSource\canUseWikiPage(), Skin\editUrlOptions(), ContextSource\getAuthority(), ContextSource\getContext(), ContextSource\getOutput(), Skin\getRelevantTitle(), ContextSource\getRequest(), ContextSource\getTitle(), SpecialPage\getTitleFor(), getWatchLinkAttrs(), ContextSource\getWikiPage(), ContextSource\msg(), NS_MEDIAWIKI, runOnSkinTemplateNavigationHooks(), ContextSource\setContext(), tabAction(), wfMessage(), and wfMessageFallback().

Referenced by buildPersonalUrls(), getPortletsTemplateData(), and prepareQuickTemplate().

◆ buildCreateAccountData()

SkinTemplate::buildCreateAccountData (   $returnto)
protected

Build "Create Account" link.

Stability: unstable
Parameters
string[]$returntoquery params for the page to return to
Returns
array

Definition at line 1063 of file SkinTemplate.php.

References $title, ContextSource\getTitle(), Skin\makeSpecialUrl(), and ContextSource\msg().

Referenced by buildPersonalUrls().

◆ buildLoginData()

SkinTemplate::buildLoginData (   $returnto,
  $useCombinedLoginLink 
)
protected

Build "Login" link.

Stability: unstable
Parameters
string[]$returntoquery params for the page to return to
bool$useCombinedLoginLinkwhen set a single link to login form will be created with alternative label.
Returns
array

Definition at line 729 of file SkinTemplate.php.

References $title, ContextSource\getAuthority(), ContextSource\getTitle(), Skin\makeSpecialUrl(), and ContextSource\msg().

Referenced by buildPersonalUrls().

◆ buildLogoutLinkData()

SkinTemplate::buildLogoutLinkData ( )
finalprotected

Build data required for "Logout" link.

Stability: unstable
Since
1.37
Returns
array Array of data required to create a logout link.

Definition at line 1040 of file SkinTemplate.php.

References $title, getReturnToParam(), ContextSource\getTitle(), Skin\makeSpecialUrl(), and ContextSource\msg().

Referenced by buildPersonalUrls().

◆ buildPersonalPageItem()

SkinTemplate::buildPersonalPageItem (   $id = 'pt-userpage')
protected

Build a personal page link.

Parameters
string$idof user page item to be output in HTML attribute (optional)
Returns
array

Definition at line 1081 of file SkinTemplate.php.

References $username, and ContextSource\getTitle().

Referenced by buildContentNavigationUrls(), and buildPersonalUrls().

◆ buildPersonalUrls()

SkinTemplate::buildPersonalUrls ( bool  $includeNotifications = true)
protected

◆ buildSearchProps()

◆ generateHTML()

SkinTemplate::generateHTML ( )

Subclasses not wishing to use the QuickTemplate render method can rewrite this method, for example to use TemplateParser::processTemplate.

Since
1.35
Returns
string of complete document HTML to output to the page which includes <!DOCTYPE> and opening and closing html tags.

Reimplemented in SkinMustache.

Definition at line 126 of file SkinTemplate.php.

References prepareQuickTemplate().

Referenced by outputPage().

◆ getFooterIcons()

SkinTemplate::getFooterIcons ( )
protected

Get template representation of the footer.

Since
1.35
Returns
array

Definition at line 218 of file SkinTemplate.php.

References ContextSource\getConfig().

Referenced by getFooterTemplateData(), and prepareQuickTemplate().

◆ getFooterTemplateData()

SkinTemplate::getFooterTemplateData ( )
private

Get rows that make up the footer.

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

Definition at line 893 of file SkinTemplate.php.

References getFooterIcons(), Skin\getFooterLinks(), and Skin\makeFooterIcon().

Referenced by getTemplateData().

◆ getJsConfigVars()

SkinTemplate::getJsConfigVars ( )
protected

Returns array of config variables that should be added only to this skin for use in JavaScript.

Skins can override this to add variables to the page.

Since
1.35
Returns
array

Definition at line 154 of file SkinTemplate.php.

Referenced by outputPage().

◆ getLogoData()

SkinTemplate::getLogoData ( )
private
Returns
array of logo data localised to the current language variant

Definition at line 960 of file SkinTemplate.php.

References ResourceLoaderSkinModule\getAvailableLogos(), ContextSource\getConfig(), and ContextSource\getOutput().

Referenced by getTemplateData().

◆ getNameSpaceKey()

SkinTemplate::getNameSpaceKey ( )
protected

Generate strings used for xml 'id' names.

Deprecated:
since 1.35, use Title::getNamespaceKey() instead
Returns
string

Definition at line 1655 of file SkinTemplate.php.

References ContextSource\getTitle().

◆ getPersonalToolsList()

SkinTemplate::getPersonalToolsList ( )

Get the HTML for the p-personal list.

Deprecated:
since 1.35, hard deprecated since 1.38 Use SkinTemplate::makePersonalToolsList() instead
Returns
string

Definition at line 476 of file SkinTemplate.php.

References makePersonalToolsList(), and wfDeprecated().

◆ getPortletData()

SkinTemplate::getPortletData (   $name,
array  $items 
)
protected
Since
1.37 for non-SkinMustache base classes. Available since 1.36 for SkinMustache
Stability: stable
to override
Parameters
string$nameof the portal e.g. p-personal the name is personal.
array$itemsthat are accepted input to Skin::makeListItem
Returns
array data that can be passed to a Mustache template that represents a single menu.

Definition at line 754 of file SkinTemplate.php.

References $content, Sanitizer\escapeClass(), Sanitizer\escapeIdForAttribute(), Skin\getAfterPortlet(), getPortletLabel(), Skin\makeListItem(), Html\rawElement(), and Linker\tooltip().

Referenced by getPortletsTemplateData().

◆ getPortletLabel()

SkinTemplate::getPortletLabel (   $name)
private
Parameters
string$nameof the portal e.g. p-personal the name is personal.
Returns
string that is human readable corresponding to the menu

Definition at line 812 of file SkinTemplate.php.

References ContextSource\msg().

Referenced by getPortletData().

◆ getPortletsTemplateData()

SkinTemplate::getPortletsTemplateData ( )
private
Returns
array of portlet data for all portlets

Definition at line 829 of file SkinTemplate.php.

References buildContentNavigationUrls(), Skin\buildSidebar(), Skin\getPersonalToolsForMakeListItem(), getPortletData(), and injectLegacyMenusIntoPersonalTools().

Referenced by getTemplateData().

◆ getReturnToParam()

SkinTemplate::getReturnToParam ( )
protected

Builds query params for the page to return to, used when building links.

Stability: unstable
Returns
string[]

Definition at line 674 of file SkinTemplate.php.

References $title, ContextSource\getAuthority(), ContextSource\getRequest(), ContextSource\getTitle(), Title\newFromText(), wfArrayToCgi(), and wfCgiToArray().

Referenced by buildLogoutLinkData(), and buildPersonalUrls().

◆ getStructuredPersonalTools()

SkinTemplate::getStructuredPersonalTools ( )

Get personal tools for the user.

Since
1.31
Returns
array[]

Definition at line 515 of file SkinTemplate.php.

References buildPersonalUrls(), Skin\getPersonalToolsForMakeListItem(), and setupTemplateContext().

◆ getTemplateData()

SkinTemplate::getTemplateData ( )

Subclasses may extend this method to add additional template data.

The data keys should be valid English words. Compound words should be hypenated except if they are normally written as one word. Each key should be prefixed with a type hint, this may be enforced by the class PHPUnit test.

Plain strings are prefixed with 'html-', plain arrays with 'array-' and complex array data with 'data-'. 'is-' and 'has-' prefixes can be used for boolean variables. Messages are prefixed with 'msg-', followed by their message key. All messages specified in the skin option 'messages' will be available under 'msg-MESSAGE-NAME'.

Returns
array Data for a mustache template

Reimplemented in SkinMustache, and SkinFallback.

Definition at line 283 of file SkinTemplate.php.

References buildSearchProps(), getFooterTemplateData(), getLogoData(), ContextSource\getOutput(), getPortletsTemplateData(), ContextSource\getTitle(), and ContextSource\getUser().

◆ getWatchLinkAttrs()

SkinTemplate::getWatchLinkAttrs ( string  $mode,
Authority  $performer,
Title  $title,
?string  $action,
bool  $onPage 
)
private

Get the attributes for the watch link.

Parameters
string$modeEither 'watch' or 'unwatch'
Authority$performer
Title$title
string | null$action
bool$onPage
Returns
array

Definition at line 1191 of file SkinTemplate.php.

References $action, $title, ContextSource\getConfig(), and ContextSource\msg().

Referenced by buildContentNavigationUrls().

◆ injectLegacyMenusIntoPersonalTools()

SkinTemplate::injectLegacyMenusIntoPersonalTools ( array  $contentNavigation)
finalprotected

Insert legacy menu items from content navigation into the personal toolbar.

Access: internal
Parameters
array$contentNavigation
Returns
array

Definition at line 1667 of file SkinTemplate.php.

References wfArrayInsertAfter().

Referenced by getPortletsTemplateData(), and makeSkinTemplatePersonalUrls().

◆ makePersonalToolsList()

SkinTemplate::makePersonalToolsList (   $personalTools = null,
  $options = [] 
)

Get the HTML for the personal tools list Please ensure setupTemplateContext is called before calling this method.

Since
1.31
Parameters
array | null$personalTools
array$options
Returns
string

Definition at line 491 of file SkinTemplate.php.

References Skin\$options, buildPersonalUrls(), Skin\getPersonalToolsForMakeListItem(), Skin\makeListItem(), and setupTemplateContext().

Referenced by getPersonalToolsList().

◆ makeSkinTemplatePersonalUrls()

SkinTemplate::makeSkinTemplatePersonalUrls ( array  $contentNavigation)
private

Build the personal urls array.

Access: internal
Parameters
array$contentNavigation
Returns
array

Definition at line 1697 of file SkinTemplate.php.

References injectLegacyMenusIntoPersonalTools().

Referenced by prepareQuickTemplate().

◆ makeTalkUrlDetails()

SkinTemplate::makeTalkUrlDetails (   $name,
  $urlaction = '' 
)
private
Parameters
string$name
string | array$urlaction
Returns
array

Definition at line 1169 of file SkinTemplate.php.

References $title, Skin\checkTitle(), and Title\newFromText().

Referenced by buildPersonalUrls().

◆ outputPage()

SkinTemplate::outputPage ( )

Initialize various variables and generate the template @stable to override.

Reimplemented from Skin.

Definition at line 136 of file SkinTemplate.php.

References generateHTML(), getJsConfigVars(), ContextSource\getOutput(), Skin\initPage(), and Profiler\instance().

◆ prepareQuickTemplate()

◆ prepareUndeleteLink()

SkinTemplate::prepareUndeleteLink ( )
finalprotected

Prepare undelete link for output in page.

Since
1.35
Returns
null|string HTML, or null if there is no undelete link.

Definition at line 260 of file SkinTemplate.php.

References Skin\getUndeleteLink().

Referenced by SkinMustache\getTemplateData(), and prepareQuickTemplate().

◆ prepareUserLanguageAttributes()

SkinTemplate::prepareUserLanguageAttributes ( )
finalprotected

Prepare user language attribute links.

Since
1.35
Returns
string HTML attributes

Definition at line 195 of file SkinTemplate.php.

References ContextSource\getLanguage().

Referenced by SkinMustache\getTemplateData(), and prepareQuickTemplate().

◆ runOnSkinTemplateNavigationHooks()

SkinTemplate::runOnSkinTemplateNavigationHooks ( SkinTemplate  $skin,
$content_navigation 
)
protected

Run hooks relating to navigation menu data.

Skins should extend this if they want to run opinionated transformations to the data after all hooks have been run. Note hooks are run in an arbitary order.

Parameters
SkinTemplate$skin
array&$content_navigationrepresenting all menus.
Since
1.37

Definition at line 1227 of file SkinTemplate.php.

References $title, and Skin\getRelevantTitle().

Referenced by buildContentNavigationUrls().

◆ setupTemplate()

SkinTemplate::setupTemplate (   $classname)
protected

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
Returns
QuickTemplate

Definition at line 59 of file SkinTemplate.php.

References ContextSource\getConfig().

Referenced by setupTemplateForOutput().

◆ setupTemplateContext()

SkinTemplate::setupTemplateContext ( )
finalprotected

Setup class properties that are necessary prior to calling setupTemplateForOutput.

It must be called inside prepareQuickTemplate. This function may set local class properties that will be used by other methods, but should not make assumptions about the implementation of setupTemplateForOutput

Since
1.35

Definition at line 88 of file SkinTemplate.php.

References $title, Action\getActionName(), ContextSource\getRequest(), ContextSource\getTitle(), ContextSource\getUser(), Skin\makeKnownUrlDetails(), Skin\makeUrlDetails(), and wfArrayToCgi().

Referenced by SkinMustache\generateHTML(), getStructuredPersonalTools(), makePersonalToolsList(), and setupTemplateForOutput().

◆ setupTemplateForOutput()

SkinTemplate::setupTemplateForOutput ( )
protected
Returns
QuickTemplate

Definition at line 66 of file SkinTemplate.php.

References $template, setupTemplate(), and setupTemplateContext().

Referenced by prepareQuickTemplate().

◆ tabAction()

SkinTemplate::tabAction (   $title,
  $message,
  $selected,
  $query = '',
  $checkEdit = false 
)

Builds an array with tab definition.

Parameters
Title$titlePage Where the tab links to
string | string[] | MessageSpecifier$messageMessage 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
Parameters
-taint$messagetainted

Definition at line 1108 of file SkinTemplate.php.

References $title, ContextSource\getContext(), true, and wfMessageFallback().

Referenced by buildContentNavigationUrls().

◆ useCombinedLoginLink()

SkinTemplate::useCombinedLoginLink ( )
protected

Returns if a combined login/signup link will be used.

Stability: unstable
Returns
bool

Definition at line 708 of file SkinTemplate.php.

References ContextSource\getConfig().

Referenced by buildPersonalUrls().

◆ wrapHTML()

SkinTemplate::wrapHTML (   $title,
  $html 
)
protected

Wrap the body text with language information and identifiable element.

Parameters
Title$title
string$htmlbody text
Returns
string html

Definition at line 165 of file SkinTemplate.php.

References $title, NS_FILE, NS_SPECIAL, and Html\rawElement().

Referenced by SkinMustache\getTemplateData(), and prepareQuickTemplate().

Member Data Documentation

◆ $action

SkinTemplate::$action
protected

Definition at line 41 of file SkinTemplate.php.

Referenced by getWatchLinkAttrs().

◆ $loggedin

SkinTemplate::$loggedin

Definition at line 47 of file SkinTemplate.php.

◆ $template

string SkinTemplate::$template

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

Definition at line 39 of file SkinTemplate.php.

Referenced by SkinMustache\generateHTML(), and setupTemplateForOutput().

◆ $thispage

SkinTemplate::$thispage

Definition at line 42 of file SkinTemplate.php.

◆ $thisquery

SkinTemplate::$thisquery

Definition at line 45 of file SkinTemplate.php.

◆ $titletxt

SkinTemplate::$titletxt

Definition at line 43 of file SkinTemplate.php.

◆ $username

SkinTemplate::$username

Definition at line 48 of file SkinTemplate.php.

Referenced by buildPersonalPageItem(), and buildPersonalUrls().

◆ $userpage

SkinTemplate::$userpage

Definition at line 44 of file SkinTemplate.php.

◆ $userpageUrlDetails

SkinTemplate::$userpageUrlDetails

Definition at line 49 of file SkinTemplate.php.


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