59 # @todo FIXME: We have a whole bunch of handling here that doesn't happen in
60 # getExternalLinkAttributes, why?
65 return self::getLinkAttributesInternal(
$title, $class );
85 return self::getLinkAttributesInternal(
$title, $class );
106 $title = $nt->getPrefixedText();
108 return self::getLinkAttributesInternal(
$title, $class );
126 $class = htmlspecialchars( $class );
128 if ( $class !=
'' ) {
129 $r .=
" class=\"$class\"";
132 $r .=
" title=\"$title\"";
149 $services = MediaWikiServices::getInstance();
206 if ( !$target instanceof
Title ) {
207 wfWarn( __METHOD__ .
': Requires $target to be a Title object.', 2 );
208 return "<!-- ERROR -->$html";
211 if ( is_string(
$query ) ) {
213 wfDeprecated( __METHOD__ .
' with parameter $query as string (should be array)',
'1.20' );
217 $services = MediaWikiServices::getInstance();
221 if ( !isset(
$options[
'stubThreshold'] ) ) {
222 $defaultLinkRenderer =
$services->getLinkRenderer();
223 $options[
'stubThreshold'] = $defaultLinkRenderer->getStubThreshold();
226 ->createFromLegacyOptions(
$options );
231 if (
$html !== null ) {
236 if ( in_array(
'known',
$options,
true ) ) {
238 } elseif ( in_array(
'broken',
$options,
true ) ) {
240 } elseif ( in_array(
'noclasses',
$options,
true ) ) {
278 $ret =
"<strong class=\"selflink\">{$prefix}{$html}</strong>{$trail}";
284 $html = htmlspecialchars( $nt->getPrefixedText() );
286 list( $inside, $trail ) = self::splitTrail( $trail );
287 return "<strong class=\"selflink\">{$prefix}{$html}{$inside}</strong>{$trail}";
306 $name = $context->
msg(
'blanknamespace' )->text();
308 $name = $wgContLang->getFormattedNsText( $namespace );
310 return $context->
msg(
'invalidtitle-knownnamespace', $namespace,
$name,
$title )->text();
312 return $context->
msg(
'invalidtitle-unknownnamespace', $namespace,
$title )->text();
343 $basename = strrchr( $url,
'/' );
344 if (
false === $basename ) {
347 $basename = substr( $basename, 1 );
364 $alt = self::fnamePart( $url );
369 wfDebug(
"Hook LinkerMakeExternalImage changed the output of external image "
370 .
"with url {$url} and alt text {$alt} to {$img}\n",
true );
417 $query =
"", $widthOption = null
421 if ( !
Hooks::run(
'ImageBeforeProduceHTML', [ &$dummy, &$title,
426 if ( $file && !$file->allowInlineDisplay() ) {
436 $page = isset( $hp[
'page'] ) ? $hp[
'page'] :
false;
437 if ( !isset( $fp[
'align'] ) ) {
440 if ( !isset( $fp[
'alt'] ) ) {
443 if ( !isset( $fp[
'title'] ) ) {
446 if ( !isset( $fp[
'class'] ) ) {
450 $prefix = $postfix =
'';
452 if (
'center' == $fp[
'align'] ) {
453 $prefix =
'<div class="center">';
455 $fp[
'align'] =
'none';
457 if ( $file && !isset( $hp[
'width'] ) ) {
458 if ( isset( $hp[
'height'] ) && $file->isVectorized() ) {
464 $hp[
'width'] = $file->getWidth(
$page );
467 if ( isset( $fp[
'thumbnail'] )
468 || isset( $fp[
'manualthumb'] )
469 || isset( $fp[
'framed'] )
470 || isset( $fp[
'frameless'] )
475 if ( $widthOption === null || !isset( $wgThumbLimits[$widthOption] ) ) {
480 if ( isset( $fp[
'upright'] ) && $fp[
'upright'] == 0 ) {
487 $prefWidth = isset( $fp[
'upright'] ) ?
488 round( $wgThumbLimits[$widthOption] * $fp[
'upright'], -1 ) :
489 $wgThumbLimits[$widthOption];
493 if ( !isset( $hp[
'height'] ) && ( $hp[
'width'] <= 0 ||
494 $prefWidth < $hp[
'width'] || $file->isVectorized() ) ) {
495 $hp[
'width'] = $prefWidth;
500 if ( isset( $fp[
'thumbnail'] ) || isset( $fp[
'manualthumb'] ) || isset( $fp[
'framed'] ) ) {
501 # Create a thumbnail. Alignment depends on the writing direction of
502 # the page content language (right-aligned for LTR languages,
503 # left-aligned for RTL languages)
504 # If a thumbnail width has not been provided, it is set
505 # to the default user option as specified in Language*.php
506 if ( $fp[
'align'] ==
'' ) {
509 return $prefix . self::makeThumbLink2( $title, $file, $fp, $hp,
$time,
$query ) . $postfix;
512 if ( $file && isset( $fp[
'frameless'] ) ) {
513 $srcWidth = $file->getWidth(
$page );
514 # For "frameless" option: do not present an image bigger than the
515 # source (for bitmap-style images). This is the same behavior as the
516 # "thumb" option does it already.
517 if ( $srcWidth && !$file->mustRender() && $hp[
'width'] > $srcWidth ) {
518 $hp[
'width'] = $srcWidth;
522 if ( $file && isset( $hp[
'width'] ) ) {
523 # Create a resized image, without the additional thumbnail features
524 $thumb = $file->transform( $hp );
530 $s = self::makeBrokenImageLinkObj( $title, $fp[
'title'],
'',
'',
'',
$time ==
true );
532 self::processResponsiveImages( $file, $thumb, $hp );
535 'title' => $fp[
'title'],
536 'valign' => isset( $fp[
'valign'] ) ? $fp[
'valign'] :
false,
537 'img-class' => $fp[
'class'] ];
538 if ( isset( $fp[
'border'] ) ) {
539 $params[
'img-class'] .= (
$params[
'img-class'] !==
'' ?
' ' :
'' ) .
'thumbborder';
545 if ( $fp[
'align'] !=
'' ) {
546 $s =
"<div class=\"float{$fp['align']}\">{$s}</div>";
548 return str_replace(
"\n",
' ', $prefix .
$s . $postfix );
561 if ( isset( $frameParams[
'link-url'] ) && $frameParams[
'link-url'] !==
'' ) {
562 $mtoParams[
'custom-url-link'] = $frameParams[
'link-url'];
563 if ( isset( $frameParams[
'link-target'] ) ) {
564 $mtoParams[
'custom-target-link'] = $frameParams[
'link-target'];
567 $extLinkAttrs =
$parser->getExternalLinkAttribs( $frameParams[
'link-url'] );
568 foreach ( $extLinkAttrs
as $name => $val ) {
570 $mtoParams[
'parser-extlink-' .
$name] = $val;
573 } elseif ( isset( $frameParams[
'link-title'] ) && $frameParams[
'link-title'] !==
'' ) {
574 $mtoParams[
'custom-title-link'] = self::normaliseSpecialPage( $frameParams[
'link-title'] );
575 } elseif ( !empty( $frameParams[
'no-link'] ) ) {
578 $mtoParams[
'desc-link'] =
true;
579 $mtoParams[
'desc-query'] =
$query;
597 $align =
'right',
$params = [], $framed =
false, $manualthumb =
""
605 $frameParams[
'framed'] =
true;
607 if ( $manualthumb ) {
608 $frameParams[
'manualthumb'] = $manualthumb;
610 return self::makeThumbLink2( $title, $file, $frameParams,
$params );
625 $exists = $file && $file->exists();
631 $page = isset( $hp[
'page'] ) ? $hp[
'page'] :
false;
632 if ( !isset( $fp[
'align'] ) ) {
633 $fp[
'align'] =
'right';
635 if ( !isset( $fp[
'alt'] ) ) {
638 if ( !isset( $fp[
'title'] ) ) {
641 if ( !isset( $fp[
'caption'] ) ) {
645 if ( empty( $hp[
'width'] ) ) {
647 $hp[
'width'] = isset( $fp[
'upright'] ) ? 130 : 180;
651 $manualthumb =
false;
654 $outerWidth = $hp[
'width'] + 2;
656 if ( isset( $fp[
'manualthumb'] ) ) {
657 # Use manually specified thumbnail
659 if ( $manual_title ) {
662 $thumb = $manual_img->getUnscaledThumb( $hp );
668 } elseif ( isset( $fp[
'framed'] ) ) {
670 $thumb = $file->getUnscaledThumb( $hp );
673 # Do not present an image bigger than the source, for bitmap-style images
674 # This is a hack to maintain compatibility with arbitrary pre-1.10 behavior
675 $srcWidth = $file->getWidth(
$page );
676 if ( $srcWidth && !$file->mustRender() && $hp[
'width'] > $srcWidth ) {
677 $hp[
'width'] = $srcWidth;
679 $thumb = $file->transform( $hp );
683 $outerWidth = $thumb->getWidth() + 2;
685 $outerWidth = $hp[
'width'] + 2;
689 # ThumbnailImage::toHtml() already adds page= onto the end of DjVu URLs
690 # So we don't need to pass it here in $query. However, the URL for the
691 # zoom icon still needs it, so we make a unique query for it. See bug 14771
697 && !isset( $fp[
'link-title'] )
698 && !isset( $fp[
'link-url'] )
699 && !isset( $fp[
'no-link'] ) ) {
700 $fp[
'link-url'] = $url;
703 $s =
"<div class=\"thumb t{$fp['align']}\">"
704 .
"<div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
707 $s .= self::makeBrokenImageLinkObj( $title, $fp[
'title'],
'',
'',
'',
$time ==
true );
709 } elseif ( !$thumb ) {
710 $s .=
wfMessage(
'thumbnail_error',
'' )->escaped();
713 if ( !$noscale && !$manualthumb ) {
714 self::processResponsiveImages( $file, $thumb, $hp );
718 'title' => $fp[
'title'],
719 'img-class' => ( isset( $fp[
'class'] ) && $fp[
'class'] !==
''
721 :
'' ) .
'thumbimage'
725 if ( isset( $fp[
'framed'] ) ) {
731 'class' =>
'internal',
736 $s .=
' <div class="thumbcaption">' . $zoomIcon . $fp[
'caption'] .
"</div></div></div>";
737 return str_replace(
"\n",
' ',
$s );
750 if ( $wgResponsiveImages && $thumb && !$thumb->isError() ) {
752 $hp15[
'width'] = round( $hp[
'width'] * 1.5 );
754 $hp20[
'width'] = $hp[
'width'] * 2;
755 if ( isset( $hp[
'height'] ) ) {
756 $hp15[
'height'] = round( $hp[
'height'] * 1.5 );
757 $hp20[
'height'] = $hp[
'height'] * 2;
760 $thumb15 = $file->transform( $hp15 );
761 $thumb20 = $file->transform( $hp20 );
762 if ( $thumb15 && !$thumb15->isError() && $thumb15->getUrl() !== $thumb->getUrl() ) {
763 $thumb->responsiveUrls[
'1.5'] = $thumb15->getUrl();
765 if ( $thumb20 && !$thumb20->isError() && $thumb20->getUrl() !== $thumb->getUrl() ) {
766 $thumb->responsiveUrls[
'2'] = $thumb20->getUrl();
784 $query =
'', $unused1 =
'', $unused2 =
'',
$time =
false
787 wfWarn( __METHOD__ .
': Requires $title to be a Title object.' );
788 return "<!-- ERROR -->" . htmlspecialchars( $label );
792 if ( $label ==
'' ) {
793 $label =
$title->getPrefixedText();
795 $encLabel = htmlspecialchars( $label );
798 if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
809 [
'class' =>
'mw-redirect' ],
811 [
'known',
'noclasses' ]
817 return '<a href="' . htmlspecialchars( $href ) .
'" class="new" title="' .
818 htmlspecialchars(
$title->getPrefixedText(), ENT_QUOTES ) .
'">' .
835 $q =
'wpDestFile=' . $destFile->getPartialURL();
840 if ( $wgUploadMissingFileUrl ) {
842 } elseif ( $wgUploadNavigationUrl ) {
846 return $upload->getLocalURL( $q );
861 return self::makeMediaLinkFile(
$title, $img,
$html );
877 if ( $file && $file->exists() ) {
878 $url = $file->getUrl();
881 $url = self::getUploadUrl( $title );
899 wfDebug(
"Hook LinkerMakeMediaLinkFile changed the output of link "
900 .
"with url {$url} and text {$html} to {$ret}\n",
true );
919 $key = strtolower(
$name );
942 $class .=
" $linktype";
945 $class .=
" {$attribs['class']}";
950 $text = htmlspecialchars( $text );
959 } elseif ( $newRel !==
'' ) {
961 $newRels = explode(
' ', $newRel );
962 $oldRels = explode(
' ',
$attribs[
'rel'] );
963 $combined = array_unique( array_merge( $newRels, $oldRels ) );
964 $attribs[
'rel'] = implode(
' ', $combined );
970 wfDebug(
"Hook LinkerMakeExternalLink changed the output of link "
971 .
"with url {$url} and text {$text} to {$link}\n",
true );
986 public static function userLink( $userId, $userName, $altUserName =
false ) {
987 $classes =
'mw-userlink';
988 if ( $userId == 0 ) {
990 if ( $altUserName ===
false ) {
993 $classes .=
' mw-anonuserlink';
1000 htmlspecialchars( $altUserName !==
false ? $altUserName : $userName ),
1001 [
'class' => $classes ]
1019 $userId, $userText, $redContribsWhenNoEdits =
false,
$flags = 0, $edits = null
1022 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
1023 $blockable = !(
$flags & self::TOOL_LINKS_NOBLOCK );
1024 $addEmailLink =
$flags & self::TOOL_LINKS_EMAIL && $userId;
1028 $items[] = self::userTalkLink( $userId, $userText );
1033 if ( $redContribsWhenNoEdits ) {
1034 if ( intval( $edits ) === 0 && $edits !== 0 ) {
1036 $edits =
$user->getEditCount();
1038 if ( $edits === 0 ) {
1046 if ( $blockable && $wgUser->isAllowed(
'block' ) ) {
1047 $items[] = self::blockLink( $userId, $userText );
1050 if ( $addEmailLink && $wgUser->canSendEmail() ) {
1051 $items[] = self::emailLink( $userId, $userText );
1054 Hooks::run(
'UserToolLinksEdit', [ $userId, $userText, &$items ] );
1057 return wfMessage(
'word-separator' )->escaped()
1058 .
'<span class="mw-usertoollinks">'
1059 .
wfMessage(
'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped()
1075 return self::userToolLinks( $userId, $userText,
true, 0, $edits );
1087 return $userTalkLink;
1130 return '<span class="history-deleted">' .
$link .
'</span>';
1148 $link = self::userLink( $userId, $userText )
1149 . self::userToolLinks( $userId, $userText );
1154 return ' <span class="history-deleted">' .
$link .
'</span>';
1184 # Sanitize text a bit:
1186 # Allow HTML entities (for bug 13815)
1189 # Render autocomments and make links:
1228 '!(?:(?<=(.)))?/\*\s*(.*?)\s*\*/(?:(?=(.)))?!',
1229 function ( $match )
use (
$title, $local, $wikiId, &$append ) {
1233 $match += [
'',
'',
'',
'' ];
1235 $pre = $match[1] !==
'';
1237 $post = $match[3] !==
'';
1241 'FormatAutocomments',
1249 # Remove links that a user may have manually put in the autosummary
1250 # This could be improved by copying as much of Parser::stripSectionName as desired.
1262 if ( $sectionTitle ) {
1269 # written summary $presep autocomment (summary )
1270 $pre =
wfMessage(
'autocomment-prefix' )->inContentLanguage()->escaped();
1273 # autocomment $postsep written summary ( summary)
1274 $auto .=
wfMessage(
'colon-separator' )->inContentLanguage()->escaped();
1276 $auto =
'<span class="autocomment">' .
$auto .
'</span>';
1278 .
'<span dir="auto">' .
$auto;
1279 $append .=
'</span>';
1309 return preg_replace_callback(
1312 :? # ignore optional leading colon
1313 ([^\]|]+) # 1. link target; page names cannot include ] or |
1315 # 2. a pipe-separated substring; only the last is captured
1316 # Stop matching at | and ]] without relying on backtracking.
1320 ([^[]*) # 3. link trail (the text up until the next link)
1322 function ( $match )
use (
$title, $local, $wikiId ) {
1326 $medians .= preg_quote( $wgContLang->getNsText(
NS_MEDIA ),
'/' ) .
'):';
1330 # fix up urlencoded title texts (copied from Parser::replaceInternalLinks)
1331 if ( strpos( $match[1],
'%' ) !==
false ) {
1333 rawurldecode( $match[1] ),
1334 [
'<' =>
'<',
'>' =>
'>' ]
1338 # Handle link renaming [[foo|text]] will show link as "text"
1339 if ( $match[2] !=
"" ) {
1346 if ( preg_match(
'/^' . $medians .
'(.*)$/i', $match[1], $submatch ) ) {
1347 # Media link; trail not supported.
1348 $linkRegexp =
'/\[\[(.*?)\]\]/';
1354 # Other kind of link
1355 # Make sure its target is non-empty
1356 if ( isset( $match[1][0] ) && $match[1][0] ==
':' ) {
1357 $match[1] = substr( $match[1], 1 );
1359 if ( $match[1] !==
false && $match[1] !==
'' ) {
1360 if ( preg_match( $wgContLang->linkTrail(), $match[3], $submatch ) ) {
1361 $trail = $submatch[1];
1365 $linkRegexp =
'/\[\[(.*?)\]\]' . preg_quote( $trail,
'/' ) .
'/';
1373 if ( $target->getText() ==
'' && !$target->isExternal()
1376 $newTarget = clone
$title;
1377 $newTarget->setFragment(
'#' . $target->getFragment() );
1378 $target = $newTarget;
1387 $comment = preg_replace(
1389 StringUtils::escapeRegexReplacement( $thelink ),
1417 if ( $wikiId !== null && !$title->
isExternal() ) {
1443 # :Foobar -- override special treatment of prefix (images, language links)
1444 # /Foobar -- convert to CurrentPage/Foobar
1445 # /Foobar/ -- convert to CurrentPage/Foobar, strip the initial and final / from text
1446 # ../ -- convert to CurrentPage, from CurrentPage/CurrentSubPage
1447 # ../Foobar -- convert to CurrentPage/Foobar,
1448 # (from CurrentPage/CurrentSubPage)
1449 # ../Foobar/ -- convert to CurrentPage/Foobar, use 'Foobar' as text
1450 # (from CurrentPage/CurrentSubPage)
1454 # Some namespaces don't allow subpages,
1455 # so only perform processing if subpages are allowed
1457 $hash = strpos( $target,
'#' );
1458 if ( $hash !==
false ) {
1459 $suffix = substr( $target, $hash );
1460 $target = substr( $target, 0, $hash );
1465 $target = trim( $target );
1466 # Look at the first character
1467 if ( $target !=
'' && $target[0] ===
'/' ) {
1468 # / at end means we don't want the slash to be shown
1470 $trailingSlashes = preg_match_all(
'%(/+)$%', $target, $m );
1471 if ( $trailingSlashes ) {
1472 $noslash = $target = substr( $target, 1, -strlen( $m[0][0] ) );
1474 $noslash = substr( $target, 1 );
1477 $ret = $contextTitle->getPrefixedText() .
'/' . trim( $noslash ) . $suffix;
1478 if ( $text ===
'' ) {
1479 $text = $target . $suffix;
1480 } #
this might be changed
for ugliness
reasons
1482 # check for .. subpage backlinks
1484 $nodotdot = $target;
1485 while ( strncmp( $nodotdot,
"../", 3 ) == 0 ) {
1487 $nodotdot = substr( $nodotdot, 3 );
1489 if ( $dotdotcount > 0 ) {
1490 $exploded = explode(
'/', $contextTitle->getPrefixedText() );
1491 if ( count( $exploded ) > $dotdotcount ) { # not allowed to go
below top level
page
1492 $ret = implode(
'/', array_slice( $exploded, 0, -$dotdotcount ) );
1493 # / at the end means don't show full path
1494 if ( substr( $nodotdot, -1, 1 ) ===
'/' ) {
1495 $nodotdot = rtrim( $nodotdot,
'/' );
1496 if ( $text ===
'' ) {
1497 $text = $nodotdot . $suffix;
1500 $nodotdot = trim( $nodotdot );
1501 if ( $nodotdot !=
'' ) {
1502 $ret .=
'/' . $nodotdot;
1535 $formatted = self::formatComment(
$comment,
$title, $local, $wikiId );
1536 $formatted =
wfMessage(
'parentheses' )->rawParams( $formatted )->escaped();
1537 return " <span class=\"comment\">$formatted</span>";
1556 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1561 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1564 return " <span class=\"history-deleted\">$block</span>";
1576 $stxt =
wfMessage(
'historyempty' )->escaped();
1578 $stxt =
wfMessage(
'nbytes' )->numParams( $size )->escaped();
1579 $stxt =
wfMessage(
'parentheses' )->rawParams( $stxt )->escaped();
1581 return "<span class=\"history-size\">$stxt</span>";
1602 return "</li>\n" . str_repeat(
"</ul>\n</li>\n", $level > 0 ? $level : 0 );
1616 public static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex =
false ) {
1617 $classes =
"toclevel-$level";
1618 if ( $sectionIndex !==
false ) {
1619 $classes .=
" tocsection-$sectionIndex";
1621 return "\n<li class=\"$classes\"><a href=\"#" .
1622 $anchor .
'"><span class="tocnumber">' .
1623 $tocnumber .
'</span> <span class="toctext">' .
1624 $tocline .
'</span></a>';
1650 return '<div id="toc" class="toc">'
1651 .
'<div id="toctitle"><h2>' .
$title .
"</h2></div>\n"
1653 .
"</ul>\n</div>\n";
1668 if ( $section[
'toclevel'] > $lastLevel ) {
1669 $toc .= self::tocIndent();
1670 } elseif ( $section[
'toclevel'] < $lastLevel ) {
1671 $toc .= self::tocUnindent(
1672 $lastLevel - $section[
'toclevel'] );
1674 $toc .= self::tocLineEnd();
1677 $toc .= self::tocLine( $section[
'anchor'],
1678 $section[
'line'], $section[
'number'],
1679 $section[
'toclevel'], $section[
'index'] );
1680 $lastLevel = $section[
'toclevel'];
1682 $toc .= self::tocLineEnd();
1683 return self::tocList( $toc,
$lang );
1703 $link, $legacyAnchor =
false
1705 $ret =
"<h$level$attribs"
1706 .
"<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
1709 if ( $legacyAnchor !==
false ) {
1710 $ret =
"<div id=\"$legacyAnchor\"></div>$ret";
1723 $regex = $wgContLang->linkTrail();
1725 if ( $trail !==
'' ) {
1727 if ( preg_match( $regex, $trail, $m ) ) {
1732 return [ $inside, $trail ];
1770 if ( in_array(
'verify',
$options,
true ) ) {
1771 $editCount = self::getRollbackEditCount(
$rev,
true );
1772 if ( $editCount ===
false ) {
1777 $inner = self::buildRollbackLink(
$rev,
$context, $editCount );
1779 if ( !in_array(
'noBrackets',
$options,
true ) ) {
1780 $inner =
$context->msg(
'brackets' )->rawParams( $inner )->escaped();
1783 return '<span class="mw-rollback-link">' . $inner .
'</span>';
1803 if ( !is_int( $wgShowRollbackEditCount ) || !$wgShowRollbackEditCount > 0 ) {
1813 [
'rev_user_text',
'rev_deleted' ],
1815 [
'rev_page' =>
$rev->getTitle()->getArticleID() ],
1818 'USE INDEX' => [
'revision' =>
'page_timestamp' ],
1819 'ORDER BY' =>
'rev_timestamp DESC',
1820 'LIMIT' => $wgShowRollbackEditCount + 1
1826 foreach (
$res as $row ) {
1843 if ( $verify && $editCount <= $wgShowRollbackEditCount && !$moreRevs ) {
1867 $disableRollbackEditCountSpecialPage = [
'Recentchanges',
'Watchlist' ];
1875 'action' =>
'rollback',
1876 'from' =>
$rev->getUserText(),
1877 'token' =>
$context->getUser()->getEditToken(
'rollback' ),
1880 'data-mw' =>
'interface',
1881 'title' =>
$context->msg(
'tooltip-rollback' )->text(),
1883 $options = [
'known',
'noclasses' ];
1885 if (
$context->getRequest()->getBool(
'bot' ) ) {
1887 $query[
'hidediff'] =
'1';
1890 $disableRollbackEditCount =
false;
1891 if ( $wgMiserMode ) {
1892 foreach ( $disableRollbackEditCountSpecialPage
as $specialPage ) {
1893 if (
$context->getTitle()->isSpecial( $specialPage ) ) {
1894 $disableRollbackEditCount =
true;
1900 if ( !$disableRollbackEditCount
1901 && is_int( $wgShowRollbackEditCount )
1902 && $wgShowRollbackEditCount > 0
1904 if ( !is_numeric( $editCount ) ) {
1905 $editCount = self::getRollbackEditCount(
$rev,
false );
1908 if ( $editCount > $wgShowRollbackEditCount ) {
1910 ->numParams( $wgShowRollbackEditCount )->parse();
1912 $html =
$context->msg(
'rollbacklinkcount' )->numParams( $editCount )->parse();
1944 if ( count( $templates ) > 0 ) {
1945 # Do a batch existence check
1948 $batch->addObj( $title );
1952 # Construct the HTML
1953 $outText =
'<div class="mw-templatesUsedExplanation">';
1955 $outText .=
wfMessage(
'templatesusedpreview' )->numParams( count( $templates ) )
1958 $outText .=
wfMessage(
'templatesusedsection' )->numParams( count( $templates ) )
1961 $outText .=
wfMessage(
'templatesused' )->numParams( count( $templates ) )
1964 $outText .=
"</div><ul>\n";
1966 usort( $templates,
'Title::compare' );
1967 foreach ( $templates
as $titleObj ) {
1969 $restrictions = $titleObj->getRestrictions(
'edit' );
1970 if ( $restrictions ) {
1973 if ( $restrictions === [
'sysop' ] ) {
1974 $msg =
wfMessage(
'template-protected' );
1975 } elseif ( $restrictions === [
'autoconfirmed' ] ) {
1976 $msg =
wfMessage(
'template-semiprotected' );
1978 if ( $msg && !$msg->isDisabled() ) {
1979 $protected = $msg->parse();
1984 foreach ( $restrictions
as $r ) {
1985 $msgs[] =
wfMessage(
"restriction-level-$r" )->parse();
1988 ->rawParams( $wgLang->commaList( $msgs ) )->escaped();
1991 if ( $titleObj->quickUserCan(
'edit' ) ) {
1996 [
'action' =>
'edit' ]
2001 wfMessage(
'viewsourcelink' )->escaped(),
2003 [
'action' =>
'edit' ]
2007 .
wfMessage(
'word-separator' )->escaped()
2008 .
wfMessage(
'parentheses' )->rawParams( $editLink )->escaped()
2009 .
wfMessage(
'word-separator' )->escaped()
2010 . $protected .
'</li>';
2013 if ( $more instanceof
Title ) {
2015 } elseif ( $more ) {
2016 $outText .=
"<li>$more</li>";
2019 $outText .=
'</ul>';
2035 if ( count( $hiddencats ) > 0 ) {
2036 # Construct the HTML
2037 $outText =
'<div class="mw-hiddenCategoriesExplanation">';
2038 $outText .=
wfMessage(
'hiddencategories' )->numParams( count( $hiddencats ) )->parseAsBlock();
2039 $outText .=
"</div><ul>\n";
2041 foreach ( $hiddencats
as $titleObj ) {
2042 # If it's hidden, it must exist - no need to check with a LinkBatch
2044 .
self::link( $titleObj, null, [], [],
'known' )
2047 $outText .=
'</ul>';
2062 return htmlspecialchars( $wgLang->formatSize( $size ) );
2081 $message =
wfMessage(
"tooltip-$name", $msgParams );
2082 if ( !$message->exists() ) {
2085 $tooltip = $message->text();
2086 # Compatibility: formerly some tooltips had [alt-.] hardcoded
2087 $tooltip = preg_replace(
"/ ?\[alt-.\]$/",
'', $tooltip );
2088 # Message equal to '-' means suppress it.
2089 if ( $tooltip ==
'-' ) {
2095 $accesskey = self::accesskey(
$name );
2096 if ( $accesskey !==
false ) {
2098 if ( $tooltip ===
false || $tooltip ===
'' ) {
2099 $tooltip =
wfMessage(
'brackets', $accesskey )->text();
2101 $tooltip .=
wfMessage(
'word-separator' )->text();
2102 $tooltip .=
wfMessage(
'brackets', $accesskey )->text();
2124 if ( isset( self::$accesskeycache[
$name] ) ) {
2125 return self::$accesskeycache[
$name];
2128 $message =
wfMessage(
"accesskey-$name" );
2130 if ( !$message->exists() ) {
2133 $accesskey = $message->plain();
2134 if ( $accesskey ===
'' || $accesskey ===
'-' ) {
2135 # @todo FIXME: Per standard MW behavior, a value of '-' means to suppress the
2136 # attribute, but this is broken for accesskey: that might be a useful
2142 self::$accesskeycache[
$name] = $accesskey;
2143 return self::$accesskeycache[
$name];
2160 $canHide = $user->
isAllowed(
'deleterevision' );
2168 if ( $rev->
getId() ) {
2172 'type' =>
'revision',
2174 'ids' => $rev->
getId()
2180 'type' =>
'archive',
2202 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2204 $tag = $restricted ?
'strong' :
'span';
2208 [
'class' =>
'mw-revdelundel-link' ],
2223 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2225 $htmlParentheses =
wfMessage(
'parentheses' )->rawParams(
$html )->escaped();
2226 return Xml::tags(
'span', [
'class' =>
'mw-revdelundel-link' ], $htmlParentheses );
2241 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2242 # no attribute" instead of "output '' as value for attribute", this
2243 # would be three lines.
2245 'title' => self::titleAttrib(
$name,
'withaccess', $msgParams ),
2246 'accesskey' => self::accesskey(
$name )
2248 if (
$attribs[
'title'] ===
false ) {
2251 if (
$attribs[
'accesskey'] ===
false ) {
2265 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2266 # no attribute" instead of "output '' as value for attribute", this
2267 # would be two lines.
2269 if ( $tooltip ===
false ) {
static generateTOC($tree, $lang=false)
Generate a table of contents from a section tree.
getFragment()
Get the Title fragment (i.e.
static tocLineEnd()
End a Table Of Contents line.
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
Interface for objects which can provide a MediaWiki context on request.
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 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...
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
static tocList($toc, $lang=false)
Wraps the TOC in a table and provides the hide/collapse javascript.
static formatAutocomments($comment, $title=null, $local=false, $wikiId=null)
Converts autogenerated comments in edit summaries into section links.
static processResponsiveImages($file, $thumb, $hp)
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
the array() calling protocol came about after MediaWiki 1.4rc1.
null for the local 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
static getRevDeleteLink(User $user, Revision $rev, Title $title)
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the setti...
getText()
Get the text form (spaces not underscores) of the main part.
processing should stop and the error should be shown to the user * false
static buildRollbackLink($rev, IContextSource $context=null, $editCount=false)
Build a raw rollback link, useful for collections of "tool" links.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
msg()
Get a Message object with context set.
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
static expandAttributes($attribs)
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attr...
if(!isset($args[0])) $lang
static formatRevisionSize($size)
static normaliseSpecialPage(LinkTarget $target)
static fnamePart($url)
Returns the filename part of an url.
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 makeSelfLinkObj($nt, $html= '', $query= '', $trail= '', $prefix= '')
Make appropriate markup for a link to the current article.
static newFromId($id)
Static factory method for creation from a given user ID.
static getLinkColour(LinkTarget $t, $threshold)
Return the CSS colour of a known link.
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
it s the revision text itself In either if gzip is the revision text is gzipped $flags
getPrefixedText()
Get the prefixed title with spaces.
static exists($index)
Returns whether the specified namespace exists.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
null means default & $customAttribs
Represents a title within MediaWiki.
when a variable name is used in a it is silently declared as a new local masking the global
static blockLink($userId, $userText)
static tooltipAndAccesskeyAttribs($name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
see documentation in includes Linker php for Linker::makeImageLink & $time
static formatTemplates($templates, $preview=false, $section=false, $more=null)
Returns HTML for the "templates used on this page" list.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
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
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
static getRollbackEditCount($rev, $verify)
This function will return the number of revisions which a rollback would revert and, if $verify is set it will verify that a revision can be reverted (that the user isn't the only contributor and the revision we might rollback to isn't deleted).
static splitTrail($trail)
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array...
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
$wgEnableUploads
Uploads have to be specially set up to be secure.
static makeMediaLinkObj($title, $html= '', $time=false)
Create a direct link to a given uploaded file.
static makeBrokenImageLinkObj($title, $label= '', $query= '', $unused1= '', $unused2= '', $time=false)
Make a "broken" link to an image.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static getLinkAttributesInternal($title, $class)
Common code for getLinkAttributesX functions.
wfCgiToArray($query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
static normalizeSectionNameWhitespace($section)
Normalizes whitespace in a section name, such as might be returned by Parser::stripSectionName(), for use in the id's that are used for section links.
static getForeignURL($wikiID, $page, $fragmentId=null)
Convenience to get a url to a page on a foreign wiki.
getTitle()
Returns the title of the page associated with this entry or null.
Some quick notes on the file repository architecture Functionality is
isExternal()
Is this Title interwiki?
static getMain()
Static methods.
$wgUploadMissingFileUrl
Point the upload link for missing files to an external URL, as with $wgUploadNavigationUrl.
static normalizeSubpageLink($contextTitle, $target, &$text)
static getCanonicalName($index)
Returns the canonical (English) name for a given index.
wfAppendQuery($url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
static titleAttrib($name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
isAllowed($action= '')
Internal mechanics of testing a permission.
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.
wfWarn($msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
$wgThumbUpright
Adjust width of upright images when parameter 'upright' is used This allows a nicer look for upright ...
static escapeHtmlAllowEntities($html)
Given HTML input, escape with htmlspecialchars but un-escape entities.
getLocalURL($query= '', $query2=false)
Get a URL with no fragment or server name (relative URL) from a Title object.
static singleton()
Get a RepoGroup instance.
$wgMiserMode
Disable database-intensive features.
static accesskey($name)
Given the id of an interface element, constructs the appropriate accesskey attribute from the system ...
static emailLink($userId, $userText)
const TOOL_LINKS_NOBLOCK
Flags for userToolLinks()
static revDeleteLinkDisabled($delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
static makeHeadline($level, $attribs, $anchor, $html, $link, $legacyAnchor=false)
Create a headline for content.
$wgThumbLimits
Adjust thumbnails on image pages according to a user setting.
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
userCan($field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
getComment($audience=self::FOR_PUBLIC, User $user=null)
Fetch revision comment if it's available to the specified audience.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
getTargetLanguage()
Get the target language for the content being parsed.
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 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 after processing 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 unsetoffset-wrap String Wrap the message in html(usually something like"<
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static hasSubpages($index)
Does the namespace allow subpages?
static tocUnindent($level)
Finish one or more sublevels on the Table of Contents.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static tocLine($anchor, $tocline, $tocnumber, $level, $sectionIndex=false)
parameter level defines if we are on an indentation level
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
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...
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
static makeCommentLink(Title $title, $text, $wikiId=null, $options=[])
Generates a link to the given Title.
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
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 userToolLinksRedContribs($userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
$wgDisableAnonTalk
Disable links to talk pages of anonymous users (IPs) in listings on special pages like page history...
static revUserLink($rev, $isPublic=false)
Generate a user link if the current user is allowed to view it.
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
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 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...
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
static link($target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
$wgSVGMaxSize
Don't scale a SVG larger than this.
static getImageLinkMTOParams($frameParams, $query= '', $parser=null)
Get the link parameters for MediaTransformOutput::toHtml() from given frame parameters supplied by th...
static tooltip($name, $options=null)
Returns raw bits of HTML, use titleAttrib()
static userLink($userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static makeExternalLink($url, $text, $escape=true, $linktype= '', $attribs=[], $title=null)
Make an external link.
static getExternalLinkRel($url=false, $title=null)
Get the rel attribute for a particular external link.
getVisibility()
Get the deletion bitfield of the revision.
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
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 tags($element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
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
static getInternalLinkAttributesObj($nt, $unused=null, $class= '', $title=false)
Get the appropriate HTML attributes to add to the "a" element of an internal link, given the Title object for the page we want to link to.
static resolveAlias($alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static generateRollback($rev, IContextSource $context=null, $options=[ 'verify'])
Generate a rollback link for a given revision.
static formatHiddenCategories($hiddencats)
Returns HTML for the "hidden categories on this page" list.
static makeThumbLink2(Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="")
static userTalkLink($userId, $userText)
static getUploadUrl($destFile, $query= '')
Get the URL to upload a certain file.
static makeMediaLinkFile(Title $title, $file, $html= '')
Create a direct link to a given uploaded file.
static userToolLinks($userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template to be included in the link
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
static formatSize($size)
Format a size in bytes for output, using an appropriate unit (B, KB, MB or GB) according to the magni...
see documentation in includes Linker php for Linker::makeImageLink & $handlerParams
static tocIndent()
Add another level to the Table of Contents.
static getInterwikiLinkAttributes($title, $unused=null, $class= 'external')
Get the appropriate HTML attributes to add to the "a" element of an interwiki link.
static getInternalLinkAttributes($title, $unused=null, $class= '')
Get the appropriate HTML attributes to add to the "a" element of an internal link.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
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
$wgShowRollbackEditCount
The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back...
if(!$wgRequest->checkUrlExtension()) if(!$wgEnableAPI) $wgTitle
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...
Marks HTML that shouldn't be escaped.
static makeThumbLinkObj(Title $title, $file, $label= '', $alt, $align= 'right', $params=[], $framed=false, $manualthumb="")
Make HTML for a thumbnail including image, border and caption.
static getDefaultOption($opt)
Get a given default option value.
$wgUploadNavigationUrl
Point the upload navigation link to an external URL Useful if you want to use a shared repository by ...
$wgResponsiveImages
Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
static revUserTools($rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
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()...
static specialLink($name, $key= '')
Make a link to a special page given its name and, optionally, a message key from the link text...
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
wfFindFile($title, $options=[])
Find a file.
static revDeleteLink($query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk page
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
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
wfGetLangObj($langcode=false)
Return a Language object from $langcode.
getPrefixedDBkey()
Get the prefixed database key form.
static prettifyIP($ip)
Prettify an IP for display to end users.
Allows to change the fields on the form that will be generated $name