MediaWiki REL1_35
|
Base class for template-based skins. More...
Public Member Functions | |
generateHTML () | |
Subclasses not wishing to use the QuickTemplate render method can rewrite this method, for example to use TemplateParser::processTemplate. | |
getPersonalToolsList () | |
Get the HTML for the p-personal list. | |
getStructuredPersonalTools () | |
Get personal tools for the user. | |
makeArticleUrlDetails ( $name, $urlaction='') | |
makePersonalToolsList ( $personalTools=null, $options=[]) | |
Get the HTML for the personal tools list Please ensure setupTemplateContext is called before calling this method. | |
outputPage () | |
Initialize various variables and generate the template Stable to override. | |
tabAction ( $title, $message, $selected, $query='', $checkEdit=false) | |
Builds an array with tab definition. | |
Public Member Functions inherited from Skin | |
__construct ( $options=null) | |
aboutLink () | |
Gets the link to the wiki's about page. | |
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 () | |
This gets called shortly before the "</body>" tag. | |
buildSidebar () | |
Build an array that represents the sidebar(s), the navigation bar among them. | |
disclaimerLink () | |
Gets the link to the wiki's general disclaimers page. | |
doEditSectionLink (Title $nt, $section, $tooltip, Language $lang) | |
Create a section edit link. | |
editUrlOptions () | |
Return URL options for the 'edit page' link. | |
footerLink ( $desc, $page) | |
Returns an HTML link for use in the footer. | |
getAfterPortlet (string $name) | |
Allows extensions to hook into known portlets and add stuff to them. | |
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. | |
getHtmlElementAttributes () | |
Return values for <html> element. | |
getIndicatorsHTML ( $indicators) | |
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. | |
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) | |
getPageClasses ( $title) | |
TODO: document. | |
getPersonalToolsForMakeListItem ( $urls) | |
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. | |
getRevisionId () | |
Get the current revision ID. | |
getSiteFooterLinks () | |
Gets the link to the wiki's privacy policy, about page, and disclaimer page. | |
getSiteNotice () | |
Get the site notice. | |
getSkinName () | |
getSkinStylePath ( $name) | |
Return a fully resolved style path URL to images or styles stored in the current skin's folder. | |
getUndeleteLink () | |
initPage (OutputPage $out) | |
Stable to override. | |
isRevisionCurrent () | |
Whether the revision displayed is the latest revision of the page. | |
logoText ( $align='') | |
mainPageLink () | |
Gets the link to the wiki's main page. | |
makeFooterIcon ( $icon, $withImage='withImage') | |
Renders a $wgFooterIcons icon according to the method's arguments. | |
makeLink ( $key, $item, $options=[]) | |
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. | |
makeSearchButton ( $mode, $attrs=[]) | |
makeSearchInput ( $attrs=[]) | |
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. | |
printSource () | |
Text with the permalink to the source page, usually shown on the footer of a printed page. | |
privacyLink () | |
Gets the link to the wiki's privacy policy page. | |
setRelevantTitle ( $t) | |
Set the "relevant" title. | |
setRelevantUser ( $u) | |
Set the "relevant" user. | |
setupSkinUserCss (OutputPage $out) | |
Hook point for adding style modules to OutputPage. | |
showEmailUser ( $id) | |
subPageSubtitle ( $out=null) | |
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. | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
Stable to override. | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Public Attributes | |
$loggedin | |
string | $skinname = 'monobook' |
Name of our skin, it probably needs to be all lower case. | |
string | $template = QuickTemplate::class |
For QuickTemplate, the name of the subclass which will actually fill the template. | |
$thispage | |
$thisquery | |
$titletxt | |
$username | |
$userpage | |
$userpageUrlDetails | |
Public Attributes inherited from Skin | |
string | $stylename = null |
Stylesheets set to use. | |
Protected Member Functions | |
buildContentNavigationUrls () | |
a structured array of links usually used for the tabs in a skin | |
buildNavUrls () | |
build array of common navigation links and run the SkinTemplateBuildNavUrlsNav_urlsAfterPermalink hook. | |
buildPersonalUrls () | |
build array of urls for personal toolbar Please ensure setupTemplateContext is called before calling this method. | |
getFooterIcons () | |
Get template representation of the footer. | |
getJsConfigVars () | |
Returns array of config variables that should be added only to this skin for use in JavaScript. | |
getNameSpaceKey () | |
Generate strings used for xml 'id' names. | |
prepareQuickTemplate () | |
initialize various variables and generate the template | |
prepareSubtitle () | |
Prepare the subtitle of the page for output in the skin if one has been set. | |
prepareUndeleteLink () | |
Prepare undelete link for output in page. | |
prepareUserLanguageAttributes () | |
Prepare user language attribute links. | |
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 () | |
wrapHTML ( $title, $html) | |
Wrap the body text with language information and identifiable element. | |
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. | |
drawCategoryBrowser ( $tree) | |
Render the array as a series of links. | |
generateDebugHTML () | |
Generate debug data HTML for displaying at the bottom of the main content area. | |
getCopyrightIcon () | |
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. | |
getLogo () | |
URL to the default square logo (1x key) Please use ResourceLoaderSkinModule::getAvailableLogos. | |
getPoweredBy () | |
Gets the powered by MediaWiki icon. | |
getSearchLink () | |
lastModified () | |
Get the timestamp of the latest revision, formatted in user language. | |
preloadExistence () | |
Preload the existence of three commonly-requested pages in a single query. | |
Private Member Functions | |
buildContentActionUrls ( $content_navigation) | |
an array of edit links by default used for the tabs | |
getWatchLinkAttrs (string $mode, User $user, Title $title, ?string $action, bool $onPage) | |
Get the attributes for the watch link. | |
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 | |
static | getAllowedSkins () |
Fetch the list of user-selectable skins in regards to $wgSkipSkins. | |
static | getDynamicStylesheetQuery () |
Get the query to generate a dynamic stylesheet. | |
static | getSkinNames () |
Fetch the set of available skins. | |
static | makeI18nUrl ( $name, $urlaction='') |
static | makeInternalOrExternalUrl ( $name) |
If url string starts with http, consider as external URL, else internal. | |
static | makeMainPageUrl ( $urlaction='') |
static | makeNSUrl ( $name, $urlaction='', $namespace=NS_MAIN) |
this can be passed the NS number as defined in Language.php | |
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 | makeUrl ( $name, $urlaction='') |
static | makeVariablesScript ( $data, $nonce=null) |
static | normalizeKey ( $key) |
Normalize a skin preference value to a form that can be loaded. | |
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 | |
$mRelevantUser = null | |
array | $options = [] |
Skin options passed into constructor. | |
string null | $skinname = null |
Base class for template-based skins.
Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge.net/) skin Based on Brion's smarty skin
Stable to extend
Definition at line 39 of file SkinTemplate.php.
|
private |
an array of edit links by default used for the tabs
array | $content_navigation |
Definition at line 1162 of file SkinTemplate.php.
References wfDebug().
|
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:
Views also have an extra key which can be used:
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:
Definition at line 833 of file SkinTemplate.php.
References $title, getContext(), Title\getLocalURL(), getTitle(), SpecialPage\getTitleFor(), getUser(), User\isWatched(), NS_MEDIAWIKI, true, and wfMessageFallback().
|
protected |
build array of common navigation links and run the SkinTemplateBuildNavUrlsNav_urlsAfterPermalink hook.
Build array of common navigation links.Assumes thispage property has been set before execution.
Reimplemented from Skin.
Definition at line 1203 of file SkinTemplate.php.
|
protected |
build array of urls for personal toolbar Please ensure setupTemplateContext is called before calling this method.
Definition at line 495 of file SkinTemplate.php.
References $title, getTitle(), getUser(), Title\isSpecialPage(), wfArrayToCgi(), and wfCgiToArray().
SkinTemplate::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 tags. Reimplemented in SkinMustache.
Definition at line 126 of file SkinTemplate.php.
References prepareQuickTemplate().
Referenced by outputPage().
|
protected |
Get template representation of the footer.
Definition at line 227 of file SkinTemplate.php.
|
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.
Definition at line 154 of file SkinTemplate.php.
Referenced by outputPage().
|
protected |
Generate strings used for xml 'id' names.
Definition at line 1229 of file SkinTemplate.php.
References getTitle().
SkinTemplate::getPersonalToolsList | ( | ) |
Get the HTML for the p-personal list.
Definition at line 443 of file SkinTemplate.php.
SkinTemplate::getStructuredPersonalTools | ( | ) |
Get personal tools for the user.
Definition at line 481 of file SkinTemplate.php.
|
private |
Get the attributes for the watch link.
string | $mode | Either 'watch' or 'unwatch' |
User | $user | |
Title | $title | |
string | null | $action | |
bool | $onPage |
Definition at line 772 of file SkinTemplate.php.
SkinTemplate::makeArticleUrlDetails | ( | $name, | |
$urlaction = '' |
|||
) |
string | $name | |
string | array | $urlaction |
Definition at line 752 of file SkinTemplate.php.
References $title, and wfDeprecated().
SkinTemplate::makePersonalToolsList | ( | $personalTools = null , |
|
$options = [] |
|||
) |
Get the HTML for the personal tools list Please ensure setupTemplateContext is called before calling this method.
array | null | $personalTools | |
array | $options |
Definition at line 457 of file SkinTemplate.php.
|
private |
string | $name | |
string | array | $urlaction |
Definition at line 733 of file SkinTemplate.php.
References $title.
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(), and Skin\initPage().
|
protected |
initialize various variables and generate the template
Definition at line 280 of file SkinTemplate.php.
References $title, ResourceLoaderSkinModule\getAvailableLogos(), getTitle(), SpecialPage\getTitleFor(), wfDebug(), and wfReportTime().
Referenced by generateHTML().
|
finalprotected |
Prepare the subtitle of the page for output in the skin if one has been set.
Definition at line 190 of file SkinTemplate.php.
Referenced by SkinMustache\getTemplateData().
|
finalprotected |
Prepare undelete link for output in page.
Definition at line 269 of file SkinTemplate.php.
Referenced by SkinMustache\getTemplateData().
|
finalprotected |
Prepare user language attribute links.
Definition at line 204 of file SkinTemplate.php.
Referenced by SkinMustache\getTemplateData().
|
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.
string | $classname |
Definition at line 68 of file SkinTemplate.php.
References ContextSource\getConfig().
Referenced by setupTemplateForOutput().
|
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
Definition at line 90 of file SkinTemplate.php.
References $title, ContextSource\getRequest(), getTitle(), getUser(), and wfArrayToCgi().
Referenced by SkinMustache\generateHTML(), and setupTemplateForOutput().
|
protected |
Definition at line 75 of file SkinTemplate.php.
References setupTemplate(), and setupTemplateContext().
SkinTemplate::tabAction | ( | $title, | |
$message, | |||
$selected, | |||
$query = '' , |
|||
$checkEdit = false |
|||
) |
Builds an array with tab definition.
Title | $title | Page Where the tab links to |
string | array | $message | Message key or an array of message keys (will fall back) |
bool | $selected | Display the tab as selected |
string | $query | Query string attached to tab URL |
bool | $checkEdit | Check if $title exists and mark with .new if one doesn't |
Definition at line 671 of file SkinTemplate.php.
References $title, getContext(), true, and wfMessageFallback().
|
protected |
Wrap the body text with language information and identifiable element.
Title | $title | |
string | $html | body text |
Definition at line 165 of file SkinTemplate.php.
References $title, NS_FILE, and NS_SPECIAL.
Referenced by SkinMustache\getTemplateData().
SkinTemplate::$loggedin |
Definition at line 56 of file SkinTemplate.php.
string SkinTemplate::$skinname = 'monobook' |
Name of our skin, it probably needs to be all lower case.
Child classes should override the default.
Definition at line 44 of file SkinTemplate.php.
string SkinTemplate::$template = QuickTemplate::class |
For QuickTemplate, the name of the subclass which will actually fill the template.
Child classes should override the default.
Definition at line 50 of file SkinTemplate.php.
Referenced by SkinMustache\generateHTML().
SkinTemplate::$thispage |
Definition at line 52 of file SkinTemplate.php.
SkinTemplate::$thisquery |
Definition at line 55 of file SkinTemplate.php.
SkinTemplate::$titletxt |
Definition at line 53 of file SkinTemplate.php.
SkinTemplate::$username |
Definition at line 57 of file SkinTemplate.php.
SkinTemplate::$userpage |
Definition at line 54 of file SkinTemplate.php.
SkinTemplate::$userpageUrlDetails |
Definition at line 58 of file SkinTemplate.php.