@@ 58-77 (lines=20) @@ | ||
55 | ||
56 | $options_list = ''; |
|
57 | ||
58 | if ($options_values) { |
|
59 | foreach ($options_values as $opt_value => $option) { |
|
60 | ||
61 | $option_attrs = array( |
|
62 | 'value' => $opt_value, |
|
63 | 'selected' => in_array((string)$opt_value, $value), |
|
64 | ); |
|
65 | ||
66 | $options_list .= elgg_format_element('option', $option_attrs, $option); |
|
67 | } |
|
68 | } else { |
|
69 | if (is_array($options)) { |
|
70 | foreach ($options as $option) { |
|
71 | ||
72 | $option_attrs = ['selected' => in_array((string)$option, $value)]; |
|
73 | ||
74 | $options_list .= elgg_format_element('option', $option_attrs, $option); |
|
75 | } |
|
76 | } |
|
77 | } |
|
78 | ||
79 | echo elgg_format_element('select', $vars, $options_list); |
|
80 |
@@ 54-73 (lines=20) @@ | ||
51 | ||
52 | $options_list = ''; |
|
53 | ||
54 | if ($options_values) { |
|
55 | foreach ($options_values as $opt_value => $option) { |
|
56 | ||
57 | $option_attrs = array( |
|
58 | 'value' => $opt_value, |
|
59 | 'selected' => in_array((string)$opt_value, $value), |
|
60 | ); |
|
61 | ||
62 | $options_list .= elgg_format_element('option', $option_attrs, $option); |
|
63 | } |
|
64 | } else { |
|
65 | if (is_array($options)) { |
|
66 | foreach ($options as $option) { |
|
67 | ||
68 | $option_attrs = ['selected' => in_array((string)$option, $value)]; |
|
69 | ||
70 | $options_list .= elgg_format_element('option', $option_attrs, $option); |
|
71 | } |
|
72 | } |
|
73 | } |
|
74 | ||
75 | echo elgg_format_element('select', $vars, $options_list); |
|
76 |