37 unset(
$vars[
'options']);
40 if (is_array($option)) {
41 if (!isset($option[
'value'])) {
56 unset(
$vars[
'options_values']);
60 if (!is_array($option)) {
68 if (is_array($optgroup)) {
82 unset(
$vars[
'value']);
87 if (
$vars[
'multiple'] && !empty(
$vars[
'name']) && is_string(
$vars[
'name'])) {
88 if (!str_ends_with(
$vars[
'name'],
'[]')) {
97 unset($option[
'text']);
100 elgg_log(
'No text defined for input/select option with value "' . $opt_value .
'"', \Psr\Log\LogLevel::NOTICE);
103 if (!isset($option[
'selected'])) {
104 $option[
'selected'] = isset($opt_value) && in_array((
string) $opt_value,
$value);
107 if (!isset($option[
'title'])) {
108 $option[
'title'] =
$text;
120 $optgroup_attrs = $option;
121 unset($optgroup_attrs[
'options']);
124 foreach (
$options as $group_option) {
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
$vars['class']
Elgg select input Displays a select input field.
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
elgg_extract_class(array $array, array|string $existing=[], string $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $render_option