From: jenkins-bot Date: Mon, 15 Aug 2016 07:39:17 +0000 (+0000) Subject: Merge "Move bottomScripts() call in SkinTemplate" X-Git-Tag: 1.31.0-rc.0~6070 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=f7429252f85c5835b291def55fc04b8196c1bb39;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Move bottomScripts() call in SkinTemplate" --- f7429252f85c5835b291def55fc04b8196c1bb39 diff --combined includes/skins/SkinTemplate.php index 22413b9971,278af67e45..749a6860c3 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@@ -17,7 -17,6 +17,7 @@@ * * @file */ +use MediaWiki\MediaWikiServices; /** * Base class for template-based skins. @@@ -456,7 -455,6 +456,6 @@@ class SkinTemplate extends Skin $tpl->set( 'indicators', $out->getIndicators() ); $tpl->set( 'sitenotice', $this->getSiteNotice() ); - $tpl->set( 'bottomscripts', $this->bottomScripts() ); $tpl->set( 'printfooter', $this->printSource() ); // Wrap the bodyText with #mw-content-text element $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext ); @@@ -509,6 -507,9 +508,9 @@@ // See Skin::afterContentHook() for further documentation. $tpl->set( 'dataAfterContent', $this->afterContentHook() ); + // Do this last in case hooks above add bottom scripts + $tpl->set( 'bottomscripts', $this->bottomScripts() ); + return $tpl; } @@@ -664,21 -665,27 +666,21 @@@ $loginlink = $this->getUser()->isAllowed( 'createaccount' ) && $useCombinedLoginLink ? 'nav-login-createaccount' : 'pt-login'; - $is_signup = $request->getText( 'type' ) == 'signup'; $login_url = [ 'text' => $this->msg( $loginlink )->text(), 'href' => self::makeSpecialUrl( 'Userlogin', $returnto ), 'active' => $title->isSpecial( 'Userlogin' ) - && ( $loginlink == 'nav-login-createaccount' || !$is_signup ), + || $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink, ]; $createaccount_url = [ 'text' => $this->msg( 'pt-createaccount' )->text(), - 'href' => self::makeSpecialUrl( 'Userlogin', "$returnto&type=signup" ), - 'active' => $title->isSpecial( 'Userlogin' ) && $is_signup, + 'href' => self::makeSpecialUrl( 'CreateAccount', $returnto ), + 'active' => $title->isSpecial( 'CreateAccount' ), ]; // No need to show Talk and Contributions to anons if they can't contribute! if ( User::groupHasPermission( '*', 'edit' ) ) { - // Show the text "Not logged in" - $personal_urls['anonuserpage'] = [ - 'text' => $this->msg( 'notloggedin' )->text() - ]; - // Because of caching, we can't link directly to the IP talk and // contributions pages. Instead we use the special page shortcuts // (which work correctly regardless of caching). This means we can't @@@ -733,8 -740,6 +735,8 @@@ } } + $linkClass = MediaWikiServices::getInstance()->getLinkRenderer()->getLinkClasses( $title ); + // wfMessageFallback will nicely accept $message as an array of fallbacks // or just a single key $msg = wfMessageFallback( $message )->setContext( $this->getContext() ); @@@ -757,16 -762,11 +759,16 @@@ return $result; } - return [ + $result = [ 'class' => implode( ' ', $classes ), 'text' => $text, 'href' => $title->getLocalURL( $query ), 'primary' => true ]; + if ( $linkClass !== '' ) { + $result['link-class'] = $linkClass; + } + + return $result; } function makeTalkUrlDetails( $name, $urlaction = '' ) {