r55692 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55691‎ | r55692 | r55693 >
Date:11:30, 31 August 2009
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
Reimplement r55685, r55686, r55687, with correct parsing of the associative array. Also add message description to MessagesQqq as requested at r55685.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesLzh.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesYue.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesZh_hans.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesZh_hant.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -2997,7 +2997,10 @@
29982998 'monthsall' => 'Used in a drop-down box on [[Special:Contributions]] as an option for "all months". See also [[MediaWiki:Month/{{SUBPAGENAME}}]].
29992999
30003000 {{Identical|All}}',
 3001+'limitall' => 'Used on [[Special:AllMessages]] (and potentially other TablePager based tables) to display "all" the messages.
30013002
 3003+{{Identical|All}}',
 3004+
30023005 # E-mail address confirmation
30033006 'confirmemail_needlogin' => 'Used on [[Special:ConfirmEmail]] when you are logged out.
30043007 * $1 is a link to [[Special:UserLogin]] with {{msg-mw|loginreqlink}} as link description',
Index: trunk/phase3/languages/messages/MessagesZh_hans.php
@@ -2993,6 +2993,7 @@
29942994 'watchlistall2' => '全部',
29952995 'namespacesall' => '全部',
29962996 'monthsall' => '全部',
 2997+'limitall' => '全部',
29972998
29982999 # E-mail address confirmation
29993000 'confirmemail' => '确认邮箱地址',
Index: trunk/phase3/languages/messages/MessagesYue.php
@@ -2956,6 +2956,7 @@
29572957 'watchlistall2' => '全部',
29582958 'namespacesall' => '全部',
29592959 'monthsall' => '全部',
 2960+'limitall' => '全部',
29602961
29612962 # E-mail address confirmation
29622963 'confirmemail' => '確認電郵地址',
Index: trunk/phase3/languages/messages/MessagesZh_hant.php
@@ -2981,6 +2981,7 @@
29822982 'watchlistall2' => '全部',
29832983 'namespacesall' => '全部',
29842984 'monthsall' => '全部',
 2985+'limitall' => '全部',
29852986
29862987 # E-mail address confirmation
29872988 'confirmemail' => '確認郵箱位址',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3814,6 +3814,7 @@
38153815 'watchlistall2' => 'all',
38163816 'namespacesall' => 'all',
38173817 'monthsall' => 'all',
 3818+'limitall' => 'all',
38183819
38193820 # E-mail address confirmation
38203821 'confirmemail' => 'Confirm e-mail address',
Index: trunk/phase3/languages/messages/MessagesLzh.php
@@ -2433,6 +2433,7 @@
24342434 'watchlistall2' => '全',
24352435 'namespacesall' => '全',
24362436 'monthsall' => '全',
 2437+'limitall' => '全',
24372438
24382439 # E-mail address confirmation
24392440 'confirmemail' => '核郵驛',
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -128,6 +128,7 @@
129129
130130 var $messages = null;
131131 var $talkPages = null;
 132+ public $mLimitsShown;
132133
133134 function __construct( $page, $conds, $langObj = null ) {
134135 parent::__construct();
@@ -135,6 +136,10 @@
136137 $this->mPage = $page;
137138 $this->mConds = $conds;
138139 $this->mDefaultDirection = true; // always sort ascending
 140+ // We want to have an option for people to view *all* the messages,
 141+ // so they can use Ctrl+F to search them. 5000 is the maximum that
 142+ // will get through WebRequest::getLimitOffset().
 143+ $this->mLimitsShown = array( 20, 50, 100, 250, 500, 5000 => wfMsg('limitall') );
139144
140145 global $wgLang, $wgContLang, $wgRequest;
141146
Index: trunk/phase3/includes/Pager.php
@@ -879,10 +879,18 @@
880880 function getLimitSelect() {
881881 global $wgLang;
882882 $s = "<select name=\"limit\">";
883 - foreach ( $this->mLimitsShown as $limit ) {
884 - $selected = $limit == $this->mLimit ? 'selected="selected"' : '';
885 - $formattedLimit = $wgLang->formatNum( $limit );
886 - $s .= "<option value=\"$limit\" $selected>$formattedLimit</option>\n";
 883+ foreach ( $this->mLimitsShown as $key => $value ) {
 884+ # The pair is either $index => $limit, in which case the $value
 885+ # will be numeric, or $limit => $text, in which case the $value
 886+ # will be a string.
 887+ if( is_int( $value ) ){
 888+ $limit = $text = $value;
 889+ } else {
 890+ $limit = $key;
 891+ $text = $value;
 892+ }
 893+ $selected = ( $limit == $this->mLimit ? 'selected="selected"' : '' );
 894+ $s .= "<option value=\"$limit\" $selected>$text</option>\n";
887895 }
888896 $s .= "</select>";
889897 return $s;
Index: trunk/phase3/RELEASE-NOTES
@@ -197,6 +197,8 @@
198198 * (bug 20404) Custom fields in the user creation form template can now have
199199 detail labels in prefsectiontip divs.
200200 * MakeSysop and MakeBot are now aliases for Special:UserRights
 201+* IndexPager->mLimitsShown can now be an associative array of limit => text-to-
 202+ display-in-limit-form.
201203
202204 === Bug fixes in 1.16 ===
203205
Index: trunk/phase3/maintenance/language/messages.inc
@@ -2822,6 +2822,7 @@
28232823 'watchlistall2',
28242824 'namespacesall',
28252825 'monthsall',
 2826+ 'limitall',
28262827 ),
28272828 'confirmemail' => array(
28282829 'confirmemail',

Follow-up revisions

RevisionCommit summaryAuthorDate
r56077Add number formatting for numeric limits, regression in r55692werdna23:32, 8 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55685* Allow IndexPager->mLimitsShown to be an associative array of limit => text-...happy-melon21:50, 30 August 2009
r55686Follow-up to r55685 - update messages.inc, and fix wierd positioning of comme...happy-melon22:06, 30 August 2009
r55687Localisation updates Cantonese, Chinese and Literary Chineseshinjiman01:24, 31 August 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:52, 8 September 2009

This seems to have lost the numeric formatting.

#Comment by Brion VIBBER (talk | contribs)   23:29, 8 September 2009

marked wrong rev resolved :)

#Comment by Brion VIBBER (talk | contribs)   23:45, 8 September 2009

ok looks good now :D

Status & tagging log