Go to the documentation of this file.
25 if ( !defined(
'MEDIAWIKI' ) ) {
41 parent::setupSkinUserCss(
$out );
42 $out->addModuleStyles(
'mediawiki.legacy.oldshared' );
43 $out->addModuleStyles(
'skins.cologneblue' );
61 $this->
html(
'headelement' );
63 $this->
html(
'bodytext' );
66 $this->
html(
'dataAfterContent' );
68 echo
"\n</body></html>";
79 $variants = $this->
data[
'content_navigation'][
'variants'];
81 foreach ( $variants
as $key =>
$link ) {
85 return $this->
getSkin()->getLanguage()->pipeList(
$s );
89 if ( $this->config->get(
'HideInterlanguageLinks' ) ) {
97 $language_urls = $this->
data[
'language_urls'];
98 if ( !empty( $language_urls ) ) {
100 foreach ( $language_urls
as $key =>
$data ) {
106 . $this->
getSkin()->getLanguage()->pipeList(
$s );
121 $html = $content !==
'' ?
"<div class='after-portlet after-portlet-$name'>$content</div>" :
'';
130 foreach ( $footlinks[
'places']
as $item ) {
131 $s[] = $this->
data[$item];
134 return $this->
getSkin()->getLanguage()->pipeList(
$s );
153 $navlink[
'text'] =
wfMessage( $message )->escaped();
165 $content_nav = $this->
data[
'content_navigation'];
169 if ( $this->
getSkin()->getOutput()->isArticleRelated() ) {
173 $editLinkMessage = $this->
getSkin()->getTitle()->exists() ?
'editthispage' :
'create-this-page';
174 $element[] = $this->
processBottomLink(
'edit', $content_nav[
'views'][
'edit'], $editLinkMessage );
177 $content_nav[
'views'][
'viewsource'],
183 $content_nav[
'actions'][
'watch'],
188 $content_nav[
'actions'][
'unwatch'],
194 $element[] = $this->
processBottomLink(
'history', $content_nav[
'views'][
'history'],
'history' );
196 $element[] = $this->
processBottomLink(
'whatlinkshere', $toolbox[
'whatlinkshere'] );
197 $element[] = $this->
processBottomLink(
'recentchangeslinked', $toolbox[
'recentchangeslinked'] );
199 $element[] = $this->
processBottomLink(
'contributions', $toolbox[
'contributions'] );
200 if ( isset( $toolbox[
'emailuser'] ) ) {
204 $lines[] = $this->
getSkin()->getLanguage()->pipeList( array_filter( $element ) );
211 $content_nav[
'actions'][
'delete'],
214 if ( isset( $content_nav[
'actions'][
'undelete'] ) ) {
217 $content_nav[
'actions'][
'undelete'],
222 if ( isset( $content_nav[
'actions'][
'protect'] ) ) {
225 $content_nav[
'actions'][
'protect'],
230 if ( isset( $content_nav[
'actions'][
'unprotect'] ) ) {
233 $content_nav[
'actions'][
'unprotect'],
238 $element[] = $this->
processBottomLink(
'move', $content_nav[
'actions'][
'move'],
'movethispage' );
240 $lines[] = $this->
getSkin()->getLanguage()->pipeList( array_filter( $element ) );
246 return implode( array_filter(
$lines ),
"<br />\n" ) .
"<br />\n";
257 $companionTitle =
$title->isTalkPage() ?
$title->getSubjectPage() :
$title->getTalkPage();
258 $companionNamespace = $companionTitle->getNamespace();
277 if ( isset( $nsToMessage[$companionNamespace] ) ) {
278 $message = $nsToMessage[$companionNamespace];
280 $message = $companionTitle->isTalkPage() ?
'talkpage' :
'articlepage';
286 $key = $companionTitle->getNamespaceKey(
'' );
287 if ( $companionTitle->isTalkPage() ) {
288 $key = ( $key ==
'main' ?
'talk' : $key .
"_talk" );
292 $namespacesLinks = $this->
data[
'content_navigation'][
'namespaces'];
308 if ( $navlink[
'id'] ) {
309 $navlink[
'single-id'] = $navlink[
'id'];
310 $navlink[
'tooltiponly'] =
true;
313 if ( $idPrefix ===
false ) {
314 unset( $navlink[
'id'] );
316 $navlink[
'id'] = $idPrefix . $navlink[
'id'];
331 <
p id=
"sitetitle" role=
"banner">
332 <
a href=
"<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>">
337 <
p id=
"sitesub"><?
php echo
wfMessage(
'sitesubtitle' )->escaped() ?></
p>
339 <div
id=
"linkcollection" role=
"navigation">
340 <div
id=
"langlinks"><?
php echo str_replace(
'<br />',
'', $this->
otherLanguages() ) ?></div>
341 <?
php echo $this->
getSkin()->getCategories() ?>
344 if ( $this->
data[
'newtalk'] ) {
346 <div
class=
"usermessage"><strong><?
php echo $this->
data[
'newtalk'] ?></strong></div>
352 <div
id=
"article" class=
"mw-body" role=
"main">
356 <div
id=
"siteNotice"><?
php echo $this->
getSkin()->getSiteNotice() ?></div>
361 <h1
id=
"firstHeading" lang=
"<?php
362 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
363 $this->text( 'pageLanguage' );
364 ?>"><?
php echo $this->
data[
'title'] ?></h1>
366 if ( $this->translator->translate(
'tagline' ) ) {
368 <
p class=
"tagline"><?
php
369 echo htmlspecialchars( $this->translator->translate(
'tagline' ) )
375 if ( $this->
getSkin()->getOutput()->getSubtitle() ) {
377 <
p class=
"subtitle"><?
php echo $this->
getSkin()->getOutput()->getSubtitle() ?></
p>
382 if ( $this->
getSkin()->subPageSubtitle() ) {
384 <
p class=
"subpages"><?
php echo $this->
getSkin()->subPageSubtitle() ?></
p>
389 $s = ob_get_contents();
403 <div
id=
"footer-navigation" role=
"navigation">
410 echo $this->
getSkin()->getLanguage()->pipeList( [
411 $this->
getSkin()->mainPageLink(),
417 <div
id=
"footer-info" role=
"contentinfo">
421 if ( $footlinks[
'info'] ) {
422 foreach ( $footlinks[
'info']
as $item ) {
423 echo $this->
data[$item] .
' ';
430 <div
id=
"mw-navigation">
431 <h2><?
php echo
wfMessage(
'navigation-heading' )->escaped() ?></h2>
433 <div
id=
"toplinks" role=
"navigation">
441 $s = ob_get_contents();
452 $this->
getSkin()->mainPageLink(),
469 foreach ( [
'logout',
'createaccount',
'login' ]
as $key ) {
470 if ( isset( $personalUrls[$key] ) ) {
471 $s[] = $this->
makeListItem( $key, $personalUrls[$key], [
'tag' =>
'span' ] );
475 return $this->
getSkin()->getLanguage()->pipeList(
$s );
490 $content_navigation = $this->
data[
'content_navigation'];
491 $qbpageoptions = array_merge(
492 $content_navigation[
'namespaces'],
494 'history' => $content_navigation[
'views'][
'history'],
495 'watch' => $content_navigation[
'actions'][
'watch'],
496 'unwatch' => $content_navigation[
'actions'][
'unwatch'],
499 $content_navigation[
'actions'][
'watch'] =
null;
500 $content_navigation[
'actions'][
'unwatch'] =
null;
501 $qbEditLinks = [
'edit' => $content_navigation[
'views'][
'edit'] ];
502 if ( isset( $content_navigation[
'views'][
'addsection'] ) ) {
503 $qbEditLinks[
'addsection'] = $content_navigation[
'views'][
'addsection'];
505 $qbedit = array_merge(
507 $content_navigation[
'actions']
512 foreach ( [
'logout',
'createaccount',
'login' ]
as $key ) {
513 $qbmyoptions[$key] =
null;
517 $bar[
'cactions'] = $qbedit;
518 $bar[
'pageoptions'] = $qbpageoptions;
519 $bar[
'personal'] = $qbmyoptions;
535 $orig_bar = $this->
data[
'sidebar'];
540 $bar[
'SEARCH'] =
true;
542 foreach ( $orig_bar
as $heading =>
$data ) {
543 if ( $heading ==
'TOOLBOX' ) {
549 if ( $heading !=
'LANGUAGES' ) {
550 $bar[$heading] =
$data;
554 if ( !$hasToolbox ) {
561 foreach ( $orig_bar
as $heading =>
$data ) {
562 if ( $heading ==
'SEARCH' ) {
563 $bar[
'search'] = $this->
searchForm(
'sidebar' );
564 } elseif ( $heading ==
'TOOLBOX' ) {
567 $bar[$heading] =
$data;
574 'search' =>
'qbfind',
575 'navigation' =>
'qbbrowse',
577 'cactions' =>
'qbedit',
578 'personal' =>
'qbmyoptions',
579 'pageoptions' =>
'qbpageoptions',
582 $s =
"<div id='quickbar'>\n";
584 foreach ( $bar
as $heading =>
$data ) {
586 $heading = (
string)$heading;
588 $portletId = Sanitizer::escapeId(
"p-$heading" );
589 $headingMsg =
wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
590 $headingHTML =
"<h3>";
591 $headingHTML .= $headingMsg->exists()
592 ? $headingMsg->escaped()
593 : htmlspecialchars( $heading );
594 $headingHTML .=
"</h3>";
597 if ( is_array(
$data ) ) {
606 $listHTML =
"<ul>$listHTML</ul>";
614 $role = ( $heading ==
'search' ) ?
'search' :
'navigation';
615 $s .=
"<div class=\"portlet\" id=\"$portletId\" "
616 .
"role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
632 $search = $this->
getSkin()->getRequest()->getText(
'search' );
633 $action = $this->
data[
'searchaction'];
634 $s =
"<form id=\"searchform-" . htmlspecialchars( $which )
635 .
"\" method=\"get\" class=\"inline\" action=\"$action\">";
636 if ( $which ==
'footer' ) {
641 'class' =>
'mw-searchInput',
645 $s .= ( $which ==
'footer' ?
" " :
"<br />" );
648 if ( $this->config->get(
'UseTwoButtonsSearchForm' ) ) {
651 $s .=
'<div><a href="' . $action .
'" rel="search">'
652 .
wfMessage(
'powersearch-legend' )->escaped() .
"</a></div>\n";
$this data['pageLanguage']
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
if( $this->translator->translate( 'tagline')) if( $this->getSkin() ->getOutput() ->getSubtitle()) if( $this->getSkin() ->subPageSubtitle()) $s
makeSearchButton( $mode, $attrs=[])
variantLinks()
Language/charset variant links for classic-style skins.
execute()
Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
quickBar()
Compute the sidebar.
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
processNavlinkForDocument( $navlink, $idPrefix='cb-')
Takes a navigational link generated by SkinTemplate in whichever way and mangles attributes unsuitabl...
Allows to change the fields on the form that will be generated $name
getSkin()
Get the Skin object related to this object.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
namespace and then decline to actually register it file or subcat img or subcat $title
</source > ! result< div class="mw-highlight mw-content-ltr" dir="ltr">< pre >< span ></span >< span class="kd"> var</span >< span class="nx"> a</span >< span class="p"></span ></pre ></div > ! end ! test Multiline< source/> in lists !input *< source > a b</source > *foo< source > a b</source > ! html< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! html tidy< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! end ! test Custom attributes !input< source lang="javascript" id="foo" class="bar" dir="rtl" style="font-size: larger;"> var a
printTrail()
Output getTrail.
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
This class should be covered by a general architecture document which does not exist as of January 20...
makeSearchInput( $attrs=[])
setupSkinUserCss(OutputPage $out)
processBottomLink( $key, $navlink, $message=null)
Used in bottomLinks() to eliminate repetitive code.
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
usually copyright or history_copyright This message must be in HTML not wikitext & $link
formatLanguageName( $name)
Override langlink formatting behavior not to uppercase the language names.
sidebarAdditions( $bar)
Adds CologneBlue-specific items to the sidebar: qbedit, qbpageoptions and qbmyoptions menus.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
New base template for a skin's template extended from QuickTemplate this class features helper method...
Base class for template-based skins.
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
renderAfterPortlet( $name)
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out