Go to the documentation of this file.
53 $services = MediaWikiServices::getInstance();
110 if ( !$target instanceof
Title ) {
111 wfWarn( __METHOD__ .
': Requires $target to be a Title object.', 2 );
112 return "<!-- ERROR -->$html";
115 if ( is_string(
$query ) ) {
117 wfDeprecated( __METHOD__ .
' with parameter $query as string (should be array)',
'1.20' );
121 $services = MediaWikiServices::getInstance();
125 if ( !isset(
$options[
'stubThreshold'] ) ) {
126 $defaultLinkRenderer =
$services->getLinkRenderer();
127 $options[
'stubThreshold'] = $defaultLinkRenderer->getStubThreshold();
130 ->createFromLegacyOptions(
$options );
135 if (
$html !==
null ) {
140 if ( in_array(
'known',
$options,
true ) ) {
142 } elseif ( in_array(
'broken',
$options,
true ) ) {
144 } elseif ( in_array(
'noclasses',
$options,
true ) ) {
182 $ret =
"<a class=\"mw-selflink selflink\">{$prefix}{$html}</a>{$trail}";
188 $html = htmlspecialchars( $nt->getPrefixedText() );
191 return "<a class=\"mw-selflink selflink\">{$prefix}{$html}{$inside}</a>{$trail}";
216 return $context->
msg(
'invalidtitle-unknownnamespace', $namespace,
$title )->text();
247 $basename = strrchr( $url,
'/' );
248 if (
false === $basename ) {
251 $basename = substr( $basename, 1 );
273 wfDebug(
"Hook LinkerMakeExternalImage changed the output of external image "
274 .
"with url {$url} and alt text {$alt} to {$img}\n",
true );
321 $query =
"", $widthOption =
null
330 if ( $file && !$file->allowInlineDisplay() ) {
331 wfDebug( __METHOD__ .
': ' .
$title->getPrefixedDBkey() .
" does not allow inline display\n" );
337 if ( !isset( $frameParams[
'align'] ) ) {
338 $frameParams[
'align'] =
'';
340 if ( !isset( $frameParams[
'alt'] ) ) {
341 $frameParams[
'alt'] =
'';
343 if ( !isset( $frameParams[
'title'] ) ) {
344 $frameParams[
'title'] =
'';
346 if ( !isset( $frameParams[
'class'] ) ) {
347 $frameParams[
'class'] =
'';
350 $prefix = $postfix =
'';
352 if (
'center' == $frameParams[
'align'] ) {
353 $prefix =
'<div class="center">';
355 $frameParams[
'align'] =
'none';
358 if ( isset(
$handlerParams[
'height'] ) && $file->isVectorized() ) {
367 if ( isset( $frameParams[
'thumbnail'] )
368 || isset( $frameParams[
'manualthumb'] )
369 || isset( $frameParams[
'framed'] )
370 || isset( $frameParams[
'frameless'] )
375 if ( $widthOption ===
null || !isset(
$wgThumbLimits[$widthOption] ) ) {
380 if ( isset( $frameParams[
'upright'] ) && $frameParams[
'upright'] == 0 ) {
387 $prefWidth = isset( $frameParams[
'upright'] ) ?
388 round(
$wgThumbLimits[$widthOption] * $frameParams[
'upright'], -1 ) :
394 $prefWidth <
$handlerParams[
'width'] || $file->isVectorized() ) ) {
400 if ( isset( $frameParams[
'thumbnail'] ) || isset( $frameParams[
'manualthumb'] )
401 || isset( $frameParams[
'framed'] )
403 # Create a thumbnail. Alignment depends on the writing direction of
404 # the page content language (right-aligned for LTR languages,
405 # left-aligned for RTL languages)
406 # If a thumbnail width has not been provided, it is set
407 # to the default user option as specified in Language*.php
408 if ( $frameParams[
'align'] ==
'' ) {
409 $frameParams[
'align'] =
$parser->getTargetLanguage()->alignEnd();
416 if ( $file && isset( $frameParams[
'frameless'] ) ) {
417 $srcWidth = $file->getWidth(
$page );
418 # For "frameless" option: do not present an image bigger than the
419 # source (for bitmap-style images). This is the same behavior as the
420 # "thumb" option does it already.
421 if ( $srcWidth && !$file->mustRender() &&
$handlerParams[
'width'] > $srcWidth ) {
427 # Create a resized image, without the additional thumbnail features
438 'alt' => $frameParams[
'alt'],
439 'title' => $frameParams[
'title'],
440 'valign' => isset( $frameParams[
'valign'] ) ? $frameParams[
'valign'] :
false,
441 'img-class' => $frameParams[
'class'] ];
442 if ( isset( $frameParams[
'border'] ) ) {
443 $params[
'img-class'] .= (
$params[
'img-class'] !==
'' ?
' ' :
'' ) .
'thumbborder';
449 if ( $frameParams[
'align'] !=
'' ) {
450 $s =
"<div class=\"float{$frameParams['align']}\">{$s}</div>";
452 return str_replace(
"\n",
' ', $prefix .
$s . $postfix );
465 if ( isset( $frameParams[
'link-url'] ) && $frameParams[
'link-url'] !==
'' ) {
466 $mtoParams[
'custom-url-link'] = $frameParams[
'link-url'];
467 if ( isset( $frameParams[
'link-target'] ) ) {
468 $mtoParams[
'custom-target-link'] = $frameParams[
'link-target'];
471 $extLinkAttrs =
$parser->getExternalLinkAttribs( $frameParams[
'link-url'] );
472 foreach ( $extLinkAttrs
as $name => $val ) {
474 $mtoParams[
'parser-extlink-' .
$name] = $val;
477 } elseif ( isset( $frameParams[
'link-title'] ) && $frameParams[
'link-title'] !==
'' ) {
479 self::normaliseSpecialPage( $frameParams[
'link-title'] )
481 } elseif ( !empty( $frameParams[
'no-link'] ) ) {
484 $mtoParams[
'desc-link'] =
true;
485 $mtoParams[
'desc-query'] =
$query;
503 $align =
'right',
$params = [], $framed =
false, $manualthumb =
""
511 $frameParams[
'framed'] =
true;
513 if ( $manualthumb ) {
514 $frameParams[
'manualthumb'] = $manualthumb;
531 $exists = $file && $file->exists();
534 if ( !isset( $frameParams[
'align'] ) ) {
535 $frameParams[
'align'] =
'right';
537 if ( !isset( $frameParams[
'alt'] ) ) {
538 $frameParams[
'alt'] =
'';
540 if ( !isset( $frameParams[
'title'] ) ) {
541 $frameParams[
'title'] =
'';
543 if ( !isset( $frameParams[
'caption'] ) ) {
544 $frameParams[
'caption'] =
'';
549 $handlerParams[
'width'] = isset( $frameParams[
'upright'] ) ? 130 : 180;
553 $manualthumb =
false;
558 if ( isset( $frameParams[
'manualthumb'] ) ) {
559 # Use manually specified thumbnail
561 if ( $manual_title ) {
570 } elseif ( isset( $frameParams[
'framed'] ) ) {
575 # Do not present an image bigger than the source, for bitmap-style images
576 # This is a hack to maintain compatibility with arbitrary pre-1.10 behavior
577 $srcWidth = $file->getWidth(
$page );
578 if ( $srcWidth && !$file->mustRender() &&
$handlerParams[
'width'] > $srcWidth ) {
585 $outerWidth = $thumb->getWidth() + 2;
591 # ThumbnailImage::toHtml() already adds page= onto the end of DjVu URLs
592 # So we don't need to pass it here in $query. However, the URL for the
593 # zoom icon still needs it, so we make a unique query for it. See T16771
599 && !isset( $frameParams[
'link-title'] )
600 && !isset( $frameParams[
'link-url'] )
601 && !isset( $frameParams[
'no-link'] ) ) {
602 $frameParams[
'link-url'] = $url;
605 $s =
"<div class=\"thumb t{$frameParams['align']}\">"
606 .
"<div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
611 } elseif ( !$thumb ) {
612 $s .=
wfMessage(
'thumbnail_error',
'' )->escaped();
615 if ( !$noscale && !$manualthumb ) {
619 'alt' => $frameParams[
'alt'],
620 'title' => $frameParams[
'title'],
621 'img-class' => ( isset( $frameParams[
'class'] ) && $frameParams[
'class'] !==
''
622 ? $frameParams[
'class'] .
' '
623 :
'' ) .
'thumbimage'
627 if ( isset( $frameParams[
'framed'] ) ) {
633 'class' =>
'internal',
638 $s .=
' <div class="thumbcaption">' . $zoomIcon . $frameParams[
'caption'] .
"</div></div></div>";
639 return str_replace(
"\n",
' ',
$s );
654 $hp15[
'width'] = round( $hp[
'width'] * 1.5 );
656 $hp20[
'width'] = $hp[
'width'] * 2;
657 if ( isset( $hp[
'height'] ) ) {
658 $hp15[
'height'] = round( $hp[
'height'] * 1.5 );
659 $hp20[
'height'] = $hp[
'height'] * 2;
662 $thumb15 = $file->transform( $hp15 );
663 $thumb20 = $file->transform( $hp20 );
664 if ( $thumb15 && !$thumb15->isError() && $thumb15->getUrl() !== $thumb->getUrl() ) {
665 $thumb->responsiveUrls[
'1.5'] = $thumb15->getUrl();
667 if ( $thumb20 && !$thumb20->isError() && $thumb20->getUrl() !== $thumb->getUrl() ) {
668 $thumb->responsiveUrls[
'2'] = $thumb20->getUrl();
686 $query =
'', $unused1 =
'', $unused2 =
'',
$time =
false
689 wfWarn( __METHOD__ .
': Requires $title to be a Title object.' );
690 return "<!-- ERROR -->" . htmlspecialchars( $label );
694 if ( $label ==
'' ) {
695 $label =
$title->getPrefixedText();
697 $encLabel = htmlspecialchars( $label );
711 [
'class' =>
'mw-redirect' ],
713 [
'known',
'noclasses' ]
719 return '<a href="' . htmlspecialchars( $href ) .
'" class="new" title="' .
720 htmlspecialchars(
$title->getPrefixedText(), ENT_QUOTES ) .
'">' .
737 $q =
'wpDestFile=' . $destFile->getPartialURL();
748 return $upload->getLocalURL( $q );
779 if ( $file && $file->exists() ) {
780 $url = $file->getUrl();
801 wfDebug(
"Hook LinkerMakeMediaLinkFile changed the output of link "
802 .
"with url {$url} and text {$html} to {$ret}\n",
true );
821 $key = strtolower(
$name );
844 $class .=
" $linktype";
847 $class .=
" {$attribs['class']}";
852 $text = htmlspecialchars( $text );
858 $newRel = Parser::getExternalLinkRel( $url,
$title );
861 } elseif ( $newRel !==
'' ) {
863 $newRels = explode(
' ', $newRel );
864 $oldRels = explode(
' ',
$attribs[
'rel'] );
865 $combined = array_unique( array_merge( $newRels, $oldRels ) );
866 $attribs[
'rel'] = implode(
' ', $combined );
872 wfDebug(
"Hook LinkerMakeExternalLink changed the output of link "
873 .
"with url {$url} and text {$text} to {$link}\n",
true );
888 public static function userLink( $userId, $userName, $altUserName =
false ) {
889 $classes =
'mw-userlink';
890 if ( $userId == 0 ) {
892 if ( $altUserName ===
false ) {
895 $classes .=
' mw-anonuserlink';
903 '<bdi>' . htmlspecialchars( $altUserName !==
false ? $altUserName : $userName ) .
'</bdi>',
904 [
'class' => $classes ]
922 $userId, $userText, $redContribsWhenNoEdits =
false,
$flags = 0, $edits =
null
925 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
927 $addEmailLink =
$flags & self::TOOL_LINKS_EMAIL && $userId;
936 $attribs[
'class'] =
'mw-usertoollinks-contribs';
937 if ( $redContribsWhenNoEdits ) {
938 if ( intval( $edits ) === 0 && $edits !== 0 ) {
940 $edits =
$user->getEditCount();
942 if ( $edits === 0 ) {
950 if ( $blockable &&
$wgUser->isAllowed(
'block' ) ) {
954 if ( $addEmailLink &&
$wgUser->canSendEmail() ) {
958 Hooks::run(
'UserToolLinksEdit', [ $userId, $userText, &$items ] );
961 return wfMessage(
'word-separator' )->escaped()
962 .
'<span class="mw-usertoollinks">'
963 .
wfMessage(
'parentheses' )->rawParams(
$wgLang->pipeList( $items ) )->escaped()
990 $moreLinkAttribs[
'class'] =
'mw-usertoollinks-talk';
992 wfMessage(
'talkpagelinktext' )->escaped(),
994 return $userTalkLink;
1005 $moreLinkAttribs[
'class'] =
'mw-usertoollinks-block';
1019 $moreLinkAttribs[
'class'] =
'mw-usertoollinks-mail';
1043 return '<span class="history-deleted">' .
$link .
'</span>';
1067 return ' <span class="history-deleted">' .
$link .
'</span>';
1095 $comment,
$title =
null, $local =
false, $wikiId =
null
1097 # Sanitize text a bit:
1098 $comment = str_replace(
"\n",
" ", $comment );
1099 # Allow HTML entities (for T15815)
1100 $comment = Sanitizer::escapeHtmlAllowEntities( $comment );
1102 # Render autocomments and make links:
1127 $comment,
$title =
null, $local =
false, $wikiId =
null
1135 $comment = preg_replace_callback(
1141 '!(?:(?<=(.)))?/\*\s*(.*?)\s*\*/(?:(?=(.)))?!',
1142 function ( $match )
use (
$title, $local, $wikiId, &$append ) {
1146 $match += [
'',
'',
'',
'' ];
1148 $pre = $match[1] !==
'';
1150 $post = $match[3] !==
'';
1154 'FormatAutocomments',
1158 if ( $comment ===
null ) {
1162 # Remove links that a user may have manually put in the autosummary
1163 # This could be improved by copying as much of Parser::stripSectionName as desired.
1175 if ( $sectionTitle ) {
1182 # written summary $presep autocomment (summary )
1183 $pre =
wfMessage(
'autocomment-prefix' )->inContentLanguage()->escaped();
1186 # autocomment $postsep written summary ( summary)
1187 $auto .=
wfMessage(
'colon-separator' )->inContentLanguage()->escaped();
1189 $auto =
'<span class="autocomment">' .
$auto .
'</span>';
1191 .
'<span dir="auto">' .
$auto;
1192 $append .=
'</span>';
1198 return $comment . $append;
1220 $comment,
$title =
null, $local =
false, $wikiId =
null
1222 return preg_replace_callback(
1225 :? # ignore optional leading colon
1226 ([^\]|]+) # 1. link target; page names cannot include ] or |
1229 # Stop matching at ]] without relying on backtracking.
1233 ([^[]*) # 3. link trail (the text up until the next link)
1235 function ( $match )
use (
$title, $local, $wikiId ) {
1241 $comment = $match[0];
1243 # fix up urlencoded title texts (copied from Parser::replaceInternalLinks)
1244 if ( strpos( $match[1],
'%' ) !==
false ) {
1246 rawurldecode( $match[1] ),
1247 [
'<' =>
'<',
'>' =>
'>' ]
1251 # Handle link renaming [[foo|text]] will show link as "text"
1252 if ( $match[2] !=
"" ) {
1259 if ( preg_match(
'/^' . $medians .
'(.*)$/i', $match[1], $submatch ) ) {
1260 # Media link; trail not supported.
1261 $linkRegexp =
'/\[\[(.*?)\]\]/';
1267 # Other kind of link
1268 # Make sure its target is non-empty
1269 if ( isset( $match[1][0] ) && $match[1][0] ==
':' ) {
1270 $match[1] = substr( $match[1], 1 );
1272 if ( $match[1] !==
false && $match[1] !==
'' ) {
1273 if ( preg_match(
$wgContLang->linkTrail(), $match[3], $submatch ) ) {
1274 $trail = $submatch[1];
1278 $linkRegexp =
'/\[\[(.*?)\]\]' . preg_quote( $trail,
'/' ) .
'/';
1286 if ( $target->getText() ==
'' && !$target->isExternal()
1289 $newTarget = clone
$title;
1290 $newTarget->setFragment(
'#' . $target->getFragment() );
1291 $target = $newTarget;
1300 $comment = preg_replace(
1330 if ( $wikiId !==
null && !
$title->isExternal() ) {
1334 $title->getPrefixedText(),
1356 # :Foobar -- override special treatment of prefix (images, language links)
1357 # /Foobar -- convert to CurrentPage/Foobar
1358 # /Foobar/ -- convert to CurrentPage/Foobar, strip the initial and final / from text
1359 # ../ -- convert to CurrentPage, from CurrentPage/CurrentSubPage
1360 # ../Foobar -- convert to CurrentPage/Foobar,
1361 # (from CurrentPage/CurrentSubPage)
1362 # ../Foobar/ -- convert to CurrentPage/Foobar, use 'Foobar' as text
1363 # (from CurrentPage/CurrentSubPage)
1367 # Some namespaces don't allow subpages,
1368 # so only perform processing if subpages are allowed
1370 $hash = strpos( $target,
'#' );
1371 if ( $hash !==
false ) {
1372 $suffix = substr( $target, $hash );
1373 $target = substr( $target, 0, $hash );
1378 $target = trim( $target );
1379 # Look at the first character
1380 if ( $target !=
'' && $target[0] ===
'/' ) {
1381 # / at end means we don't want the slash to be shown
1383 $trailingSlashes = preg_match_all(
'%(/+)$%', $target, $m );
1384 if ( $trailingSlashes ) {
1385 $noslash = $target = substr( $target, 1, -strlen( $m[0][0] ) );
1387 $noslash = substr( $target, 1 );
1390 $ret = $contextTitle->getPrefixedText() .
'/' . trim( $noslash ) . $suffix;
1391 if ( $text ===
'' ) {
1392 $text = $target . $suffix;
1393 } #
this might be changed
for ugliness
reasons
1395 # check for .. subpage backlinks
1397 $nodotdot = $target;
1398 while ( strncmp( $nodotdot,
"../", 3 ) == 0 ) {
1400 $nodotdot = substr( $nodotdot, 3 );
1402 if ( $dotdotcount > 0 ) {
1403 $exploded = explode(
'/', $contextTitle->getPrefixedText() );
1404 if (
count( $exploded ) > $dotdotcount ) { #
not allowed to go
below top level
page
1405 $ret = implode(
'/', array_slice( $exploded, 0, -$dotdotcount ) );
1406 # / at the end means don't show full path
1407 if ( substr( $nodotdot, -1, 1 ) ===
'/' ) {
1408 $nodotdot = rtrim( $nodotdot,
'/' );
1409 if ( $text ===
'' ) {
1410 $text = $nodotdot . $suffix;
1413 $nodotdot = trim( $nodotdot );
1414 if ( $nodotdot !=
'' ) {
1415 $ret .=
'/' . $nodotdot;
1440 $comment,
$title =
null, $local =
false, $wikiId =
null
1445 if ( $comment ==
'' || $comment ==
'*' ) {
1449 $formatted =
wfMessage(
'parentheses' )->rawParams( $formatted )->escaped();
1450 return " <span class=\"comment\">$formatted</span>";
1469 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1472 $rev->getTitle(), $local );
1474 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1477 return " <span class=\"history-deleted\">$block</span>";
1489 $stxt =
wfMessage(
'historyempty' )->escaped();
1491 $stxt =
wfMessage(
'nbytes' )->numParams( $size )->escaped();
1492 $stxt =
wfMessage(
'parentheses' )->rawParams( $stxt )->escaped();
1494 return "<span class=\"history-size\">$stxt</span>";
1515 return "</li>\n" . str_repeat(
"</ul>\n</li>\n", $level > 0 ? $level : 0 );
1529 public static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex =
false ) {
1530 $classes =
"toclevel-$level";
1531 if ( $sectionIndex !==
false ) {
1532 $classes .=
" tocsection-$sectionIndex";
1534 return "\n<li class=\"$classes\"><a href=\"#" .
1535 $anchor .
'"><span class="tocnumber">' .
1536 $tocnumber .
'</span> <span class="toctext">' .
1537 $tocline .
'</span></a>';
1563 return '<div id="toc" class="toc">'
1564 .
'<div id="toctitle" class="toctitle"><h2>' .
$title .
"</h2></div>\n"
1566 .
"</ul>\n</div>\n";
1581 if (
$section[
'toclevel'] > $lastLevel ) {
1583 } elseif (
$section[
'toclevel'] < $lastLevel ) {
1585 $lastLevel -
$section[
'toclevel'] );
1616 $link, $legacyAnchor =
false
1618 $ret =
"<h$level$attribs"
1619 .
"<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
1622 if ( $legacyAnchor !==
false ) {
1623 $ret =
"<div id=\"$legacyAnchor\"></div>$ret";
1638 if ( $trail !==
'' ) {
1640 if ( preg_match( $regex, $trail, $m ) ) {
1645 return [ $inside, $trail ];
1683 if ( in_array(
'verify',
$options,
true ) ) {
1685 if ( $editCount ===
false ) {
1692 if ( !in_array(
'noBrackets',
$options,
true ) ) {
1693 $inner =
$context->
msg(
'brackets' )->rawParams( $inner )->escaped();
1696 return '<span class="mw-rollback-link">' . $inner .
'</span>';
1715 global $wgShowRollbackEditCount;
1716 if ( !is_int( $wgShowRollbackEditCount ) || !$wgShowRollbackEditCount > 0 ) {
1726 [
'rev_user_text',
'rev_deleted' ],
1728 [
'rev_page' =>
$rev->getTitle()->getArticleID() ],
1731 'USE INDEX' => [
'revision' =>
'page_timestamp' ],
1732 'ORDER BY' =>
'rev_timestamp DESC',
1733 'LIMIT' => $wgShowRollbackEditCount + 1
1739 foreach (
$res as $row ) {
1756 if ( $verify && $editCount <= $wgShowRollbackEditCount && !$moreRevs ) {
1780 $disableRollbackEditCountSpecialPage = [
'Recentchanges',
'Watchlist' ];
1788 'action' =>
'rollback',
1789 'from' =>
$rev->getUserText(),
1793 'data-mw' =>
'interface',
1794 'title' =>
$context->
msg(
'tooltip-rollback' )->text(),
1796 $options = [
'known',
'noclasses' ];
1800 $query[
'hidediff'] =
'1';
1803 $disableRollbackEditCount =
false;
1805 foreach ( $disableRollbackEditCountSpecialPage
as $specialPage ) {
1807 $disableRollbackEditCount =
true;
1813 if ( !$disableRollbackEditCount
1814 && is_int( $wgShowRollbackEditCount )
1815 && $wgShowRollbackEditCount > 0
1817 if ( !is_numeric( $editCount ) ) {
1821 if ( $editCount > $wgShowRollbackEditCount ) {
1823 ->numParams( $wgShowRollbackEditCount )->parse();
1825 $html =
$context->
msg(
'rollbacklinkcount' )->numParams( $editCount )->parse();
1865 if ( $more instanceof Message ) {
1866 $more = $more->toString();
1871 MediaWikiServices::getInstance()->getLinkRenderer()
1873 return $formatter->format( $templates,
$type, $more );
1887 if (
count( $hiddencats ) > 0 ) {
1888 # Construct the HTML
1889 $outText =
'<div class="mw-hiddenCategoriesExplanation">';
1890 $outText .=
wfMessage(
'hiddencategories' )->numParams(
count( $hiddencats ) )->parseAsBlock();
1891 $outText .=
"</div><ul>\n";
1893 foreach ( $hiddencats
as $titleObj ) {
1894 # If it's hidden, it must exist - no need to check with a LinkBatch
1896 .
self::link( $titleObj,
null, [], [],
'known' )
1899 $outText .=
'</ul>';
1918 return htmlspecialchars(
$wgLang->formatSize( $size ) );
1937 $message =
wfMessage(
"tooltip-$name", $msgParams );
1938 if ( !$message->exists() ) {
1941 $tooltip = $message->text();
1942 # Compatibility: formerly some tooltips had [alt-.] hardcoded
1943 $tooltip = preg_replace(
"/ ?\[alt-.\]$/",
'', $tooltip );
1944 # Message equal to '-' means suppress it.
1945 if ( $tooltip ==
'-' ) {
1952 if ( $accesskey !==
false ) {
1954 if ( $tooltip ===
false || $tooltip ===
'' ) {
1955 $tooltip =
wfMessage(
'brackets', $accesskey )->text();
1957 $tooltip .=
wfMessage(
'word-separator' )->text();
1958 $tooltip .=
wfMessage(
'brackets', $accesskey )->text();
1980 if ( isset( self::$accesskeycache[
$name] ) ) {
1981 return self::$accesskeycache[
$name];
1984 $message =
wfMessage(
"accesskey-$name" );
1986 if ( !$message->exists() ) {
1989 $accesskey = $message->plain();
1990 if ( $accesskey ===
'' || $accesskey ===
'-' ) {
1991 # @todo FIXME: Per standard MW behavior, a value of '-' means to suppress the
1992 # attribute, but this is broken for accesskey: that might be a useful
1998 self::$accesskeycache[
$name] = $accesskey;
1999 return self::$accesskeycache[
$name];
2016 $canHide =
$user->isAllowed(
'deleterevision' );
2017 if ( !$canHide && !(
$rev->getVisibility() &&
$user->isAllowed(
'deletedhistory' ) ) ) {
2024 if (
$rev->getId() ) {
2028 'type' =>
'revision',
2029 'target' =>
$title->getPrefixedDBkey(),
2030 'ids' =>
$rev->getId()
2036 'type' =>
'archive',
2037 'target' =>
$title->getPrefixedDBkey(),
2038 'ids' =>
$rev->getTimestamp()
2058 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2060 $tag = $restricted ?
'strong' :
'span';
2064 [
'class' =>
'mw-revdelundel-link' ],
2079 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2081 $htmlParentheses =
wfMessage(
'parentheses' )->rawParams(
$html )->escaped();
2082 return Xml::tags(
'span', [
'class' =>
'mw-revdelundel-link' ], $htmlParentheses );
2097 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2098 # no attribute" instead of "output '' as value for attribute", this
2099 # would be three lines.
2104 if (
$attribs[
'title'] ===
false ) {
2107 if (
$attribs[
'accesskey'] ===
false ) {
2121 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2122 # no attribute" instead of "output '' as value for attribute", this
2123 # would be two lines.
2125 if ( $tooltip ===
false ) {
static getDefaultOption( $opt)
Get a given default option value.
static getImageLinkMTOParams( $frameParams, $query='', $parser=null)
Get the link parameters for MediaTransformOutput::toHtml() from given frame parameters supplied by th...
error also a ContextSource you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
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.
Marks HTML that shouldn't be escaped.
$wgThumbLimits
Adjust thumbnails on image pages according to a user setting.
static formatLinksInComment( $comment, $title=null, $local=false, $wikiId=null)
Formats wiki links and media links in text; all other wiki formatting is ignored.
Some internal bits split of from Skin.php.
const TOOL_LINKS_NOBLOCK
Flags for userToolLinks()
static userTalkLink( $userId, $userText)
static singleton()
Get a RepoGroup instance.
static expandAttributes( $attribs)
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : att...
processing should stop and the error should be shown to the user * false
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
static emailLink( $userId, $userText)
$wgResponsiveImages
Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
static revUserLink( $rev, $isPublic=false)
Generate a user link if the current user is allowed to view it.
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped true if there is text before this autocomment $auto
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like please read the documentation for except in special pages derived from QueryPage It s a common pitfall for new developers to submit code containing SQL queries which examine huge numbers of rows Remember that COUNT * is(N), counting rows in atable is like counting beans in a bucket.------------------------------------------------------------------------ Replication------------------------------------------------------------------------The largest installation of MediaWiki, Wikimedia, uses a large set ofslave MySQL servers replicating writes made to a master MySQL server. Itis important to understand the issues associated with this setup if youwant to write code destined for Wikipedia.It 's often the case that the best algorithm to use for a given taskdepends on whether or not replication is in use. Due to our unabashedWikipedia-centrism, we often just use the replication-friendly version, but if you like, you can use wfGetLB() ->getServerCount() > 1 tocheck to see if replication is in use.===Lag===Lag primarily occurs when large write queries are sent to the master.Writes on the master are executed in parallel, but they are executed inserial when they are replicated to the slaves. The master writes thequery to the binlog when the transaction is committed. The slaves pollthe binlog and start executing the query as soon as it appears. They canservice reads while they are performing a write query, but will not readanything more from the binlog and thus will perform no more writes. Thismeans that if the write query runs for a long time, the slaves will lagbehind the master for the time it takes for the write query to complete.Lag can be exacerbated by high read load. MediaWiki 's load balancer willstop sending reads to a slave when it is lagged by more than 30 seconds.If the load ratios are set incorrectly, or if there is too much loadgenerally, this may lead to a slave permanently hovering around 30seconds lag.If all slaves are lagged by more than 30 seconds, MediaWiki will stopwriting to the database. All edits and other write operations will berefused, with an error returned to the user. This gives the slaves achance to catch up. Before we had this mechanism, the slaves wouldregularly lag by several minutes, making review of recent editsdifficult.In addition to this, MediaWiki attempts to ensure that the user seesevents occurring on the wiki in chronological order. A few seconds of lagcan be tolerated, as long as the user sees a consistent picture fromsubsequent requests. This is done by saving the master binlog positionin the session, and then at the start of each request, waiting for theslave to catch up to that position before doing any reads from it. Ifthis wait times out, reads are allowed anyway, but the request isconsidered to be in "lagged slave mode". Lagged slave mode can bechecked by calling wfGetLB() ->getLaggedSlaveMode(). The onlypractical consequence at present is a warning displayed in the pagefooter.===Lag avoidance===To avoid excessive lag, queries which write large numbers of rows shouldbe split up, generally to write one row at a time. Multi-row INSERT ...SELECT queries are the worst offenders should be avoided altogether.Instead do the select first and then the insert.===Working with lag===Despite our best efforts, it 's not practical to guarantee a low-lagenvironment. Lag will usually be less than one second, but mayoccasionally be up to 30 seconds. For scalability, it 's very importantto keep load on the master low, so simply sending all your queries tothe master is not the answer. So when you have a genuine need forup-to-date data, the following approach is advised:1) Do a quick query to the master for a sequence number or timestamp 2) Run the full query on the slave and check if it matches the data you gotfrom the master 3) If it doesn 't, run the full query on the masterTo avoid swamping the master every time the slaves lag, use of thisapproach should be kept to a minimum. In most cases you should just readfrom the slave and let the user deal with the delay.------------------------------------------------------------------------ Lock contention------------------------------------------------------------------------Due to the high write rate on Wikipedia(and some other wikis), MediaWiki developers need to be very careful to structure their writesto avoid long-lasting locks. By default, MediaWiki opens a transactionat the first query, and commits it before the output is sent. Locks willbe held from the time when the query is done until the commit. So youcan reduce lock time by doing as much processing as possible before youdo your write queries.Often this approach is not good enough, and it becomes necessary toenclose small groups of queries in their own transaction. Use thefollowing syntax:$dbw=wfGetDB(DB_MASTER
if(!isset( $args[0])) $lang
static makeSelfLinkObj( $nt, $html='', $query='', $trail='', $prefix='')
Make appropriate markup for a link to the current article.
static generateTOC( $tree, $lang=false)
Generate a table of contents from a section tree.
static getUploadUrl( $destFile, $query='')
Get the URL to upload a certain file.
static tocIndent()
Add another level to the Table of Contents.
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
$wgSVGMaxSize
Don't scale a SVG larger than this.
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 change
static getLinkColour(LinkTarget $t, $threshold)
Return the CSS colour of a known link.
static getForeignURL( $wikiID, $page, $fragmentId=null)
Convenience to get a url to a page on a foreign wiki.
static fnamePart( $url)
Returns the filename part of an url.
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 specialLink( $name, $key='')
Make a link to a special page given its name and, optionally, a message key from the link text.
static escapeRegexReplacement( $string)
Escape a string to make it suitable for inclusion in a preg_replace() replacement parameter.
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
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 before processing starts Return false to skip default processing and return $ret $linkRenderer
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,...
static processResponsiveImages( $file, $thumb, $hp)
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
static makeCommentLink(Title $title, $text, $wikiId=null, $options=[])
Generates a link to the given Title.
Allows to change the fields on the form that will be generated $name
if(! $wgRequest->checkUrlExtension()) if(! $wgEnableAPI) $wgTitle
getRequest()
Get the WebRequest object.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
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.
static tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex=false)
parameter level defines if we are on an indentation level
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
static formatHiddenCategories( $hiddencats)
Returns HTML for the "hidden categories on this page" list.
controlled by $wgMainCacheType controlled by $wgParserCacheType controlled by $wgMessageCacheType If you set CACHE_NONE to one of the three control default value for MediaWiki still create a but requests to it are no ops and we always fall through to the database If the cache daemon can t be it should also disable itself fairly smoothly By $wgMemc is used but when it is $parserMemc or $messageMemc this is mentioned below
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
null means default & $customAttribs
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
namespace and then decline to actually register it file or subcat img or subcat $title
static makeMediaLinkObj( $title, $html='', $time=false)
Create a direct link to a given uploaded file.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static generateRollback( $rev, IContextSource $context=null, $options=[ 'verify'])
Generate a rollback link for a given revision.
static makeThumbLink2(Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="")
static getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
static newFromLinkTarget(LinkTarget $linkTarget)
Create a new Title from a LinkTarget.
static formatAutocomments( $comment, $title=null, $local=false, $wikiId=null)
Converts autogenerated comments in edit summaries into section links.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database 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 in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database etc For and for historical reasons
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
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
static tocList( $toc, $lang=false)
Wraps the TOC in a table and provides the hide/collapse javascript.
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 $tag
static getRollbackEditCount( $rev, $verify)
This function will return the number of revisions which a rollback would revert 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
static tocLineEnd()
End a Table Of Contents line.
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
static hasSubpages( $index)
Does the namespace allow subpages?
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
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
do that in ParserLimitReportFormat instead $parser
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
see documentation in includes Linker php for Linker::makeImageLink & $time
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
when a variable name is used in a it is silently declared as a new masking the global
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
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
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title 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
static splitTrail( $trail)
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array...
static prettifyIP( $ip)
Prettify an IP for display to end users.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
static blockLink( $userId, $userText)
static normaliseSpecialPage(LinkTarget $target)
Handles formatting for the "templates used on this page" lists.
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
static getRevDeleteLink(User $user, Revision $rev, Title $title)
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the setti...
static formatSize( $size)
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
static formatRevisionSize( $size)
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
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 & $ret
static makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor=false)
Create a headline for content.
static makeImageLink(Parser $parser, Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="", $widthOption=null)
Given parameters derived from [[Image:Foo|options...]], generate the HTML that that syntax inserts in...
static formatTemplates( $templates, $preview=false, $section=false, $more=null)
static exists( $index)
Returns whether the specified namespace exists.
static getMain()
Static methods.
$wgUploadNavigationUrl
Point the upload navigation link to an external URL Useful if you want to use a shared repository by ...
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
wfFindFile( $title, $options=[])
Find a file.
Interface for objects which can provide a MediaWiki context on request.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
see documentation in includes Linker php for Linker::makeImageLink & $handlerParams
static tooltip( $name, $options=null)
Returns raw bits of HTML, use titleAttrib()
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 page
Represents a title within MediaWiki.
$wgMiserMode
Disable database-intensive features.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
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
$wgThumbUpright
Adjust width of upright images when parameter 'upright' is used This allows a nicer look for upright ...
static tocUnindent( $level)
Finish one or more sublevels on the Table of Contents.
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static makeMediaLinkFile(Title $title, $file, $html='')
Create a direct link to a given uploaded file.
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
$wgEnableUploads
Uploads have to be specially set up to be secure.
static commentBlock( $comment, $title=null, $local=false, $wikiId=null)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
static normalizeSubpageLink( $contextTitle, $target, &$text)
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 "<
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
$wgUploadMissingFileUrl
Point the upload link for missing files to an external URL, as with $wgUploadNavigationUrl.
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 MediaWikiServices
static accesskey( $name)
Given the id of an interface element, constructs the appropriate accesskey attribute from the system ...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static makeThumbLinkObj(Title $title, $file, $label='', $alt, $align='right', $params=[], $framed=false, $manualthumb="")
Make HTML for a thumbnail including image, border and caption.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static buildRollbackLink( $rev, IContextSource $context=null, $editCount=false)
Build a raw rollback link, useful for collections of "tool" links.
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped $pre
static makeExternalImage( $url, $alt='')
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage().
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 getCanonicalName( $index)
Returns the canonical (English) name for a given index.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
static makeBrokenImageLinkObj( $title, $label='', $query='', $unused1='', $unused2='', $time=false)
Make a "broken" link to an image.
the array() calling protocol came about after MediaWiki 1.4rc1.
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