| @@ 170-181 (lines=12) @@ | ||
| 167 | $val = $user->getOption( $name ); |
|
| 168 | ||
| 169 | // Handling for multiselect preferences |
|
| 170 | if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) || |
|
| 171 | ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) { |
|
| 172 | $options = HTMLFormField::flattenOptions( $info['options'] ); |
|
| 173 | $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; |
|
| 174 | $val = []; |
|
| 175 | ||
| 176 | foreach ( $options as $value ) { |
|
| 177 | if ( $user->getOption( "$prefix$value" ) ) { |
|
| 178 | $val[] = $value; |
|
| 179 | } |
|
| 180 | } |
|
| 181 | } |
|
| 182 | ||
| 183 | // Handling for checkmatrix preferences |
|
| 184 | if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) || |
|
| @@ 3108-3118 (lines=11) @@ | ||
| 3105 | // one key per option, each having a boolean value. Extract those keys. |
|
| 3106 | $multiselectOptions = []; |
|
| 3107 | foreach ( $prefs as $name => $info ) { |
|
| 3108 | if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) || |
|
| 3109 | ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) { |
|
| 3110 | $opts = HTMLFormField::flattenOptions( $info['options'] ); |
|
| 3111 | $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; |
|
| 3112 | ||
| 3113 | foreach ( $opts as $value ) { |
|
| 3114 | $multiselectOptions["$prefix$value"] = true; |
|
| 3115 | } |
|
| 3116 | ||
| 3117 | unset( $prefs[$name] ); |
|
| 3118 | } |
|
| 3119 | } |
|
| 3120 | $checkmatrixOptions = []; |
|
| 3121 | foreach ( $prefs as $name => $info ) { |
|