Go to the documentation of this file.
59 foreach ( self::getSkinNames()
as $skinKey => $skinName ) {
78 unset( $allowedSkins[$skip] );
94 global $wgDefaultSkin, $wgFallbackSkin;
99 $skinNames = array_change_key_case( $skinNames, CASE_LOWER );
100 $key = strtolower( $key );
101 $defaultSkin = strtolower( $wgDefaultSkin );
102 $fallbackSkin = strtolower( $wgFallbackSkin );
104 if ( $key ==
'' || $key ==
'default' ) {
110 if ( isset( $skinNames[$key] ) ) {
125 if ( isset( $skinNames[$key] ) ) {
127 } elseif ( isset( $skinNames[$defaultSkin] ) ) {
130 return $fallbackSkin;
158 global $wgUseAjax, $wgEnableAPI, $wgEnableWriteAPI;
165 'mediawiki.page.ready',
176 if ( strpos(
$out->getHTML(),
'sortable' ) !==
false ) {
177 $modules[
'content'][] =
'jquery.tablesorter';
181 if ( strpos(
$out->getHTML(),
'mw-collapsible' ) !==
false ) {
182 $modules[
'content'][] =
'jquery.makeCollapsible';
186 if ( $wgUseAjax && $wgEnableAPI ) {
187 if ( $wgEnableWriteAPI &&
$user->isLoggedIn()
188 &&
$user->isAllowedAll(
'writeapi',
'viewmywatchlist',
'editmywatchlist' )
191 $modules[
'watch'][] =
'mediawiki.page.watch.ajax';
194 $modules[
'search'][] =
'mediawiki.searchSuggest';
197 if (
$user->getBoolOption(
'editsectiononrightclick' ) ) {
198 $modules[
'user'][] =
'mediawiki.action.view.rightClickEdit';
202 if (
$out->isArticle() &&
$user->getOption(
'editondblclick' ) ) {
203 $modules[
'user'][] =
'mediawiki.action.view.dblClickEdit';
216 if (
$user->isLoggedIn() ) {
223 if (
$title->canExist() ) {
224 if (
$title->isTalkPage() ) {
246 $lb->setCaller( __METHOD__ );
257 return $this->
getOutput()->getRevisionId();
267 return $revID == 0 || $revID == $this->
getTitle()->getLatestRevID();
276 $this->mRelevantTitle =
$t;
290 if ( isset( $this->mRelevantTitle ) ) {
302 $this->mRelevantUser = $u;
314 if ( isset( $this->mRelevantUser ) ) {
319 $rootUser =
$title->getRootText();
326 $user->load( User::READ_NORMAL );
328 if (
$user->isLoggedIn() ) {
329 $this->mRelevantUser =
$user;
350 return ResourceLoader::makeInlineScript(
351 ResourceLoader::makeConfigSetScript( $data )
369 'usemsgcache' =>
'yes',
370 'ctype' =>
'text/css',
391 $numeric =
'ns-' .
$title->getNamespace();
393 if (
$title->isSpecialPage() ) {
394 $type =
'ns-special';
397 if ( $canonicalName ) {
398 $type .=
' ' . Sanitizer::escapeClass(
"mw-special-$canonicalName" );
400 $type .=
' mw-invalidspecialpage';
402 } elseif (
$title->isTalkPage() ) {
405 $type =
'ns-subject';
408 $name = Sanitizer::escapeClass(
'page-' .
$title->getPrefixedText() );
409 $root = Sanitizer::escapeClass(
'rootpage-' .
$title->getRootTitle()->getPrefixedText() );
411 return "$numeric $type $name $root";
421 'lang' =>
$lang->getHtmlCode(),
422 'dir' =>
$lang->getDir(),
423 'class' =>
'client-nojs',
451 global $wgUseCategoryBrowser;
454 $allCats =
$out->getCategoryLinks();
456 if ( !
count( $allCats ) ) {
464 $colon = $this->
msg(
'colon-separator' )->escaped();
466 if ( !empty( $allCats[
'normal'] ) ) {
467 $t = $embed . implode(
"{$pop}{$embed}", $allCats[
'normal'] ) . $pop;
469 $msg = $this->
msg(
'pagecategories' )->numParams(
count( $allCats[
'normal'] ) )->escaped();
470 $linkPage =
wfMessage(
'pagecategorieslink' )->inContentLanguage()->text();
473 $s .=
'<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
474 $link . $colon .
'<ul>' .
$t .
'</ul>' .
'</div>';
478 if ( isset( $allCats[
'hidden'] ) ) {
479 if ( $this->
getUser()->getBoolOption(
'showhiddencats' ) ) {
480 $class =
' mw-hidden-cats-user-shown';
482 $class =
' mw-hidden-cats-ns-shown';
484 $class =
' mw-hidden-cats-hidden';
487 $s .=
"<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
488 $this->
msg(
'hidden-categories' )->numParams(
count( $allCats[
'hidden'] ) )->escaped() .
489 $colon .
'<ul>' . $embed . implode(
"{$pop}{$embed}", $allCats[
'hidden'] ) . $pop .
'</ul>' .
493 # optional 'dmoz-like' category browser. Will be shown under the list
494 # of categories an article belong to
495 if ( $wgUseCategoryBrowser ) {
496 $s .=
'<br /><hr />';
498 # get a big array of the parents tree
499 $parenttree = $this->
getTitle()->getParentCategoryTree();
500 # Skin object passed by reference cause it can not be
501 # accessed under the method subfunction drawCategoryBrowser
503 # Clean out bogus first entry and sort them
504 unset( $tempout[0] );
506 # Output one per line
507 $s .= implode(
"<br />\n", $tempout );
521 foreach ( $tree
as $element => $parent ) {
522 if ( empty( $parent ) ) {
523 # element start a new list
526 # grab the others elements
530 # add our current element to the list
532 $return .=
Linker::link( $eltitle, htmlspecialchars( $eltitle->getText() ) );
546 $allCats =
$out->getCategoryLinks();
547 $showHidden = $this->
getUser()->getBoolOption(
'showhiddencats' ) ||
550 $classes = [
'catlinks' ];
551 if ( empty( $allCats[
'normal'] ) && !( !empty( $allCats[
'hidden'] ) && $showHidden ) ) {
552 $classes[] =
'catlinks-allhidden';
557 [
'id' =>
'catlinks',
'class' => $classes,
'data-mw' =>
'interface' ],
579 if (
Hooks::run(
'SkinAfterContent', [ &$data, $this ] ) ) {
582 if ( trim( $data ) !=
'' ) {
586 $data =
"<div id='mw-data-after-content'>\n" .
591 wfDebug(
"Hook SkinAfterContent changed output processing.\n" );
615 $bottomScriptText = $this->
getOutput()->getBottomScripts();
616 Hooks::run(
'SkinAfterBottomScripts', [ $this, &$bottomScriptText ] );
618 return $bottomScriptText;
630 $canonicalUrl = $this->
getTitle()->getCanonicalURL(
'oldid=' . $oldid );
631 $url = htmlspecialchars(
wfExpandIRI( $canonicalUrl ) );
637 return $this->
msg(
'retrievedfrom' )
638 ->rawParams(
'<a dir="ltr" href="' . $url .
'">' . $url .
'</a>' )
646 $action = $this->
getRequest()->getVal(
'action',
'view' );
648 if ( $this->
getTitle()->userCan(
'deletedhistory', $this->
getUser() ) &&
649 ( !$this->
getTitle()->exists() || $action ==
'history' ) ) {
650 $n = $this->
getTitle()->isDeleted();
653 if ( $this->
getTitle()->quickUserCan(
'undelete', $this->
getUser() ) ) {
654 $msg =
'thisisdeleted';
656 $msg =
'viewdeleted';
659 return $this->
msg( $msg )->rawParams(
662 $this->
msg(
'restorelink' )->numParams( $n )->escaped() )
675 if (
$out ===
null ) {
681 if ( !
Hooks::run(
'SkinSubPageSubtitle', [ &$subpages, $this,
$out ] ) ) {
686 $ptext =
$title->getPrefixedText();
687 if ( strpos( $ptext,
'/' ) !==
false ) {
688 $links = explode(
'/', $ptext );
696 $growinglink .=
$link;
700 if ( is_object( $linkObj ) && $linkObj->isKnown() ) {
703 htmlspecialchars( $display )
709 $subpages .=
$lang->getDirMarkEntity() . $this->
msg(
'pipe-separator' )->escaped();
711 $subpages .=
'< ';
714 $subpages .= $getlink;
741 return $searchPage->getLocalURL();
756 global $wgRightsPage, $wgRightsUrl, $wgRightsText;
758 if (
$type ==
'detect' ) {
760 && !$this->
msg(
'history_copyright' )->inContentLanguage()->isDisabled()
768 if (
$type ==
'history' ) {
769 $msg =
'history_copyright';
774 if ( $wgRightsPage ) {
777 } elseif ( $wgRightsUrl ) {
779 } elseif ( $wgRightsText ) {
780 $link = $wgRightsText;
791 'SkinCopyrightFooter',
795 return $this->
msg( $msg )->rawParams(
$link )->text();
802 global $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgFooterIcons;
806 if ( $wgFooterIcons[
'copyright'][
'copyright'] ) {
807 $out = $wgFooterIcons[
'copyright'][
'copyright'];
808 } elseif ( $wgRightsIcon ) {
809 $icon = htmlspecialchars( $wgRightsIcon );
811 if ( $wgRightsUrl ) {
812 $url = htmlspecialchars( $wgRightsUrl );
813 $out .=
'<a href="' . $url .
'">';
816 $text = htmlspecialchars( $wgRightsText );
817 $out .=
"<img src=\"$icon\" alt=\"$text\" width=\"88\" height=\"31\" />";
819 if ( $wgRightsUrl ) {
832 global $wgResourceBasePath;
834 $url1 = htmlspecialchars(
835 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
837 $url1_5 = htmlspecialchars(
838 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png"
840 $url2 = htmlspecialchars(
841 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png"
843 $text =
'<a href="//www.mediawiki.org/"><img src="' . $url1
844 .
'" srcset="' . $url1_5 .
' 1.5x, ' . $url2 .
' 2x" '
845 .
'height="31" width="88" alt="Powered by MediaWiki" /></a>';
846 Hooks::run(
'SkinGetPoweredBy', [ &$text, $this ] );
856 $timestamp = $this->
getOutput()->getRevisionTimestamp();
858 # No cached timestamp, load it from the database
859 if ( $timestamp ===
null ) {
866 $s =
' ' . $this->
msg(
'lastmodifiedat', $d,
$t )->parse();
871 if (
wfGetLB()->getLaggedReplicaMode() ) {
872 $s .=
' <strong>' . $this->
msg(
'laggedslavemode' )->parse() .
'</strong>';
883 if ( $align !=
'' ) {
884 $a =
" style='float: {$align};'";
889 $mp = $this->
msg(
'mainpage' )->escaped();
891 $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) :
'' );
894 $s =
"<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
908 if ( is_string( $icon ) ) {
911 $url = isset( $icon[
"url"] ) ? $icon[
"url"] :
null;
912 unset( $icon[
"url"] );
913 if ( isset( $icon[
"src"] ) && $withImage ===
'withImage' ) {
917 $html = htmlspecialchars( $icon[
"alt"] );
920 global $wgExternalLinkTarget;
922 [
"href" => $url,
"target" => $wgExternalLinkTarget ],
936 $this->
msg(
'mainpage' )->escaped()
956 $this->
msg( $desc )->escaped()
967 if ( $this->
msg( $desc )->inContentLanguage()->isDisabled() ) {
984 return $this->
footerLink(
'privacy',
'privacypage' );
992 return $this->
footerLink(
'aboutsite',
'aboutpage' );
1000 return $this->
footerLink(
'disclaimers',
'disclaimerpage' );
1025 if ( $id instanceof
User ) {
1031 # The sending user must have a confirmed email address and the target
1032 # user must have a confirmed email address and allow emails from users.
1033 return $this->
getUser()->canSendEmail() &&
1034 $targetUser->canReceiveEmail();
1051 if ( $this->stylename ===
null ) {
1053 throw new MWException(
"$class::\$stylename must be set to use getSkinStylePath()" );
1056 return "$wgStylePath/{$this->stylename}/$name?$wgStyleVersion";
1069 return $title->getLocalURL( $urlaction );
1085 if ( is_null( $proto ) ) {
1086 return $title->getLocalURL( $urlaction );
1088 return $title->getFullURL( $urlaction,
false, $proto );
1100 return $title->getLocalURL( $urlaction );
1111 return $title->getLocalURL( $urlaction );
1123 return $title->getLocalURL( $urlaction );
1151 return $title->getLocalURL( $urlaction );
1165 'href' =>
$title->getLocalURL( $urlaction ),
1166 'exists' =>
$title->isKnown(),
1181 'href' =>
$title->getLocalURL( $urlaction ),
1193 if ( !is_object(
$title ) ) {
1195 if ( !is_object(
$title ) ) {
1226 $callback =
function ()
use ( $that ) {
1228 $that->addToSidebar( $bar,
'sidebar' );
1229 Hooks::run(
'SkinBuildSidebar', [ $that, &$bar ] );
1236 $sidebar =
$cache->getWithSetCallback(
1237 $cache->makeKey(
'sidebar', $this->getLanguage()->getCode() ),
1239 ? $cache::TTL_UNCACHEABLE
1245 $sidebar = $callback();
1249 Hooks::run(
'SidebarBeforeOutput', [ $this, &$sidebar ] );
1275 $lines = explode(
"\n", $text );
1278 $messageTitle = $this->
getConfig()->get(
'EnableSidebarCache' )
1282 if ( strpos(
$line,
'*' ) !== 0 ) {
1287 if ( strpos(
$line,
'**' ) !== 0 ) {
1288 $heading = trim(
$line,
'* ' );
1289 if ( !array_key_exists( $heading, $bar ) ) {
1290 $bar[$heading] = [];
1295 if ( strpos(
$line,
'|' ) !==
false ) {
1297 $line = array_map(
'trim', explode(
'|',
$line, 2 ) );
1306 $msgLink = $this->
msg( $line[0] )->title( $messageTitle )->inContentLanguage();
1307 if ( $msgLink->exists() ) {
1308 $link = $msgLink->text();
1309 if (
$link ==
'-' ) {
1315 $msgText = $this->
msg( $line[1] )->title( $messageTitle );
1316 if ( $msgText->exists() ) {
1317 $text = $msgText->text();
1326 global $wgNoFollowLinks, $wgNoFollowDomainExceptions;
1328 $extraAttribs[
'rel'] =
'nofollow';
1331 global $wgExternalLinkTarget;
1332 if ( $wgExternalLinkTarget ) {
1333 $extraAttribs[
'target'] = $wgExternalLinkTarget;
1340 $href =
$title->getLinkURL();
1342 $href =
'INVALID-TITLE';
1346 $bar[$heading][] = array_merge( [
1349 'id' =>
'n-' . Sanitizer::escapeId( strtr(
$line[1],
' ',
'-' ),
'noninitial' ),
1368 $newMessagesAlert =
'';
1377 if ( $newMessagesAlert ) {
1378 return $newMessagesAlert;
1382 $uTalkTitle =
$user->getTalkPage();
1385 if ( $lastSeenRev !==
null ) {
1388 if ( $latestRev !==
null ) {
1390 $plural = $latestRev->getParentId() !== $lastSeenRev->getId();
1391 $nofAuthors = $uTalkTitle->countAuthorsBetween(
1392 $lastSeenRev, $latestRev, 10,
'include_new' );
1398 $plural = $plural ? 999 : 1;
1404 $this->
msg(
'newmessageslinkplural' )->params( $plural )->escaped(),
1406 [
'redirect' =>
'no' ]
1411 $this->
msg(
'newmessagesdifflinkplural' )->params( $plural )->escaped(),
1413 $lastSeenRev !==
null
1414 ? [
'oldid' => $lastSeenRev->getId(),
'diff' =>
'cur' ]
1415 : [
'diff' =>
'cur' ]
1418 if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
1419 $newMessagesAlert = $this->
msg(
1420 'youhavenewmessagesfromusers',
1422 $newMessagesDiffLink
1423 )->numParams( $nofAuthors, $plural );
1426 $newMessagesAlert = $this->
msg(
1427 $nofAuthors > 10 ?
'youhavenewmessagesmanyusers' :
'youhavenewmessages',
1429 $newMessagesDiffLink
1430 )->numParams( $plural );
1432 $newMessagesAlert = $newMessagesAlert->text();
1434 $out->setCdnMaxage( 0 );
1436 $sep = $this->
msg(
'newtalkseparator' )->escaped();
1442 [
'href' => $newtalk[
'link'] ], $newtalk[
'wiki']
1445 $parts = implode( $sep, $msgs );
1446 $newMessagesAlert = $this->
msg(
'youhavenewmessagesmulti' )->rawParams( $parts )->escaped();
1447 $out->setCdnMaxage( 0 );
1450 return $newMessagesAlert;
1465 if (
$name ===
'default' ) {
1468 $notice = $wgSiteNotice;
1469 if ( empty( $notice ) ) {
1473 $msg = $this->
msg(
$name )->inContentLanguage();
1474 if ( $msg->isBlank() ) {
1476 } elseif ( $msg->isDisabled() ) {
1479 $notice = $msg->plain();
1485 if ( is_array( $cachedNotice ) ) {
1486 if ( md5( $notice ) == $cachedNotice[
'hash'] ) {
1487 $notice = $cachedNotice[
'html'];
1496 $parsed = $this->
getOutput()->parse( $notice );
1497 $parserMemc->set( $key, [
'html' => $parsed,
'hash' => md5( $notice ) ], 600 );
1514 if (
Hooks::run(
'SiteNoticeBefore', [ &$siteNotice, $this ] ) ) {
1515 if ( is_object( $this->
getUser() ) && $this->
getUser()->isLoggedIn() ) {
1519 if ( $anonNotice ===
false ) {
1522 $siteNotice = $anonNotice;
1525 if ( $siteNotice ===
false ) {
1530 Hooks::run(
'SiteNoticeAfter', [ &$siteNotice, $this ] );
1554 if ( !is_null( $tooltip ) ) {
1555 # T27462: undo double-escaping.
1556 $tooltip = Sanitizer::decodeCharReferences( $tooltip );
1558 ->inLanguage(
$lang )->text();
1563 'text' =>
wfMessage(
'editsection' )->inLanguage(
$lang )->escaped(),
1564 'targetTitle' => $nt,
1566 'query' => [
'action' =>
'edit',
'section' =>
$section ],
1567 'options' => [
'noclasses',
'known' ]
1573 $result =
'<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>';
1576 foreach ( $links
as $k => $linkDetails ) {
1578 $linkDetails[
'targetTitle'],
1579 $linkDetails[
'text'],
1580 $linkDetails[
'attribs'],
1581 $linkDetails[
'query'],
1582 $linkDetails[
'options']
1587 '<span class="mw-editsection-divider">'
1593 $result .=
'<span class="mw-editsection-bracket">]</span></span>';
1596 'DoEditSectionLink',
getConfig()
Get the Config object.
editUrlOptions()
Return URL options for the 'edit page' link.
static newFromId( $id)
Static factory method for creation from a given user ID.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static makeUrlDetails( $name, $urlaction='')
these return an array with the 'href' and boolean 'exists'
getSiteNotice()
Get the site notice.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
footerLinkTitle( $desc, $page)
Class representing a list of titles The execute() method checks them all for existence and adds them ...
doEditSectionLink(Title $nt, $section, $tooltip=null, $lang=false)
Create a section edit link.
getPoweredBy()
Gets the powered by MediaWiki icon.
if(!isset( $args[0])) $lang
wfGetLB( $wiki=false)
Get a load balancer object.
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
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
static newMainPage()
Create a new Title for the Main Page.
lastModified()
Get the timestamp of the latest revision, formatted in user language.
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:Array with elements of the form "language:title" in the order that they will be output. & $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
static checkTitle(&$title, $name)
make sure we have some title to operate on
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
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 account $user
static getHTMLDebugLog()
Generate debug log in HTML for displaying at the bottom of the main content area.
static makeSpecialUrl( $name, $urlaction='', $proto=null)
Make a URL for a Special Page using the given query and protocol.
aboutLink()
Gets the link to the wiki's about page.
static getDynamicStylesheetQuery()
Get the query to generate a dynamic stylesheet.
static makeSpecialUrlSubpage( $name, $subpage, $urlaction='')
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
addToBodyAttributes( $out, &$bodyAttrs)
This will be called by OutputPage::headElement when it is creating the "<body>" tag,...
controlled by $wgMainCacheType * $parserMemc
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
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,...
Allows to change the fields on the form that will be generated $name
getRequest()
Get the WebRequest object.
$wgSidebarCacheExpiry
Expiry time for the sidebar cache, in seconds.
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 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
getUser()
Get the User object.
getTitle()
Get the Title object.
wfExpandIRI( $url)
Take a URL, make sure it's expanded to fully qualified, and replace any encoded non-ASCII Unicode cha...
$wgLogo
The URL path of the wiki logo.
static makeI18nUrl( $name, $urlaction='')
getHtmlElementAttributes()
Return values for <html> element.
$wgStylePath
The URL path of the skins directory.
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
bottomScripts()
This gets called shortly before the "</body>" tag.
mainPageLink()
Gets the link to the wiki's main page.
static getSkinNames()
Fetch the set of available skins.
afterContentHook()
This runs a hook to allow extensions placing their stuff after content and article metadata (e....
getLanguage()
Get the Language object.
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
getCachedNotice( $name)
Get a cached notice.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
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
wfMemcKey()
Make a cache key for the local wiki.
namespace and then decline to actually register it file or subcat img or subcat $title
buildSidebar()
Build an array that represents the sidebar(s), the navigation bar among them.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
privacyLink()
Gets the link to the wiki's privacy policy page.
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
static getSkinNameMessages()
Fetch the skinname messages for available skins.
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.
footerLink( $desc, $page)
Returns an HTML link for use in the footer.
generateDebugHTML()
Generate debug data HTML for displaying at the bottom of the main content area.
static getTimestampFromId( $title, $id, $flags=0)
Get rev_timestamp from rev_id, without loading the rest of the row.
string $stylename
Stylesheets set to use.
setRelevantUser( $u)
Set the "relevant" user.
$wgEnableSidebarCache
If on, the sidebar navigation links are cached for users with the current language set.
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
getOutput()
Get the OutputPage object.
$wgStyleVersion
Bump this number when changing the global style sheets and JavaScript.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
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
addToSidebar(&$bar, $message)
Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used ...
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
static isIP( $name)
Does the string match an anonymous IP address?
isRevisionCurrent()
Whether the revision displayed is the latest revision of the page.
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
static hasSubpages( $index)
Does the namespace allow subpages?
drawCategoryBrowser( $tree)
Render the array as a series of links.
static makeNSUrl( $name, $urlaction='', $namespace=NS_MAIN)
this can be passed the NS number as defined in Language.php
preloadExistence()
Preload the existence of three commonly-requested pages in a single query.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
when a variable name is used in a it is silently declared as a new masking the global
disclaimerLink()
Gets the link to the wiki's general disclaimers page.
getLogo()
URL to the logo.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
This class should be covered by a general architecture document which does not exist as of January 20...
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
outputPage(OutputPage $out=null)
Outputs the HTML generated by other functions.
static singleton()
Get the signleton instance of this class.
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
getRelevantTitle()
Return the "relevant" title.
getSkinStylePath( $name)
Return a fully resolved style path url to images or styles stored in the current skins's folder.
getPageClasses( $title)
TODO: document.
getDefaultModules()
Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wish...
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
printSource()
Text with the permalink to the source page, usually shown on the footer of a printed page.
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static makeVariablesScript( $data)
getNewtalks()
Gets new talk page messages for the current user and returns an appropriate alert message (or an empt...
Represents a title within MediaWiki.
static makeUrl( $name, $urlaction='')
wfMatchesDomainList( $url, $domains)
Check whether a given URL has a domain that occurs in a given set of domains.
if( $wgSkipSkin) $wgSkipSkins[]
static getMainWANInstance()
Get the main WAN cache object.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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
getCopyright( $type='detect')
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
getRelevantUser()
Return the "relevant" user.
subPageSubtitle( $out=null)
$wgRenderHashAppend
Append a configured value to the parser cache and the sitenotice key so that they can be kept separat...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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 makeKnownUrlDetails( $name, $urlaction='')
Make URL details where the article exists (or at least it's convenient to think so)
setupSkinUserCss(OutputPage $out)
Add skin specific stylesheets Calling this method with an $out of anything but the same OutputPage in...
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 makeMainPageUrl( $urlaction='')
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static getAllowedSkins()
Fetch the list of user-selectable skins in regards to $wgSkipSkins.
The main skin class which provides methods and properties for all other skins.
initPage(OutputPage $out)
setRelevantTitle( $t)
Set the "relevant" title.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
getRevisionId()
Get the current revision ID.
addToSidebarPlain(&$bar, $text)
Add content from plain text.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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
static getDefaultInstance()
$wgSquidMaxage
Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
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 content language as $wgContLang
makeFooterIcon( $icon, $withImage='withImage')
Renders a $wgFooterIcons icon according to the method's arguments.
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