Revision: 48620
Author: nad
Date: 2009-03-20 03:12:51 +0000 (Fri, 20 Mar 2009)
Log Message:
-----------
only remove selected options in lists if replacement value exists, otherwise
use default
Modified Paths:
--------------
trunk/extensions/RecordAdmin/RecordAdmin_body.php
Modified: trunk/extensions/RecordAdmin/RecordAdmin_body.php
===================================================================
--- trunk/extensions/RecordAdmin/RecordAdmin_body.php 2009-03-20 02:58:18 UTC
(rev 48619)
+++ trunk/extensions/RecordAdmin/RecordAdmin_body.php 2009-03-20 03:12:51 UTC
(rev 48620)
@@ -436,8 +436,8 @@
break;
case 'list':
$html =
preg_replace_callback("|\{\{.+\}\}|s", array($this, 'parsePart'), $html); #
parse any braces
- $html = preg_replace( "|(<option[^<>]*)
selected|", "$1", $html ); # remove the currently selected option
if ( $v ) {
+ $html = preg_replace(
"|(<option[^<>]*) selected|", "$1", $html ); # remove the currently selected
option
$html = preg_match(
"|<option[^>]+value\s*=|s", $html )
? preg_replace(
"|(<option)([^>]+value\s*=\s*[\"']{$v}['\"])|s", "$1 selected$2", $html )
: preg_replace(
"|(<option[^>]*)(?=>$v</option>)|s", "$1 selected", $html );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs