Go to the documentation of this file.
46 static $skinsInitialised =
false;
49 # Get a list of available skins
50 # Build using the regular expression '^(.*).php$'
51 # Array keys are all lower case, array value keep the case used by filename
57 $skinDir = dir( $wgStyleDirectory );
59 if ( $skinDir !==
false && $skinDir !==
null ) {
60 # while code from www.php.net
61 while (
false !== (
$file = $skinDir->read() ) ) {
69 if ( !in_array( $aSkin,
array(
'CologneBlue',
'Modern',
'MonoBook',
'Vector' ) ) ) {
71 "A skin using autodiscovery mechanism, $aSkin, was found in your skins/ directory. " .
72 "The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. " .
73 "See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this."
82 $skinsInitialised =
true;
94 foreach ( self::getSkinNames()
as $skinKey => $skinName ) {
113 foreach ( $wgSkipSkins
as $skip ) {
114 unset( $allowedSkins[$skip] );
117 return $allowedSkins;
141 if ( $key ==
'' || $key ==
'default' ) {
144 $key = $wgDefaultSkin;
147 if ( isset( $skinNames[$key] ) ) {
162 if ( isset( $skinNames[$key] ) ) {
164 } elseif ( isset( $skinNames[$wgDefaultSkin] ) ) {
165 return $wgDefaultSkin;
182 $skinName = $skinNames[$key];
183 $className =
"Skin{$skinName}";
185 # Grab the skin class and initialise it.
186 if ( !class_exists( $className ) ) {
188 require_once
"{$wgStyleDirectory}/{$skinName}.php";
190 # Check if we got if not fallback to default skin
191 if ( !class_exists( $className ) ) {
192 # DO NOT die if the class isn't found. This breaks maintenance
193 # scripts and can cause a user account to be unrecoverable
194 # except by SQL manipulation if a previously valid skin name
195 # is no longer valid.
196 wfDebug(
"Skin class does not exist: $className\n" );
197 $className =
'SkinVector';
198 require_once
"{$wgStyleDirectory}/Vector.php";
201 $skin =
new $className( $key );
230 global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax,
231 $wgAjaxWatch, $wgEnableAPI, $wgEnableWriteAPI;
238 'mediawiki.page.ready',
249 if ( $wgIncludeLegacyJavaScript ) {
250 $modules[
'legacy'][] =
'mediawiki.legacy.wikibits';
253 if ( $wgPreloadJavaScriptMwUtil ) {
254 $modules[
'legacy'][] =
'mediawiki.util';
259 $modules[
'legacy'][] =
'mediawiki.legacy.ajax';
261 if ( $wgEnableAPI ) {
262 if ( $wgEnableWriteAPI && $wgAjaxWatch &&
$user->isLoggedIn()
263 &&
$user->isAllowed(
'writeapi' )
265 $modules[
'watch'][] =
'mediawiki.page.watch.ajax';
268 $modules[
'search'][] =
'mediawiki.searchSuggest';
272 if (
$user->getBoolOption(
'editsectiononrightclick' ) ) {
273 $modules[
'user'][] =
'mediawiki.action.view.rightClickEdit';
277 if (
$out->isArticle() &&
$user->getOption(
'editondblclick' ) ) {
278 $modules[
'user'][] =
'mediawiki.action.view.dblClickEdit';
293 if ( $this->
getTitle()->isSpecialPage() ) {
295 } elseif ( $this->
getTitle()->isTalkPage() ) {
302 $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 ) ) {
357 $this->mRelevantUser = $u;
369 if ( isset( $this->mRelevantUser ) ) {
374 $rootUser =
$title->getRootText();
380 $this->mRelevantUser =
$user;
433 'maxage' => $wgSquidMaxage,
434 'usemsgcache' =>
'yes',
435 'ctype' =>
'text/css',
436 'smaxage' => $wgSquidMaxage,
456 $numeric =
'ns-' .
$title->getNamespace();
458 if (
$title->isSpecialPage() ) {
459 $type =
'ns-special';
462 if ( $canonicalName ) {
465 $type .=
' mw-invalidspecialpage';
467 } elseif (
$title->isTalkPage() ) {
470 $type =
'ns-subject';
475 return "$numeric $type $name";
485 'lang' => $lang->getHtmlCode(),
486 'dir' => $lang->getDir(),
487 'class' =>
'client-nojs',
515 global $wgUseCategoryBrowser;
518 $allCats =
$out->getCategoryLinks();
520 if ( !count( $allCats ) ) {
528 $colon = $this->
msg(
'colon-separator' )->escaped();
530 if ( !empty( $allCats[
'normal'] ) ) {
531 $t = $embed . implode(
"{$pop}{$embed}", $allCats[
'normal'] ) . $pop;
533 $msg = $this->
msg(
'pagecategories' )->numParams( count( $allCats[
'normal'] ) )->escaped();
534 $linkPage =
wfMessage(
'pagecategorieslink' )->inContentLanguage()->text();
535 $s .=
'<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
537 . $colon .
'<ul>' .
$t .
'</ul>' .
'</div>';
541 if ( isset( $allCats[
'hidden'] ) ) {
542 if ( $this->
getUser()->getBoolOption(
'showhiddencats' ) ) {
543 $class =
' mw-hidden-cats-user-shown';
545 $class =
' mw-hidden-cats-ns-shown';
547 $class =
' mw-hidden-cats-hidden';
550 $s .=
"<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
551 $this->
msg(
'hidden-categories' )->numParams( count( $allCats[
'hidden'] ) )->escaped() .
552 $colon .
'<ul>' . $embed . implode(
"{$pop}{$embed}", $allCats[
'hidden'] ) . $pop .
'</ul>' .
556 # optional 'dmoz-like' category browser. Will be shown under the list
557 # of categories an article belong to
558 if ( $wgUseCategoryBrowser ) {
559 $s .=
'<br /><hr />';
561 # get a big array of the parents tree
562 $parenttree = $this->
getTitle()->getParentCategoryTree();
563 # Skin object passed by reference cause it can not be
564 # accessed under the method subfunction drawCategoryBrowser
566 # Clean out bogus first entry and sort them
567 unset( $tempout[0] );
569 # Output one per line
570 $s .= implode(
"<br />\n", $tempout );
584 foreach ( $tree
as $element => $parent ) {
585 if ( empty( $parent ) ) {
586 # element start a new list
589 # grab the others elements
593 # add our current element to the list
595 $return .=
Linker::link( $eltitle, htmlspecialchars( $eltitle->getText() ) );
609 $classes =
'catlinks';
612 $allCats =
$out->getCategoryLinks();
613 $showHidden = $this->
getUser()->getBoolOption(
'showhiddencats' ) ||
616 if ( empty( $allCats[
'normal'] ) && !( !empty( $allCats[
'hidden'] ) && $showHidden ) ) {
617 $classes .=
' catlinks-allhidden';
620 return "<div id='catlinks' class='$classes'>{$catlinks}</div>";
643 if ( trim( $data ) !=
'' ) {
647 $data =
"<div id='mw-data-after-content'>\n" .
652 wfDebug(
"Hook SkinAfterContent changed output processing.\n" );
676 $bottomScriptText = $this->
getOutput()->getBottomScripts();
677 wfRunHooks(
'SkinAfterBottomScripts',
array( $this, &$bottomScriptText ) );
679 return $bottomScriptText;
691 $url = htmlspecialchars(
wfExpandIRI( $this->
getTitle()->getCanonicalURL(
'oldid=' . $oldid ) ) );
696 return $this->
msg(
'retrievedfrom',
'<a href="' . $url .
'">' . $url .
'</a>' )->text();
703 $action = $this->
getRequest()->getVal(
'action',
'view' );
705 if ( $this->
getUser()->isAllowed(
'deletedhistory' ) &&
706 ( $this->
getTitle()->getArticleID() == 0 || $action ==
'history' ) ) {
710 if ( $this->
getUser()->isAllowed(
'undelete' ) ) {
711 $msg =
'thisisdeleted';
713 $msg =
'viewdeleted';
716 return $this->
msg( $msg )->rawParams(
719 $this->
msg(
'restorelink' )->numParams(
$n )->escaped() )
740 $ptext = $this->
getTitle()->getPrefixedText();
741 if ( preg_match(
'/\//', $ptext ) ) {
742 $links = explode(
'/', $ptext );
749 $growinglink .=
$link;
753 if ( is_object( $linkObj ) && $linkObj->isKnown() ) {
756 htmlspecialchars( $display )
762 $subpages .=
$wgLang->getDirMarkEntity() . $this->
msg(
'pipe-separator' )->escaped();
764 $subpages .=
'< ';
767 $subpages .= $getlink;
786 return $wgShowIPinHeader && session_id() !=
'';
794 return $searchPage->getLocalURL();
811 if (
$type ==
'detect' ) {
812 if ( !$this->
isRevisionCurrent() && !$this->
msg(
'history_copyright' )->inContentLanguage()->isDisabled() ) {
819 if (
$type ==
'history' ) {
820 $msg =
'history_copyright';
825 if ( $wgRightsPage ) {
828 } elseif ( $wgRightsUrl ) {
830 } elseif ( $wgRightsText ) {
831 $link = $wgRightsText;
842 $msgObj = $this->
msg( $msg )->rawParams(
$link );
844 $msg = $msgObj->inContentLanguage()->text();
850 return $msgObj->text();
858 global $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgCopyrightIcon;
862 if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
863 $out = $wgCopyrightIcon;
864 } elseif ( $wgRightsIcon ) {
865 $icon = htmlspecialchars( $wgRightsIcon );
867 if ( $wgRightsUrl ) {
868 $url = htmlspecialchars( $wgRightsUrl );
869 $out .=
'<a href="' . $url .
'">';
872 $text = htmlspecialchars( $wgRightsText );
873 $out .=
"<img src=\"$icon\" alt=\"$text\" width=\"88\" height=\"31\" />";
875 if ( $wgRightsUrl ) {
890 $url = htmlspecialchars(
"$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
891 $text =
'<a href="//www.mediawiki.org/"><img src="' . $url .
'" height="31" width="88" alt="Powered by MediaWiki" /></a>';
904 # No cached timestamp, load it from the database
912 $s =
' ' . $this->
msg(
'lastmodifiedat', $d,
$t )->text();
917 if (
wfGetLB()->getLaggedSlaveMode() ) {
918 $s .=
' <strong>' . $this->
msg(
'laggedslavemode' )->text() .
'</strong>';
929 if ( $align !=
'' ) {
930 $a =
" style='float: {$align};'";
935 $mp = $this->
msg(
'mainpage' )->escaped();
937 $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) :
'' );
940 $s =
"<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
952 if ( is_string( $icon ) ) {
955 $url = isset( $icon[
"url"] ) ? $icon[
"url"] :
null;
956 unset( $icon[
"url"] );
957 if ( isset( $icon[
"src"] ) && $withImage ===
'withImage' ) {
960 $html = htmlspecialchars( $icon[
"alt"] );
976 $this->
msg(
'mainpage' )->escaped()
990 if ( $this->
msg( $desc )->inContentLanguage()->isDisabled() ) {
1001 $this->
msg( $desc )->escaped()
1011 return $this->
footerLink(
'privacy',
'privacypage' );
1019 return $this->
footerLink(
'aboutsite',
'aboutpage' );
1027 return $this->
footerLink(
'disclaimers',
'disclaimerpage' );
1052 if ( $id instanceof
User ) {
1057 return $this->
getUser()->canSendEmail() && # the sending
user must have a confirmed email address
1058 $targetUser->canReceiveEmail(); # the target
user must have a confirmed email address and allow emails
from users
1069 global $wgStylePath, $wgStyleVersion;
1070 return "$wgStylePath/common/$name?$wgStyleVersion";
1081 global $wgStylePath, $wgStyleVersion;
1082 return "$wgStylePath/{$this->stylename}/$name?$wgStyleVersion";
1095 return $title->getLocalURL( $urlaction );
1111 if ( is_null( $proto ) ) {
1112 return $title->getLocalURL( $urlaction );
1114 return $title->getFullURL( $urlaction,
false, $proto );
1126 return $title->getLocalURL( $urlaction );
1137 return $title->getLocalURL( $urlaction );
1149 return $title->getLocalURL( $urlaction );
1177 return $title->getLocalURL( $urlaction );
1191 'href' =>
$title->getLocalURL( $urlaction ),
1192 'exists' =>
$title->getArticleID() != 0,
1207 'href' =>
$title->getLocalURL( $urlaction ),
1219 if ( !is_object(
$title ) ) {
1221 if ( !is_object(
$title ) ) {
1249 global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
1254 if ( $wgEnableSidebarCache ) {
1255 $cachedsidebar =
$wgMemc->get( $key );
1256 if ( $cachedsidebar ) {
1258 return $cachedsidebar;
1266 if ( $wgEnableSidebarCache ) {
1267 $wgMemc->set( $key, $bar, $wgSidebarCacheExpiry );
1295 $lines = explode(
"\n", $text );
1300 if ( strpos(
$line,
'*' ) !== 0 ) {
1305 if ( strpos(
$line,
'**' ) !== 0 ) {
1306 $heading = trim(
$line,
'* ' );
1307 if ( !array_key_exists( $heading, $bar ) ) {
1308 $bar[$heading] =
array();
1313 if ( strpos(
$line,
'|' ) !==
false ) {
1315 $line = array_map(
'trim', explode(
'|',
$line, 2 ) );
1316 if ( count(
$line ) !== 2 ) {
1322 $extraAttribs =
array();
1324 $msgLink = $this->
msg( $line[0] )->inContentLanguage();
1325 if ( $msgLink->exists() ) {
1326 $link = $msgLink->text();
1327 if (
$link ==
'-' ) {
1333 $msgText = $this->
msg( $line[1] );
1334 if ( $msgText->exists() ) {
1335 $text = $msgText->text();
1344 global $wgNoFollowLinks, $wgNoFollowDomainExceptions;
1346 $extraAttribs[
'rel'] =
'nofollow';
1349 global $wgExternalLinkTarget;
1350 if ( $wgExternalLinkTarget ) {
1351 $extraAttribs[
'target'] = $wgExternalLinkTarget;
1358 $href =
$title->getLinkURL();
1360 $href =
'INVALID-TITLE';
1364 $bar[$heading][] = array_merge(
array(
1402 $newMessagesAlert =
'';
1411 if ( $newMessagesAlert ) {
1412 return $newMessagesAlert;
1416 $uTalkTitle =
$user->getTalkPage();
1419 if ( $lastSeenRev !==
null ) {
1422 if ( $latestRev !==
null ) {
1424 $plural = $latestRev->getParentId() !== $lastSeenRev->getId();
1425 $nofAuthors = $uTalkTitle->countAuthorsBetween(
1426 $lastSeenRev, $latestRev, 10,
'include_new' );
1432 $plural = $plural ? 999 : 1;
1438 $this->
msg(
'newmessageslinkplural' )->params( $plural )->escaped(),
1440 array(
'redirect' =>
'no' )
1445 $this->
msg(
'newmessagesdifflinkplural' )->params( $plural )->escaped(),
1447 $lastSeenRev !==
null
1448 ?
array(
'oldid' => $lastSeenRev->getId(),
'diff' =>
'cur' )
1449 :
array(
'diff' =>
'cur' )
1452 if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
1453 $newMessagesAlert = $this->
msg(
1454 'youhavenewmessagesfromusers',
1456 $newMessagesDiffLink
1457 )->numParams( $nofAuthors, $plural );
1460 $newMessagesAlert = $this->
msg(
1461 $nofAuthors > 10 ?
'youhavenewmessagesmanyusers' :
'youhavenewmessages',
1463 $newMessagesDiffLink
1464 )->numParams( $plural );
1466 $newMessagesAlert = $newMessagesAlert->text();
1467 # Disable Squid cache
1468 $out->setSquidMaxage( 0 );
1470 $sep = $this->
msg(
'newtalkseparator' )->escaped();
1476 array(
'href' => $newtalk[
'link'] ), $newtalk[
'wiki']
1479 $parts = implode( $sep, $msgs );
1480 $newMessagesAlert = $this->
msg(
'youhavenewmessagesmulti' )->rawParams( $parts )->escaped();
1481 $out->setSquidMaxage( 0 );
1484 return $newMessagesAlert;
1500 if (
$name ===
'default' ) {
1503 $notice = $wgSiteNotice;
1504 if ( empty( $notice ) ) {
1509 $msg = $this->
msg(
$name )->inContentLanguage();
1510 if ( $msg->isDisabled() ) {
1514 $notice = $msg->plain();
1520 if ( is_array( $cachedNotice ) ) {
1521 if ( md5( $notice ) == $cachedNotice[
'hash'] ) {
1522 $notice = $cachedNotice[
'html'];
1531 $parsed = $this->
getOutput()->parse( $notice );
1532 $parserMemc->set( $key,
array(
'html' => $parsed,
'hash' => md5( $notice ) ), 600 );
1550 $key =
'namespacenotice-' . $this->
getTitle()->getNsText();
1552 if ( $namespaceNotice && substr( $namespaceNotice, 0, 7 ) !=
'<p><' ) {
1553 $namespaceNotice =
'<div id="namespacebanner">' . $namespaceNotice .
'</div>';
1555 $namespaceNotice =
'';
1559 return $namespaceNotice;
1572 if ( is_object( $this->
getUser() ) && $this->
getUser()->isLoggedIn() ) {
1576 if ( !$anonNotice ) {
1612 if ( !is_null( $tooltip ) ) {
1613 # Bug 25462: undo double-escaping.
1616 ->inLanguage( $lang )->text();
1621 array(
'noclasses',
'known' )
1624 # Add the brackets and the span and run the hook.
1625 $result =
'<span class="mw-editsection">'
1626 .
'<span class="mw-editsection-bracket">[</span>'
1628 .
'<span class="mw-editsection-bracket">]</span>'
1646 if ( is_callable( $realFunction ) ) {
1648 return call_user_func_array( $realFunction,
$args );
1650 $className = get_class( $this );
1651 throw new MWException(
"Call to undefined method $className::$fname" );
static makeLoaderConditionalScript( $script)
Returns JS code which runs given JS code if the client-side framework is present.
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. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag '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 '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. '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 '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 '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 wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() '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 User::isValidEmailAddr(), 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. '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 '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) '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. 'LinkBegin':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
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.
getNamespaceNotice()
Get a notice based on page's namespace.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static makeConfigSetScript(array $configuration)
Returns JS code which will set the MediaWiki configuration array to the given value.
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
msg()
Get a Message object with context set Parameters are the same as wfMessage()
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.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $wgMemc
wfGetLB( $wiki=false)
Get a load balancer object.
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.
wfProfileIn( $functionname)
Begin profiling of a function.
static checkTitle(&$title, $name)
make sure we have some title to operate on
static getHTMLDebugLog()
Generate debug log in HTML for displaying at the bottom of the main content area.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
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 getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
static escapeClass( $class)
Given a value, escape it so that it can be used as a CSS class and return it.
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
getRequest()
Get the WebRequest object.
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
getUser()
Get the User object.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
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...
static makeI18nUrl( $name, $urlaction='')
getHtmlElementAttributes()
static inlineScript( $contents)
Output a "<script>" tag with the given contents.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=array(), $title=null)
Make an external 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
bottomScripts()
This gets called shortly before the "</body>" tag.
mainPageLink()
Gets the link to the wiki's main page.
static getTimestampFromId( $title, $id)
Get rev_timestamp from rev_id, without loading the rest of the row.
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....
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
getLanguage()
Get the Language object.
getCommonStylePath( $name)
Return a fully resolved style path url to images or styles stored in the common folder.
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.
if( $wgAPIRequestLog) $lb
wfMemcKey()
Get a cache key.
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 element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
setRelevantUser( $u)
Set the "relevant" user.
getOutput()
Get the OutputPage object.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
This technique is used by the more ambitious MediaWiki site to create complex custom skins for their wikis It should be preferred over editing the core Monobook skin directly See enabled via LocalSettings php This is done by adding it to $wgValidSkinNames
addToSidebar(&$bar, $message)
Add content from a sidebar system message Currently only used for MediaWiki:Sidebar (but may be used ...
wfProfileOut( $functionname='missing')
Stop profiling of a function.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting or change the value of $siteNotice and return false to alter it & $siteNotice
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 after in associative array form externallinks including delete and has completed for all link tables 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 element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
static isIP( $name)
Does the string match an anonymous IPv4 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
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
preloadExistence()
Preload the existence of three commonly-requested pages in a single query.
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.
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.
static escapeId( $id, $options=array())
Given a value, escape it so that it can be used in an id attribute and return it.
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
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
static newFromTitle( $title, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given title.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
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.
presenting them properly to the user as errors is done by the caller $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.
showIPinHeader()
Returns true if the IP should be shown in the header.
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Allows to change the fields on the form that will be generated $name
if(!defined( 'MEDIAWIKI')) if(!isset( $wgVersion)) $matches
getDefaultModules()
Defines the ResourceLoader modules that should be added to the skin It is recommended that skins wish...
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)
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
if(PHP_SAPI !='cli') $file
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 $skin
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='')
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 $wgLang
__call( $fname, $args)
Use PHP's magic __call handler to intercept legacy calls to the linker for backwards compatibility.
wfMatchesDomainList( $url, $domains)
Check whether a given URL has a domain that occurs in a given set of domains.
commonPrintStylesheet()
This function previously controlled whether the 'mediawiki.legacy.wikiprintable' module should be loa...
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')
getRelevantUser()
Return the "relevant" user.
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...
static makeMainPageUrl( $urlaction='')
Please log in again after you receive it</td >< td > s a saved copy from
static decodeCharReferences( $text)
Decode any character references, numeric or named entities, in the text and return a UTF-8 string.
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.
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
initPage(OutputPage $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 after processing & $attribs
setRelevantTitle( $t)
Set the "relevant" title.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getRevisionId()
Get the current revision ID.
addToSidebarPlain(&$bar, $text)
Add content from plain text.
static & newFromKey( $key)
Factory method for loading a skin of a given type.
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
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
makeFooterIcon( $icon, $withImage='withImage')
Renders a $wgFooterIcons icon according to the method's arguments.
static makeGlobalVariablesScript( $unused)
Make a "<script>" tag containing global variables.