29 'elgg-input-dropdown',
44 unset(
$vars[
'options']);
47 if (is_array($option)) {
48 if (!isset($option[
'value'])) {
63 unset(
$vars[
'options_values']);
67 if (is_string($option)) {
75 if (is_array($optgroup)) {
89 unset(
$vars[
'value']);
94 if (
$vars[
'multiple'] && !empty(
$vars[
'name']) && is_string(
$vars[
'name'])) {
95 if (substr(
$vars[
'name'], -2) !=
'[]') {
104 unset($option[
'text']);
106 if (!is_string(
$text) && !is_numeric(
$text)) {
107 elgg_log(
'No text defined for input/select option with value "' . $opt_value .
'"',
'NOTICE');
110 if (!isset($option[
'selected'])) {
111 $option[
'selected'] = isset($opt_value) && in_array((
string) $opt_value,
$value);
114 if (!isset($option[
'title'])) {
115 $option[
'title'] =
$text;
127 $optgroup_attrs = $option;
128 unset($optgroup_attrs[
'options']);
131 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_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg echo
Translates a string.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $render_option