Reimplement r55685, r55686, r55687, with correct parsing of the associative array...
authorHappy-melon <happy-melon@users.mediawiki.org>
Mon, 31 Aug 2009 11:30:50 +0000 (11:30 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Mon, 31 Aug 2009 11:30:50 +0000 (11:30 +0000)
RELEASE-NOTES
includes/Pager.php
includes/specials/SpecialAllmessages.php
languages/messages/MessagesEn.php
languages/messages/MessagesLzh.php
languages/messages/MessagesQqq.php
languages/messages/MessagesYue.php
languages/messages/MessagesZh_hans.php
languages/messages/MessagesZh_hant.php
maintenance/language/messages.inc

index ead2b92..aa149b0 100644 (file)
@@ -197,6 +197,8 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 20404) Custom fields in the user creation form template can now have
   detail labels in prefsectiontip divs.
 * MakeSysop and MakeBot are now aliases for Special:UserRights
+* IndexPager->mLimitsShown can now be an associative array of limit => text-to-
+  display-in-limit-form.
 
 === Bug fixes in 1.16 ===
 
index 054ca38..3a129e7 100644 (file)
@@ -879,10 +879,18 @@ abstract class TablePager extends IndexPager {
        function getLimitSelect() {
                global $wgLang;
                $s = "<select name=\"limit\">";
-               foreach ( $this->mLimitsShown as $limit ) {
-                       $selected = $limit == $this->mLimit ? 'selected="selected"' : '';
-                       $formattedLimit = $wgLang->formatNum( $limit );
-                       $s .= "<option value=\"$limit\" $selected>$formattedLimit</option>\n";
+               foreach ( $this->mLimitsShown as $key => $value ) {
+                       # The pair is either $index => $limit, in which case the $value
+                       # will be numeric, or $limit => $text, in which case the $value
+                       # will be a string.
+                       if( is_int( $value ) ){
+                               $limit = $text = $value;
+                       } else {
+                               $limit = $key;
+                               $text = $value;
+                       }
+                       $selected = ( $limit == $this->mLimit ? 'selected="selected"' : '' );
+                       $s .= "<option value=\"$limit\" $selected>$text</option>\n";
                }
                $s .= "</select>";
                return $s;
index f762532..417e367 100644 (file)
@@ -128,6 +128,7 @@ class AllmessagesTablePager extends TablePager {
 
        var $messages  = null;
        var $talkPages = null;
+       public $mLimitsShown;
 
        function __construct( $page, $conds, $langObj = null ) {
                parent::__construct();
@@ -135,6 +136,10 @@ class AllmessagesTablePager extends TablePager {
                $this->mPage = $page;
                $this->mConds = $conds;
                $this->mDefaultDirection = true; // always sort ascending
+               // We want to have an option for people to view *all* the messages, 
+               // so they can use Ctrl+F to search them.  5000 is the maximum that 
+               // will get through WebRequest::getLimitOffset().
+               $this->mLimitsShown = array( 20, 50, 100, 250, 500, 5000 => wfMsg('limitall') );
 
                global $wgLang, $wgContLang, $wgRequest;
 
index 3e43790..f708c21 100644 (file)
@@ -3814,6 +3814,7 @@ Others will be hidden by default.
 'watchlistall2'    => 'all',
 'namespacesall'    => 'all',
 'monthsall'        => 'all',
+'limitall'         => 'all',
 
 # E-mail address confirmation
 'confirmemail'             => 'Confirm e-mail address',
index 4f6472b..24e9adc 100644 (file)
@@ -2433,6 +2433,7 @@ $1',
 'watchlistall2'    => '全',
 'namespacesall'    => '全',
 'monthsall'        => '全',
+'limitall'         => '全',
 
 # E-mail address confirmation
 'confirmemail'             => '核郵驛',
index 89ae8de..310e9aa 100644 (file)
@@ -2996,6 +2996,9 @@ Please leave the link http://www.mediawiki.org/wiki/Manual:External_editors exac
 {{Identical|All}}',
 'monthsall'        => 'Used in a drop-down box on [[Special:Contributions]] as an option for "all months". See also [[MediaWiki:Month/{{SUBPAGENAME}}]].
 
+{{Identical|All}}',
+'limitall'      => 'Used on [[Special:AllMessages]] (and potentially other TablePager based tables) to display "all" the messages. 
+
 {{Identical|All}}',
 
 # E-mail address confirmation
index d9b041c..34586f2 100644 (file)
@@ -2956,6 +2956,7 @@ Variants for Chinese language
 'watchlistall2'    => '全部',
 'namespacesall'    => '全部',
 'monthsall'        => '全部',
+'limitall'         => '全部',
 
 # E-mail address confirmation
 'confirmemail'             => '確認電郵地址',
index 71eeafd..97f7f7f 100644 (file)
@@ -2993,6 +2993,7 @@ Variants for Chinese language
 'watchlistall2'    => '全部',
 'namespacesall'    => '全部',
 'monthsall'        => '全部',
+'limitall'         => '全部',
 
 # E-mail address confirmation
 'confirmemail'             => '确认邮箱地址',
index c03eec6..013ffc2 100644 (file)
@@ -2981,6 +2981,7 @@ Variants for Chinese language
 'watchlistall2'    => '全部',
 'namespacesall'    => '全部',
 'monthsall'        => '全部',
+'limitall'         => '全部',
 
 # E-mail address confirmation
 'confirmemail'             => '確認郵箱位址',
index f8b901b..82426f4 100644 (file)
@@ -2822,6 +2822,7 @@ $wgMessageStructure = array(
                'watchlistall2',
                'namespacesall',
                'monthsall',
+               'limitall',
        ),
        'confirmemail' => array(
                'confirmemail',