r44372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44371‎ | r44372 | r44373 >
Date:01:15, 10 December 2008
Author:werdna
Status:ok
Tags:
Comment:
Configure extension: Replace listing of right descriptions with listing of right IDs.

Caution: Some javascript in this commit may attract velociraptors.
Modified paths:
  • /trunk/extensions/Configure/Configure.js (modified) (history)
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.page.php
@@ -561,12 +561,14 @@
562562 } else {
563563 $val = $wgRequest->getCheck( $id );
564564 }
565 - $settings[$name][$group][$right] = $val;
 565+ if ($val)
 566+ $settings[$name][$group][$right] = true;
566567 } else if ( $wgRequest->getCheck( $id ) ) {
567568 $settings[$name][$group][] = $right;
568569 }
569570 }
570571 }
 572+
571573 break;
572574 case 'rate-limits':
573575 $all = array();
@@ -1190,7 +1192,7 @@
11911193 $checked = in_array( $right, $levs );
11921194 $id = Sanitizer::escapeId( 'wp' . $conf . '-' . $group . '-' . $right );
11931195 if( $type == 'group-bool' )
1194 - $desc = User::getRightDescription( $right ) . " (" .Xml::element( 'tt', null, $right ) . ")";
 1196+ $desc = User::getRightDescription( $right ) . " (" .Xml::element( 'tt', array( 'class' => 'configure-right-id' ), $right ) . ")";
11951197 else
11961198 $desc = User::getGroupName( $right );
11971199 $row .= '<li>' . Xml::check( $id, $checked, $attr + array( 'id' => $id ) ) . '&nbsp;' . Xml::tags( 'label', array( 'for' => $id ), $desc ) . "</li>\n";
Index: trunk/extensions/Configure/Configure.php
@@ -148,7 +148,7 @@
149149 /**
150150 * Styles versions, you shouldn't change it
151151 */
152 -$wgConfigureStyleVersion = '17';
 152+$wgConfigureStyleVersion = '18';
153153
154154 # Adding new rights...
155155 $wgAvailableRights[] = 'configure';
Index: trunk/extensions/Configure/Configure.js
@@ -373,9 +373,14 @@
374374 for( var i=0; i<labels.length; ++i ) {
375375 var label = labels[i];
376376 var checkbox = document.getElementById( label.htmlFor );
 377+ var idcandidates = label.getElementsByTagName( 'tt' );
 378+ var displayid = label.innerHTML;
 379+ if (idcandidates.length) {
 380+ displayid = '<tt>'+idcandidates[0].innerHTML+'</tt>'; // Ew ew ew ew ew ew
 381+ }
377382
378383 if (checkbox.checked) {
379 - matches.push( label.innerHTML ); // Yuck
 384+ matches.push( displayid ); // Yuck
380385 }
381386 }
382387

Status & tagging log