Elgg  Version 3.0
Namespaces | Variables
select.php File Reference

Go to the source code of this file.

Namespaces

 Elgg
 Configuration exception.
 

Variables

 $vars ['class']
 
 $defaults
 
 $options_values = []
 
 $options = elgg_extract('options', $vars, [])
 
 $normalize_options
 
 $value = is_array($vars['value']) ? $vars['value'] : [$vars['value']]
 
 $vars ['multiple'] = !empty($vars['multiple'])
 
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $render_option
 
 $options_list = ''
 
 foreach ($options_values as $option)
 

Variable Documentation

$defaults
Initial value:
= [
'disabled' => false

Definition at line 33 of file select.php.

$normalize_options
Initial value:
= function($options) use (&$normalize_options) {
foreach ($options as $key => $option) {
if (is_string($option)) {
$option = [
'text' => $option,
'value' => $key,
];
}
$optgroup = elgg_extract('options', $option);
if (is_array($optgroup)) {
$option['options'] = $normalize_options($optgroup);
}
$options[$key] = $option;
}
return $options;
}
$options
Definition: select.php:43
$normalize_options
Definition: select.php:65
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:55

Definition at line 65 of file select.php.

$options = elgg_extract('options', $vars, [])

Definition at line 43 of file select.php.

$options_list = ''

Definition at line 121 of file select.php.

$options_values = []

Definition at line 40 of file select.php.

if ($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $render_option
Initial value:
= function($option) use ($value) {
$opt_value = elgg_extract('value', $option);
$text = elgg_extract('text', $option);
unset($option['text']);
if (!is_string($text) && !is_numeric($text)) {
elgg_log('No text defined for input/select option with value "' . $opt_value . '"', 'NOTICE');
}
if (!isset($option['selected'])) {
$option['selected'] = isset($opt_value) && in_array((string) $opt_value, $value);
}
if (!isset($option['title'])) {
$option['title'] = $text;
}
return elgg_format_element('option', $option, $text);
}
$value
Definition: select.php:87
$text
Definition: default.php:28
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
Definition: elgglib.php:786
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131

Definition at line 100 of file select.php.

$value = is_array($vars['value']) ? $vars['value'] : [$vars['value']]

Definition at line 87 of file select.php.

$vars
Initial value:
'elgg-input-dropdown',
'elgg-input-select',
])
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:1153
$vars['class']
Definition: select.php:28

Definition at line 28 of file select.php.

$vars['multiple'] = !empty($vars['multiple'])

Definition at line 91 of file select.php.

foreach($options_values as $option)

Definition at line 123 of file select.php.