50 return SkinFactory::getDefaultInstance()->getSkinNames();
59 foreach ( self::getSkinNames()
as $skinKey => $skinName ) {
78 unset( $allowedSkins[$skip] );
99 $skinNames = array_change_key_case( $skinNames, CASE_LOWER );
100 $key = strtolower( $key );
104 if ( $key ==
'' || $key ==
'default' ) {
110 if ( isset( $skinNames[$key] ) ) {
125 if ( isset( $skinNames[$key] ) ) {
127 } elseif ( isset( $skinNames[$defaultSkin] ) ) {
130 return $fallbackSkin;
162 'mediawiki.page.ready',
177 &&
$user->isAllowedAll(
'writeapi',
'viewmywatchlist',
'editmywatchlist' )
178 && $this->getRelevantTitle()->canExist()
180 $modules[
'watch'][] =
'mediawiki.page.watch.ajax';
183 $modules[
'search'][] =
'mediawiki.searchSuggest';
186 if (
$user->getBoolOption(
'editsectiononrightclick' ) ) {
187 $modules[
'user'][] =
'mediawiki.action.view.rightClickEdit';
191 if (
$out->isArticle() &&
$user->getOption(
'editondblclick' ) ) {
192 $modules[
'user'][] =
'mediawiki.action.view.dblClickEdit';
205 if (
$user->isLoggedIn() ) {
212 if (
$title->canExist() ) {
213 if (
$title->isTalkPage() ) {
220 Hooks::run(
'SkinPreloadExistence', [ &
$titles, $this ] );
224 $lb->setCaller( __METHOD__ );
235 return $this->
getOutput()->getRevisionId();
245 return $revID == 0 || $revID == $this->
getTitle()->getLatestRevID();
254 $this->mRelevantTitle =
$t;
268 if ( isset( $this->mRelevantTitle ) ) {
280 $this->mRelevantUser = $u;
292 if ( isset( $this->mRelevantUser ) ) {
297 $rootUser =
$title->getRootText();
298 if ( User::isIP( $rootUser ) ) {
299 $this->mRelevantUser = User::newFromName( $rootUser,
false );
301 $user = User::newFromName( $rootUser,
false );
304 $user->load( User::READ_NORMAL );
306 if (
$user->isLoggedIn() ) {
307 $this->mRelevantUser =
$user;
347 'usemsgcache' =>
'yes',
348 'ctype' =>
'text/css',
369 $numeric =
'ns-' .
$title->getNamespace();
371 if (
$title->isSpecialPage() ) {
372 $type =
'ns-special';
375 if ( $canonicalName ) {
376 $type .=
' ' . Sanitizer::escapeClass(
"mw-special-$canonicalName" );
378 $type .=
' mw-invalidspecialpage';
380 } elseif (
$title->isTalkPage() ) {
383 $type =
'ns-subject';
386 $name = Sanitizer::escapeClass(
'page-' .
$title->getPrefixedText() );
387 $root = Sanitizer::escapeClass(
'rootpage-' .
$title->getRootTitle()->getPrefixedText() );
389 return "$numeric $type $name $root";
399 'lang' =>
$lang->getHtmlCode(),
400 'dir' =>
$lang->getDir(),
401 'class' =>
'client-nojs',
432 $allCats =
$out->getCategoryLinks();
434 if ( !count( $allCats ) ) {
442 $colon = $this->
msg(
'colon-separator' )->escaped();
444 if ( !empty( $allCats[
'normal'] ) ) {
445 $t = $embed . implode(
"{$pop}{$embed}", $allCats[
'normal'] ) . $pop;
447 $msg = $this->
msg(
'pagecategories' )->numParams( count( $allCats[
'normal'] ) )->escaped();
448 $linkPage =
wfMessage(
'pagecategorieslink' )->inContentLanguage()->text();
449 $title = Title::newFromText( $linkPage );
451 $s .=
'<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
452 $link . $colon .
'<ul>' .
$t .
'</ul>' .
'</div>';
456 if ( isset( $allCats[
'hidden'] ) ) {
457 if ( $this->
getUser()->getBoolOption(
'showhiddencats' ) ) {
458 $class =
' mw-hidden-cats-user-shown';
460 $class =
' mw-hidden-cats-ns-shown';
462 $class =
' mw-hidden-cats-hidden';
465 $s .=
"<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
466 $this->
msg(
'hidden-categories' )->numParams( count( $allCats[
'hidden'] ) )->escaped() .
467 $colon .
'<ul>' . $embed . implode(
"{$pop}{$embed}", $allCats[
'hidden'] ) . $pop .
'</ul>' .
471 # optional 'dmoz-like' category browser. Will be shown under the list
472 # of categories an article belong to
474 $s .=
'<br /><hr />';
476 # get a big array of the parents tree
477 $parenttree = $this->
getTitle()->getParentCategoryTree();
478 # Skin object passed by reference cause it can not be
479 # accessed under the method subfunction drawCategoryBrowser
481 # Clean out bogus first entry and sort them
482 unset( $tempout[0] );
484 # Output one per line
485 $s .= implode(
"<br />\n", $tempout );
499 foreach ( $tree
as $element => $parent ) {
500 if ( empty( $parent ) ) {
501 # element start a new list
504 # grab the others elements
508 # add our current element to the list
509 $eltitle = Title::newFromText( $element );
510 $return .=
Linker::link( $eltitle, htmlspecialchars( $eltitle->getText() ) );
524 $allCats =
$out->getCategoryLinks();
525 $showHidden = $this->
getUser()->getBoolOption(
'showhiddencats' ) ||
528 $classes = [
'catlinks' ];
529 if ( empty( $allCats[
'normal'] ) && !( !empty( $allCats[
'hidden'] ) && $showHidden ) ) {
530 $classes[] =
'catlinks-allhidden';
533 return Html::rawElement(
535 [
'id' =>
'catlinks',
'class' => $classes,
'data-mw' =>
'interface' ],
557 if ( Hooks::run(
'SkinAfterContent', [ &$data, $this ] ) ) {
560 if ( trim( $data ) !=
'' ) {
564 $data =
"<div id='mw-data-after-content'>\n" .
569 wfDebug(
"Hook SkinAfterContent changed output processing.\n" );
581 return MWDebug::getHTMLDebugLog();
593 $bottomScriptText = $this->
getOutput()->getBottomScripts();
594 Hooks::run(
'SkinAfterBottomScripts', [ $this, &$bottomScriptText ] );
596 return $bottomScriptText;
608 $canonicalUrl = $this->
getTitle()->getCanonicalURL(
'oldid=' . $oldid );
609 $url = htmlspecialchars(
wfExpandIRI( $canonicalUrl ) );
615 return $this->
msg(
'retrievedfrom' )
616 ->rawParams(
'<a dir="ltr" href="' . $url .
'">' . $url .
'</a>' )
624 $action = $this->
getRequest()->getVal(
'action',
'view' );
626 if ( $this->
getTitle()->userCan(
'deletedhistory', $this->
getUser() ) &&
627 ( !$this->
getTitle()->exists() || $action ==
'history' ) ) {
628 $n = $this->
getTitle()->isDeleted();
631 if ( $this->
getTitle()->quickUserCan(
'undelete', $this->
getUser() ) ) {
632 $msg =
'thisisdeleted';
634 $msg =
'viewdeleted';
637 return $this->
msg( $msg )->rawParams(
640 $this->
msg(
'restorelink' )->numParams( $n )->escaped() )
653 if (
$out ===
null ) {
659 if ( !Hooks::run(
'SkinSubPageSubtitle', [ &$subpages, $this,
$out ] ) ) {
663 if (
$out->isArticle() && MWNamespace::hasSubpages(
$title->getNamespace() ) ) {
664 $ptext =
$title->getPrefixedText();
665 if ( strpos( $ptext,
'/' ) !==
false ) {
666 $links = explode(
'/', $ptext );
674 $growinglink .=
$link;
676 $linkObj = Title::newFromText( $growinglink );
678 if ( is_object( $linkObj ) && $linkObj->isKnown() ) {
681 htmlspecialchars( $display )
687 $subpages .=
$lang->getDirMarkEntity() . $this->
msg(
'pipe-separator' )->escaped();
689 $subpages .=
'< ';
692 $subpages .= $getlink;
736 if (
$type ==
'detect' ) {
738 && !$this->
msg(
'history_copyright' )->inContentLanguage()->isDisabled()
746 if (
$type ==
'history' ) {
747 $msg =
'history_copyright';
769 'SkinCopyrightFooter',
773 return $this->
msg( $msg )->rawParams(
$link )->text();
791 $out .=
'<a href="' . $url .
'">';
795 $out .=
"<img src=\"$icon\" alt=\"$text\" width=\"88\" height=\"31\" />";
812 $url1 = htmlspecialchars(
813 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
815 $url1_5 = htmlspecialchars(
816 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png"
818 $url2 = htmlspecialchars(
819 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png"
821 $text =
'<a href="//www.mediawiki.org/"><img src="' . $url1
822 .
'" srcset="' . $url1_5 .
' 1.5x, ' . $url2 .
' 2x" '
823 .
'height="31" width="88" alt="Powered by MediaWiki" /></a>';
824 Hooks::run(
'SkinGetPoweredBy', [ &$text, $this ] );
836 # No cached timestamp, load it from the database
844 $s =
' ' . $this->
msg(
'lastmodifiedat', $d,
$t )->parse();
849 if (
wfGetLB()->getLaggedReplicaMode() ) {
850 $s .=
' <strong>' . $this->
msg(
'laggedslavemode' )->parse() .
'</strong>';
861 if ( $align !=
'' ) {
862 $a =
" style='float: {$align};'";
867 $mp = $this->
msg(
'mainpage' )->escaped();
868 $mptitle = Title::newMainPage();
869 $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) :
'' );
872 $s =
"<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
886 if ( is_string( $icon ) ) {
889 $url = isset( $icon[
"url"] ) ? $icon[
"url"] :
null;
890 unset( $icon[
"url"] );
891 if ( isset( $icon[
"src"] ) && $withImage ===
'withImage' ) {
893 $html = Html::element(
'img', $icon );
895 $html = htmlspecialchars( $icon[
"alt"] );
898 $html = Html::rawElement(
'a', [
"href" => $url ],
$html );
910 Title::newMainPage(),
911 $this->
msg(
'mainpage' )->escaped()
925 if ( $this->
msg( $desc )->inContentLanguage()->isDisabled() ) {
940 $this->
msg( $desc )->escaped()
950 return $this->
footerLink(
'privacy',
'privacypage' );
958 return $this->
footerLink(
'aboutsite',
'aboutpage' );
966 return $this->
footerLink(
'disclaimers',
'disclaimerpage' );
991 if ( $id instanceof
User ) {
994 $targetUser = User::newFromId( $id );
997 # The sending user must have a confirmed email address and the target
998 # user must have a confirmed email address and allow emails from users.
999 return $this->
getUser()->canSendEmail() &&
1000 $targetUser->canReceiveEmail();
1017 if ( $this->stylename ===
null ) {
1018 $class = get_class( $this );
1019 throw new MWException(
"$class::\$stylename must be set to use getSkinStylePath()" );
1022 return "$wgStylePath/{$this->stylename}/$name?$wgStyleVersion";
1032 $title = Title::newMainPage();
1035 return $title->getLocalURL( $urlaction );
1051 if ( is_null( $proto ) ) {
1052 return $title->getLocalURL( $urlaction );
1054 return $title->getFullURL( $urlaction,
false, $proto );
1066 return $title->getLocalURL( $urlaction );
1077 return $title->getLocalURL( $urlaction );
1085 static function makeUrl( $name, $urlaction =
'' ) {
1089 return $title->getLocalURL( $urlaction );
1114 $title = Title::makeTitleSafe( $namespace,
$name );
1117 return $title->getLocalURL( $urlaction );
1131 'href' =>
$title->getLocalURL( $urlaction ),
1132 'exists' =>
$title->isKnown(),
1147 'href' =>
$title->getLocalURL( $urlaction ),
1159 if ( !is_object(
$title ) ) {
1161 if ( !is_object(
$title ) ) {
1162 $title = Title::newFromText(
'--error: link target missing--' );
1192 $callback =
function ()
use ( $that ) {
1194 $that->addToSidebar( $bar,
'sidebar' );
1195 Hooks::run(
'SkinBuildSidebar', [ $that, &$bar ] );
1201 $cache = ObjectCache::getMainWANInstance();
1202 $sidebar =
$cache->getWithSetCallback(
1203 $cache->makeKey(
'sidebar', $this->getLanguage()->getCode() ),
1205 ? $cache::TTL_UNCACHEABLE
1211 $sidebar = $callback();
1215 Hooks::run(
'SidebarBeforeOutput', [ $this, &$sidebar ] );
1241 $lines = explode(
"\n", $text );
1244 $messageTitle = $this->
getConfig()->get(
'EnableSidebarCache' )
1245 ? Title::newMainPage() : $this->
getTitle();
1248 if ( strpos(
$line,
'*' ) !== 0 ) {
1253 if ( strpos(
$line,
'**' ) !== 0 ) {
1254 $heading = trim(
$line,
'* ' );
1255 if ( !array_key_exists( $heading, $bar ) ) {
1256 $bar[$heading] = [];
1261 if ( strpos(
$line,
'|' ) !==
false ) {
1263 $line = array_map(
'trim', explode(
'|',
$line, 2 ) );
1264 if ( count(
$line ) !== 2 ) {
1272 $msgLink = $this->
msg( $line[0] )->title( $messageTitle )->inContentLanguage();
1273 if ( $msgLink->exists() ) {
1274 $link = $msgLink->text();
1275 if (
$link ==
'-' ) {
1281 $msgText = $this->
msg( $line[1] )->title( $messageTitle );
1282 if ( $msgText->exists() ) {
1283 $text = $msgText->text();
1294 $extraAttribs[
'rel'] =
'nofollow';
1306 $href =
$title->getLinkURL();
1308 $href =
'INVALID-TITLE';
1312 $bar[$heading][] = array_merge( [
1315 'id' =>
'n-' . Sanitizer::escapeId( strtr(
$line[1],
' ',
'-' ),
'noninitial' ),
1334 $newMessagesAlert =
'';
1340 if ( !Hooks::run(
'GetNewMessagesAlert', [ &$newMessagesAlert,
$newtalks,
$user,
$out ] ) ) {
1343 if ( $newMessagesAlert ) {
1344 return $newMessagesAlert;
1348 $uTalkTitle =
$user->getTalkPage();
1351 if ( $lastSeenRev !==
null ) {
1354 if ( $latestRev !==
null ) {
1356 $plural = $latestRev->getParentId() !== $lastSeenRev->getId();
1357 $nofAuthors = $uTalkTitle->countAuthorsBetween(
1358 $lastSeenRev, $latestRev, 10,
'include_new' );
1364 $plural = $plural ? 999 : 1;
1370 $this->
msg(
'newmessageslinkplural' )->params( $plural )->escaped(),
1372 [
'redirect' =>
'no' ]
1377 $this->
msg(
'newmessagesdifflinkplural' )->params( $plural )->escaped(),
1379 $lastSeenRev !==
null
1380 ? [
'oldid' => $lastSeenRev->getId(),
'diff' =>
'cur' ]
1381 : [
'diff' =>
'cur' ]
1384 if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
1385 $newMessagesAlert = $this->
msg(
1386 'youhavenewmessagesfromusers',
1388 $newMessagesDiffLink
1389 )->numParams( $nofAuthors, $plural );
1392 $newMessagesAlert = $this->
msg(
1393 $nofAuthors > 10 ?
'youhavenewmessagesmanyusers' :
'youhavenewmessages',
1395 $newMessagesDiffLink
1396 )->numParams( $plural );
1398 $newMessagesAlert = $newMessagesAlert->text();
1400 $out->setCdnMaxage( 0 );
1402 $sep = $this->
msg(
'newtalkseparator' )->escaped();
1408 [
'href' => $newtalk[
'link'] ], $newtalk[
'wiki']
1411 $parts = implode( $sep, $msgs );
1412 $newMessagesAlert = $this->
msg(
'youhavenewmessagesmulti' )->rawParams( $parts )->escaped();
1413 $out->setCdnMaxage( 0 );
1416 return $newMessagesAlert;
1431 if (
$name ===
'default' ) {
1435 if ( empty( $notice ) ) {
1439 $msg = $this->
msg(
$name )->inContentLanguage();
1440 if ( $msg->isBlank() ) {
1442 } elseif ( $msg->isDisabled() ) {
1445 $notice = $msg->plain();
1451 if ( is_array( $cachedNotice ) ) {
1452 if ( md5( $notice ) == $cachedNotice[
'hash'] ) {
1453 $notice = $cachedNotice[
'html'];
1462 $parsed = $this->
getOutput()->parse( $notice );
1463 $parserMemc->set( $key, [
'html' => $parsed,
'hash' => md5( $notice ) ], 600 );
1467 $notice = Html::rawElement(
'div', [
'id' =>
'localNotice',
1480 if ( Hooks::run(
'SiteNoticeBefore', [ &$siteNotice, $this ] ) ) {
1481 if ( is_object( $this->
getUser() ) && $this->
getUser()->isLoggedIn() ) {
1485 if ( $anonNotice ===
false ) {
1488 $siteNotice = $anonNotice;
1491 if ( $siteNotice ===
false ) {
1496 Hooks::run(
'SiteNoticeAfter', [ &$siteNotice, $this ] );
1520 if ( !is_null( $tooltip ) ) {
1521 # Bug 25462: undo double-escaping.
1522 $tooltip = Sanitizer::decodeCharReferences( $tooltip );
1524 ->inLanguage(
$lang )->text();
1529 'text' =>
wfMessage(
'editsection' )->inLanguage(
$lang )->escaped(),
1530 'targetTitle' => $nt,
1532 'query' => [
'action' =>
'edit',
'section' =>
$section ],
1533 'options' => [
'noclasses',
'known' ]
1537 Hooks::run(
'SkinEditSectionLinks', [ $this, $nt,
$section, $tooltip, &$links,
$lang ] );
1539 $result =
'<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>';
1542 foreach ( $links
as $k => $linkDetails ) {
1544 $linkDetails[
'targetTitle'],
1545 $linkDetails[
'text'],
1546 $linkDetails[
'attribs'],
1547 $linkDetails[
'query'],
1548 $linkDetails[
'options']
1553 '<span class="mw-editsection-divider">'
1559 $result .=
'<span class="mw-editsection-bracket">]</span></span>';
1562 'DoEditSectionLink',
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgRightsIcon
Override for copyright metadata.
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
$wgRenderHashAppend
Append a configured value to the parser cache and the sitenotice key so that they can be kept separat...
$wgStyleVersion
Bump this number when changing the global style sheets and JavaScript.
$wgUseAjax
Enable AJAX framework.
$wgFallbackSkin
Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
$wgNoFollowLinks
If true, external URL links in wiki text will be given the rel="nofollow" attribute as a hint to sear...
$wgSiteNotice
Site notice shown at the top of each page.
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
$wgEnableWriteAPI
Allow the API to be used to perform write operations (page edits, rollback, etc.) when an authorised ...
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
$wgSidebarCacheExpiry
Expiry time for the sidebar cache, in seconds.
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
$wgEnableSidebarCache
If on, the sidebar navigation links are cached for users with the current language set.
$wgNoFollowDomainExceptions
If this is set to an array of domains, external links to these domain names (or any subdomains) will ...
$wgSkipSkins
Specify the names of skins that should not be presented in the list of available skins in user prefer...
$wgDefaultSkin
Default skin, for new users and anonymous visitors.
$wgSquidMaxage
Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
$wgUseCategoryBrowser
Use experimental, DMOZ-like category browser.
$wgExternalLinkTarget
Set a default target for external links, e.g.
$wgEnableAPI
Enable the MediaWiki API for convenient access to machine-readable data via api.php.
$wgStylePath
The URL path of the skins directory.
$wgLogo
The URL path of the wiki logo.
$wgRightsPage
Override for copyright metadata.
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetLB( $wiki=false)
Get a load balancer object.
wfExpandIRI( $url)
Take a URL, make sure it's expanded to fully qualified, and replace any encoded non-ASCII Unicode cha...
wfMemcKey()
Make a cache key for the local wiki.
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
wfMatchesDomainList( $url, $domains)
Check whether a given URL has a domain that occurs in a given set of domains.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
getUser()
Get the User object.
getRequest()
Get the WebRequest object.
getConfig()
Get the Config object.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
getTitle()
Get the Title object.
getOutput()
Get the OutputPage object.
getLanguage()
Get the Language object.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
static singleton()
Get the signleton instance of this class.
This class should be covered by a general architecture document which does not exist as of January 20...
static getLegacyModules()
static makeConfigSetScript(array $configuration)
Returns JS code which will set the MediaWiki configuration array to the given value.
static makeInlineScript( $script)
Construct an inline script tag with given JS code.
static getTimestampFromId( $title, $id, $flags=0)
Get rev_timestamp from rev_id, without loading the rest of the row.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
The main skin class which provides methods and properties for all other skins.
aboutLink()
Gets the link to the wiki's about page.
isRevisionCurrent()
Whether the revision displayed is the latest revision of the page.
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
afterContentHook()
This runs a hook to allow extensions placing their stuff after content and article metadata (e....
string $stylename
Stylesheets set to use.
getNewtalks()
Gets new talk page messages for the current user and returns an appropriate alert message (or an empt...
mainPageLink()
Gets the link to the wiki's main page.
static getAllowedSkins()
Fetch the list of user-selectable skins in regards to $wgSkipSkins.
getSkinStylePath( $name)
Return a fully resolved style path url to images or styles stored in the current skins's folder.
getCachedNotice( $name)
Get a cached notice.
static makeMainPageUrl( $urlaction='')
static makeKnownUrlDetails( $name, $urlaction='')
Make URL details where the article exists (or at least it's convenient to think so)
generateDebugHTML()
Generate debug data HTML for displaying at the bottom of the main content area.
privacyLink()
Gets the link to the wiki's privacy policy page.
getSiteNotice()
Get the site notice.
getHtmlElementAttributes()
Return values for <html> element.
static getSkinNames()
Fetch the set of available skins.
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.
getPoweredBy()
Gets the powered by MediaWiki icon.
static makeUrlDetails( $name, $urlaction='')
these return an array with the 'href' and boolean 'exists'
getLogo()
URL to the logo.
addToSidebar(&$bar, $message)
Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used ...
static makeSpecialUrlSubpage( $name, $subpage, $urlaction='')
getRelevantUser()
Return the "relevant" user.
setRelevantTitle( $t)
Set the "relevant" title.
addToBodyAttributes( $out, &$bodyAttrs)
This will be called by OutputPage::headElement when it is creating the "<body>" tag,...
drawCategoryBrowser( $tree)
Render the array as a series of links.
static checkTitle(&$title, $name)
make sure we have some title to operate on
static makeUrl( $name, $urlaction='')
getPageClasses( $title)
TODO: document.
editUrlOptions()
Return URL options for the 'edit page' link.
static makeVariablesScript( $data)
static makeNSUrl( $name, $urlaction='', $namespace=NS_MAIN)
this can be passed the NS number as defined in Language.php
buildSidebar()
Build an array that represents the sidebar(s), the navigation bar among them.
getCopyright( $type='detect')
printSource()
Text with the permalink to the source page, usually shown on the footer of a printed page.
setRelevantUser( $u)
Set the "relevant" user.
setupSkinUserCss(OutputPage $out)
Add skin specific stylesheets Calling this method with an $out of anything but the same OutputPage in...
static getSkinNameMessages()
Fetch the skinname messages for available skins.
makeFooterIcon( $icon, $withImage='withImage')
Renders a $wgFooterIcons icon according to the method's arguments.
getRevisionId()
Get the current revision ID.
preloadExistence()
Preload the existence of three commonly-requested pages in a single query.
bottomScripts()
This gets called shortly before the "</body>" tag.
outputPage(OutputPage $out=null)
Outputs the HTML generated by other functions.
doEditSectionLink(Title $nt, $section, $tooltip=null, $lang=false)
Create a section edit link.
disclaimerLink()
Gets the link to the wiki's general disclaimers page.
getDefaultModules()
Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wish...
static makeSpecialUrl( $name, $urlaction='', $proto=null)
Make a URL for a Special Page using the given query and protocol.
lastModified()
Get the timestamp of the latest revision, formatted in user language.
initPage(OutputPage $out)
static getDynamicStylesheetQuery()
Get the query to generate a dynamic stylesheet.
subPageSubtitle( $out=null)
addToSidebarPlain(&$bar, $text)
Add content from plain text.
footerLink( $desc, $page)
Returns an HTML link for use in the footer.
static makeI18nUrl( $name, $urlaction='')
getRelevantTitle()
Return the "relevant" title.
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
when a variable name is used in a it is silently declared as a new local masking the global
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
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
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
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 "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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 true
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
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
usually copyright or history_copyright This message must be in HTML not wikitext & $link
if the prop value should be in the metadata multi language array can modify can modify indexed by page_id indexed by prefixed DB keys can modify can modify can modify this should be populated with an alert message to that effect $newtalks
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 after processing & $attribs
Allows to change the fields on the form that will be generated $name
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
controlled by $wgMainCacheType * $parserMemc
if(!isset( $args[0])) $lang