r44230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44229‎ | r44230 | r44231 >
Date:13:46, 4 December 2008
Author:werdna
Status:resolved (Comments)
Tags:
Comment:
Fix wgRateLimits display in read-only mode.
Modified paths:
  • /trunk/extensions/Configure/Configure.i18n.php (modified) (history)
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)
  • /trunk/extensions/Configure/SpecialViewConfig.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.page.php
@@ -1026,8 +1026,14 @@
10271027 $id = 'wp'.$conf.'-key-'.$action.'-'.$type;
10281028 $left_col = Xml::tags( 'td', null, wfMsgExt( "configure-throttle-group-$type", 'parseinline' ) );
10291029
1030 - $right_col = Xml::inputLabel( wfMsg( 'configure-throttle-count' ), "$id-count", "$id-count", 15, $count ) . ' <br /> ' .
1031 - Xml::inputLabel( wfMsg( 'configure-throttle-period' ), "$id-period", "$id-period", 15, $period );
 1030+ if ($allowed) {
 1031+ $right_col = Xml::inputLabel( wfMsg( 'configure-throttle-count' ), "$id-count", "$id-count", 15, $count ) . ' <br /> ' .
 1032+ Xml::inputLabel( wfMsg( 'configure-throttle-period' ), "$id-period", "$id-period", 15, $period );
 1033+ } else {
 1034+ $right_col = ($count && $period) ? wfMsg( 'configure-throttle-summary', $count, $period ) : wfMsg( 'configure-throttle-none' );
 1035+ ## Laziness: Make summaries work by putting the data in hidden fields, rather than a special case in JS.
 1036+ $right_col .= "\n" . Xml::hidden( "$id-count", $count, array( 'id' => "$id-count" ) ) . Xml::hidden( "$id-period", $period, array( 'id' => "$id-period" ) );
 1037+ }
10321038 $right_col = Xml::tags( 'td', null, $right_col );
10331039
10341040 $innerRows .= Xml::tags( 'tr', array( 'id' => $id), $left_col . $right_col ) . "\n";
Index: trunk/extensions/Configure/SpecialViewConfig.php
@@ -195,8 +195,6 @@
196196 $actions = array();
197197 if ( $hasSelf )
198198 $view = $skin->makeKnownLinkObj( $self, wfMsgHtml( 'configure-view' ), "version=$ts" );
199 - else
200 - $view = wfMsgHtml( 'configure-view' );
201199
202200 if ( $allowedAll ) {
203201 $viewWikis = array();
@@ -211,7 +209,7 @@
212210 if ( $hasSelf )
213211 $editCore = $editMsg . $skin->makeKnownLinkObj( $configTitle, wfMsgHtml( 'configure-edit-core' ), "version=$ts" );
214212 else
215 - $editCore = $editMsg . wfMsgHtml( 'configure-edit-core' );
 213+ $editCore = $editMsg;
216214
217215 if ( $allowedConfigAll ) {
218216 $viewWikis = array();
@@ -228,8 +226,6 @@
229227 $editExt .= $editMsg;
230228 if ( $hasSelf )
231229 $editExt .= $skin->makeKnownLinkObj( $extTitle, wfMsgHtml( 'configure-edit-ext' ), "version=$ts" );
232 - else
233 - $editExt .= wfMsgHtml( 'configure-edit-ext' );
234230
235231 if ( $allowedExtensionsAll ) {
236232 $viewWikis = array();
Index: trunk/extensions/Configure/Configure.i18n.php
@@ -174,6 +174,7 @@
175175 'configure-throttle-summary' => '$1 actions in $2 seconds.',
176176 'configure-throttle-group' => 'Type',
177177 'configure-throttle-limit' => 'Limit',
 178+ 'configure-throttle-none' => 'No limit',
178179 );
179180
180181 /** Message documentation (Message documentation)

Follow-up revisions

RevisionCommit summaryAuthorDate
r44261* Fixed E_NOTICE introduced in r44230...ialex20:27, 5 December 2008

Comments

#Comment by Aaron Schulz (talk | contribs)   16:49, 4 December 2008

'$actions[] = $view;' seems like it could throw fatals

#Comment by Werdna (talk | contribs)   22:41, 4 December 2008

That isn't even in the code. Only search result for that is your comment.

#Comment by IAlex (talk | contribs)   20:28, 5 December 2008

Should be fixed in r44261.

Status & tagging log