24use Wikimedia\WrappedString;
25use Wikimedia\WrappedStringList;
58 return SkinFactory::getDefaultInstance()->getSkinNames();
67 foreach ( self::getSkinNames() as $skinKey => $skinName ) {
83 $allowedSkins = self::getSkinNames();
86 unset( $allowedSkins[$skip] );
104 $skinNames = self::getSkinNames();
107 $skinNames = array_change_key_case( $skinNames, CASE_LOWER );
108 $key = strtolower( $key );
112 if ( $key ==
'' || $key ==
'default' ) {
118 if ( isset( $skinNames[$key] ) ) {
133 if ( isset( $skinNames[$key] ) ) {
135 } elseif ( isset( $skinNames[$defaultSkin] ) ) {
138 return $fallbackSkin;
156 return $this->skinname;
190 'mediawiki.legacy.shared',
191 'mediawiki.legacy.commonPrint',
198 'mediawiki.page.startup',
203 'mediawiki.page.ready',
216 if ( strpos(
$out->getHTML(),
'sortable' ) !==
false ) {
217 $modules[
'content'][] =
'jquery.tablesorter';
221 if ( strpos(
$out->getHTML(),
'mw-collapsible' ) !==
false ) {
222 $modules[
'content'][] =
'jquery.makeCollapsible';
223 $modules[
'styles'][
'content'][] =
'jquery.makeCollapsible.styles';
228 if ( strpos(
$out->getHTML(),
'mw-ui-button' ) !==
false ) {
229 $modules[
'styles'][
'content'][] =
'mediawiki.ui.button';
232 if (
$out->isTOCEnabled() ) {
233 $modules[
'content'][] =
'mediawiki.toc';
234 $modules[
'styles'][
'content'][] =
'mediawiki.toc.styles';
238 if ( $user->isLoggedIn()
239 && $user->isAllowedAll(
'writeapi',
'viewmywatchlist',
'editmywatchlist' )
240 && $this->getRelevantTitle()->canExist()
242 $modules[
'watch'][] =
'mediawiki.page.watch.ajax';
245 $modules[
'search'][] =
'mediawiki.searchSuggest';
247 if ( $user->getBoolOption(
'editsectiononrightclick' ) ) {
248 $modules[
'user'][] =
'mediawiki.action.view.rightClickEdit';
252 if (
$out->isArticle() && $user->getOption(
'editondblclick' ) ) {
253 $modules[
'user'][] =
'mediawiki.action.view.dblClickEdit';
256 if (
$out->isSyndicated() ) {
257 $modules[
'styles'][
'syndicate'][] =
'mediawiki.feedlink';
271 if ( $user->isLoggedIn() ) {
272 $titles[] = $user->getUserPage();
273 $titles[] = $user->getTalkPage();
278 if ( $title->canExist() ) {
279 if ( $title->isTalkPage() ) {
280 $titles[] = $title->getSubjectPage();
282 $titles[] = $title->getTalkPage();
297 Hooks::run(
'SkinPreloadExistence', [ &
$titles, $this ] );
301 $lb->setCaller( __METHOD__ );
312 return $this->
getOutput()->getRevisionId();
322 return $revID == 0 || $revID == $this->
getTitle()->getLatestRevID();
331 $this->mRelevantTitle =
$t;
345 if ( isset( $this->mRelevantTitle ) ) {
346 return $this->mRelevantTitle;
357 $this->mRelevantUser = $u;
369 if ( isset( $this->mRelevantUser ) ) {
370 return $this->mRelevantUser;
373 if ( $title->hasSubjectNamespace( NS_USER ) ) {
374 $rootUser = $title->getRootText();
381 $user->load( User::READ_NORMAL );
383 if ( $user->isLoggedIn() ) {
384 $this->mRelevantUser =
$user;
388 return $this->mRelevantUser;
423 'ctype' =>
'text/css',
443 $numeric =
'ns-' . $title->getNamespace();
445 if ( $title->isSpecialPage() ) {
446 $type =
'ns-special';
448 list( $canonicalName ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
449 resolveAlias( $title->getDBkey() );
450 if ( $canonicalName ) {
451 $type .=
' ' . Sanitizer::escapeClass(
"mw-special-$canonicalName" );
453 $type .=
' mw-invalidspecialpage';
455 } elseif ( $title->isTalkPage() ) {
458 $type =
'ns-subject';
461 $name = Sanitizer::escapeClass(
'page-' . $title->getPrefixedText() );
462 $root = Sanitizer::escapeClass(
'rootpage-' . $title->getRootTitle()->getPrefixedText() );
464 return "$numeric $type $name $root";
474 'lang' =>
$lang->getHtmlCode(),
475 'dir' =>
$lang->getDir(),
476 'class' =>
'client-nojs',
520 $allCats =
$out->getCategoryLinks();
522 if ( !count( $allCats ) ) {
530 $colon = $this->
msg(
'colon-separator' )->escaped();
532 if ( !empty( $allCats[
'normal'] ) ) {
533 $t = $embed . implode(
"{$pop}{$embed}", $allCats[
'normal'] ) . $pop;
535 $msg = $this->
msg(
'pagecategories' )->numParams( count( $allCats[
'normal'] ) )->escaped();
536 $linkPage = $this->
msg(
'pagecategorieslink' )->inContentLanguage()->text();
537 $title = Title::newFromText( $linkPage );
539 $s .=
'<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
540 $link . $colon .
'<ul>' .
$t .
'</ul>' .
'</div>';
544 if ( isset( $allCats[
'hidden'] ) ) {
545 if ( $this->
getUser()->getBoolOption(
'showhiddencats' ) ) {
546 $class =
' mw-hidden-cats-user-shown';
548 $class =
' mw-hidden-cats-ns-shown';
550 $class =
' mw-hidden-cats-hidden';
553 $s .=
"<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
554 $this->
msg(
'hidden-categories' )->numParams( count( $allCats[
'hidden'] ) )->escaped() .
555 $colon .
'<ul>' . $embed . implode(
"{$pop}{$embed}", $allCats[
'hidden'] ) . $pop .
'</ul>' .
559 # optional 'dmoz-like' category browser. Will be shown under the list
560 # of categories an article belong to
562 $s .=
'<br /><hr />';
564 # get a big array of the parents tree
565 $parenttree = $this->
getTitle()->getParentCategoryTree();
566 # Skin object passed by reference cause it can not be
567 # accessed under the method subfunction drawCategoryBrowser
569 # Clean out bogus first entry and sort them
570 unset( $tempout[0] );
572 # Output one per line
573 $s .= implode(
"<br />\n", $tempout );
587 foreach ( $tree as $element =>
$parent ) {
589 # element start a new list
592 # grab the others elements
596 # add our current element to the list
597 $eltitle = Title::newFromText( $element );
598 $return .=
Linker::link( $eltitle, htmlspecialchars( $eltitle->getText() ) );
612 $allCats =
$out->getCategoryLinks();
613 $showHidden = $this->
getUser()->getBoolOption(
'showhiddencats' ) ||
616 $classes = [
'catlinks' ];
617 if ( empty( $allCats[
'normal'] ) && !( !empty( $allCats[
'hidden'] ) && $showHidden ) ) {
618 $classes[] =
'catlinks-allhidden';
621 return Html::rawElement(
623 [
'id' =>
'catlinks',
'class' => $classes,
'data-mw' =>
'interface' ],
645 if ( Hooks::run(
'SkinAfterContent', [ &$data, $this ] ) ) {
648 if ( trim( $data ) !=
'' ) {
652 $data =
"<div id='mw-data-after-content'>\n" .
657 wfDebug(
"Hook SkinAfterContent changed output processing.\n" );
669 return MWDebug::getHTMLDebugLog();
681 $chunks = [ $this->
getOutput()->getBottomScripts() ];
686 Hooks::run(
'SkinAfterBottomScripts', [ $this, &$extraHtml ] );
687 if ( $extraHtml !==
'' ) {
688 $chunks[] = $extraHtml;
690 return WrappedString::join(
"\n", $chunks );
702 $canonicalUrl = $this->
getTitle()->getCanonicalURL(
'oldid=' . $oldid );
703 $url = htmlspecialchars(
wfExpandIRI( $canonicalUrl ) );
709 return $this->
msg(
'retrievedfrom' )
710 ->rawParams(
'<a dir="ltr" href="' . $url .
'">' . $url .
'</a>' )
718 $action = $this->
getRequest()->getVal(
'action',
'view' );
720 if ( $this->
getTitle()->userCan(
'deletedhistory', $this->
getUser() ) &&
721 ( !$this->
getTitle()->exists() || $action ==
'history' ) ) {
722 $n = $this->
getTitle()->isDeleted();
725 if ( $this->
getTitle()->quickUserCan(
'undelete', $this->
getUser() ) ) {
726 $msg =
'thisisdeleted';
728 $msg =
'viewdeleted';
731 return $this->
msg( $msg )->rawParams(
733 SpecialPage::getTitleFor(
'Undelete', $this->
getTitle()->getPrefixedDBkey() ),
734 $this->
msg(
'restorelink' )->numParams( $n )->escaped() )
747 if (
$out ===
null ) {
750 $title =
$out->getTitle();
753 if ( !Hooks::run(
'SkinSubPageSubtitle', [ &$subpages, $this,
$out ] ) ) {
757 if (
$out->isArticle() && MWNamespace::hasSubpages( $title->getNamespace() ) ) {
758 $ptext = $title->getPrefixedText();
759 if ( strpos( $ptext,
'/' ) !==
false ) {
760 $links = explode(
'/', $ptext );
767 foreach ( $links as
$link ) {
768 $growinglink .=
$link;
770 $linkObj = Title::newFromText( $growinglink );
772 if ( is_object( $linkObj ) && $linkObj->isKnown() ) {
775 htmlspecialchars( $display )
781 $subpages .=
$lang->getDirMarkEntity() . $this->
msg(
'pipe-separator' )->escaped();
783 $subpages .=
'< ';
786 $subpages .= $getlink;
803 $searchPage = SpecialPage::getTitleFor(
'Search' );
821 if (
$type ==
'detect' ) {
823 && !$this->
msg(
'history_copyright' )->inContentLanguage()->isDisabled()
831 if (
$type ==
'history' ) {
832 $msg =
'history_copyright';
854 'SkinCopyrightFooter',
858 return $this->
msg( $msg )->rawParams(
$link )->text();
876 $out .=
'<a href="' . $url .
'">';
880 $out .=
"<img src=\"$icon\" alt=\"$text\" width=\"88\" height=\"31\" />";
897 $url1 = htmlspecialchars(
898 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
900 $url1_5 = htmlspecialchars(
901 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png"
903 $url2 = htmlspecialchars(
904 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png"
906 $text =
'<a href="//www.mediawiki.org/"><img src="' . $url1
907 .
'" srcset="' . $url1_5 .
' 1.5x, ' . $url2 .
' 2x" '
908 .
'height="31" width="88" alt="Powered by MediaWiki" /></a>';
909 Hooks::run(
'SkinGetPoweredBy', [ &$text, $this ] );
919 $timestamp = $this->
getOutput()->getRevisionTimestamp();
921 # No cached timestamp, load it from the database
922 if ( $timestamp ===
null ) {
929 $s =
' ' . $this->
msg(
'lastmodifiedat', $d,
$t )->parse();
934 if ( MediaWikiServices::getInstance()->getDBLoadBalancer()->getLaggedReplicaMode() ) {
935 $s .=
' <strong>' . $this->
msg(
'laggedslavemode' )->parse() .
'</strong>';
946 if ( $align !=
'' ) {
947 $a =
" style='float: {$align};'";
952 $mp = $this->
msg(
'mainpage' )->escaped();
953 $mptitle = Title::newMainPage();
954 $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) :
'' );
957 $s =
"<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
971 if ( is_string( $icon ) ) {
974 $url = $icon[
"url"] ??
null;
975 unset( $icon[
"url"] );
976 if ( isset( $icon[
"src"] ) && $withImage ===
'withImage' ) {
978 $html = Html::element(
'img', $icon );
980 $html = htmlspecialchars( $icon[
"alt"] );
984 $html = Html::rawElement(
'a',
998 Title::newMainPage(),
999 $this->
msg(
'mainpage' )->escaped()
1019 $this->
msg( $desc )->escaped()
1030 if ( $this->
msg( $desc )->inContentLanguage()->isDisabled() ) {
1037 $title = Title::newFromText( $this->
msg( $page )->inContentLanguage()->
text() );
1039 return $title ?:
null;
1047 return $this->
footerLink(
'privacy',
'privacypage' );
1055 return $this->
footerLink(
'aboutsite',
'aboutpage' );
1063 return $this->
footerLink(
'disclaimers',
'disclaimerpage' );
1088 if ( $id instanceof
User ) {
1094 # The sending user must have a confirmed email address and the receiving
1095 # user must accept emails from the sender.
1096 return $this->
getUser()->canSendEmail()
1114 if ( $this->stylename ===
null ) {
1115 $class = static::class;
1116 throw new MWException(
"$class::\$stylename must be set to use getSkinStylePath()" );
1119 return "$wgStylePath/{$this->stylename}/$name";
1129 $title = Title::newMainPage();
1130 self::checkTitle( $title,
'' );
1132 return $title->getLinkURL( $urlaction );
1147 $title = SpecialPage::getSafeTitleFor( $name );
1148 if ( is_null( $proto ) ) {
1149 return $title->getLocalURL( $urlaction );
1151 return $title->getFullURL( $urlaction,
false, $proto );
1162 $title = SpecialPage::getSafeTitleFor( $name, $subpage );
1163 return $title->getLocalURL( $urlaction );
1172 $title = Title::newFromText(
wfMessage( $name )->inContentLanguage()->
text() );
1173 self::checkTitle( $title, $name );
1174 return $title->getLocalURL( $urlaction );
1182 static function makeUrl( $name, $urlaction =
'' ) {
1183 $title = Title::newFromText( $name );
1184 self::checkTitle( $title, $name );
1186 return $title->getLocalURL( $urlaction );
1199 return self::makeUrl( $name );
1211 $title = Title::makeTitleSafe( $namespace, $name );
1212 self::checkTitle( $title, $name );
1214 return $title->getLocalURL( $urlaction );
1224 $title = Title::newFromText( $name );
1225 self::checkTitle( $title, $name );
1228 'href' => $title->getLocalURL( $urlaction ),
1229 'exists' => $title->isKnown(),
1240 $title = Title::newFromText( $name );
1241 self::checkTitle( $title, $name );
1244 'href' => $title->getLocalURL( $urlaction ),
1256 if ( !is_object( $title ) ) {
1257 $title = Title::newFromText( $name );
1258 if ( !is_object( $title ) ) {
1259 $title = Title::newFromText(
'--error: link target missing--' );
1288 $callback =
function ( $old =
null, &$ttl = null ) {
1291 Hooks::run(
'SkinBuildSidebar', [ $this, &$bar ] );
1292 if ( MessageCache::singleton()->isDisabled() ) {
1293 $ttl = WANObjectCache::TTL_UNCACHEABLE;
1299 $msgCache = MessageCache::singleton();
1300 $wanCache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1303 ? $wanCache->getWithSetCallback(
1304 $wanCache->makeKey(
'sidebar', $this->getLanguage()->getCode() ),
1311 $msgCache->getCheckKey( $this->getLanguage()->getCode() )
1319 Hooks::run(
'SidebarBeforeOutput', [ $this, &$sidebar ] );
1345 $lines = explode(
"\n", $text );
1348 $messageTitle = $this->
getConfig()->get(
'EnableSidebarCache' )
1349 ? Title::newMainPage() : $this->
getTitle();
1352 if ( strpos(
$line,
'*' ) !== 0 ) {
1357 if ( strpos(
$line,
'**' ) !== 0 ) {
1358 $heading = trim(
$line,
'* ' );
1359 if ( !array_key_exists( $heading, $bar ) ) {
1360 $bar[$heading] = [];
1365 if ( strpos(
$line,
'|' ) !==
false ) {
1366 $line = MessageCache::singleton()->transform(
$line,
false,
null, $messageTitle );
1367 $line = array_map(
'trim', explode(
'|',
$line, 2 ) );
1368 if ( count(
$line ) !== 2 ) {
1376 $msgLink = $this->
msg(
$line[0] )->title( $messageTitle )->inContentLanguage();
1377 if ( $msgLink->exists() ) {
1378 $link = $msgLink->text();
1379 if (
$link ==
'-' ) {
1385 $msgText = $this->
msg(
$line[1] )->title( $messageTitle );
1386 if ( $msgText->exists() ) {
1387 $text = $msgText->text();
1398 $extraAttribs[
'rel'] =
'nofollow';
1406 $title = Title::newFromText(
$link );
1409 $title = $title->fixSpecialName();
1410 $href = $title->getLinkURL();
1412 $href =
'INVALID-TITLE';
1416 $bar[$heading][] = array_merge( [
1419 'id' => Sanitizer::escapeIdForAttribute(
'n-' . strtr(
$line[1],
' ',
'-' ) ),
1437 $newMessagesAlert =
'';
1439 $newtalks = $user->getNewMessageLinks();
1443 if ( !Hooks::run(
'GetNewMessagesAlert', [ &$newMessagesAlert,
$newtalks, $user,
$out ] ) ) {
1446 if ( $newMessagesAlert ) {
1447 return $newMessagesAlert;
1451 $uTalkTitle = $user->getTalkPage();
1452 $lastSeenRev =
$newtalks[0][
'rev'] ??
null;
1454 if ( $lastSeenRev !==
null ) {
1457 if ( $latestRev !==
null ) {
1459 $plural = $latestRev->getParentId() !== $lastSeenRev->getId();
1460 $nofAuthors = $uTalkTitle->countAuthorsBetween(
1461 $lastSeenRev, $latestRev, 10,
'include_new' );
1467 $plural = $plural ? 999 : 1;
1473 $this->
msg(
'newmessageslinkplural' )->params( $plural )->escaped(),
1475 $uTalkTitle->isRedirect() ? [
'redirect' =>
'no' ] : []
1480 $this->
msg(
'newmessagesdifflinkplural' )->params( $plural )->escaped(),
1482 $lastSeenRev !==
null
1483 ? [
'oldid' => $lastSeenRev->getId(),
'diff' =>
'cur' ]
1484 : [
'diff' =>
'cur' ]
1487 if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
1488 $newMessagesAlert = $this->
msg(
1489 'youhavenewmessagesfromusers',
1491 $newMessagesDiffLink
1492 )->numParams( $nofAuthors, $plural );
1495 $newMessagesAlert = $this->
msg(
1496 $nofAuthors > 10 ?
'youhavenewmessagesmanyusers' :
'youhavenewmessages',
1498 $newMessagesDiffLink
1499 )->numParams( $plural );
1501 $newMessagesAlert = $newMessagesAlert->text();
1503 $out->setCdnMaxage( 0 );
1505 $sep = $this->
msg(
'newtalkseparator' )->escaped();
1509 $msgs[] = Xml::element(
1511 [
'href' => $newtalk[
'link'] ], $newtalk[
'wiki']
1514 $parts = implode( $sep, $msgs );
1515 $newMessagesAlert = $this->
msg(
'youhavenewmessagesmulti' )->rawParams( $parts )->escaped();
1516 $out->setCdnMaxage( 0 );
1519 return $newMessagesAlert;
1534 if ( $name ===
'default' ) {
1538 if ( empty( $notice ) ) {
1542 $msg = $this->
msg( $name )->inContentLanguage();
1543 if ( $msg->isBlank() ) {
1545 } elseif ( $msg->isDisabled() ) {
1548 $notice = $msg->plain();
1551 $services = MediaWikiServices::getInstance();
1553 $parsed =
$cache->getWithSetCallback(
1559 function () use ( $notice ) {
1560 return $this->
getOutput()->parse( $notice );
1564 $contLang =
$services->getContentLanguage();
1565 return Html::rawElement(
1568 'id' =>
'localNotice',
1569 'lang' => $contLang->getHtmlCode(),
1570 'dir' => $contLang->getDir()
1584 if ( Hooks::run(
'SiteNoticeBefore', [ &$siteNotice, $this ] ) ) {
1585 if ( is_object( $this->
getUser() ) && $this->
getUser()->isLoggedIn() ) {
1589 if ( $anonNotice ===
false ) {
1592 $siteNotice = $anonNotice;
1595 if ( $siteNotice ===
false ) {
1600 Hooks::run(
'SiteNoticeAfter', [ &$siteNotice, $this ] );
1624 wfDeprecated( __METHOD__ .
' with other type than Language for $lang',
'1.32' );
1629 if ( !is_null( $tooltip ) ) {
1630 $attribs[
'title'] = $this->
msg(
'editsectionhint' )->rawParams( $tooltip )
1631 ->inLanguage(
$lang )->text();
1636 'text' => $this->
msg(
'editsection' )->inLanguage(
$lang )->escaped(),
1637 'targetTitle' => $nt,
1639 'query' => [
'action' =>
'edit',
'section' =>
$section ],
1640 'options' => [
'noclasses',
'known' ]
1644 Hooks::run(
'SkinEditSectionLinks', [ $this, $nt,
$section, $tooltip, &$links,
$lang ] );
1646 $result =
'<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>';
1649 foreach ( $links as $k => $linkDetails ) {
1651 $linkDetails[
'targetTitle'],
1652 $linkDetails[
'text'],
1653 $linkDetails[
'attribs'],
1654 $linkDetails[
'query'],
1655 $linkDetails[
'options']
1660 '<span class="mw-editsection-divider">'
1661 . $this->
msg(
'pipe-separator' )->inLanguage(
$lang )->escaped()
1666 $result .=
'<span class="mw-editsection-bracket">]</span></span>';
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
$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...
$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.
$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.
$wgUseCategoryBrowser
Use experimental, DMOZ-like category browser.
$wgExternalLinkTarget
Set a default target for external links, e.g.
$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.
wfExpandIRI( $url)
Take a URL, make sure it's expanded to fully qualified, and replace any encoded non-ASCII Unicode cha...
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 ...
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
Internationalisation code.
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.
This class should be covered by a general architecture document which does not exist as of January 20...
static makeInlineScript( $script, $nonce=null)
Returns an HTML script tag that runs given JS code after startup and base modules.
static makeConfigSetScript(array $configuration)
Returns JS code which will set the MediaWiki configuration array to the given value.
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 skin'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.
footerLinkTitle( $desc, $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 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.
shouldPreloadLogo()
Whether the logo should be preloaded with an HTTP link header or not.
setRelevantUser( $u)
Set the "relevant" user.
setupSkinUserCss(OutputPage $out)
Hook point for adding style modules to OutputPage.
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.
__construct( $skinname=null)
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.
static makeVariablesScript( $data, $nonce=null)
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 validateTarget( $target, User $sender=null)
Validate target User.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromId( $id)
Static factory method for creation from a given user ID.
static isIP( $name)
Does the string match an anonymous IP address?
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
namespace being checked & $result
the value of this variable comes from LanguageConverter indexed by page_id indexed by prefixed DB keys on which the links will be shown 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 & $options
namespace and then decline to actually register it file or subcat img or subcat $title
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
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
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 use $formDescriptor instead 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
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
Allows to change the fields on the form that will be generated $name
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
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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
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
if(!isset( $args[0])) $lang