jenkins-bot has submitted this change and it was merged.

Change subject: Enable login for older phones
......................................................................


Enable login for older phones

Fix the watch star behaviour in no JavaScript mode for logged
out users by turning it into a link to the login form

Enable the login link in the menu
Bug: 51414

Change-Id: I49d4b998397d8c1ca119f5fa0f5177c0a980e128
---
M includes/skins/SkinMinerva.php
M includes/skins/SkinMobile.php
2 files changed, 14 insertions(+), 4 deletions(-)

Approvals:
  JGonera: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index b57e7f4..13728ef 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -46,6 +46,16 @@
                }
        }
 
+       /**
+        * Prepares a url to the Special:UserLogin with query parameters,
+        * taking into account $wgMFForceSecureLogin
+        * @param array $query
+        * @return string
+        */
+       public static function getLoginUrl( $query ) {
+               return SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( 
$query );
+       }
+
        public function prepareData( BaseTemplate $tpl ) {
                global $wgMFEnableSiteNotice;
                $title = $this->getTitle();
@@ -148,6 +158,7 @@
                        $menu['watch'] = $watchTemplate;
                        // FIXME: makeLink (used by makeListItem) when no text 
is present defaults to use the key
                        $menu['watch']['text'] = '';
+                       $menu['watch']['href'] = static::getLoginUrl( array( 
'returnto' => $title ) );
                }
 
                $tpl->set( 'page_actions', $menu );
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index b8aba00..b56ba8c 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -243,7 +243,7 @@
                                'href' => $this->getUser()->isLoggedIn() ?
                                        $watchTitle->getLocalUrl( 
$watchlistQuery ) :
                                        static::getLoginUrl( array( 'returnto' 
=> $watchTitle ) ),
-                               'class' => 'icon-watchlist jsonly',
+                               'class' => 'icon-watchlist',
                        ),
                        'uploads' => array(
                                'text' => wfMessage( 
'mobile-frontend-main-menu-upload' )->escaped(),
@@ -395,15 +395,14 @@
                        // note welcome=yes in return to query allows us to 
detect accounts created from the left nav
                        $returntoquery[ 'welcome' ] = 'yes';
                        $query[ 'returntoquery' ] = wfArrayToCgi( 
$returntoquery );
-                       $url = SpecialPage::getTitleFor( 'Userlogin' 
)->getFullURL( $query );
-                       $url = $context->getMobileUrl( $url, 
$wgMFForceSecureLogin );
+                       $url = static::getLoginUrl( $query );
                        $text = wfMessage( 'mobile-frontend-main-menu-login' 
)->escaped();
                }
                wfProfileOut( __METHOD__ );
                return array(
                        'text' => $text,
                        'href' => $url,
-                       'class' => 'icon-loginout jsonly',
+                       'class' => 'icon-loginout',
                );
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I49d4b998397d8c1ca119f5fa0f5177c0a980e128
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to