Kaldari has uploaded a new change for review.

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


Change subject: Fixing link to login page so that it returns users to upload 
page
......................................................................

Fixing link to login page so that it returns users to upload page

Bug: 50397
Change-Id: I4f7ee65bd483797ee4363f13b00ceba66dae40c2
---
M MobileFrontend.i18n.php
M includes/specials/SpecialUploads.php
2 files changed, 13 insertions(+), 3 deletions(-)


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

diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index a0cb6f3..a022355 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -148,7 +148,8 @@
        'mobile-frontend-photo-upload-generic' => 'Contribute an image',
        'mobile-frontend-donate-image-title' => 'Uploads',
        'mobile-frontend-donate-image-heading' => 'Your recent contributions',
-       'mobile-frontend-donate-image-anon' => 'A [[Special:UserLogin|user 
account]] is required to view the uploads page',
+       'mobile-frontend-donate-image-anon' => 'A $1 is required to view the 
uploads page',
+       'mobile-frontend-user-account' => 'user account',
        'mobile-frontend-listed-image-no-description' => 'No description',
        'mobile-frontend-donate-photo-upload-success' => 'Success! Your image 
can now be used on {{SITENAME}}!',
        'mobile-frontend-donate-photo-first-upload-success' => 'Success! Thanks 
for your first contribution!',
@@ -530,7 +531,9 @@
        'mobile-frontend-donate-image-title' => 
'{{doc-special|Uploads|unlisted=1}}
 {{Identical|Upload}}',
        'mobile-frontend-donate-image-heading' => 'heading for a list of recent 
contributions',
-       'mobile-frontend-donate-image-anon' => 'Message shown to user who 
visits the Special:Uploads page without a user account',
+       'mobile-frontend-donate-image-anon' => 'Message shown to user who 
visits the Special:Uploads page without a user account
+*$1 - link to the user login page, see 
{{msg-mw|mobile-frontend-user-account}}',
+       'mobile-frontend-user-account' => 'Text for a link to the user login 
page. Displayed as part of the sentence 
{{msg-mw|mobile-frontend-donate-image-anon}}.',
        'mobile-frontend-listed-image-no-description' => 'What to show when no 
description available',
        'mobile-frontend-donate-photo-upload-success' => 'On upload page - 
notification shown after a successful upload',
        'mobile-frontend-donate-photo-first-upload-success' => 'On upload page 
- notification shown after a successful upload when it is the first upload by 
that user',
diff --git a/includes/specials/SpecialUploads.php 
b/includes/specials/SpecialUploads.php
index 271bd61..4bc8c38 100644
--- a/includes/specials/SpecialUploads.php
+++ b/includes/specials/SpecialUploads.php
@@ -18,8 +18,15 @@
 
                // TODO: what if the user cannot upload to the destination wiki 
in $wgMFPhotoUploadEndpoint?
                if( $user->isAnon() ) {
+                       $returnTo = $this->getTitle()->getPrefixedText();
+                       $loginLink = Linker::link(
+                               SpecialPage::getTitleFor( 'UserLogin' ),
+                               wfMessage( 'mobile-frontend-user-account' 
)->plain(),
+                               array(),
+                               array( 'returnto' => $returnTo )
+                       );
                        $html = '<div class="alert error">' .
-                               $this->msg( 'mobile-frontend-donate-image-anon' 
)->parse() .
+                               $this->msg( 
'mobile-frontend-donate-image-anon', $loginLink )->text() .
                                '</div>';
                } else {
                        $uploadCount = $this->getUserUploadCount( 
$user->getName() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f7ee65bd483797ee4363f13b00ceba66dae40c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>

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

Reply via email to