Jdlrobson has uploaded a new change for review.

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


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

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/58/75058/1

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..07016ee 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -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: newchange
Gerrit-Change-Id: I49d4b998397d8c1ca119f5fa0f5177c0a980e128
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to