MediaWiki
1.23.2
|
Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge.net/) skin Based on Brion's smarty skin. More...
Public Member Functions | |
formatLanguageName ( $name) | |
Format language name for use in sidebar interlanguage links list. More... | |
getLanguages () | |
Generates array of language links for the current page. More... | |
getNameSpaceKey () | |
Generate strings used for xml 'id' names. More... | |
getPersonalToolsList () | |
Get the HTML for the p-personal list. More... | |
makeArticleUrlDetails ( $name, $urlaction='') | |
makeTalkUrlDetails ( $name, $urlaction='') | |
outputPage (OutputPage $out=null) | |
initialize various variables and generate the template More... | |
printOrError ( $str) | |
Output the string, or print error message if it's an error object of the appropriate type. More... | |
setupSkinUserCss (OutputPage $out) | |
#- More... | |
setupTemplate ( $classname, $repository=false, $cache_dir=false) | |
Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML. More... | |
tabAction ( $title, $message, $selected, $query='', $checkEdit=false) | |
Builds an array with tab definition. More... | |
useCombinedLoginLink () | |
Output a boolean indicating if buildPersonalUrls should output separate login and create account links or output a combined link By default we simply return a global config setting that affects most skins This is setup as a method so that like with $wgLogo and getLogo() a skin can override this setting and always output one or the other if it has a reason it can't output one of the two modes. More... | |
Public Member Functions inherited from Skin | |
__call ( $fname, $args) | |
Use PHP's magic __call handler to intercept legacy calls to the linker for backwards compatibility. More... | |
aboutLink () | |
Gets the link to the wiki's about page. More... | |
addToBodyAttributes ( $out, &$bodyAttrs) | |
This will be called by OutputPage::headElement when it is creating the "<body>" tag, skins can override it if they have a need to add in any body attributes or classes of their own. More... | |
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... | |
commonPrintStylesheet () | |
This function previously controlled whether the 'mediawiki.legacy.wikiprintable' module should be loaded by OutputPage. More... | |
disclaimerLink () | |
Gets the link to the wiki's general disclaimers page. More... | |
doEditSectionLink (Title $nt, $section, $tooltip=null, $lang=false) | |
Create a section edit link. More... | |
drawCategoryBrowser ( $tree) | |
Render the array as a series of links. More... | |
editUrlOptions () | |
Return URL options for the 'edit page' link. More... | |
escapeSearchLink () | |
footerLink ( $desc, $page) | |
Returns an HTML link for use in the footer. More... | |
getCategories () | |
getCategoryLinks () | |
getCommonStylePath ( $name) | |
Return a fully resolved style path url to images or styles stored in the common folder. More... | |
getCopyright ( $type='detect') | |
getCopyrightIcon () | |
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 () | |
getLogo () | |
URL to the logo. More... | |
getNamespaceNotice () | |
Get a notice based on page's namespace. 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... | |
getPageClasses ( $title) | |
TODO: document. More... | |
getPoweredBy () | |
Gets the powered by MediaWiki icon. More... | |
getRelevantTitle () | |
Return the "relevant" title. More... | |
getRelevantUser () | |
Return the "relevant" user. More... | |
getRevisionId () | |
Get the current revision ID. More... | |
getSearchLink () | |
getSiteNotice () | |
Get the site notice. More... | |
getSkinName () | |
getSkinStylePath ( $name) | |
Return a fully resolved style path url to images or styles stored in the current skins's folder. More... | |
getUndeleteLink () | |
initPage (OutputPage $out) | |
isRevisionCurrent () | |
Whether the revision displayed is the latest revision of the page. More... | |
logoText ( $align='') | |
mainPageLink () | |
Gets the link to the wiki's main page. More... | |
makeFooterIcon ( $icon, $withImage='withImage') | |
Renders a $wgFooterIcons icon according to the method's arguments. More... | |
preloadExistence () | |
Preload the existence of three commonly-requested pages in a single query. More... | |
printSource () | |
Text with the permalink to the source page, usually shown on the footer of a printed page. More... | |
privacyLink () | |
Gets the link to the wiki's privacy policy page. More... | |
setRelevantTitle ( $t) | |
Set the "relevant" title. More... | |
setRelevantUser ( $u) | |
Set the "relevant" user. More... | |
showEmailUser ( $id) | |
showIPinHeader () | |
Returns true if the IP should be shown in the header. More... | |
subPageSubtitle () | |
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... | |
getConfig () | |
Get the Config object. More... | |
getContext () | |
Get the RequestContext object. More... | |
getLang () | |
Get the Language object. More... | |
getLanguage () | |
Get the Language object. More... | |
getOutput () | |
Get the OutputPage object. More... | |
getRequest () | |
Get the WebRequest object. More... | |
getSkin () | |
Get the Skin object. More... | |
getTitle () | |
Get the Title object. More... | |
getUser () | |
Get the User object. More... | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg () | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Set the IContextSource object. More... | |
Public Attributes | |
$skinname = 'monobook' | |
#+ More... | |
$stylename = 'monobook' | |
Stylesheets set to use. More... | |
$template = 'QuickTemplate' | |
For QuickTemplate, the name of the subclass which will actually fill the template. More... | |
$useHeadElement = false | |
Whether this skin use OutputPage::headElement() to generate the "<head>" tag. More... | |
Protected Member Functions | |
buildContentNavigationUrls () | |
a structured array of links usually used for the tabs in a skin More... | |
buildNavUrls () | |
build array of common navigation links More... | |
buildPersonalUrls () | |
build array of urls for personal toolbar More... | |
prepareQuickTemplate () | |
initialize various variables and generate the template More... | |
setupTemplateForOutput () | |
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... | |
generateDebugHTML () | |
Generate debug data HTML for displaying at the bottom of the main content area. More... | |
lastModified () | |
Get the timestamp of the latest revision, formatted in user language. More... | |
Private Member Functions | |
buildContentActionUrls ( $content_navigation) | |
an array of edit links by default used for the tabs More... | |
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 | getAllowedSkins () |
Fetch the list of user-selectable skins in regards to $wgSkipSkins. More... | |
static | getDynamicStylesheetQuery () |
Get the query to generate a dynamic stylesheet. More... | |
static | getSkinNameMessages () |
Fetch the skinname messages for available skins. More... | |
static | getSkinNames () |
Fetch the set of available skins. More... | |
static | getUsableSkins () |
static | makeGlobalVariablesScript ( $unused) |
Make a "<script>" tag containing global variables. More... | |
static | makeI18nUrl ( $name, $urlaction='') |
static | makeInternalOrExternalUrl ( $name) |
If url string starts with http, consider as external URL, else internal. More... | |
static | makeKnownUrlDetails ( $name, $urlaction='') |
Make URL details where the article exists (or at least it's convenient to think so) More... | |
static | makeMainPageUrl ( $urlaction='') |
static | makeNSUrl ( $name, $urlaction='', $namespace=NS_MAIN) |
this can be passed the NS number as defined in Language.php More... | |
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 | makeUrl ( $name, $urlaction='') |
static | makeUrlDetails ( $name, $urlaction='') |
these return an array with the 'href' and boolean 'exists' More... | |
static | makeVariablesScript ( $data) |
static & | newFromKey ( $key) |
Factory method for loading a skin of a given type. More... | |
static | normalizeKey ( $key) |
Normalize a skin preference value to a form that can be loaded. More... | |
Protected Attributes inherited from Skin | |
$mRelevantTitle = null | |
$mRelevantUser = null | |
$skinname = 'standard' | |
Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge.net/) skin Based on Brion's smarty skin.
Definition at line 70 of file SkinTemplate.php.
|
private |
an array of edit links by default used for the tabs
Definition at line 1196 of file SkinTemplate.php.
References $value, array(), as, wfDebug(), wfProfileIn(), and wfProfileOut().
Referenced by prepareQuickTemplate().
|
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 884 of file SkinTemplate.php.
References $file, $link, $n, $out, $params, $section, $skinname, $title, $user, array(), as, ContextSource\canUseWikiPage(), false, Action\getActionName(), ContextSource\getContext(), ContextSource\getOutput(), Skin\getRelevantTitle(), ContextSource\getRequest(), MWNamespace\getRestrictionLevels(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), WatchAction\getWatchToken(), ContextSource\getWikiPage(), global, Skin\isRevisionCurrent(), ContextSource\msg(), NS_FILE, NS_MEDIAWIKI, ContextSource\setContext(), tabAction(), text, wfBCP47(), wfMessageFallback(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by prepareQuickTemplate().
|
protected |
build array of common navigation links
Definition at line 1245 of file SkinTemplate.php.
References $out, $user, array(), ContextSource\getContext(), ContextSource\getOutput(), Skin\getRelevantUser(), ContextSource\getRequest(), Skin\getRevisionId(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), global, UploadBase\isAllowed(), UploadBase\isEnabled(), ContextSource\msg(), SpecialPage\setContext(), Skin\showEmailUser(), text, wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by prepareQuickTemplate().
|
protected |
build array of urls for personal toolbar
Definition at line 634 of file SkinTemplate.php.
References $personal_urls, $query, $title, array(), ContextSource\getRequest(), ContextSource\getTitle(), ContextSource\getUser(), Title\isSpecialPage(), list, Skin\makeSpecialUrl(), Skin\makeSpecialUrlSubpage(), makeTalkUrlDetails(), ContextSource\msg(), Title\newFromText(), SpecialPageFactory\resolveAlias(), Skin\showIPinHeader(), text, useCombinedLoginLink(), wfArrayToCgi(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by getPersonalToolsList(), and prepareQuickTemplate().
SkinTemplate::formatLanguageName | ( | $name | ) |
Format language name for use in sidebar interlanguage links list.
By default it is capitalized.
string | $name | Language name, e.g. "English" or "español" |
Reimplemented in SkinCologneBlue.
Definition at line 600 of file SkinTemplate.php.
References $name, and ContextSource\getLanguage().
Referenced by getLanguages().
SkinTemplate::getLanguages | ( | ) |
Generates array of language links for the current page.
Definition at line 135 of file SkinTemplate.php.
References array(), as, Language\fetchLanguageName(), formatLanguageName(), ContextSource\getLanguage(), ContextSource\getOutput(), ContextSource\getTitle(), global, Title\newFromText(), wfBCP47(), wfMessage(), and wfRunHooks().
Referenced by prepareQuickTemplate().
SkinTemplate::getNameSpaceKey | ( | ) |
Generate strings used for xml 'id' names.
Definition at line 1362 of file SkinTemplate.php.
References ContextSource\getTitle().
SkinTemplate::getPersonalToolsList | ( | ) |
Get the HTML for the p-personal list.
Definition at line 582 of file SkinTemplate.php.
References $html, as, buildPersonalUrls(), and setupTemplateForOutput().
SkinTemplate::makeArticleUrlDetails | ( | $name, | |
$urlaction = '' |
|||
) |
Definition at line 841 of file SkinTemplate.php.
References $name, $title, array(), Skin\checkTitle(), and Title\newFromText().
SkinTemplate::makeTalkUrlDetails | ( | $name, | |
$urlaction = '' |
|||
) |
Definition at line 828 of file SkinTemplate.php.
References $name, $title, array(), Skin\checkTitle(), and Title\newFromText().
Referenced by buildPersonalUrls().
SkinTemplate::outputPage | ( | OutputPage | $out = null | ) |
initialize various variables and generate the template
$out | OutputPage |
Reimplemented from Skin.
Definition at line 244 of file SkinTemplate.php.
References $out, $res, ContextSource\getContext(), ContextSource\getOutput(), Skin\initPage(), Profiler\instance(), prepareQuickTemplate(), printOrError(), ContextSource\setContext(), wfProfileIn(), and wfProfileOut().
|
protected |
initialize various variables and generate the template
Definition at line 282 of file SkinTemplate.php.
References $dbr, $link, $out, $title, $wgArticlePath, $wgContLang, $wgJsMimeType, Skin\aboutLink(), Skin\afterContentHook(), array(), as, Skin\bottomScripts(), buildContentActionUrls(), buildContentNavigationUrls(), buildNavUrls(), buildPersonalUrls(), Skin\buildSidebar(), DB_SLAVE, Skin\disclaimerLink(), Sanitizer\escapeClass(), Skin\escapeSearchLink(), Action\factory(), Skin\generateDebugHTML(), Action\getActionName(), Skin\getCategories(), ContextSource\getContext(), Skin\getCopyright(), Skin\getCopyrightIcon(), ContextSource\getLanguage(), getLanguages(), Skin\getNewtalks(), ContextSource\getOutput(), Skin\getPageClasses(), Skin\getPoweredBy(), ContextSource\getRequest(), Skin\getSiteNotice(), Skin\getSkinName(), ContextSource\getTitle(), SpecialPage\getTitleFor(), Skin\getUndeleteLink(), ContextSource\getWikiPage(), global, Skin\isRevisionCurrent(), Skin\lastModified(), Skin\logoText(), ContextSource\msg(), NS_FILE, NS_MEDIAWIKI, NS_SPECIAL, Skin\printSource(), Skin\privacyLink(), Html\rawElement(), setupTemplateForOutput(), Skin\subPageSubtitle(), text, wfDebug(), wfGetDB(), wfProfileIn(), wfProfileOut(), wfReportTime(), and wfRunHooks().
Referenced by outputPage().
SkinTemplate::printOrError | ( | $str | ) |
Output the string, or print error message if it's an error object of the appropriate type.
For the base class, assume strings all around.
$str | Mixed |
Definition at line 612 of file SkinTemplate.php.
Referenced by outputPage().
SkinTemplate::setupSkinUserCss | ( | OutputPage | $out | ) |
#-
Add specific styles for this skin
$out | OutputPage |
Reimplemented from Skin.
Reimplemented in SkinVector, SkinMonoBook, SkinCologneBlue, and SkinModern.
Definition at line 106 of file SkinTemplate.php.
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.
$classname | String | |
string | $repository | subdirectory where we keep template files |
$cache_dir | string |
Definition at line 125 of file SkinTemplate.php.
Referenced by setupTemplateForOutput().
|
protected |
Definition at line 198 of file SkinTemplate.php.
References $query, $title, $user, array(), ContextSource\getRequest(), ContextSource\getTitle(), ContextSource\getUser(), Skin\makeKnownUrlDetails(), Skin\makeUrlDetails(), setupTemplate(), Skin\showIPinHeader(), wfArrayToCgi(), wfProfileIn(), and wfProfileOut().
Referenced by getPersonalToolsList(), and prepareQuickTemplate().
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) |
boolean | $selected | display the tab as selected |
string | $query | query string attached to tab URL |
boolean | $checkEdit | check if $title exists and mark with .new if one doesn't |
Definition at line 785 of file SkinTemplate.php.
References $query, $title, $wgContLang, array(), ContextSource\getContext(), MWNamespace\getSubject(), global, true, wfMessageFallback(), and wfRunHooks().
Referenced by buildContentNavigationUrls().
SkinTemplate::useCombinedLoginLink | ( | ) |
Output a boolean indicating if buildPersonalUrls should output separate login and create account links or output a combined link By default we simply return a global config setting that affects most skins This is setup as a method so that like with $wgLogo and getLogo() a skin can override this setting and always output one or the other if it has a reason it can't output one of the two modes.
Definition at line 625 of file SkinTemplate.php.
References global.
Referenced by buildPersonalUrls().
SkinTemplate::$skinname = 'monobook' |
#+
Definition at line 79 of file SkinTemplate.php.
Referenced by buildContentNavigationUrls().
SkinTemplate::$stylename = 'monobook' |
Stylesheets set to use.
Subdirectory in skins/ where various stylesheets are located. Child classes should override the default.
Definition at line 85 of file SkinTemplate.php.
SkinTemplate::$template = 'QuickTemplate' |
For QuickTemplate, the name of the subclass which will actually fill the template.
Child classes should override the default.
Definition at line 91 of file SkinTemplate.php.
SkinTemplate::$useHeadElement = false |
Whether this skin use OutputPage::headElement() to generate the "<head>" tag.
Definition at line 97 of file SkinTemplate.php.