X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=97c0ec445d836b8da6c1e559c3eaab469da21dae;hb=a439b58fcf1dd94386969ba558ec93cb31bdef53;hp=08816add7f150c86ccb75ed0f0daf000cb2dc8c2;hpb=374f77d0c6602a512ac041fca4ce51b1825d6116;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 08816add7f..97c0ec445d 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -74,24 +74,12 @@ 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. */ public $template = 'QuickTemplate'; - /** - * @var bool Whether this skin use OutputPage::headElement() to generate - * the "" tag. - */ - public $useHeadElement = false; - /** * Add specific styles for this skin * @@ -124,7 +112,6 @@ class SkinTemplate extends Skin { * Generates array of language links for the current page * * @return array - * @public */ public function getLanguages() { global $wgHideInterlanguageLinks; @@ -146,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 ); } @@ -159,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 @@ -290,26 +307,6 @@ class SkinTemplate extends Skin { $out = $this->getOutput(); $tpl = $this->setupTemplateForOutput(); - wfProfileIn( __METHOD__ . '-stuff-head' ); - if ( !$this->useHeadElement ) { - $tpl->set( 'pagecss', false ); - $tpl->set( 'usercss', false ); - - $tpl->set( 'userjs', false ); - $tpl->set( 'userjsprev', false ); - - $tpl->set( 'jsvarurl', false ); - - $tpl->set( 'xhtmldefaultnamespace', 'http://www.w3.org/1999/xhtml' ); - $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces ); - $tpl->set( 'html5version', $wgHtml5Version ); - $tpl->set( 'headlinks', $out->getHeadLinks() ); - $tpl->set( 'csslinks', $out->buildCssLinks() ); - $tpl->set( 'pageclass', $this->getPageClasses( $title ) ); - $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) ); - } - wfProfileOut( __METHOD__ . '-stuff-head' ); - wfProfileIn( __METHOD__ . '-stuff2' ); $tpl->set( 'title', $out->getPageTitle() ); $tpl->set( 'pagetitle', $out->getHTMLTitle() ); @@ -540,11 +537,7 @@ class SkinTemplate extends Skin { $tpl->set( 'nav_urls', $this->buildNavUrls() ); // Set the head scripts near the end, in case the above actions resulted in added scripts - if ( $this->useHeadElement ) { - $tpl->set( 'headelement', $out->headElement( $this ) ); - } else { - $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() ); - } + $tpl->set( 'headelement', $out->headElement( $this ) ); $tpl->set( 'debug', '' ); $tpl->set( 'debughtml', $this->generateDebugHTML() ); @@ -1104,7 +1097,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