MediaWiki REL1_39
|
Generic template for use with Mustache templates. More...
Public Member Functions | |
generateHTML () | |
Subclasses not wishing to use the QuickTemplate render method can rewrite this method, for example to use TemplateParser::processTemplate.
| |
getTemplateData () | |
Subclasses may extend this method to add additional template data.The data keys should be valid English words. Compound words should be hyphenated 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'.
| |
Public Member Functions inherited from SkinTemplate | |
getCategoryLinks () | |
Extends category links with Skin::getAfterPortlet functionality. | |
getStructuredPersonalTools () | |
Get personal tools for the user. | |
makePersonalToolsList ( $personalTools=null, $options=[]) | |
Get the HTML for the personal tools list. | |
makeSearchButton ( $mode, $attrs=[]) | |
makeSearchInput ( $attrs=[]) | |
outputPage () | |
Initialize various variables and generate the template. | |
tabAction ( $title, $message, $selected, $query='', $checkEdit=false) | |
Builds an array with tab definition. | |
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) | |
addToSidebarPlain (&$bar, $text) | |
Add content from plain text. | |
bottomScripts ( $triggerWarnings=true) | |
This gets called shortly before the "</body>" tag. | |
buildSidebar () | |
Build an array that represents the sidebar(s), the navigation bar among them. | |
doEditSectionLink (Title $nt, $section, $sectionTitle, Language $lang) | |
Create a section edit link. | |
editUrlOptions () | |
Return URL options for the 'edit page' link. | |
footerLink ( $desc, $page) | |
Given a pair of message keys for link and text label, return an HTML link for use in the footer. | |
getAfterPortlet (string $name) | |
Allows extensions to hook into known portlets and add stuff to them. | |
getCategories () | |
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. | |
getHtmlElementAttributes () | |
Return values for <html> element. | |
getLanguages () | |
Generates array of language links for the current page. | |
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) | |
getOptions () | |
Returns skin options Recommended to use SkinFactory::getSkinOptions instead. | |
getPageClasses ( $title) | |
TODO: document. | |
getPersonalToolsForMakeListItem ( $urls, $applyClassesToListItems=false) | |
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate. | |
getRelevantTitle () | |
Return the "relevant" title. | |
getRelevantUser () | |
Return the "relevant" user. | |
getSearchPageTitle () | |
getSiteFooterLinks () | |
Gets the link to the wiki's privacy policy, about page, and disclaimer page. | |
getSiteNotice () | |
getSkinName () | |
getUndeleteLink () | |
initPage (OutputPage $out) | |
isResponsive () | |
Indicates if this skin is responsive. | |
logoText ( $align='') | |
makeFooterIcon ( $icon, $withImage='withImage') | |
Renders a $wgFooterIcons icon according to the method's arguments. | |
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... | |
makeListItem ( $key, $item, $options=[]) | |
Generates a list item for a navigation, portlet, portal, sidebar... list. | |
makeToolbox ( $navUrls, $feedUrls) | |
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate. | |
mapInterwikiToLanguage ( $code) | |
Allows correcting the language of interlanguage links which, mostly due to legacy reasons, do not always match the standards compliant language tag. | |
prepareSubtitle () | |
Prepare the subtitle of the page for output in the skin if one has been set. | |
printSource () | |
Text with the permalink to the source page, usually shown on the footer of a printed page. | |
setRelevantTitle ( $t) | |
setRelevantUser (?UserIdentity $u) | |
setSearchPageTitle (Title $title) | |
showEmailUser ( $id) | |
supportsMenu (string $menu) | |
Does the skin support the named menu? | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getActionName () | |
Get the action name for the current web request. | |
getAuthority () | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Protected Member Functions | |
getTemplateParser () | |
Get the template parser, it will be lazily created if not already set. | |
Protected Member Functions inherited from SkinTemplate | |
buildContentNavigationUrls () | |
Wrapper for private buildContentNavigationUrlsInternal. | |
buildCreateAccountData ( $returnto) | |
Build "Create Account" link data. | |
buildLoginData ( $returnto, $useCombinedLoginLink) | |
Build "Login" link. | |
buildLogoutLinkData () | |
Build data required for "Logout" link. | |
buildPersonalPageItem ( $id='pt-userpage') | |
Build a user page link data. | |
buildPersonalUrls (bool $includeNotifications=true) | |
Build array of urls for personal toolbar. | |
getFooterIcons () | |
Get template representation of the footer. | |
getNameSpaceKey () | |
Generate strings used for xml 'id' names. | |
getReturnToParam () | |
Builds query params for the page to return to, used when building links. | |
injectLegacyMenusIntoPersonalTools (array $contentNavigation) | |
Insert legacy menu items from content navigation into the personal toolbar. | |
prepareQuickTemplate () | |
initialize various variables and generate the template | |
runOnSkinTemplateNavigationHooks (SkinTemplate $skin, &$content_navigation) | |
Run hooks relating to navigation menu data. | |
setupTemplate ( $classname) | |
Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML. | |
setupTemplateContext () | |
Setup class properties that are necessary prior to calling setupTemplateForOutput. | |
setupTemplateForOutput () | |
useCombinedLoginLink () | |
Returns if a combined login/signup link will be used. | |
Protected Member Functions inherited from Skin | |
afterContentHook () | |
This runs a hook to allow extensions placing their stuff after content and article metadata (e.g. | |
buildFeedUrls () | |
Build data structure representing syndication links. | |
buildNavUrls () | |
Build array of common navigation links. | |
getAction () | |
getComponent (string $name) | |
getFooterLinks () | |
Get template representation of the footer containing site footer links as well as standard footer links. | |
getIndicatorsData ( $indicators) | |
Return an array of indicator data. | |
getJsConfigVars () | |
Returns array of config variables that should be added only to this skin for use in JavaScript. | |
lastModified () | |
Get the timestamp of the latest revision, formatted in user language. | |
prepareUndeleteLink () | |
Prepare undelete link for output in page. | |
prepareUserLanguageAttributes () | |
Prepare user language attribute links. | |
wrapHTML ( $title, $html) | |
Wrap the body text with language information and identifiable element. | |
Additional Inherited Members | |
Static Public Member Functions inherited from SkinTemplate | |
static | makeSearchButtonInternal ( $mode, $searchData, $attrs=[]) |
Static Public Member Functions inherited from Skin | |
static | getPortletLinkOptions (RL\Context $context) |
Returns skin options for portlet links, used by addPortletLink. | |
static | getVersion () |
Get the current major version of Skin. | |
static | makeInternalOrExternalUrl ( $name) |
If url string starts with http, consider as external URL, else internal. | |
static | makeMainPageUrl ( $urlaction='') |
static | makeSpecialUrl ( $name, $urlaction='', $proto=null) |
Make a URL for a Special Page using the given query and protocol. | |
static | makeSpecialUrlSubpage ( $name, $subpage, $urlaction='') |
static | normalizeKey ( $key) |
Normalize a skin preference value to a form that can be loaded. | |
Public Attributes inherited from SkinTemplate | |
$loggedin | |
string | $template |
For QuickTemplate, the name of the subclass which will actually fill the template. | |
$thispage | |
$thisquery | |
$titletxt | |
$username | |
$userpage | |
$userpageUrlDetails | |
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) | |
static | makeUrlDetails ( $name, $urlaction='') |
these return an array with the 'href' and boolean 'exists' | |
Protected Attributes inherited from Skin | |
$mRelevantTitle = null | |
array | $options = [] |
Skin options passed into constructor. | |
string null | $skinname = null |
const | VERSION_MAJOR = 1 |
The current major version of the skin specification. | |
Generic template for use with Mustache templates.
Definition at line 25 of file SkinMustache.php.
SkinMustache::generateHTML | ( | ) |
Subclasses not wishing to use the QuickTemplate render method can rewrite this method, for example to use TemplateParser::processTemplate.
<!DOCTYPE>
and opening and closing html tagsThe master template is assumed to be 'skin' unless template
has been passed in the skin options to the constructor.
Reimplemented from SkinTemplate.
Definition at line 53 of file SkinMustache.php.
References SkinTemplate\$template, ContextSource\getOutput(), getTemplateData(), getTemplateParser(), and SkinTemplate\setupTemplateContext().
SkinMustache::getTemplateData | ( | ) |
Subclasses may extend this method to add additional template data.The data keys should be valid English words. Compound words should be hyphenated 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'.
Reimplemented from SkinTemplate.
Reimplemented in SkinFallback.
Definition at line 74 of file SkinMustache.php.
References Skin\afterContentHook(), Skin\getCategories(), Skin\getIndicatorsData(), Skin\getNewtalks(), ContextSource\getOutput(), Skin\getSiteNotice(), ContextSource\msg(), Skin\prepareSubtitle(), Skin\prepareUndeleteLink(), Skin\prepareUserLanguageAttributes(), Skin\printSource(), and Skin\wrapHTML().
Referenced by generateHTML().
|
protected |
Get the template parser, it will be lazily created if not already set.
The template directory is defined in the skin options passed to the class constructor.
Definition at line 38 of file SkinMustache.php.
Referenced by generateHTML().