| @@ 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' ) || |
|
| @@ 3087-3097 (lines=11) @@ | ||
| 3084 | // one key per option, each having a boolean value. Extract those keys. |
|
| 3085 | $multiselectOptions = []; |
|
| 3086 | foreach ( $prefs as $name => $info ) { |
|
| 3087 | if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) || |
|
| 3088 | ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) { |
|
| 3089 | $opts = HTMLFormField::flattenOptions( $info['options'] ); |
|
| 3090 | $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; |
|
| 3091 | ||
| 3092 | foreach ( $opts as $value ) { |
|
| 3093 | $multiselectOptions["$prefix$value"] = true; |
|
| 3094 | } |
|
| 3095 | ||
| 3096 | unset( $prefs[$name] ); |
|
| 3097 | } |
|
| 3098 | } |
|
| 3099 | $checkmatrixOptions = []; |
|
| 3100 | foreach ( $prefs as $name => $info ) { |
|