Introduce default expiry time for special:block (bug 32178)
authorWaldir Pimenta <waldir@email.com>
Wed, 6 Jun 2012 19:50:19 +0000 (20:50 +0100)
committerWaldir Pimenta <waldir@email.com>
Tue, 31 Jul 2012 17:12:01 +0000 (18:12 +0100)
Minor side change 1: fix preservation of infinite expiry time when reblocking:
the hardcoded value "indefinite" did not match with the default value
specified in ipboptions "infinite"

Minor side change 2: fix link in includes/Message.php's documentation

Change-Id: Icb1edabd8bb3dd1020c023b27b1270b9d2735b06

includes/Message.php
includes/specials/SpecialBlock.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index 3a87a00..78b9ec2 100644 (file)
@@ -28,7 +28,7 @@
  *
  * First implemented with MediaWiki 1.17, the Message class is intented to
  * replace the old wfMsg* functions that over time grew unusable.
- * @see https://www.mediawiki.org/wiki/New_messages_API for equivalences
+ * @see https://www.mediawiki.org/wiki/Manual:Messages_API for equivalences
  * between old and new functions.
  *
  * You should use the wfMessage() global function which acts as a wrapper for
index 3c43ed1..f271929 100644 (file)
@@ -144,6 +144,7 @@ class SpecialBlock extends FormSpecialPage {
                                'tabindex' => '2',
                                'options' => self::getSuggestedDurations(),
                                'other' => $this->msg( 'ipbother' )->text(),
+                               'default' => $this->msg( 'ipb-default-expiry' )->inContentLanguage()->text(),
                        ),
                        'Reason' => array(
                                'type' => 'selectandother',
@@ -271,7 +272,7 @@ class SpecialBlock extends FormSpecialPage {
                        }
 
                        if( $block->mExpiry == 'infinity' ) {
-                               $fields['Expiry']['default'] = 'indefinite';
+                               $fields['Expiry']['default'] = 'infinite';
                        } else {
                                $fields['Expiry']['default'] = wfTimestamp( TS_RFC2822, $block->mExpiry );
                        }
index ffef8a1..658607e 100644 (file)
@@ -3258,6 +3258,7 @@ You cannot create an account',
 Since you do not have the hideuser right, you cannot see or edit the user's block.",
 'ipbblocked'                      => 'You cannot block or unblock other users, because you are yourself blocked',
 'ipbnounblockself'                => 'You are not allowed to unblock yourself',
+'ipb-default-expiry'              => '', # empty so the default is unchanged from previous versions of MediaWiki
 
 # Developer tools
 'lockdb'              => 'Lock database',
index 9cdbf34..1918109 100644 (file)
@@ -241,6 +241,7 @@ $wgIgnoredMessages = array(
        'version-entrypoints-index-php',
        'version-entrypoints-api-php',
        'version-entrypoints-load-php',
+       'ipb-default-expiry',
 );
 
 /** Optional messages, which may be translated only if changed in the target language. */
index 2e381aa..e2e86bd 100644 (file)
@@ -2249,6 +2249,7 @@ $wgMessageStructure = array(
                'cant-see-hidden-user',
                'ipbblocked',
                'ipbnounblockself',
+               'ipb-default-expiry',
        ),
        'developertools' => array(
                'lockdb',