From: jenkins-bot Date: Wed, 3 May 2017 14:21:38 +0000 (+0000) Subject: Merge "Add mw-content-ltr|rtl to file redirect pages" X-Git-Tag: 1.31.0-rc.0~3357 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=cf35ff756c89ca6d6e003b440076df5ebe7ccef7;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Add mw-content-ltr|rtl to file redirect pages" --- cf35ff756c89ca6d6e003b440076df5ebe7ccef7 diff --combined includes/skins/SkinTemplate.php index 1dd9a06add,c3e3cea48f..f49d46c2fd --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@@ -61,7 -61,7 +61,7 @@@ class SkinTemplate extends Skin * * @param OutputPage $out */ - function setupSkinUserCss( OutputPage $out ) { + public function setupSkinUserCss( OutputPage $out ) { $moduleStyles = [ 'mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint', @@@ -269,11 -269,13 +269,13 @@@ # An ID that includes the actual body text; without categories, contentSub, ... $realBodyAttribs = [ 'id' => 'mw-content-text' ]; - # Add a mw-content-ltr/rtl class to be able to style based on text direction - # when the content is different from the UI language, i.e.: - # not for special pages or file pages AND only when viewing - if ( !in_array( $title->getNamespace(), [ NS_SPECIAL, NS_FILE ] ) && - Action::getActionName( $this ) === 'view' ) { + # Add a mw-content-ltr/rtl class to be able to style based on text + # direction when the content is different from the UI language (only + # when viewing) + # Most information on special pages and file pages is in user language, + # rather than content language, so those will not get this + if ( Action::getActionName( $this ) === 'view' && + ( !$title->inNamespaces( NS_SPECIAL, NS_FILE ) || $title->isRedirect() ) ) { $pageLang = $title->getPageViewLanguage(); $realBodyAttribs['lang'] = $pageLang->getHtmlCode(); $realBodyAttribs['dir'] = $pageLang->getDir(); @@@ -344,7 -346,7 +346,7 @@@ $tpl->set( 'charset', 'UTF-8' ); $tpl->setRef( 'wgScript', $wgScript ); $tpl->setRef( 'skinname', $this->skinname ); - $tpl->set( 'skinclass', get_class( $this ) ); + $tpl->set( 'skinclass', static::class ); $tpl->setRef( 'skin', $this ); $tpl->setRef( 'stylename', $this->stylename ); $tpl->set( 'printable', $out->isPrintable() ); @@@ -582,7 -584,7 +584,7 @@@ /* set up the default links for the personal toolbar */ $personal_urls = []; - # Due to bug 32276, if a user does not have read permissions, + # Due to T34276, if a user does not have read permissions, # $this->getTitle() will just give Special:Badtitle, which is # not especially useful as a returnto parameter. Use the title # from the request instead, if there was one. @@@ -663,7 -665,7 +665,7 @@@ 'text' => $this->msg( 'pt-userlogout' )->text(), 'href' => self::makeSpecialUrl( 'Userlogout', // userlogout link must always contain an & character, otherwise we might not be able - // to detect a buggy precaching proxy (bug 17790) + // to detect a buggy precaching proxy (T19790) $title->isSpecial( 'Preferences' ) ? 'noreturnto' : $returnto ), 'active' => false ]; @@@ -720,10 -722,7 +722,10 @@@ } if ( $authManager->canAuthenticateNow() ) { - $personal_urls['login'] = $login_url; + $key = User::groupHasPermission( '*', 'read' ) + ? 'login' + : 'login-private'; + $personal_urls[$key] = $login_url; } } @@@ -1123,7 -1122,7 +1125,7 @@@ $content_navigation['namespaces']['special'] = [ 'class' => 'selected', 'text' => $this->msg( 'nstab-special' )->text(), - 'href' => $request->getRequestURL(), // @see: bug 2457, bug 2510 + 'href' => $request->getRequestURL(), // @see: T4457, T4510 'context' => 'subject' ]; @@@ -1286,7 -1285,7 +1288,7 @@@ 'href' => $this->getTitle()->getLocalURL( "action=info" ) ]; - if ( $this->getTitle()->exists() ) { + if ( $this->getTitle()->exists() || $this->getTitle()->inNamespace( NS_CATEGORY ) ) { $nav_urls['recentchangeslinked'] = [ 'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalURL() ];