38 unset(
$vars[
'options']);
41 if (is_array($option)) {
42 if (!isset($option[
'value'])) {
57 unset(
$vars[
'options_values']);
61 if (!is_array($option)) {
69 if (is_array($optgroup)) {
83 unset(
$vars[
'value']);
88 if (
$vars[
'multiple'] && !empty(
$vars[
'name']) && is_string(
$vars[
'name'])) {
89 if (!str_ends_with(
$vars[
'name'],
'[]')) {
98 unset($option[
'text']);
100 if (!is_string(
$text) && !is_numeric(
$text)) {
101 elgg_log(
'No text defined for input/select option with value "' . $opt_value .
'"',
'NOTICE');
104 if (!isset($option[
'selected'])) {
105 $option[
'selected'] = isset($opt_value) && in_array((
string) $opt_value,
$value);
108 if (!isset($option[
'title'])) {
109 $option[
'title'] =
$text;
121 $optgroup_attrs = $option;
122 unset($optgroup_attrs[
'options']);
125 foreach (
$options as $group_option) {
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
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.
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $render_option