MediaWiki
REL1_22
|
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. | |
getLanguages () | |
Generates array of language links for the current page. | |
getNameSpaceKey () | |
Generate strings used for xml 'id' names. | |
getPersonalToolsList () | |
Get the HTML for the p-personal list. | |
makeArticleUrlDetails ($name, $urlaction= '') | |
makeTalkUrlDetails ($name, $urlaction= '') | |
outputPage (OutputPage $out=null) | |
initialize various variables and generate the template | |
printOrError ($str) | |
Output the string, or print error message if it's an error object of the appropriate type. | |
setupSkinUserCss (OutputPage $out) | |
#@- | |
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. | |
tabAction ($title, $message, $selected, $query= '', $checkEdit=false) | |
Builds an array with tab definition. | |
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. | |
Public Attributes | |
$skinname = 'monobook' | |
#@+ | |
$stylename = 'monobook' | |
Stylesheets set to use. | |
$template = 'QuickTemplate' | |
For QuickTemplate, the name of the subclass which will actually fill the template. | |
$useHeadElement = false | |
Whether this skin use OutputPage::headElement() to generate the "<head>" tag. | |
Protected Member Functions | |
buildContentNavigationUrls () | |
a structured array of links usually used for the tabs in a skin | |
buildNavUrls () | |
build array of common navigation links | |
buildPersonalUrls () | |
build array of urls for personal toolbar | |
setupTemplateForOutput () | |
Private Member Functions | |
buildContentActionUrls ($content_navigation) | |
an array of edit links by default used for the tabs |
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.
SkinTemplate::buildContentActionUrls | ( | $ | content_navigation | ) | [private] |
an array of edit links by default used for the tabs
Definition at line 1138 of file SkinTemplate.php.
References $key, $value, array(), as, wfDebug(), wfProfileIn(), and wfProfileOut().
Referenced by outputPage().
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:
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 847 of file SkinTemplate.php.
References $key, $link, $n, $out, $params, $section, $title, $user, array(), as, false, Action\getActionName(), ContextSource\getContext(), ContextSource\getOutput(), Skin\getRelevantTitle(), ContextSource\getRequest(), ContextSource\getTitle(), SpecialPage\getTitleFor(), ContextSource\getUser(), WatchAction\getWatchToken(), global, Skin\isRevisionCurrent(), ContextSource\msg(), ContextSource\setContext(), tabAction(), text, wfBCP47(), wfMessageFallback(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by outputPage().
SkinTemplate::buildNavUrls | ( | ) | [protected] |
build array of common navigation links
Definition at line 1186 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 outputPage().
SkinTemplate::buildPersonalUrls | ( | ) | [protected] |
build array of urls for personal toolbar
Definition at line 596 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 outputPage().
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 562 of file SkinTemplate.php.
References $name, and ContextSource\getLanguage().
Referenced by getLanguages().
Generates array of language links for the current page.
Definition at line 131 of file SkinTemplate.php.
References $out, array(), as, Language\fetchLanguageName(), formatLanguageName(), ContextSource\getLanguage(), ContextSource\getOutput(), global, Title\newFromText(), text, wfBCP47(), and wfMessage().
Referenced by outputPage().
Generate strings used for xml 'id' names.
Definition at line 1303 of file SkinTemplate.php.
References ContextSource\getTitle().
Get the HTML for the p-personal list.
Definition at line 544 of file SkinTemplate.php.
References $html, $key, as, buildPersonalUrls(), and setupTemplateForOutput().
SkinTemplate::makeArticleUrlDetails | ( | $ | name, |
$ | urlaction = '' |
||
) |
Definition at line 804 of file SkinTemplate.php.
References $name, $title, array(), Skin\checkTitle(), and Title\newFromText().
SkinTemplate::makeTalkUrlDetails | ( | $ | name, |
$ | urlaction = '' |
||
) |
Definition at line 791 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 219 of file SkinTemplate.php.
References $dbr, $link, $out, $res, $title, $user, $wgArticlePath, $wgContLang, $wgDisableCounters, $wgJsMimeType, Skin\aboutLink(), Skin\afterContentHook(), array(), as, Skin\bottomScripts(), buildContentActionUrls(), buildContentNavigationUrls(), buildNavUrls(), buildPersonalUrls(), Skin\buildSidebar(), 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\getUser(), ContextSource\getWikiPage(), global, Skin\initPage(), Profiler\instance(), Skin\isRevisionCurrent(), Skin\lastModified(), Skin\logoText(), ContextSource\msg(), printOrError(), Skin\printSource(), Skin\privacyLink(), Html\rawElement(), ContextSource\setContext(), setupTemplateForOutput(), Skin\subPageSubtitle(), text, wfDebug(), wfGetDB(), wfProfileIn(), wfProfileOut(), wfReportTime(), and wfRunHooks().
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 574 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.
References OutputPage\addModuleStyles(), and array().
SkinTemplate::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.
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 121 of file SkinTemplate.php.
Referenced by setupTemplateForOutput().
SkinTemplate::setupTemplateForOutput | ( | ) | [protected] |
Definition at line 173 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 outputPage().
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 748 of file SkinTemplate.php.
References $query, $result, $title, $wgContLang, array(), ContextSource\getContext(), MWNamespace\getSubject(), global, true, wfMessageFallback(), and wfRunHooks().
Referenced by buildContentNavigationUrls().
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 587 of file SkinTemplate.php.
References global.
Referenced by buildPersonalUrls().
SkinTemplate::$skinname = 'monobook' |
#@+
Reimplemented from Skin.
Reimplemented in SkinMonoBook, SkinVector, SkinModern, and SkinCologneBlue.
Definition at line 79 of file SkinTemplate.php.
SkinTemplate::$stylename = 'monobook' |
Stylesheets set to use.
Subdirectory in skins/ where various stylesheets are located. Child classes should override the default.
Reimplemented in SkinMonoBook, SkinVector, SkinModern, and SkinCologneBlue.
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.
Reimplemented in SkinMonoBook, SkinVector, SkinModern, and SkinCologneBlue.
Definition at line 91 of file SkinTemplate.php.
SkinTemplate::$useHeadElement = false |
Whether this skin use OutputPage::headElement() to generate the "<head>" tag.
Reimplemented in SkinMonoBook, SkinVector, SkinCologneBlue, and SkinModern.
Definition at line 97 of file SkinTemplate.php.