Merge "Don't break existing expiry time of "infinity" when modifying protection"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 18 Sep 2014 02:27:56 +0000 (02:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 18 Sep 2014 02:27:56 +0000 (02:27 +0000)
includes/ProtectionForm.php
languages/i18n/en.json
languages/i18n/qqq.json

index 35352d6..7bad8b5 100644 (file)
@@ -384,13 +384,18 @@ class ProtectionForm {
                        );
 
                        $expiryFormOptions = '';
-                       if ( $this->mExistingExpiry[$action] && $this->mExistingExpiry[$action] != 'infinity' ) {
-                               $timestamp = $lang->timeanddate( $this->mExistingExpiry[$action], true );
-                               $d = $lang->date( $this->mExistingExpiry[$action], true );
-                               $t = $lang->time( $this->mExistingExpiry[$action], true );
+                       if ( $this->mExistingExpiry[$action] ) {
+                               if ( $this->mExistingExpiry[$action] == 'infinity' ) {
+                                       $existingExpiryMessage = wfMessage( 'protect-existing-expiry-infinity' );
+                               } else {
+                                       $timestamp = $lang->timeanddate( $this->mExistingExpiry[$action], true );
+                                       $d = $lang->date( $this->mExistingExpiry[$action], true );
+                                       $t = $lang->time( $this->mExistingExpiry[$action], true );
+                                       $existingExpiryMessage = wfMessage( 'protect-existing-expiry', $timestamp, $d, $t );
+                               }
                                $expiryFormOptions .=
                                        Xml::option(
-                                               wfMessage( 'protect-existing-expiry', $timestamp, $d, $t )->text(),
+                                               $existingExpiryMessage->text(),
                                                'existing',
                                                $this->mExpirySelection[$action] == 'existing'
                                        ) . "\n";
index 6e26e65..e56789a 100644 (file)
        "protect-othertime": "Other time:",
        "protect-othertime-op": "other time",
        "protect-existing-expiry": "Existing expiry time: $3, $2",
+       "protect-existing-expiry-infinity": "Existing expiry time: infinite",
        "protect-otherreason": "Other/additional reason:",
        "protect-otherreason-op": "Other reason",
        "protect-dropdown": "*Common protection reasons\n** Excessive vandalism\n** Excessive spamming\n** Counter-productive edit warring\n** High traffic page",
index 956849e..5c5683a 100644 (file)
        "protect-cantedit": "Used as error message when changing the protection levels of the page.",
        "protect-othertime": "Used on the page protection form as label for the following input field (text)\n{{Identical|Other time}}",
        "protect-othertime-op": "Used on the page protection form in the drop down menu\n{{Identical|Other time}}",
-       "protect-existing-expiry": "Shows the existing expiry time in the drop down menu of the protection form ([{{canonicalurl:User:Raymond/test|action=unprotect}} example])\n\nParameters:\n* $1 - (Unused) date and time of the existing expiry time (kept for backward compatibility purposes)\n* $2 - date of the existing expiry time\n* $3 - time of the existing expiry time",
+       "protect-existing-expiry": "Shows the existing expiry time in the drop down menu of the protection form ([{{canonicalurl:User:Raymond/test|action=unprotect}} example])\n\nParameters:\n* $1 - (Unused) date and time of the existing expiry time (kept for backward compatibility purposes)\n* $2 - date of the existing expiry time\n* $3 - time of the existing expiry time\n\nSee also:\n* {{msg-mw|protect-existing-expiry-infinity}}",
+       "protect-existing-expiry-infinity": "Shows the existing expiry time in the drop down menu of the protection form, in the special case that it is infinity\n\nSee also:\n* {{msg-mw|protect-existing-expiry}}",
        "protect-otherreason": "Shown on the page protection form as label for the following input field (text)\n{{Identical|Other/additional reason}}",
        "protect-otherreason-op": "Shown on the page protection form in the drop down menu\n{{Identical|Other reason}}",
        "protect-dropdown": "Shown on the page protection form as drop down menu for protection reasons.\n\n* <code><nowiki>* Groupname</nowiki></code> - defines a new group\n* <code><nowiki>** Reason</nowiki></code> - defines a reason in this group",