From 7800979a9fefd910c4aec3265732e3926f643281 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Wed, 6 Jun 2012 20:50:19 +0100 Subject: [PATCH] Introduce default expiry time for special:block (bug 32178) 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 | 2 +- includes/specials/SpecialBlock.php | 3 ++- languages/messages/MessagesEn.php | 1 + maintenance/language/messageTypes.inc | 1 + maintenance/language/messages.inc | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Message.php b/includes/Message.php index 3a87a001fc..78b9ec2044 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -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 diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 3c43ed1b2b..f27192956b 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -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 ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index ffef8a158e..658607ef1b 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 9cdbf34ff5..191810927f 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -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. */ diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 2e381aa011..e2e86bd0b4 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2249,6 +2249,7 @@ $wgMessageStructure = array( 'cant-see-hidden-user', 'ipbblocked', 'ipbnounblockself', + 'ipb-default-expiry', ), 'developertools' => array( 'lockdb', -- 2.20.1