69 return new $classname( $this->
getConfig() );
86 foreach ( $this->
getOutput()->getLanguageLinks() as $languageLinkText ) {
87 $class =
'interlanguage-link interwiki-' . explode(
':', $languageLinkText, 2 )[0];
90 if ( $languageLinkTitle ) {
91 $ilInterwikiCode = $languageLinkTitle->getInterwiki();
94 if ( strval( $ilLangName ) ===
'' ) {
95 $ilDisplayTextMsg =
wfMessage(
"interlanguage-link-$ilInterwikiCode" );
96 if ( !$ilDisplayTextMsg->isDisabled() ) {
98 $ilLangName = $ilDisplayTextMsg->text();
101 $ilLangName = $languageLinkText;
115 $languageLinkTitleText = $languageLinkTitle->getText();
116 if ( $ilLangLocalName ===
'' ) {
117 $ilFriendlySiteName =
wfMessage(
"interlanguage-link-sitename-$ilInterwikiCode" );
118 if ( !$ilFriendlySiteName->isDisabled() ) {
119 if ( $languageLinkTitleText ===
'' ) {
121 'interlanguage-link-title-nonlangonly',
122 $ilFriendlySiteName->text()
126 'interlanguage-link-title-nonlang',
127 $languageLinkTitleText,
128 $ilFriendlySiteName->text()
135 $ilTitle = $languageLinkTitle->getInterwiki() .
136 ":$languageLinkTitleText";
138 } elseif ( $languageLinkTitleText ===
'' ) {
140 'interlanguage-link-title-langonly',
145 'interlanguage-link-title',
146 $languageLinkTitleText,
153 'href' => $languageLinkTitle->getFullURL(),
154 'text' => $ilLangName,
157 'link-class' =>
'interlanguage-link-target',
158 'lang' => $ilInterwikiCodeBCP47,
159 'hreflang' => $ilInterwikiCodeBCP47,
162 'SkinTemplateGetLanguageLink',
165 $languageLinks[] = $languageLink;
169 return $languageLinks;
182 $this->thispage =
$title->getPrefixedDBkey();
183 $this->titletxt =
$title->getPrefixedText();
184 $this->userpage = $user->getUserPage()->getPrefixedText();
186 if ( !$request->wasPosted() ) {
187 $query = $request->getValues();
188 unset( $query[
'title'] );
189 unset( $query[
'returnto'] );
190 unset( $query[
'returntoquery'] );
193 $this->loggedin = $user->isLoggedIn();
194 $this->username = $user->getName();
196 if ( $this->loggedin ) {
199 # This won't be used in the standard skins, but we define it to preserve the interface
200 # To save time, we check for existence
217 $res = $tpl->execute();
231 # An ID that includes the actual body text; without categories, contentSub, ...
232 $realBodyAttribs = [
'id' =>
'mw-content-text' ];
234 # Add a mw-content-ltr/rtl class to be able to style based on text
235 # direction when the content is different from the UI language (only
237 # Most information on special pages and file pages is in user language,
238 # rather than content language, so those will not get this
241 $pageLang =
$title->getPageViewLanguage();
242 $realBodyAttribs[
'lang'] = $pageLang->getHtmlCode();
243 $realBodyAttribs[
'dir'] = $pageLang->getDir();
244 $realBodyAttribs[
'class'] =
'mw-content-' . $pageLang->getDir();
247 return Html::rawElement(
'div', $realBodyAttribs, $html );
267 $tpl->set(
'title', $out->getPageTitle() );
268 $tpl->set(
'pagetitle', $out->getHTMLTitle() );
269 $tpl->set(
'displaytitle', $out->mPageLinkTitle );
271 $tpl->set(
'thispage', $this->thispage );
272 $tpl->set(
'titleprefixeddbkey', $this->thispage );
273 $tpl->set(
'titletext',
$title->getText() );
274 $tpl->set(
'articleid',
$title->getArticleID() );
276 $tpl->set(
'isarticle', $out->isArticle() );
279 if ( $subpagestr !==
'' ) {
280 $subpagestr =
'<span class="subpages">' . $subpagestr .
'</span>';
282 $tpl->set(
'subtitle', $subpagestr . $out->getSubtitle() );
285 if ( $undelete ===
'' ) {
286 $tpl->set(
'undelete',
'' );
288 $tpl->set(
'undelete',
'<span class="subpages">' . $undelete .
'</span>' );
292 if ( $out->isSyndicated() ) {
294 foreach ( $out->getSyndicationLinks() as $format => $link ) {
297 'text' => $this->
msg(
"feed-$format" )->text(),
301 $tpl->set(
'feeds', $feeds );
303 $tpl->set(
'feeds',
false );
307 $tpl->set(
'charset',
'UTF-8' );
309 $tpl->set(
'skinname', $this->skinname );
310 $tpl->set(
'skinclass', static::class );
311 $tpl->set(
'skin', $this );
312 $tpl->set(
'stylename', $this->stylename );
313 $tpl->set(
'printable', $out->isPrintable() );
314 $tpl->set(
'handheld', $request->getBool(
'handheld' ) );
315 $tpl->set(
'loggedin', $this->loggedin );
316 $tpl->set(
'notspecialpage', !
$title->isSpecialPage() );
319 $tpl->set(
'search', trim( $request->getVal(
'search' ) ) );
324 $tpl->set(
'logopath',
$wgLogo );
328 $userLangCode = $userLang->getHtmlCode();
329 $userLangDir = $userLang->getDir();
331 $tpl->set(
'lang', $userLangCode );
332 $tpl->set(
'dir', $userLangDir );
333 $tpl->set(
'rtl', $userLang->isRTL() );
335 $tpl->set(
'capitalizeallnouns', $userLang->capitalizeAllNouns() ?
' capitalize-all-nouns' :
'' );
336 $tpl->set(
'showjumplinks',
true );
337 $tpl->set(
'username', $this->loggedin ? $this->username :
null );
338 $tpl->set(
'userpage', $this->userpage );
339 $tpl->set(
'userpageurl', $this->userpageUrlDetails[
'href'] );
340 $tpl->set(
'userlang', $userLangCode );
345 $tpl->set(
'userlangattributes',
'' );
346 $tpl->set(
'specialpageattributes',
'' ); # obsolete
349 $tpl->set(
'prebodyhtml',
'' );
351 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
353 $userLangCode !== $contLang->getHtmlCode() ||
354 $userLangDir !== $contLang->getDir()
356 $escUserlang = htmlspecialchars( $userLangCode );
357 $escUserdir = htmlspecialchars( $userLangDir );
360 $attrs =
" lang=\"$escUserlang\" dir=\"$escUserdir\"";
361 $tpl->set(
'userlangattributes', $attrs );
365 $tpl->set(
'logo', $this->
logoText() );
367 $tpl->set(
'copyright',
false );
369 $tpl->set(
'viewcount',
false );
370 $tpl->set(
'lastmod',
false );
371 $tpl->set(
'credits',
false );
372 $tpl->set(
'numberofwatchingusers',
false );
374 if ( $out->isArticle() && $out->isRevisionCurrent() ) {
379 '@phan-var CreditsAction $action';
380 $tpl->set(
'credits',
386 if ( $out->showsCopyright() ) {
395 $tpl->set(
'about', $this->
aboutLink() );
397 $tpl->set(
'footerlinks', [
400 'numberofwatchingusers',
413 foreach ( $tpl->data[
'footericons'] as $footerIconsKey => &$footerIconsBlock ) {
414 if ( count( $footerIconsBlock ) > 0 ) {
415 foreach ( $footerIconsBlock as &$footerIcon ) {
416 if ( isset( $footerIcon[
'src'] ) ) {
417 if ( !isset( $footerIcon[
'width'] ) ) {
418 $footerIcon[
'width'] = 88;
420 if ( !isset( $footerIcon[
'height'] ) ) {
421 $footerIcon[
'height'] = 31;
426 unset( $tpl->data[
'footericons'][$footerIconsKey] );
430 $tpl->set(
'indicators', $out->getIndicators() );
436 $tpl->set(
'bodytext', $out->mBodytext );
439 if ( count( $language_urls ) ) {
440 $tpl->set(
'language_urls', $language_urls );
442 $tpl->set(
'language_urls',
false );
449 $tpl->set(
'content_navigation', $content_navigation );
450 $tpl->set(
'content_actions', $content_actions );
459 $tpl->set(
'headelement', $out->headElement( $this ) );
461 $tpl->set(
'debug',
'' );
463 $tpl->set(
'reporttime',
wfReportTime( $out->getCSPNonce() ) );
466 $skinTemplate = $this;
468 if ( !
Hooks::run(
'SkinTemplateOutputPageBeforeExec', [ &$skinTemplate, &$tpl ] ) ) {
469 wfDebug( __METHOD__ .
": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
474 $tpl->set(
'bodycontent', $tpl->data[
'bodytext'] );
479 $tpl->data[
'bodytext'] .= Html::rawElement(
481 [
'class' =>
'printfooter' ],
482 "\n{$tpl->data['printfooter']}"
484 $tpl->data[
'bodytext'] .= $tpl->data[
'debughtml'];
515 if ( $personalTools ===
null ) {
517 ? $tpl->getPersonalTools()
521 foreach ( $personalTools as $key => $item ) {
522 $html .= $tpl->makeListItem( $key, $item, $options );
539 return ( $tpl instanceof
BaseTemplate ) ? $tpl->getPersonalTools() : [];
587 $pageurl =
$title->getLocalURL();
588 $authManager = AuthManager::singleton();
589 $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
594 # Due to T34276, if a user does not have read permissions,
595 # $this->getTitle() will just give Special:Badtitle, which is
596 # not especially useful as a returnto parameter. Use the title
597 # from the request instead, if there was one.
598 if ( $permissionManager->userHasRight( $this->getUser(),
'read' ) ) {
603 $page = $request->getVal(
'returnto', $page );
605 if ( strval( $page ) !==
'' ) {
606 $returnto[
'returnto'] = $page;
607 $query = $request->getVal(
'returntoquery', $this->thisquery );
610 if ( $query !=
'' ) {
611 $returnto[
'returntoquery'] = $query;
615 if ( $this->loggedin ) {
616 $personal_urls[
'userpage'] = [
618 'href' => &$this->userpageUrlDetails[
'href'],
619 'class' => $this->userpageUrlDetails[
'exists'] ? false :
'new',
620 'exists' => $this->userpageUrlDetails[
'exists'],
621 'active' => ( $this->userpageUrlDetails[
'href'] == $pageurl ),
625 $personal_urls[
'mytalk'] = [
626 'text' => $this->
msg(
'mytalk' )->text(),
627 'href' => &$usertalkUrlDetails[
'href'],
628 'class' => $usertalkUrlDetails[
'exists'] ? false :
'new',
629 'exists' => $usertalkUrlDetails[
'exists'],
630 'active' => ( $usertalkUrlDetails[
'href'] == $pageurl )
633 $personal_urls[
'preferences'] = [
634 'text' => $this->
msg(
'mypreferences' )->text(),
636 'active' => ( $href == $pageurl )
639 if ( $permissionManager->userHasRight( $this->getUser(),
'viewmywatchlist' ) ) {
641 $personal_urls[
'watchlist'] = [
642 'text' => $this->
msg(
'mywatchlist' )->text(),
644 'active' => ( $href == $pageurl )
648 # We need to do an explicit check for Special:Contributions, as we
649 # have to match both the title, and the target, which could come
650 # from request values (Special:Contributions?target=Jimbo_Wales)
651 # or be specified in "sub page" form
652 # (Special:Contributions/Jimbo_Wales). The plot
653 # thickens, because the Title object is altered for special pages,
654 # so it doesn't contain the original alias-with-subpage.
657 list( $spName, $spPar ) =
658 MediaWikiServices::getInstance()->getSpecialPageFactory()->
659 resolveAlias( $origTitle->getText() );
660 $active = $spName ==
'Contributions'
668 $personal_urls[
'mycontris'] = [
669 'text' => $this->
msg(
'mycontris' )->text(),
675 if ( $request->getSession()->canSetUser() ) {
676 $personal_urls[
'logout'] = [
677 'text' => $this->
msg(
'pt-userlogout' )->text(),
681 (
$title->isSpecial(
'Preferences' ) ? [] : $returnto ) ),
687 if ( !$authManager->canCreateAccounts() || !$authManager->canAuthenticateNow() ) {
689 $useCombinedLoginLink =
false;
692 $loginlink = $permissionManager->userHasRight( $this->
getUser(),
'createaccount' )
693 && $useCombinedLoginLink ?
'nav-login-createaccount' :
'pt-login';
696 'text' => $this->
msg( $loginlink )->text(),
698 'active' =>
$title->isSpecial(
'Userlogin' )
699 ||
$title->isSpecial(
'CreateAccount' ) && $useCombinedLoginLink,
701 $createaccount_url = [
702 'text' => $this->
msg(
'pt-createaccount' )->text(),
704 'active' =>
$title->isSpecial(
'CreateAccount' ),
708 if ( $permissionManager->groupHasPermission(
'*',
'edit' ) ) {
715 $personal_urls[
'anontalk'] = [
716 'text' => $this->
msg(
'anontalk' )->text(),
720 $personal_urls[
'anoncontribs'] = [
721 'text' => $this->
msg(
'anoncontribs' )->text(),
728 $authManager->canCreateAccounts()
729 && $permissionManager->userHasRight( $this->
getUser(),
'createaccount' )
730 && !$useCombinedLoginLink
732 $personal_urls[
'createaccount'] = $createaccount_url;
735 if ( $authManager->canAuthenticateNow() ) {
736 $key = $permissionManager->groupHasPermission(
'*',
'read' )
739 $personal_urls[$key] = $login_url;
744 return $personal_urls;
761 $classes[] =
'selected';
764 if ( $checkEdit && !
$title->isKnown() ) {
767 if ( $query !==
'' ) {
768 $query =
'action=edit&redlink=1&' . $query;
770 $query =
'action=edit&redlink=1';
774 $services = MediaWikiServices::getInstance();
775 $linkClass = $services->getLinkRenderer()->getLinkClasses(
$title );
780 if ( is_array( $message ) ) {
782 $message = end( $message );
784 if ( $msg->exists() ) {
785 $text = $msg->text();
787 $text = $services->getContentLanguage()->getConverter()->
788 convertNamespace( $services->getNamespaceInfo()->
789 getSubject(
$title->getNamespace() ) );
793 $skinTemplate = $this;
795 if ( !
Hooks::run(
'SkinTemplateTabAction', [ &$skinTemplate,
796 $title, $message, $selected, $checkEdit,
797 &$classes, &$query, &$text, &$result ] ) ) {
802 'class' => implode(
' ', $classes ),
804 'href' =>
$title->getLocalURL( $query ),
807 if ( $linkClass !==
'' ) {
808 $result[
'link-class'] = $linkClass;
816 if ( !is_object(
$title ) ) {
817 throw new MWException( __METHOD__ .
" given invalid pagename $name" );
822 'href' =>
$title->getLocalURL( $urlaction ),
823 'exists' =>
$title->isKnown(),
838 'href' =>
$title->getLocalURL( $urlaction ),
839 'exists' =>
$title->exists(),
887 $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
889 $content_navigation = [
897 $action = $request->getVal(
'action',
'view' );
899 $userCanRead = $permissionManager->quickUserCan(
'read', $user,
$title );
902 $skinTemplate = $this;
903 $preventActiveTabs =
false;
904 Hooks::run(
'SkinTemplatePreventOtherActiveTabs', [ &$skinTemplate, &$preventActiveTabs ] );
907 if (
$title->canExist() ) {
909 $subjectPage =
$title->getSubjectPage();
910 $talkPage =
$title->getTalkPage();
913 $isTalk =
$title->isTalkPage();
916 $subjectId =
$title->getNamespaceKey(
'' );
918 if ( $subjectId ==
'main' ) {
921 $talkId =
"{$subjectId}_talk";
927 $subjectMsg = [
"nstab-$subjectId" ];
928 if ( $subjectPage->isMainPage() ) {
929 array_unshift( $subjectMsg,
'mainpage-nstab' );
931 $content_navigation[
'namespaces'][$subjectId] = $this->
tabAction(
932 $subjectPage, $subjectMsg, !$isTalk && !$preventActiveTabs,
'', $userCanRead
934 $content_navigation[
'namespaces'][$subjectId][
'context'] =
'subject';
935 $content_navigation[
'namespaces'][$talkId] = $this->
tabAction(
936 $talkPage, [
"nstab-$talkId",
'talk' ], $isTalk && !$preventActiveTabs,
'', $userCanRead
938 $content_navigation[
'namespaces'][$talkId][
'context'] =
'talk';
940 if ( $userCanRead ) {
942 if (
$title->isKnown() ) {
943 $content_navigation[
'views'][
'view'] = $this->
tabAction(
944 $isTalk ? $talkPage : $subjectPage,
945 [
"$skname-view-view",
'view' ],
946 ( $onPage && ( $action ==
'view' || $action ==
'purge' ) ),
'',
true
949 $content_navigation[
'views'][
'view'][
'redundant'] =
true;
953 $isRemoteContent = $page && !$page->isLocal();
957 if ( $isRemoteContent ) {
958 $content_navigation[
'views'][
'view-foreign'] = [
962 params( $page->getWikiDisplayName() )->text(),
963 'href' => $page->getSourceURL(),
969 if ( $permissionManager->quickUserCan(
'edit', $user,
$title ) &&
971 $permissionManager->quickUserCan(
'create', $user,
$title ) )
974 $isTalkClass = $isTalk ?
' istalk' :
'';
976 $isEditing = $onPage && ( $action ==
'edit' || $action ==
'submit' );
979 $showNewSection = !$out->forceHideNewSectionLink()
980 && ( ( $isTalk && $out->isRevisionCurrent() ) || $out->showNewSectionLink() );
981 $section = $request->getVal(
'section' );
985 &&
$title->getDefaultMessageText() !== false
988 $msgKey = $isRemoteContent ?
'edit-local' :
'edit';
990 $msgKey = $isRemoteContent ?
'create-local' :
'create';
992 $content_navigation[
'views'][
'edit'] = [
993 'class' => ( $isEditing && ( $section !==
'new' || !$showNewSection )
1000 'primary' => !$isRemoteContent,
1004 if ( $showNewSection ) {
1007 $content_navigation[
'views'][
'addsection'] = [
1008 'class' => ( $isEditing && $section ==
'new' ) ?
'selected' :
false,
1011 'href' =>
$title->getLocalURL(
'action=edit§ion=new' )
1015 } elseif (
$title->hasSourceText() ) {
1017 $content_navigation[
'views'][
'viewsource'] = [
1018 'class' => ( $onPage && $action ==
'edit' ) ?
'selected' :
false,
1027 if (
$title->exists() ) {
1029 $content_navigation[
'views'][
'history'] = [
1030 'class' => ( $onPage && $action ==
'history' ) ?
'selected' :
false,
1033 'href' =>
$title->getLocalURL(
'action=history' ),
1036 if ( $permissionManager->quickUserCan(
'delete', $user,
$title ) ) {
1037 $content_navigation[
'actions'][
'delete'] = [
1038 'class' => ( $onPage && $action ==
'delete' ) ?
'selected' :
false,
1041 'href' =>
$title->getLocalURL(
'action=delete' )
1045 if ( $permissionManager->quickUserCan(
'move', $user,
$title ) ) {
1047 $content_navigation[
'actions'][
'move'] = [
1048 'class' => $this->
getTitle()->isSpecial(
'Movepage' ) ?
'selected' :
false,
1051 'href' => $moveTitle->getLocalURL()
1056 if ( $permissionManager->quickUserCan(
'deletedhistory', $user,
$title ) ) {
1057 $n =
$title->isDeleted();
1062 $msgKey = $permissionManager->quickUserCan(
'undelete',
1063 $user,
$title ) ?
'undelete' :
'viewdeleted';
1064 $content_navigation[
'actions'][
'undelete'] = [
1065 'class' => $this->
getTitle()->isSpecial(
'Undelete' ) ?
'selected' :
false,
1067 ->setContext( $this->
getContext() )->numParams( $n )->text(),
1068 'href' => $undelTitle->getLocalURL()
1074 if ( $permissionManager->quickUserCan(
'protect', $user,
$title ) &&
1075 $title->getRestrictionTypes() &&
1076 $permissionManager->getNamespaceRestrictionLevels(
$title->getNamespace(), $user ) !== [
'' ]
1078 $mode =
$title->isProtected() ?
'unprotect' :
'protect';
1079 $content_navigation[
'actions'][$mode] = [
1080 'class' => ( $onPage && $action == $mode ) ?
'selected' :
false,
1083 'href' =>
$title->getLocalURL(
"action=$mode" )
1088 if ( $this->loggedin && $permissionManager->userHasAllRights( $user,
1089 'viewmywatchlist',
'editmywatchlist' )
1100 $mode = $user->isWatched(
$title ) ?
'unwatch' :
'watch';
1101 $content_navigation[
'actions'][$mode] = [
1102 'class' =>
'mw-watchlink ' . (
1103 $onPage && ( $action ==
'watch' || $action ==
'unwatch' ) ?
'selected' :
''
1106 'text' => $this->
msg( $mode )->text(),
1107 'href' =>
$title->getLocalURL( [
'action' => $mode ] ),
1111 'mw' =>
'interface',
1118 $skinTemplate = $this;
1120 'SkinTemplateNavigation',
1121 [ &$skinTemplate, &$content_navigation ]
1125 $pageLang =
$title->getPageLanguage();
1128 if ( $pageLang->hasVariants() ) {
1130 $variants = $pageLang->getVariants();
1133 $preferred = $pageLang->getPreferredVariant();
1135 $params = $request->getQueryValues();
1136 unset( $params[
'title'] );
1141 foreach ( $variants as $code ) {
1143 $varname = $pageLang->getVariantname( $code );
1145 $content_navigation[
'variants'][] = [
1146 'class' => ( $code == $preferred ) ?
'selected' :
false,
1148 'href' =>
$title->getLocalURL( [
'variant' => $code ] + $params ),
1157 $content_navigation[
'namespaces'][
'special'] = [
1158 'class' =>
'selected',
1159 'text' => $this->
msg(
'nstab-special' )->text(),
1160 'href' => $request->getRequestURL(),
1161 'context' =>
'subject'
1165 $skinTemplate = $this;
1167 [ &$skinTemplate, &$content_navigation ] );
1171 $skinTemplate = $this;
1174 [ &$skinTemplate, &$content_navigation ] );
1177 foreach ( $content_navigation as $section => &$links ) {
1178 foreach ( $links as $key => &$link ) {
1180 if ( isset( $link[
'context'] ) && $link[
'context'] ==
'subject' ) {
1181 $xmlID =
'ca-nstab-' . $xmlID;
1182 } elseif ( isset( $link[
'context'] ) && $link[
'context'] ==
'talk' ) {
1184 $link[
'rel'] =
'discussion';
1185 } elseif ( $section ==
'variants' ) {
1186 $xmlID =
'ca-varlang-' . $xmlID;
1188 $xmlID =
'ca-' . $xmlID;
1190 $link[
'id'] = $xmlID;
1194 # We don't want to give the watch tab an accesskey if the
1195 # page is being edited, because that conflicts with the
1196 # accesskey on the watch checkbox. We also don't want to
1197 # give the edit tab an accesskey, because that's fairly
1198 # superfluous and conflicts with an accesskey (Ctrl-E) often
1199 # used for editing in Safari.
1200 if ( in_array( $action, [
'edit',
'submit' ] ) ) {
1201 if ( isset( $content_navigation[
'views'][
'edit'] ) ) {
1202 $content_navigation[
'views'][
'edit'][
'tooltiponly'] =
true;
1204 if ( isset( $content_navigation[
'actions'][
'watch'] ) ) {
1205 $content_navigation[
'actions'][
'watch'][
'tooltiponly'] =
true;
1207 if ( isset( $content_navigation[
'actions'][
'unwatch'] ) ) {
1208 $content_navigation[
'actions'][
'unwatch'][
'tooltiponly'] =
true;
1212 return $content_navigation;
1225 $content_actions = [];
1227 foreach ( $content_navigation as $links ) {
1228 foreach ( $links as $key => $value ) {
1229 if ( isset( $value[
'redundant'] ) && $value[
'redundant'] ) {
1238 if ( isset( $value[
'id'] ) && substr( $value[
'id'], 0, 3 ) ==
'ca-' ) {
1239 $key = substr( $value[
'id'], 3 );
1242 if ( isset( $content_actions[$key] ) ) {
1243 wfDebug( __METHOD__ .
": Found a duplicate key for $key while flattening " .
1244 "content_navigation into content_actions.\n" );
1248 $content_actions[$key] = $value;
1252 return $content_actions;
1269 } elseif ( UploadBase::isEnabled() && UploadBase::isAllowed( $this->
getUser() ) ===
true ) {
1272 $nav_urls[
'upload'] =
false;
1276 $nav_urls[
'print'] =
false;
1277 $nav_urls[
'permalink'] =
false;
1278 $nav_urls[
'info'] =
false;
1279 $nav_urls[
'whatlinkshere'] =
false;
1280 $nav_urls[
'recentchangeslinked'] =
false;
1281 $nav_urls[
'contributions'] =
false;
1282 $nav_urls[
'log'] =
false;
1283 $nav_urls[
'blockip'] =
false;
1284 $nav_urls[
'mute'] =
false;
1285 $nav_urls[
'emailuser'] =
false;
1286 $nav_urls[
'userrights'] =
false;
1290 if ( !$out->isPrintable() && ( $out->isArticle() || $this->
getTitle()->isSpecialPage() ) ) {
1291 $nav_urls[
'print'] = [
1292 'text' => $this->
msg(
'printableversion' )->text(),
1293 'href' => $this->
getTitle()->getLocalURL(
1294 $request->appendQueryValue(
'printable',
'yes' ) )
1298 if ( $out->isArticle() ) {
1300 $revid = $this->
getOutput()->getRevisionId();
1302 $nav_urls[
'permalink'] = [
1303 'text' => $this->
msg(
'permalink' )->text(),
1304 'href' => $this->
getTitle()->getLocalURL(
"oldid=$revid" )
1309 $skinTemplate = $this;
1311 Hooks::run(
'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
1312 [ &$skinTemplate, &$nav_urls, &$revid, &$revid ] );
1315 if ( $out->isArticleRelated() ) {
1316 $nav_urls[
'whatlinkshere'] = [
1320 $nav_urls[
'info'] = [
1321 'text' => $this->
msg(
'pageinfo-toolboxlink' )->text(),
1322 'href' => $this->
getTitle()->getLocalURL(
"action=info" )
1326 $nav_urls[
'recentchangeslinked'] = [
1334 $rootUser = $user->getName();
1336 $nav_urls[
'contributions'] = [
1337 'text' => $this->
msg(
'contributions', $rootUser )->text(),
1339 'tooltip-params' => [ $rootUser ],
1342 $nav_urls[
'log'] = [
1346 if ( MediawikiServices::getInstance()
1348 ->userHasRight( $this->
getUser(),
'block' )
1350 $nav_urls[
'blockip'] = [
1351 'text' => $this->
msg(
'blockip', $rootUser )->text(),
1357 $nav_urls[
'emailuser'] = [
1358 'text' => $this->
msg(
'tool-link-emailuser', $rootUser )->text(),
1360 'tooltip-params' => [ $rootUser ],
1364 if ( !$user->isAnon() ) {
1365 if ( $this->
getUser()->isRegistered() && $this->
getConfig()->get(
'EnableSpecialMute' ) ) {
1366 $nav_urls[
'mute'] = [
1367 'text' => $this->
msg(
'mute-preferences' )->text(),
1374 $canChange = $sur->userCanChangeRights( $user );
1375 $nav_urls[
'userrights'] = [
1376 'text' => $this->
msg(
1377 $canChange ?
'tool-link-userrights' :
'tool-link-userrights-readonly',
1393 return $this->
getTitle()->getNamespaceKey();