r52739 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52738‎ | r52739 | r52740 >
Date:13:54, 3 July 2009
Author:werdna
Status:deferred
Tags:
Comment:
Change disabled to readonly for textboxes on uneditable filters
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php
@@ -230,10 +230,11 @@
231231
232232 // Read-only attribute
233233 $readOnlyAttrib = array();
 234+ $cbReadOnlyAttrib = array(); // For checkboxes
234235
235236 if (!$this->canEdit()) {
236237 $readOnlyAttrib['readonly'] = 'readonly';
237 - $readOnlyAttrib['disabled'] = 'disabled';
 238+ $cbReadOnlyAttrib['disabled'] = 'disabled';
238239 }
239240
240241 $fields = array();
@@ -324,7 +325,7 @@
325326 $postVar,
326327 $postVar,
327328 isset( $row->$dbField ) ? $row->$dbField : false,
328 - $readOnlyAttrib
 329+ $cbReadOnlyAttrib
329330 );
330331 $checkbox = Xml::tags( 'p', null, $checkbox );
331332 $flags .= $checkbox;
@@ -433,10 +434,11 @@
434435 }
435436
436437 $readOnlyAttrib = array();
 438+ $cbReadOnlyAttrib = array(); // For checkboxes
437439
438440 if (!$this->canEdit()) {
439441 $readOnlyAttrib['readonly'] = 'readonly';
440 - $readOnlyAttrib['disabled'] = 'disabled';
 442+ $cbReadOnlyAttrib['disabled'] = 'disabled';
441443 }
442444
443445 switch( $action ) {
@@ -446,7 +448,7 @@
447449 'wpFilterActionThrottle',
448450 "mw-abusefilter-action-checkbox-$action",
449451 $set,
450 - array( 'class' => 'mw-abusefilter-action-checkbox' ) + $readOnlyAttrib );
 452+ array( 'class' => 'mw-abusefilter-action-checkbox' ) + $cbReadOnlyAttrib );
451453 $throttleFields = array();
452454
453455 if ($set) {
@@ -499,7 +501,7 @@
500502 'wpFilterActionWarn',
501503 "mw-abusefilter-action-checkbox-$action",
502504 $set,
503 - array( 'class' => 'mw-abusefilter-action-checkbox' ) + $readOnlyAttrib );
 505+ array( 'class' => 'mw-abusefilter-action-checkbox' ) + $cbReadOnlyAttrib );
504506 $output .= Xml::tags( 'p', null, $checkbox );
505507 $warnMsg = empty($set) ? 'abusefilter-warning' : $parameters[0];
506508
@@ -510,7 +512,7 @@
511513 'wpFilterWarnMessageOther',
512514 45,
513515 $warnMsg ? $warnMsg : 'abusefilter-warning-',
514 - array( 'id' => 'mw-abusefilter-warn-message-other' ) + $readOnlyAttrib
 516+ array( 'id' => 'mw-abusefilter-warn-message-other' ) + $cbReadOnlyAttrib
515517 );
516518
517519 $previewButton = Xml::element(
@@ -555,7 +557,7 @@
556558 'wpFilterActionTag',
557559 "mw-abusefilter-action-checkbox-$action",
558560 $set,
559 - array( 'class' => 'mw-abusefilter-action-checkbox' ) + $readOnlyAttrib
 561+ array( 'class' => 'mw-abusefilter-action-checkbox' ) + $cbReadOnlyAttrib
560562 );
561563 $output .= Xml::tags( 'p', null, $checkbox );
562564
@@ -577,7 +579,7 @@
578580 $form_field,
579581 "mw-abusefilter-action-checkbox-$action",
580582 $status,
581 - array( 'class' => 'mw-abusefilter-action-checkbox' ) + $readOnlyAttrib
 583+ array( 'class' => 'mw-abusefilter-action-checkbox' ) + $cbReadOnlyAttrib
582584 );
583585 $thisAction = Xml::tags( 'p', null, $thisAction );
584586 return $thisAction;
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -1285,7 +1285,7 @@
12861286
12871287 $readOnlyAttrib = array();
12881288 if (!$canEdit)
1289 - $readOnlyAttrib['disabled'] = 'disabled';
 1289+ $readOnlyAttrib['readonly'] = 'readonly';
12901290
12911291 global $wgUser;
12921292 $noTestAttrib = array();

Status & tagging log