/**
* Double field with a dropdown list constructed from a system message in the format
* * Optgroup header
- * ** <option value>|<option name>
- * ** <option value == option name>
+ * ** <option value>
* * New Optgroup header
* Plus a text field underneath for an additional reason. The 'value' of the field is
* ""<select>: <extra reason>"", or "<extra reason>" if nothing has been selected in the
function __construct( $params ) {
if ( array_key_exists( 'other', $params ) ) {
} elseif( array_key_exists( 'other-message', $params ) ){
- $params['other'] = wfMessage( $params['other-message'] )->escaped();
+ $params['other'] = wfMessage( $params['other-message'] )->plain();
} else {
$params['other'] = null;
}
} elseif( array_key_exists( 'options-message', $params ) ){
# Generate options array from a system message
$params['options'] = self::parseMessage(
- wfMessage( $params['options-message'] )->inContentLanguage()->escaped(),
+ wfMessage( $params['options-message'] )->inContentLanguage()->plain(),
$params['other']
);
} else {
*/
public static function parseMessage( $string, $otherName=null ) {
if( $otherName === null ){
- $otherName = wfMessage( 'htmlform-selectorother-other' )->escaped();
+ $otherName = wfMessage( 'htmlform-selectorother-other' )->plain();
}
$optgroup = false;
} elseif ( substr( $value, 0, 2) == '**' ) {
# groupmember
$opt = trim( substr( $value, 2 ) );
- $parts = array_map( 'trim', explode( '|', $opt, 2 ) );
- if( count( $parts ) === 1 ){
- $parts[1] = $parts[0];
- }
if( $optgroup === false ){
- $options[$parts[1]] = $parts[0];
+ $options[$opt] = $opt;
} else {
- $options[$optgroup][$parts[1]] = $parts[0];
+ $options[$optgroup][$opt] = $opt;
}
} else {
# groupless reason list
$optgroup = false;
- $parts = array_map( 'trim', explode( '|', $option, 2 ) );
- if( count( $parts ) === 1 ){
- $parts[1] = $parts[0];
- }
- $options[$parts[1]] = $parts[0];
+ $options[$option] = $option;
}
}