Thcipriani has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278923

Change subject: Revert "Add link to anon's user page; remove "Not logged in""
......................................................................

Revert "Add link to anon's user page; remove "Not logged in""

This reverts change I049d0671a7050.

This change was reverted in the wmf/1.27.0-wmf.17. Since there is no
clear consensus, revert in master before branching wmf/1.27.0-wmf.18.

Bug: T121793
Change-Id: I2dc0f2562c908d4e419d34e80a64065843778f3d
---
M includes/skins/SkinTemplate.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 31 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/278923/1

diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 419c4b4..92311b5 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -650,33 +650,42 @@
                                'active' => false
                        ];
                } else {
+                       $useCombinedLoginLink = $this->useCombinedLoginLink();
+                       $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 ),
+                       ];
+                       $createaccount_url = [
+                               'text' => $this->msg( 'pt-createaccount' 
)->text(),
+                               'href' => self::makeSpecialUrl( 'Userlogin', 
"$returnto&type=signup" ),
+                               'active' => $title->isSpecial( 'Userlogin' ) && 
$is_signup,
+                       ];
+
                        // 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 anonymous
-                               // user page (for example [[User:127.0.0.1]]), 
talk page, and
-                               // contributions pages. Instead we use the 
special page
-                               // shortcuts (which work correctly regardless 
of caching). This
-                               // means we can't determine whether these links 
are active or
-                               // not, but since major skins (MonoBook, 
Vector) don't use this
-                               // information, it's not a huge loss.
-
-                               // Only show (red) link to anon user page if 
anon users are
-                               // allowed to create that page
-                               if ( User::groupHasPermission( '*', 
'createpage' ) ) {
-                                       $personal_urls[ 'anonuserpage' ] = [
-                                               'text'   => $this->msg( 
'anonuserpage' )->text(),
-                                               'href'   => 
self::makeSpecialUrlSubpage( 'Mypage', false ),
-                                               'active' => false
-                                       ];
-                               }
-
+                               // 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
+                               // determine whether these links are active or 
not, but since major
+                               // skins (MonoBook, Vector) don't use this 
information, it's not a
+                               // huge loss.
                                $personal_urls['anontalk'] = [
                                        'text' => $this->msg( 'anontalk' 
)->text(),
                                        'href' => self::makeSpecialUrlSubpage( 
'Mytalk', false ),
                                        'active' => false
                                ];
-
                                $personal_urls['anoncontribs'] = [
                                        'text' => $this->msg( 'anoncontribs' 
)->text(),
                                        'href' => self::makeSpecialUrlSubpage( 
'Mycontributions', false ),
@@ -684,21 +693,11 @@
                                ];
                        }
 
-                       $is_signup = $request->getText( 'type' ) === 'signup';
-
-                       if ( $this->getUser()->isAllowed( 'createaccount' ) && 
!( $this->useCombinedLoginLink() ) ) {
-                               $personal_urls[ 'createaccount' ] = [
-                                       'text' => $this->msg( 
'pt-createaccount' )->text(),
-                                       'href' => self::makeSpecialUrl( 
'Userlogin', "$returnto&type=signup" ),
-                                       'active' => $title->isSpecial( 
'Userlogin' ) && $is_signup,
-                               ];
+                       if ( $this->getUser()->isAllowed( 'createaccount' ) && 
!$useCombinedLoginLink ) {
+                               $personal_urls['createaccount'] = 
$createaccount_url;
                        }
 
-                       $personal_urls['login'] = [
-                               'text' => $this->msg( 'pt-login' )->text(),
-                               'href' => self::makeSpecialUrl( 'Userlogin', 
$returnto ),
-                               'active' => $title->isSpecial( 'Userlogin' ) && 
!$is_signup,
-                       ];
+                       $personal_urls['login'] = $login_url;
                }
 
                Hooks::run( 'PersonalUrls', [ &$personal_urls, &$title, $this ] 
);
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index b27aee4..b68fa5a 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -143,7 +143,6 @@
        "moredotdotdot": "More...",
        "morenotlisted": "This list is not complete.",
        "mypage": "Page",
-       "anonuserpage": "Unknown user",
        "mytalk": "Talk",
        "anontalk": "Talk",
        "navigation": "Navigation",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index ae2eca4..4058d83 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -319,7 +319,6 @@
        "moredotdotdot": "Used as \"More...\" link for 
{{msg-mw|pageinfo-transclusions}} field, in the \"templates used on this page\" 
list.\n\nSimilar to {{msg-mw|morenotlisted}}.\n{{Identical|More...}}",
        "morenotlisted": "An indication that more of a templates list is not 
shown.\n\nUsed as \"More...\" link for {{msg-mw|pageinfo-templates}} 
field.\n\nSimilar to {{msg-mw|moredotdotdot}}.",
        "mypage": "A text for the link to the user's user page in the links at 
the top of the page.\n{{Identical|Page}}",
-       "anonuserpage": "Same as {{msg-mw|mypage}} but used for non-logged-in 
users.\nA text for the link to the IP user page in the links at the top of the 
page.\n\nSee also:\n* {{msg-mw|Accesskey-pt-anonuserpage}}\n* 
{{msg-mw|Tooltip-pt-anonuserpage}}",
        "mytalk": "In the personal URLs page section - right upper 
corner.\n\nUsed as link title in your personal toolbox.\n\nSee also:\n* 
{{msg-mw|Mytalk}}\n* {{msg-mw|Accesskey-pt-mytalk}}\n* 
{{msg-mw|Tooltip-pt-mytalk}}\n{{Identical|Talk}}",
        "anontalk": "Same as {{msg-mw|mytalk}} but used for non-logged-in 
users.\n{{Identical|Talk}}\n\nSee also:\n* {{msg-mw|Accesskey-pt-anontalk}}\n* 
{{msg-mw|Tooltip-pt-anontalk}}",
        "navigation": "This is shown as a section header in the sidebar of most 
skins.\n\n{{Identical|Navigation}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/278923
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dc0f2562c908d4e419d34e80a64065843778f3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to