3 * Base class for all skins.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
24 * @defgroup Skins Skins
28 * The main skin class which provides methods and properties for all other skins.
30 * See docs/skin.txt for more information.
34 abstract class Skin
extends ContextSource
{
35 protected $skinname = null;
36 protected $mRelevantTitle = null;
37 protected $mRelevantUser = null;
40 * @var string Stylesheets set to use. Subdirectory in skins/ where various stylesheets are
41 * located. Only needs to be set if you intend to use the getSkinStylePath() method.
43 public $stylename = null;
46 * Fetch the set of available skins.
47 * @return array Associative array of strings
49 static function getSkinNames() {
50 return SkinFactory
::getDefaultInstance()->getSkinNames();
54 * Fetch the skinname messages for available skins.
57 static function getSkinNameMessages() {
59 foreach ( self
::getSkinNames() as $skinKey => $skinName ) {
60 $messages[] = "skinname-$skinKey";
66 * Fetch the list of user-selectable skins in regards to $wgSkipSkins.
67 * Useful for Special:Preferences and other places where you
68 * only want to show skins users _can_ use.
72 public static function getAllowedSkins() {
75 $allowedSkins = self
::getSkinNames();
77 foreach ( $wgSkipSkins as $skip ) {
78 unset( $allowedSkins[$skip] );
85 * Normalize a skin preference value to a form that can be loaded.
87 * If a skin can't be found, it will fall back to the configured default ($wgDefaultSkin), or the
88 * hardcoded default ($wgFallbackSkin) if the default skin is unavailable too.
90 * @param string $key 'monobook', 'vector', etc.
93 static function normalizeKey( $key ) {
94 global $wgDefaultSkin, $wgFallbackSkin;
96 $skinNames = Skin
::getSkinNames();
98 // Make keys lowercase for case-insensitive matching.
99 $skinNames = array_change_key_case( $skinNames, CASE_LOWER
);
100 $key = strtolower( $key );
101 $defaultSkin = strtolower( $wgDefaultSkin );
102 $fallbackSkin = strtolower( $wgFallbackSkin );
104 if ( $key == '' ||
$key == 'default' ) {
105 // Don't return the default immediately;
106 // in a misconfiguration we need to fall back.
110 if ( isset( $skinNames[$key] ) ) {
114 // Older versions of the software used a numeric setting
115 // in the user preferences.
121 if ( isset( $fallback[$key] ) ) {
122 $key = $fallback[$key];
125 if ( isset( $skinNames[$key] ) ) {
127 } elseif ( isset( $skinNames[$defaultSkin] ) ) {
130 return $fallbackSkin;
135 * @return string Skin name
137 public function getSkinName() {
138 return $this->skinname
;
142 * @param OutputPage $out
144 function initPage( OutputPage
$out ) {
146 $this->preloadExistence();
151 * Defines the ResourceLoader modules that should be added to the skin
152 * It is recommended that skins wishing to override call parent::getDefaultModules()
153 * and substitute out any modules they wish to change by using a key to look them up
154 * @return array Array of modules with helper keys for easy overriding
156 public function getDefaultModules() {
157 global $wgUseAjax, $wgEnableAPI, $wgEnableWriteAPI;
159 $out = $this->getOutput();
160 $user = $out->getUser();
162 // modules that enhance the page content in some way
164 'mediawiki.page.ready',
166 // modules that exist for legacy reasons
167 'legacy' => ResourceLoaderStartUpModule
::getLegacyModules(),
168 // modules relating to search functionality
170 // modules relating to functionality relating to watching an article
172 // modules which relate to the current users preferences
176 // Add various resources if required
177 if ( $wgUseAjax && $wgEnableAPI ) {
178 if ( $wgEnableWriteAPI && $user->isLoggedIn()
179 && $user->isAllowedAll( 'writeapi', 'viewmywatchlist', 'editmywatchlist' )
180 && $this->getRelevantTitle()->canExist()
182 $modules['watch'][] = 'mediawiki.page.watch.ajax';
185 $modules['search'][] = 'mediawiki.searchSuggest';
188 if ( $user->getBoolOption( 'editsectiononrightclick' ) ) {
189 $modules['user'][] = 'mediawiki.action.view.rightClickEdit';
192 // Crazy edit-on-double-click stuff
193 if ( $out->isArticle() && $user->getOption( 'editondblclick' ) ) {
194 $modules['user'][] = 'mediawiki.action.view.dblClickEdit';
200 * Preload the existence of three commonly-requested pages in a single query
202 function preloadExistence() {
205 $user = $this->getUser();
206 $title = $this->getRelevantTitle();
209 if ( $user->isLoggedIn() ) {
210 $titles[] = $user->getUserPage();
211 $titles[] = $user->getTalkPage();
214 // Check, if the page can hold some kind of content, otherwise do nothing
215 if ( !$title->canExist() ) {
217 } elseif ( $title->isTalkPage() ) {
218 $titles[] = $title->getSubjectPage();
220 $titles[] = $title->getTalkPage();
223 Hooks
::run( 'SkinPreloadExistence', [ &$titles, $this ] );
225 if ( count( $titles ) ) {
226 $lb = new LinkBatch( $titles );
227 $lb->setCaller( __METHOD__
);
233 * Get the current revision ID
237 public function getRevisionId() {
238 return $this->getOutput()->getRevisionId();
242 * Whether the revision displayed is the latest revision of the page
246 public function isRevisionCurrent() {
247 $revID = $this->getRevisionId();
248 return $revID == 0 ||
$revID == $this->getTitle()->getLatestRevID();
252 * Set the "relevant" title
253 * @see self::getRelevantTitle()
256 public function setRelevantTitle( $t ) {
257 $this->mRelevantTitle
= $t;
261 * Return the "relevant" title.
262 * A "relevant" title is not necessarily the actual title of the page.
263 * Special pages like Special:MovePage use set the page they are acting on
264 * as their "relevant" title, this allows the skin system to display things
265 * such as content tabs which belong to to that page instead of displaying
266 * a basic special page tab which has almost no meaning.
270 public function getRelevantTitle() {
271 if ( isset( $this->mRelevantTitle
) ) {
272 return $this->mRelevantTitle
;
274 return $this->getTitle();
278 * Set the "relevant" user
279 * @see self::getRelevantUser()
282 public function setRelevantUser( $u ) {
283 $this->mRelevantUser
= $u;
287 * Return the "relevant" user.
288 * A "relevant" user is similar to a relevant title. Special pages like
289 * Special:Contributions mark the user which they are relevant to so that
290 * things like the toolbox can display the information they usually are only
291 * able to display on a user's userpage and talkpage.
294 public function getRelevantUser() {
295 if ( isset( $this->mRelevantUser
) ) {
296 return $this->mRelevantUser
;
298 $title = $this->getRelevantTitle();
299 if ( $title->hasSubjectNamespace( NS_USER
) ) {
300 $rootUser = $title->getRootText();
301 if ( User
::isIP( $rootUser ) ) {
302 $this->mRelevantUser
= User
::newFromName( $rootUser, false );
304 $user = User
::newFromName( $rootUser, false );
307 $user->load( User
::READ_NORMAL
);
309 if ( $user->isLoggedIn() ) {
310 $this->mRelevantUser
= $user;
314 return $this->mRelevantUser
;
320 * Outputs the HTML generated by other functions.
321 * @param OutputPage $out
323 abstract function outputPage( OutputPage
$out = null );
329 static function makeVariablesScript( $data ) {
331 return ResourceLoader
::makeInlineScript(
332 ResourceLoader
::makeConfigSetScript( $data )
340 * Get the query to generate a dynamic stylesheet
344 public static function getDynamicStylesheetQuery() {
345 global $wgSquidMaxage;
349 'maxage' => $wgSquidMaxage,
350 'usemsgcache' => 'yes',
351 'ctype' => 'text/css',
352 'smaxage' => $wgSquidMaxage,
357 * Add skin specific stylesheets
358 * Calling this method with an $out of anything but the same OutputPage
359 * inside ->getOutput() is deprecated. The $out arg is kept
360 * for compatibility purposes with skins.
361 * @param OutputPage $out
364 abstract function setupSkinUserCss( OutputPage
$out );
368 * @param Title $title
371 function getPageClasses( $title ) {
372 $numeric = 'ns-' . $title->getNamespace();
374 if ( $title->isSpecialPage() ) {
375 $type = 'ns-special';
376 // bug 23315: provide a class based on the canonical special page name without subpages
377 list( $canonicalName ) = SpecialPageFactory
::resolveAlias( $title->getDBkey() );
378 if ( $canonicalName ) {
379 $type .= ' ' . Sanitizer
::escapeClass( "mw-special-$canonicalName" );
381 $type .= ' mw-invalidspecialpage';
383 } elseif ( $title->isTalkPage() ) {
386 $type = 'ns-subject';
389 $name = Sanitizer
::escapeClass( 'page-' . $title->getPrefixedText() );
390 $root = Sanitizer
::escapeClass( 'rootpage-' . $title->getRootTitle()->getPrefixedText() );
392 return "$numeric $type $name $root";
396 * Return values for <html> element
397 * @return array Array of associative name-to-value elements for <html> element
399 public function getHtmlElementAttributes() {
400 $lang = $this->getLanguage();
402 'lang' => $lang->getHtmlCode(),
403 'dir' => $lang->getDir(),
404 'class' => 'client-nojs',
409 * This will be called by OutputPage::headElement when it is creating the
410 * "<body>" tag, skins can override it if they have a need to add in any
411 * body attributes or classes of their own.
412 * @param OutputPage $out
413 * @param array $bodyAttrs
415 function addToBodyAttributes( $out, &$bodyAttrs ) {
416 // does nothing by default
429 * @return string HTML
431 function getCategoryLinks() {
432 global $wgUseCategoryBrowser;
434 $out = $this->getOutput();
435 $allCats = $out->getCategoryLinks();
437 if ( !count( $allCats ) ) {
445 $colon = $this->msg( 'colon-separator' )->escaped();
447 if ( !empty( $allCats['normal'] ) ) {
448 $t = $embed . implode( "{$pop}{$embed}", $allCats['normal'] ) . $pop;
450 $msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped();
451 $linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text();
452 $title = Title
::newFromText( $linkPage );
453 $link = $title ? Linker
::link( $title, $msg ) : $msg;
454 $s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
455 $link . $colon . '<ul>' . $t . '</ul>' . '</div>';
459 if ( isset( $allCats['hidden'] ) ) {
460 if ( $this->getUser()->getBoolOption( 'showhiddencats' ) ) {
461 $class = ' mw-hidden-cats-user-shown';
462 } elseif ( $this->getTitle()->getNamespace() == NS_CATEGORY
) {
463 $class = ' mw-hidden-cats-ns-shown';
465 $class = ' mw-hidden-cats-hidden';
468 $s .= "<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
469 $this->msg( 'hidden-categories' )->numParams( count( $allCats['hidden'] ) )->escaped() .
470 $colon . '<ul>' . $embed . implode( "{$pop}{$embed}", $allCats['hidden'] ) . $pop . '</ul>' .
474 # optional 'dmoz-like' category browser. Will be shown under the list
475 # of categories an article belong to
476 if ( $wgUseCategoryBrowser ) {
477 $s .= '<br /><hr />';
479 # get a big array of the parents tree
480 $parenttree = $this->getTitle()->getParentCategoryTree();
481 # Skin object passed by reference cause it can not be
482 # accessed under the method subfunction drawCategoryBrowser
483 $tempout = explode( "\n", $this->drawCategoryBrowser( $parenttree ) );
484 # Clean out bogus first entry and sort them
485 unset( $tempout[0] );
487 # Output one per line
488 $s .= implode( "<br />\n", $tempout );
495 * Render the array as a series of links.
496 * @param array $tree Categories tree returned by Title::getParentCategoryTree
497 * @return string Separated by >, terminate with "\n"
499 function drawCategoryBrowser( $tree ) {
502 foreach ( $tree as $element => $parent ) {
503 if ( empty( $parent ) ) {
504 # element start a new list
507 # grab the others elements
508 $return .= $this->drawCategoryBrowser( $parent ) . ' > ';
511 # add our current element to the list
512 $eltitle = Title
::newFromText( $element );
513 $return .= Linker
::link( $eltitle, htmlspecialchars( $eltitle->getText() ) );
520 * @return string HTML
522 function getCategories() {
523 $out = $this->getOutput();
524 $catlinks = $this->getCategoryLinks();
526 // Check what we're showing
527 $allCats = $out->getCategoryLinks();
528 $showHidden = $this->getUser()->getBoolOption( 'showhiddencats' ) ||
529 $this->getTitle()->getNamespace() == NS_CATEGORY
;
531 $classes = [ 'catlinks' ];
532 if ( empty( $allCats['normal'] ) && !( !empty( $allCats['hidden'] ) && $showHidden ) ) {
533 $classes[] = 'catlinks-allhidden';
536 return Html
::rawElement(
538 [ 'id' => 'catlinks', 'class' => $classes, 'data-mw' => 'interface' ],
544 * This runs a hook to allow extensions placing their stuff after content
545 * and article metadata (e.g. categories).
546 * Note: This function has nothing to do with afterContent().
548 * This hook is placed here in order to allow using the same hook for all
549 * skins, both the SkinTemplate based ones and the older ones, which directly
550 * use this class to get their data.
552 * The output of this function gets processed in SkinTemplate::outputPage() for
553 * the SkinTemplate based skins, all other skins should directly echo it.
555 * @return string Empty by default, if not changed by any hook function.
557 protected function afterContentHook() {
560 if ( Hooks
::run( 'SkinAfterContent', [ &$data, $this ] ) ) {
561 // adding just some spaces shouldn't toggle the output
562 // of the whole <div/>, so we use trim() here
563 if ( trim( $data ) != '' ) {
564 // Doing this here instead of in the skins to
565 // ensure that the div has the same ID in all
567 $data = "<div id='mw-data-after-content'>\n" .
572 wfDebug( "Hook SkinAfterContent changed output processing.\n" );
579 * Generate debug data HTML for displaying at the bottom of the main content
581 * @return string HTML containing debug data, if enabled (otherwise empty).
583 protected function generateDebugHTML() {
584 return MWDebug
::getHTMLDebugLog();
588 * This gets called shortly before the "</body>" tag.
590 * @return string HTML-wrapped JS code to be put before "</body>"
592 function bottomScripts() {
593 // TODO and the suckage continues. This function is really just a wrapper around
594 // OutputPage::getBottomScripts() which takes a Skin param. This should be cleaned
596 $bottomScriptText = $this->getOutput()->getBottomScripts();
597 Hooks
::run( 'SkinAfterBottomScripts', [ $this, &$bottomScriptText ] );
599 return $bottomScriptText;
603 * Text with the permalink to the source page,
604 * usually shown on the footer of a printed page
606 * @return string HTML text with an URL
608 function printSource() {
609 $oldid = $this->getRevisionId();
611 $canonicalUrl = $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid );
612 $url = htmlspecialchars( wfExpandIRI( $canonicalUrl ) );
614 // oldid not available for non existing pages
615 $url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL() ) );
618 return $this->msg( 'retrievedfrom' )
619 ->rawParams( '<a dir="ltr" href="' . $url . '">' . $url . '</a>' )
624 * @return string HTML
626 function getUndeleteLink() {
627 $action = $this->getRequest()->getVal( 'action', 'view' );
629 if ( $this->getTitle()->userCan( 'deletedhistory', $this->getUser() ) &&
630 ( !$this->getTitle()->exists() ||
$action == 'history' ) ) {
631 $n = $this->getTitle()->isDeleted();
634 if ( $this->getTitle()->quickUserCan( 'undelete', $this->getUser() ) ) {
635 $msg = 'thisisdeleted';
637 $msg = 'viewdeleted';
640 return $this->msg( $msg )->rawParams(
642 SpecialPage
::getTitleFor( 'Undelete', $this->getTitle()->getPrefixedDBkey() ),
643 $this->msg( 'restorelink' )->numParams( $n )->escaped() )
654 function subPageSubtitle() {
655 $out = $this->getOutput();
658 if ( !Hooks
::run( 'SkinSubPageSubtitle', [ &$subpages, $this, $out ] ) ) {
662 if ( $out->isArticle() && MWNamespace
::hasSubpages( $out->getTitle()->getNamespace() ) ) {
663 $ptext = $this->getTitle()->getPrefixedText();
664 if ( preg_match( '/\//', $ptext ) ) {
665 $links = explode( '/', $ptext );
670 $lang = $this->getLanguage();
672 foreach ( $links as $link ) {
673 $growinglink .= $link;
675 $linkObj = Title
::newFromText( $growinglink );
677 if ( is_object( $linkObj ) && $linkObj->isKnown() ) {
678 $getlink = Linker
::linkKnown(
680 htmlspecialchars( $display )
686 $subpages .= $lang->getDirMarkEntity() . $this->msg( 'pipe-separator' )->escaped();
688 $subpages .= '< ';
691 $subpages .= $getlink;
705 * @deprecated since 1.27, feature removed
706 * @return bool Always false
708 function showIPinHeader() {
709 wfDeprecated( __METHOD__
, '1.27' );
716 function getSearchLink() {
717 $searchPage = SpecialPage
::getTitleFor( 'Search' );
718 return $searchPage->getLocalURL();
724 function escapeSearchLink() {
725 return htmlspecialchars( $this->getSearchLink() );
729 * @param string $type
732 function getCopyright( $type = 'detect' ) {
733 global $wgRightsPage, $wgRightsUrl, $wgRightsText;
735 if ( $type == 'detect' ) {
736 if ( !$this->isRevisionCurrent()
737 && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled()
745 if ( $type == 'history' ) {
746 $msg = 'history_copyright';
751 if ( $wgRightsPage ) {
752 $title = Title
::newFromText( $wgRightsPage );
753 $link = Linker
::linkKnown( $title, $wgRightsText );
754 } elseif ( $wgRightsUrl ) {
755 $link = Linker
::makeExternalLink( $wgRightsUrl, $wgRightsText );
756 } elseif ( $wgRightsText ) {
757 $link = $wgRightsText;
763 // Allow for site and per-namespace customization of copyright notice.
764 // @todo Remove deprecated $forContent param from hook handlers and then remove here.
768 'SkinCopyrightFooter',
769 [ $this->getTitle(), $type, &$msg, &$link, &$forContent ]
772 return $this->msg( $msg )->rawParams( $link )->text();
776 * @return null|string
778 function getCopyrightIcon() {
779 global $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgFooterIcons;
783 if ( $wgFooterIcons['copyright']['copyright'] ) {
784 $out = $wgFooterIcons['copyright']['copyright'];
785 } elseif ( $wgRightsIcon ) {
786 $icon = htmlspecialchars( $wgRightsIcon );
788 if ( $wgRightsUrl ) {
789 $url = htmlspecialchars( $wgRightsUrl );
790 $out .= '<a href="' . $url . '">';
793 $text = htmlspecialchars( $wgRightsText );
794 $out .= "<img src=\"$icon\" alt=\"$text\" width=\"88\" height=\"31\" />";
796 if ( $wgRightsUrl ) {
805 * Gets the powered by MediaWiki icon.
808 function getPoweredBy() {
809 global $wgResourceBasePath;
811 $url1 = htmlspecialchars(
812 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
814 $url1_5 = htmlspecialchars(
815 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png"
817 $url2 = htmlspecialchars(
818 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png"
820 $text = '<a href="//www.mediawiki.org/"><img src="' . $url1
821 . '" srcset="' . $url1_5 . ' 1.5x, ' . $url2 . ' 2x" '
822 . 'height="31" width="88" alt="Powered by MediaWiki" /></a>';
823 Hooks
::run( 'SkinGetPoweredBy', [ &$text, $this ] );
828 * Get the timestamp of the latest revision, formatted in user language
832 protected function lastModified() {
833 $timestamp = $this->getOutput()->getRevisionTimestamp();
835 # No cached timestamp, load it from the database
836 if ( $timestamp === null ) {
837 $timestamp = Revision
::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
841 $d = $this->getLanguage()->userDate( $timestamp, $this->getUser() );
842 $t = $this->getLanguage()->userTime( $timestamp, $this->getUser() );
843 $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->parse();
848 if ( wfGetLB()->getLaggedSlaveMode() ) {
849 $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->parse() . '</strong>';
856 * @param string $align
859 function logoText( $align = '' ) {
860 if ( $align != '' ) {
861 $a = " style='float: {$align};'";
866 $mp = $this->msg( 'mainpage' )->escaped();
867 $mptitle = Title
::newMainPage();
868 $url = ( is_object( $mptitle ) ?
htmlspecialchars( $mptitle->getLocalURL() ) : '' );
870 $logourl = $this->getLogo();
871 $s = "<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
877 * Renders a $wgFooterIcons icon according to the method's arguments
878 * @param array $icon The icon to build the html for, see $wgFooterIcons
879 * for the format of this array.
880 * @param bool|string $withImage Whether to use the icon's image or output
881 * a text-only footericon.
882 * @return string HTML
884 function makeFooterIcon( $icon, $withImage = 'withImage' ) {
885 if ( is_string( $icon ) ) {
887 } else { // Assuming array
888 $url = isset( $icon["url"] ) ?
$icon["url"] : null;
889 unset( $icon["url"] );
890 if ( isset( $icon["src"] ) && $withImage === 'withImage' ) {
891 // do this the lazy way, just pass icon data as an attribute array
892 $html = Html
::element( 'img', $icon );
894 $html = htmlspecialchars( $icon["alt"] );
897 $html = Html
::rawElement( 'a', [ "href" => $url ], $html );
904 * Gets the link to the wiki's main page.
907 function mainPageLink() {
908 $s = Linker
::linkKnown(
909 Title
::newMainPage(),
910 $this->msg( 'mainpage' )->escaped()
917 * Returns an HTML link for use in the footer
918 * @param string $desc The i18n message key for the link text
919 * @param string $page The i18n message key for the page to link to
920 * @return string HTML anchor
922 public function footerLink( $desc, $page ) {
923 // if the link description has been set to "-" in the default language,
924 if ( $this->msg( $desc )->inContentLanguage()->isDisabled() ) {
925 // then it is disabled, for all languages.
928 // Otherwise, we display the link for the user, described in their
929 // language (which may or may not be the same as the default language),
930 // but we make the link target be the one site-wide page.
931 $title = Title
::newFromText( $this->msg( $page )->inContentLanguage()->text() );
937 return Linker
::linkKnown(
939 $this->msg( $desc )->escaped()
945 * Gets the link to the wiki's privacy policy page.
946 * @return string HTML
948 function privacyLink() {
949 return $this->footerLink( 'privacy', 'privacypage' );
953 * Gets the link to the wiki's about page.
954 * @return string HTML
956 function aboutLink() {
957 return $this->footerLink( 'aboutsite', 'aboutpage' );
961 * Gets the link to the wiki's general disclaimers page.
962 * @return string HTML
964 function disclaimerLink() {
965 return $this->footerLink( 'disclaimers', 'disclaimerpage' );
969 * Return URL options for the 'edit page' link.
970 * This may include an 'oldid' specifier, if the current page view is such.
975 function editUrlOptions() {
976 $options = [ 'action' => 'edit' ];
978 if ( !$this->isRevisionCurrent() ) {
979 $options['oldid'] = intval( $this->getRevisionId() );
986 * @param User|int $id
989 function showEmailUser( $id ) {
990 if ( $id instanceof User
) {
993 $targetUser = User
::newFromId( $id );
996 # The sending user must have a confirmed email address and the target
997 # user must have a confirmed email address and allow emails from users.
998 return $this->getUser()->canSendEmail() &&
999 $targetUser->canReceiveEmail();
1003 * Return a fully resolved style path url to images or styles stored in the current skins's folder.
1004 * This method returns a url resolved using the configured skin style path
1005 * and includes the style version inside of the url.
1007 * Requires $stylename to be set, otherwise throws MWException.
1009 * @param string $name The name or path of a skin resource file
1010 * @return string The fully resolved style path url including styleversion
1011 * @throws MWException
1013 function getSkinStylePath( $name ) {
1014 global $wgStylePath, $wgStyleVersion;
1016 if ( $this->stylename
=== null ) {
1017 $class = get_class( $this );
1018 throw new MWException( "$class::\$stylename must be set to use getSkinStylePath()" );
1021 return "$wgStylePath/{$this->stylename}/$name?$wgStyleVersion";
1024 /* these are used extensively in SkinTemplate, but also some other places */
1027 * @param string $urlaction
1030 static function makeMainPageUrl( $urlaction = '' ) {
1031 $title = Title
::newMainPage();
1032 self
::checkTitle( $title, '' );
1034 return $title->getLocalURL( $urlaction );
1038 * Make a URL for a Special Page using the given query and protocol.
1040 * If $proto is set to null, make a local URL. Otherwise, make a full
1041 * URL with the protocol specified.
1043 * @param string $name Name of the Special page
1044 * @param string $urlaction Query to append
1045 * @param string|null $proto Protocol to use or null for a local URL
1048 static function makeSpecialUrl( $name, $urlaction = '', $proto = null ) {
1049 $title = SpecialPage
::getSafeTitleFor( $name );
1050 if ( is_null( $proto ) ) {
1051 return $title->getLocalURL( $urlaction );
1053 return $title->getFullURL( $urlaction, false, $proto );
1058 * @param string $name
1059 * @param string $subpage
1060 * @param string $urlaction
1063 static function makeSpecialUrlSubpage( $name, $subpage, $urlaction = '' ) {
1064 $title = SpecialPage
::getSafeTitleFor( $name, $subpage );
1065 return $title->getLocalURL( $urlaction );
1069 * @param string $name
1070 * @param string $urlaction
1073 static function makeI18nUrl( $name, $urlaction = '' ) {
1074 $title = Title
::newFromText( wfMessage( $name )->inContentLanguage()->text() );
1075 self
::checkTitle( $title, $name );
1076 return $title->getLocalURL( $urlaction );
1080 * @param string $name
1081 * @param string $urlaction
1084 static function makeUrl( $name, $urlaction = '' ) {
1085 $title = Title
::newFromText( $name );
1086 self
::checkTitle( $title, $name );
1088 return $title->getLocalURL( $urlaction );
1092 * If url string starts with http, consider as external URL, else
1094 * @param string $name
1095 * @return string URL
1097 static function makeInternalOrExternalUrl( $name ) {
1098 if ( preg_match( '/^(?i:' . wfUrlProtocols() . ')/', $name ) ) {
1101 return self
::makeUrl( $name );
1106 * this can be passed the NS number as defined in Language.php
1107 * @param string $name
1108 * @param string $urlaction
1109 * @param int $namespace
1112 static function makeNSUrl( $name, $urlaction = '', $namespace = NS_MAIN
) {
1113 $title = Title
::makeTitleSafe( $namespace, $name );
1114 self
::checkTitle( $title, $name );
1116 return $title->getLocalURL( $urlaction );
1120 * these return an array with the 'href' and boolean 'exists'
1121 * @param string $name
1122 * @param string $urlaction
1125 static function makeUrlDetails( $name, $urlaction = '' ) {
1126 $title = Title
::newFromText( $name );
1127 self
::checkTitle( $title, $name );
1130 'href' => $title->getLocalURL( $urlaction ),
1131 'exists' => $title->isKnown(),
1136 * Make URL details where the article exists (or at least it's convenient to think so)
1137 * @param string $name Article name
1138 * @param string $urlaction
1141 static function makeKnownUrlDetails( $name, $urlaction = '' ) {
1142 $title = Title
::newFromText( $name );
1143 self
::checkTitle( $title, $name );
1146 'href' => $title->getLocalURL( $urlaction ),
1152 * make sure we have some title to operate on
1154 * @param Title $title
1155 * @param string $name
1157 static function checkTitle( &$title, $name ) {
1158 if ( !is_object( $title ) ) {
1159 $title = Title
::newFromText( $name );
1160 if ( !is_object( $title ) ) {
1161 $title = Title
::newFromText( '--error: link target missing--' );
1167 * Build an array that represents the sidebar(s), the navigation bar among them.
1169 * BaseTemplate::getSidebar can be used to simplify the format and id generation in new skins.
1171 * The format of the returned array is array( heading => content, ... ), where:
1172 * - heading is the heading of a navigation portlet. It is either:
1173 * - magic string to be handled by the skins ('SEARCH' / 'LANGUAGES' / 'TOOLBOX' / ...)
1174 * - a message name (e.g. 'navigation'), the message should be HTML-escaped by the skin
1175 * - plain text, which should be HTML-escaped by the skin
1176 * - content is the contents of the portlet. It is either:
1177 * - HTML text (<ul><li>...</li>...</ul>)
1178 * - array of link data in a format accepted by BaseTemplate::makeListItem()
1179 * - (for a magic string as a key, any value)
1181 * Note that extensions can control the sidebar contents using the SkinBuildSidebar hook
1182 * and can technically insert anything in here; skin creators are expected to handle
1183 * values described above.
1187 function buildSidebar() {
1188 global $wgEnableSidebarCache, $wgSidebarCacheExpiry;
1191 $callback = function () use ( $that ) {
1193 $that->addToSidebar( $bar, 'sidebar' );
1194 Hooks
::run( 'SkinBuildSidebar', [ $that, &$bar ] );
1199 if ( $wgEnableSidebarCache ) {
1200 $cache = ObjectCache
::getMainWANInstance();
1201 $sidebar = $cache->getWithSetCallback(
1202 $cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ),
1203 $wgSidebarCacheExpiry,
1208 $sidebar = $callback();
1211 // Apply post-processing to the cached value
1212 Hooks
::run( 'SidebarBeforeOutput', [ $this, &$sidebar ] );
1218 * Add content from a sidebar system message
1219 * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
1221 * This is just a wrapper around addToSidebarPlain() for backwards compatibility
1224 * @param string $message
1226 public function addToSidebar( &$bar, $message ) {
1227 $this->addToSidebarPlain( $bar, wfMessage( $message )->inContentLanguage()->plain() );
1231 * Add content from plain text
1234 * @param string $text
1237 function addToSidebarPlain( &$bar, $text ) {
1238 $lines = explode( "\n", $text );
1242 foreach ( $lines as $line ) {
1243 if ( strpos( $line, '*' ) !== 0 ) {
1246 $line = rtrim( $line, "\r" ); // for Windows compat
1248 if ( strpos( $line, '**' ) !== 0 ) {
1249 $heading = trim( $line, '* ' );
1250 if ( !array_key_exists( $heading, $bar ) ) {
1251 $bar[$heading] = [];
1254 $line = trim( $line, '* ' );
1256 if ( strpos( $line, '|' ) !== false ) { // sanity check
1257 $line = MessageCache
::singleton()->transform( $line, false, null, $this->getTitle() );
1258 $line = array_map( 'trim', explode( '|', $line, 2 ) );
1259 if ( count( $line ) !== 2 ) {
1260 // Second sanity check, could be hit by people doing
1261 // funky stuff with parserfuncs... (bug 33321)
1267 $msgLink = $this->msg( $line[0] )->inContentLanguage();
1268 if ( $msgLink->exists() ) {
1269 $link = $msgLink->text();
1270 if ( $link == '-' ) {
1276 $msgText = $this->msg( $line[1] );
1277 if ( $msgText->exists() ) {
1278 $text = $msgText->text();
1283 if ( preg_match( '/^(?i:' . wfUrlProtocols() . ')/', $link ) ) {
1286 // Parser::getExternalLinkAttribs won't work here because of the Namespace things
1287 global $wgNoFollowLinks, $wgNoFollowDomainExceptions;
1288 if ( $wgNoFollowLinks && !wfMatchesDomainList( $href, $wgNoFollowDomainExceptions ) ) {
1289 $extraAttribs['rel'] = 'nofollow';
1292 global $wgExternalLinkTarget;
1293 if ( $wgExternalLinkTarget ) {
1294 $extraAttribs['target'] = $wgExternalLinkTarget;
1297 $title = Title
::newFromText( $link );
1300 $title = $title->fixSpecialName();
1301 $href = $title->getLinkURL();
1303 $href = 'INVALID-TITLE';
1307 $bar[$heading][] = array_merge( [
1310 'id' => 'n-' . Sanitizer
::escapeId( strtr( $line[1], ' ', '-' ), 'noninitial' ),
1323 * Gets new talk page messages for the current user and returns an
1324 * appropriate alert message (or an empty string if there are no messages)
1327 function getNewtalks() {
1329 $newMessagesAlert = '';
1330 $user = $this->getUser();
1331 $newtalks = $user->getNewMessageLinks();
1332 $out = $this->getOutput();
1334 // Allow extensions to disable or modify the new messages alert
1335 if ( !Hooks
::run( 'GetNewMessagesAlert', [ &$newMessagesAlert, $newtalks, $user, $out ] ) ) {
1338 if ( $newMessagesAlert ) {
1339 return $newMessagesAlert;
1342 if ( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {
1343 $uTalkTitle = $user->getTalkPage();
1344 $lastSeenRev = isset( $newtalks[0]['rev'] ) ?
$newtalks[0]['rev'] : null;
1346 if ( $lastSeenRev !== null ) {
1347 $plural = true; // Default if we have a last seen revision: if unknown, use plural
1348 $latestRev = Revision
::newFromTitle( $uTalkTitle, false, Revision
::READ_NORMAL
);
1349 if ( $latestRev !== null ) {
1350 // Singular if only 1 unseen revision, plural if several unseen revisions.
1351 $plural = $latestRev->getParentId() !== $lastSeenRev->getId();
1352 $nofAuthors = $uTalkTitle->countAuthorsBetween(
1353 $lastSeenRev, $latestRev, 10, 'include_new' );
1356 // Singular if no revision -> diff link will show latest change only in any case
1359 $plural = $plural ?
999 : 1;
1360 // 999 signifies "more than one revision". We don't know how many, and even if we did,
1361 // the number of revisions or authors is not necessarily the same as the number of
1363 $newMessagesLink = Linker
::linkKnown(
1365 $this->msg( 'newmessageslinkplural' )->params( $plural )->escaped(),
1367 [ 'redirect' => 'no' ]
1370 $newMessagesDiffLink = Linker
::linkKnown(
1372 $this->msg( 'newmessagesdifflinkplural' )->params( $plural )->escaped(),
1374 $lastSeenRev !== null
1375 ?
[ 'oldid' => $lastSeenRev->getId(), 'diff' => 'cur' ]
1376 : [ 'diff' => 'cur' ]
1379 if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
1380 $newMessagesAlert = $this->msg(
1381 'youhavenewmessagesfromusers',
1383 $newMessagesDiffLink
1384 )->numParams( $nofAuthors, $plural );
1386 // $nofAuthors === 11 signifies "11 or more" ("more than 10")
1387 $newMessagesAlert = $this->msg(
1388 $nofAuthors > 10 ?
'youhavenewmessagesmanyusers' : 'youhavenewmessages',
1390 $newMessagesDiffLink
1391 )->numParams( $plural );
1393 $newMessagesAlert = $newMessagesAlert->text();
1395 $out->setCdnMaxage( 0 );
1396 } elseif ( count( $newtalks ) ) {
1397 $sep = $this->msg( 'newtalkseparator' )->escaped();
1400 foreach ( $newtalks as $newtalk ) {
1401 $msgs[] = Xml
::element(
1403 [ 'href' => $newtalk['link'] ], $newtalk['wiki']
1406 $parts = implode( $sep, $msgs );
1407 $newMessagesAlert = $this->msg( 'youhavenewmessagesmulti' )->rawParams( $parts )->escaped();
1408 $out->setCdnMaxage( 0 );
1411 return $newMessagesAlert;
1415 * Get a cached notice
1417 * @param string $name Message name, or 'default' for $wgSiteNotice
1418 * @return string|bool HTML fragment, or false to indicate that the caller
1419 * should fall back to the next notice in its sequence
1421 private function getCachedNotice( $name ) {
1422 global $wgRenderHashAppend, $parserMemc, $wgContLang;
1426 if ( $name === 'default' ) {
1428 global $wgSiteNotice;
1429 $notice = $wgSiteNotice;
1430 if ( empty( $notice ) ) {
1434 $msg = $this->msg( $name )->inContentLanguage();
1435 if ( $msg->isBlank() ) {
1437 } elseif ( $msg->isDisabled() ) {
1440 $notice = $msg->plain();
1443 // Use the extra hash appender to let eg SSL variants separately cache.
1444 $key = wfMemcKey( $name . $wgRenderHashAppend );
1445 $cachedNotice = $parserMemc->get( $key );
1446 if ( is_array( $cachedNotice ) ) {
1447 if ( md5( $notice ) == $cachedNotice['hash'] ) {
1448 $notice = $cachedNotice['html'];
1457 $parsed = $this->getOutput()->parse( $notice );
1458 $parserMemc->set( $key, [ 'html' => $parsed, 'hash' => md5( $notice ) ], 600 );
1462 $notice = Html
::rawElement( 'div', [ 'id' => 'localNotice',
1463 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ], $notice );
1468 * Get the site notice
1470 * @return string HTML fragment
1472 function getSiteNotice() {
1475 if ( Hooks
::run( 'SiteNoticeBefore', [ &$siteNotice, $this ] ) ) {
1476 if ( is_object( $this->getUser() ) && $this->getUser()->isLoggedIn() ) {
1477 $siteNotice = $this->getCachedNotice( 'sitenotice' );
1479 $anonNotice = $this->getCachedNotice( 'anonnotice' );
1480 if ( $anonNotice === false ) {
1481 $siteNotice = $this->getCachedNotice( 'sitenotice' );
1483 $siteNotice = $anonNotice;
1486 if ( $siteNotice === false ) {
1487 $siteNotice = $this->getCachedNotice( 'default' );
1491 Hooks
::run( 'SiteNoticeAfter', [ &$siteNotice, $this ] );
1496 * Create a section edit link. This supersedes editSectionLink() and
1497 * editSectionLinkForOther().
1499 * @param Title $nt The title being linked to (may not be the same as
1500 * the current page, if the section is included from a template)
1501 * @param string $section The designation of the section being pointed to,
1502 * to be included in the link, like "§ion=$section"
1503 * @param string $tooltip The tooltip to use for the link: will be escaped
1504 * and wrapped in the 'editsectionhint' message
1505 * @param string $lang Language code
1506 * @return string HTML to use for edit link
1508 public function doEditSectionLink( Title
$nt, $section, $tooltip = null, $lang = false ) {
1509 // HTML generated here should probably have userlangattributes
1510 // added to it for LTR text on RTL pages
1512 $lang = wfGetLangObj( $lang );
1515 if ( !is_null( $tooltip ) ) {
1516 # Bug 25462: undo double-escaping.
1517 $tooltip = Sanitizer
::decodeCharReferences( $tooltip );
1518 $attribs['title'] = wfMessage( 'editsectionhint' )->rawParams( $tooltip )
1519 ->inLanguage( $lang )->text();
1524 'text' => wfMessage( 'editsection' )->inLanguage( $lang )->escaped(),
1525 'targetTitle' => $nt,
1526 'attribs' => $attribs,
1527 'query' => [ 'action' => 'edit', 'section' => $section ],
1528 'options' => [ 'noclasses', 'known' ]
1532 Hooks
::run( 'SkinEditSectionLinks', [ $this, $nt, $section, $tooltip, &$links, $lang ] );
1534 $result = '<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>';
1537 foreach ( $links as $k => $linkDetails ) {
1538 $linksHtml[] = Linker
::link(
1539 $linkDetails['targetTitle'],
1540 $linkDetails['text'],
1541 $linkDetails['attribs'],
1542 $linkDetails['query'],
1543 $linkDetails['options']
1548 '<span class="mw-editsection-divider">'
1549 . wfMessage( 'pipe-separator' )->inLanguage( $lang )->text()
1554 $result .= '<span class="mw-editsection-bracket">]</span></span>';
1555 // Deprecated, use SkinEditSectionLinks hook instead
1557 'DoEditSectionLink',
1558 [ $this, $nt, $section, $tooltip, &$result, $lang ],
1564 /** @deprecated in 1.21 */
1565 public function accesskey() {
1566 wfDeprecated( __METHOD__
, '1.21' );
1567 return call_user_func_array( [ 'Linker', 'accesskey' ], func_get_args() );
1569 /** @deprecated in 1.21 */
1570 public function blockLink() {
1571 wfDeprecated( __METHOD__
, '1.21' );
1572 return call_user_func_array( [ 'Linker', 'blockLink' ], func_get_args() );
1574 /** @deprecated in 1.21 */
1575 public function buildRollbackLink() {
1576 wfDeprecated( __METHOD__
, '1.21' );
1577 return call_user_func_array( [ 'Linker', 'buildRollbackLink' ], func_get_args() );
1579 /** @deprecated in 1.21 */
1580 public function commentBlock() {
1581 wfDeprecated( __METHOD__
, '1.21' );
1582 return call_user_func_array( [ 'Linker', 'commentBlock' ], func_get_args() );
1584 /** @deprecated in 1.21 */
1585 public function emailLink() {
1586 wfDeprecated( __METHOD__
, '1.21' );
1587 return call_user_func_array( [ 'Linker', 'emailLink' ], func_get_args() );
1589 /** @deprecated in 1.21 */
1590 public function formatComment() {
1591 wfDeprecated( __METHOD__
, '1.21' );
1592 return call_user_func_array( [ 'Linker', 'formatComment' ], func_get_args() );
1594 /** @deprecated in 1.21 */
1595 public function formatHiddenCategories() {
1596 wfDeprecated( __METHOD__
, '1.21' );
1597 return call_user_func_array( [ 'Linker', 'formatHiddenCategories' ], func_get_args() );
1599 /** @deprecated in 1.21 */
1600 public function formatLinksInComment() {
1601 wfDeprecated( __METHOD__
, '1.21' );
1602 return call_user_func_array( [ 'Linker', 'formatLinksInComment' ], func_get_args() );
1604 /** @deprecated in 1.21 */
1605 public function formatRevisionSize() {
1606 wfDeprecated( __METHOD__
, '1.21' );
1607 return call_user_func_array( [ 'Linker', 'formatRevisionSize' ], func_get_args() );
1609 /** @deprecated in 1.21 */
1610 public function formatSize() {
1611 wfDeprecated( __METHOD__
, '1.21' );
1612 return call_user_func_array( [ 'Linker', 'formatSize' ], func_get_args() );
1614 /** @deprecated in 1.21 */
1615 public function formatTemplates() {
1616 wfDeprecated( __METHOD__
, '1.21' );
1617 return call_user_func_array( [ 'Linker', 'formatTemplates' ], func_get_args() );
1619 /** @deprecated in 1.21 */
1620 public function generateRollback() {
1621 wfDeprecated( __METHOD__
, '1.21' );
1622 return call_user_func_array( [ 'Linker', 'generateRollback' ], func_get_args() );
1624 /** @deprecated in 1.21 */
1625 public function generateTOC() {
1626 wfDeprecated( __METHOD__
, '1.21' );
1627 return call_user_func_array( [ 'Linker', 'generateTOC' ], func_get_args() );
1629 /** @deprecated in 1.21 */
1630 public function getInternalLinkAttributes() {
1631 wfDeprecated( __METHOD__
, '1.21' );
1632 return call_user_func_array( [ 'Linker', 'getInternalLinkAttributes' ], func_get_args() );
1634 /** @deprecated in 1.21 */
1635 public function getInternalLinkAttributesObj() {
1636 wfDeprecated( __METHOD__
, '1.21' );
1637 return call_user_func_array( [ 'Linker', 'getInternalLinkAttributesObj' ], func_get_args() );
1639 /** @deprecated in 1.21 */
1640 public function getInterwikiLinkAttributes() {
1641 wfDeprecated( __METHOD__
, '1.21' );
1642 return call_user_func_array( [ 'Linker', 'getInterwikiLinkAttributes' ], func_get_args() );
1644 /** @deprecated in 1.21 */
1645 public function getInvalidTitleDescription() {
1646 wfDeprecated( __METHOD__
, '1.21' );
1647 return call_user_func_array( [ 'Linker', 'getInvalidTitleDescription' ], func_get_args() );
1649 /** @deprecated in 1.21 */
1650 public function getLinkColour() {
1651 wfDeprecated( __METHOD__
, '1.21' );
1652 return call_user_func_array( [ 'Linker', 'getLinkColour' ], func_get_args() );
1654 /** @deprecated in 1.21 */
1655 public function getRevDeleteLink() {
1656 wfDeprecated( __METHOD__
, '1.21' );
1657 return call_user_func_array( [ 'Linker', 'getRevDeleteLink' ], func_get_args() );
1659 /** @deprecated in 1.21 */
1660 public function getRollbackEditCount() {
1661 wfDeprecated( __METHOD__
, '1.21' );
1662 return call_user_func_array( [ 'Linker', 'getRollbackEditCount' ], func_get_args() );
1664 /** @deprecated in 1.21 */
1665 public function link() {
1666 wfDeprecated( __METHOD__
, '1.21' );
1667 return call_user_func_array( [ 'Linker', 'link' ], func_get_args() );
1669 /** @deprecated in 1.21 */
1670 public function linkKnown() {
1671 wfDeprecated( __METHOD__
, '1.21' );
1672 return call_user_func_array( [ 'Linker', 'linkKnown' ], func_get_args() );
1674 /** @deprecated in 1.21 */
1675 public function makeBrokenImageLinkObj() {
1676 wfDeprecated( __METHOD__
, '1.21' );
1677 return call_user_func_array( [ 'Linker', 'makeBrokenImageLinkObj' ], func_get_args() );
1679 /** @deprecated in 1.21 */
1680 public function makeCommentLink() {
1681 wfDeprecated( __METHOD__
, '1.21' );
1682 return call_user_func_array( [ 'Linker', 'makeCommentLink' ], func_get_args() );
1684 /** @deprecated in 1.21 */
1685 public function makeExternalImage() {
1686 wfDeprecated( __METHOD__
, '1.21' );
1687 return call_user_func_array( [ 'Linker', 'makeExternalImage' ], func_get_args() );
1689 /** @deprecated in 1.21 */
1690 public function makeExternalLink() {
1691 wfDeprecated( __METHOD__
, '1.21' );
1692 return call_user_func_array( [ 'Linker', 'makeExternalLink' ], func_get_args() );
1694 /** @deprecated in 1.21 */
1695 public function makeHeadline() {
1696 wfDeprecated( __METHOD__
, '1.21' );
1697 return call_user_func_array( [ 'Linker', 'makeHeadline' ], func_get_args() );
1699 /** @deprecated in 1.21 */
1700 public function makeImageLink() {
1701 wfDeprecated( __METHOD__
, '1.21' );
1702 return call_user_func_array( [ 'Linker', 'makeImageLink' ], func_get_args() );
1704 /** @deprecated in 1.21 */
1705 public function makeMediaLinkFile() {
1706 wfDeprecated( __METHOD__
, '1.21' );
1707 return call_user_func_array( [ 'Linker', 'makeMediaLinkFile' ], func_get_args() );
1709 /** @deprecated in 1.21 */
1710 public function makeMediaLinkObj() {
1711 wfDeprecated( __METHOD__
, '1.21' );
1712 return call_user_func_array( [ 'Linker', 'makeMediaLinkObj' ], func_get_args() );
1714 /** @deprecated in 1.21 */
1715 public function makeSelfLinkObj() {
1716 wfDeprecated( __METHOD__
, '1.21' );
1717 return call_user_func_array( [ 'Linker', 'makeSelfLinkObj' ], func_get_args() );
1719 /** @deprecated in 1.21 */
1720 public function makeThumbLink2() {
1721 wfDeprecated( __METHOD__
, '1.21' );
1722 return call_user_func_array( [ 'Linker', 'makeThumbLink2' ], func_get_args() );
1724 /** @deprecated in 1.21 */
1725 public function makeThumbLinkObj() {
1726 wfDeprecated( __METHOD__
, '1.21' );
1727 return call_user_func_array( [ 'Linker', 'makeThumbLinkObj' ], func_get_args() );
1729 /** @deprecated in 1.21 */
1730 public function normaliseSpecialPage() {
1731 wfDeprecated( __METHOD__
, '1.21' );
1732 return call_user_func_array( [ 'Linker', 'normaliseSpecialPage' ], func_get_args() );
1734 /** @deprecated in 1.21 */
1735 public function normalizeSubpageLink() {
1736 wfDeprecated( __METHOD__
, '1.21' );
1737 return call_user_func_array( [ 'Linker', 'normalizeSubpageLink' ], func_get_args() );
1739 /** @deprecated in 1.21 */
1740 public function processResponsiveImages() {
1741 wfDeprecated( __METHOD__
, '1.21' );
1742 return call_user_func_array( [ 'Linker', 'processResponsiveImages' ], func_get_args() );
1744 /** @deprecated in 1.21 */
1745 public function revComment() {
1746 wfDeprecated( __METHOD__
, '1.21' );
1747 return call_user_func_array( [ 'Linker', 'revComment' ], func_get_args() );
1749 /** @deprecated in 1.21 */
1750 public function revDeleteLink() {
1751 wfDeprecated( __METHOD__
, '1.21' );
1752 return call_user_func_array( [ 'Linker', 'revDeleteLink' ], func_get_args() );
1754 /** @deprecated in 1.21 */
1755 public function revDeleteLinkDisabled() {
1756 wfDeprecated( __METHOD__
, '1.21' );
1757 return call_user_func_array( [ 'Linker', 'revDeleteLinkDisabled' ], func_get_args() );
1759 /** @deprecated in 1.21 */
1760 public function revUserLink() {
1761 wfDeprecated( __METHOD__
, '1.21' );
1762 return call_user_func_array( [ 'Linker', 'revUserLink' ], func_get_args() );
1764 /** @deprecated in 1.21 */
1765 public function revUserTools() {
1766 wfDeprecated( __METHOD__
, '1.21' );
1767 return call_user_func_array( [ 'Linker', 'revUserTools' ], func_get_args() );
1769 /** @deprecated in 1.21 */
1770 public function specialLink() {
1771 wfDeprecated( __METHOD__
, '1.21' );
1772 return call_user_func_array( [ 'Linker', 'specialLink' ], func_get_args() );
1774 /** @deprecated in 1.21 */
1775 public function splitTrail() {
1776 wfDeprecated( __METHOD__
, '1.21' );
1777 return call_user_func_array( [ 'Linker', 'splitTrail' ], func_get_args() );
1779 /** @deprecated in 1.21 */
1780 public function titleAttrib() {
1781 wfDeprecated( __METHOD__
, '1.21' );
1782 return call_user_func_array( [ 'Linker', 'titleAttrib' ], func_get_args() );
1784 /** @deprecated in 1.21 */
1785 public function tocIndent() {
1786 wfDeprecated( __METHOD__
, '1.21' );
1787 return call_user_func_array( [ 'Linker', 'tocIndent' ], func_get_args() );
1789 /** @deprecated in 1.21 */
1790 public function tocLine() {
1791 wfDeprecated( __METHOD__
, '1.21' );
1792 return call_user_func_array( [ 'Linker', 'tocLine' ], func_get_args() );
1794 /** @deprecated in 1.21 */
1795 public function tocLineEnd() {
1796 wfDeprecated( __METHOD__
, '1.21' );
1797 return call_user_func_array( [ 'Linker', 'tocLineEnd' ], func_get_args() );
1799 /** @deprecated in 1.21 */
1800 public function tocList() {
1801 wfDeprecated( __METHOD__
, '1.21' );
1802 return call_user_func_array( [ 'Linker', 'tocList' ], func_get_args() );
1804 /** @deprecated in 1.21 */
1805 public function tocUnindent() {
1806 wfDeprecated( __METHOD__
, '1.21' );
1807 return call_user_func_array( [ 'Linker', 'tocUnindent' ], func_get_args() );
1809 /** @deprecated in 1.21 */
1810 public function tooltip() {
1811 wfDeprecated( __METHOD__
, '1.21' );
1812 return call_user_func_array( [ 'Linker', 'tooltip' ], func_get_args() );
1814 /** @deprecated in 1.21 */
1815 public function tooltipAndAccesskeyAttribs() {
1816 wfDeprecated( __METHOD__
, '1.21' );
1817 return call_user_func_array( [ 'Linker', 'tooltipAndAccesskeyAttribs' ], func_get_args() );
1819 /** @deprecated in 1.21 */
1820 public function userLink() {
1821 wfDeprecated( __METHOD__
, '1.21' );
1822 return call_user_func_array( [ 'Linker', 'userLink' ], func_get_args() );
1824 /** @deprecated in 1.21 */
1825 public function userTalkLink() {
1826 wfDeprecated( __METHOD__
, '1.21' );
1827 return call_user_func_array( [ 'Linker', 'userTalkLink' ], func_get_args() );
1829 /** @deprecated in 1.21 */
1830 public function userToolLinks() {
1831 wfDeprecated( __METHOD__
, '1.21' );
1832 return call_user_func_array( [ 'Linker', 'userToolLinks' ], func_get_args() );
1834 /** @deprecated in 1.21 */
1835 public function userToolLinksRedContribs() {
1836 wfDeprecated( __METHOD__
, '1.21' );
1837 return call_user_func_array( [ 'Linker', 'userToolLinksRedContribs' ], func_get_args() );