* Allow IndexPager->mLimitsShown to be an associative array of limit => text-to-displ...
authorHappy-melon <happy-melon@users.mediawiki.org>
Sun, 30 Aug 2009 21:50:10 +0000 (21:50 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Sun, 30 Aug 2009 21:50:10 +0000 (21:50 +0000)
* Use this to add an "all" value to the limit form in Special:AllMessages.  In reality, "all" is only 5000, but this is plenty more than most wikis should have.

RELEASE-NOTES
includes/Pager.php
includes/specials/SpecialAllmessages.php
languages/messages/MessagesEn.php

index ead2b92..e27a4ac 100644 (file)
@@ -160,6 +160,8 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 9691) Add type (signup or login) parameter to AuthPlugin::ModifyUITemplate()
 * (bug 14454) "Member of group(s)" in Special:Preferences causes language difficulties
 * (bug 16697) Unicode combining characters are difficult to edit in some browsers
+* IndexPager->mLimitsShown can now be an associative array of limit => text-to-
+  display-in-limit-form.
 * Parser test supports uploading results to remote CodeReview instance
 * (bug 20013) Added CSS class "mw-version-ext-version" is wrapped on the 
   extension version in Special:Version
index 054ca38..2aef1ba 100644 (file)
@@ -879,9 +879,9 @@ abstract class TablePager extends IndexPager {
        function getLimitSelect() {
                global $wgLang;
                $s = "<select name=\"limit\">";
-               foreach ( $this->mLimitsShown as $limit ) {
+               foreach ( $this->mLimitsShown as $limit => $text ) {
                        $selected = $limit == $this->mLimit ? 'selected="selected"' : '';
-                       $formattedLimit = $wgLang->formatNum( $limit );
+                       $formattedLimit = $text ? $text : $wgLang->formatNum( $limit );
                        $s .= "<option value=\"$limit\" $selected>$formattedLimit</option>\n";
                }
                $s .= "</select>";
index f762532..340eebc 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('messagesall') );
 
                global $wgLang, $wgContLang, $wgRequest;
 
index 3e43790..bee1158 100644 (file)
@@ -3814,6 +3814,7 @@ Others will be hidden by default.
 'watchlistall2'    => 'all',
 'namespacesall'    => 'all',
 'monthsall'        => 'all',
+'messagesall'      => 'all',
 
 # E-mail address confirmation
 'confirmemail'             => 'Confirm e-mail address',