Remove $wgDisableAuthManager
[lhc/web/wiklou.git] / includes / skins / SkinTemplate.php
index cefc5bc..22413b9 100644 (file)
@@ -17,6 +17,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Base class for template-based skins.
@@ -664,34 +665,17 @@ class SkinTemplate extends Skin {
                                ? 'nav-login-createaccount'
                                : 'pt-login';
 
-                       // TODO remove this after AuthManager is stable
-                       global $wgDisableAuthManager;
-                       if ( $wgDisableAuthManager ) {
-                               $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 ),
-                               ];
-                               $createaccount_url = [
-                                       'text' => $this->msg( 'pt-createaccount' )->text(),
-                                       'href' => self::makeSpecialUrl( 'Userlogin', "$returnto&type=signup" ),
-                                       'active' => $title->isSpecial( 'Userlogin' ) && $is_signup,
-                               ];
-                       } else {
-                               $login_url = [
-                                       'text' => $this->msg( $loginlink )->text(),
-                                       'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
-                                       'active' => $title->isSpecial( 'Userlogin' ) ||
-                                               $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink,
-                               ];
-                               $createaccount_url = [
-                                       'text' => $this->msg( 'pt-createaccount' )->text(),
-                                       'href' => self::makeSpecialUrl( 'CreateAccount', $returnto ),
-                                       'active' => $title->isSpecial( 'CreateAccount' ),
-                               ];
-                       }
+                       $login_url = [
+                               'text' => $this->msg( $loginlink )->text(),
+                               'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
+                               'active' => $title->isSpecial( 'Userlogin' )
+                                       || $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink,
+                       ];
+                       $createaccount_url = [
+                               'text' => $this->msg( 'pt-createaccount' )->text(),
+                               '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' ) ) {
@@ -749,6 +733,8 @@ class SkinTemplate extends Skin {
                        }
                }
 
+               $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() );
@@ -771,11 +757,16 @@ class SkinTemplate extends Skin {
                        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 = '' ) {