X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=faf71aa99a91b43e373931078a4059727172d2a5;hb=0b6fe244a809fed0f115ebfd233a1548df7df845;hp=86bd9797a97e0d3c1058c2af361c629f73b4f8f5;hpb=93405c852cb0a731d31b711c50f527c6aff52664;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 86bd9797a9..faf71aa99a 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -74,12 +74,6 @@ class SkinTemplate extends Skin { */ public $skinname = 'monobook'; - /** - * @var string Stylesheets set to use. Subdirectory in skins/ where various - * stylesheets are located. Child classes should override the default. - */ - public $stylename = 'monobook'; - /** * @var string For QuickTemplate, the name of the subclass which will * actually fill the template. Child classes should override the default. @@ -118,7 +112,6 @@ class SkinTemplate extends Skin { * Generates array of language links for the current page * * @return array - * @public */ public function getLanguages() { global $wgHideInterlanguageLinks; @@ -140,8 +133,16 @@ class SkinTemplate extends Skin { $ilLangName = Language::fetchLanguageName( $ilInterwikiCode ); if ( strval( $ilLangName ) === '' ) { - $ilLangName = $languageLinkText; + $ilDisplayTextMsg = wfMessage( "interlanguage-link-$ilInterwikiCode" ); + if ( !$ilDisplayTextMsg->isDisabled() ) { + // Use custom MW message for the display text + $ilLangName = $ilDisplayTextMsg->text(); + } else { + // Last resort: fallback to the language link target + $ilLangName = $languageLinkText; + } } else { + // Use the language autonym as display text $ilLangName = $this->formatLanguageName( $ilLangName ); } @@ -153,7 +154,29 @@ class SkinTemplate extends Skin { ); $languageLinkTitleText = $languageLinkTitle->getText(); - if ( $languageLinkTitleText === '' ) { + if ( $ilLangLocalName === '' ) { + $ilFriendlySiteName = wfMessage( "interlanguage-link-sitename-$ilInterwikiCode" ); + if ( !$ilFriendlySiteName->isDisabled() ) { + if ( $languageLinkTitleText === '' ) { + $ilTitle = wfMessage( + 'interlanguage-link-title-nonlangonly', + $ilFriendlySiteName->text() + )->text(); + } else { + $ilTitle = wfMessage( + 'interlanguage-link-title-nonlang', + $languageLinkTitleText, + $ilFriendlySiteName->text() + )->text(); + } + } else { + // we have nothing friendly to put in the title, so fall back to + // displaying the interlanguage link itself in the title text + // (similar to what is done in page content) + $ilTitle = $languageLinkTitle->getInterwiki() . + ":$languageLinkTitleText"; + } + } elseif ( $languageLinkTitleText === '' ) { $ilTitle = wfMessage( 'interlanguage-link-title-langonly', $ilLangLocalName @@ -336,13 +359,6 @@ class SkinTemplate extends Skin { $tpl->set( 'handheld', $request->getBool( 'handheld' ) ); $tpl->setRef( 'loggedin', $this->loggedin ); $tpl->set( 'notspecialpage', !$title->isSpecialPage() ); - /* XXX currently unused, might get useful later - $tpl->set( 'editable', ( !$title->isSpecialPage() ) ); - $tpl->set( 'exists', $title->getArticleID() != 0 ); - $tpl->set( 'watch', $user->isWatched( $title ) ? 'unwatch' : 'watch' ); - $tpl->set( 'protect', count( $title->isProtected() ) ? 'unprotect' : 'protect' ); - $tpl->set( 'helppage', $this->msg( 'helppage' )->text() ); - */ $tpl->set( 'searchaction', $this->escapeSearchLink() ); $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() ); $tpl->set( 'search', trim( $request->getVal( 'search' ) ) ); @@ -1074,7 +1090,7 @@ class SkinTemplate extends Skin { /** * The following actions use messages which, if made particular to * the any specific skins, would break the Ajax code which makes this - * action happen entirely inline. Skin::makeGlobalVariablesScript + * action happen entirely inline. OutputPage::getJSVars * defines a set of messages in a javascript object - and these * messages are assumed to be global for all skins. Without making * a change to that procedure these messages will have to remain as