Elgg  Version 2.3
Namespaces | Variables
select.php File Reference

Go to the source code of this file.

Namespaces

 Elgg
 Save menu items.
 

Variables

 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-dropdown')
 
 $defaults
 
 $options_values = $vars['options_values']
 
 $options = $vars['options']
 
 $value = is_array($vars['value']) ? $vars['value'] : array($vars['value'])
 
 $vars ['multiple'] = !empty($vars['multiple'])
 
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $options_list = ''
 
if($options_values) else
 

Variable Documentation

Initial value:
= array(
'disabled' => false,
'value' => '',
'options_values' => array(),
'options' => array(),
)

Definition at line 28 of file select.php.

$options = $vars['options']

Definition at line 40 of file select.php.

if ($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $options_list = ''

Definition at line 56 of file select.php.

$options_values = $vars['options_values']

Definition at line 37 of file select.php.

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

Definition at line 43 of file select.php.

$vars = elgg_extract_class($vars, 'elgg-input-dropdown')

Definition at line 26 of file select.php.

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

Definition at line 47 of file select.php.

if ($options_values) else
Initial value:
{
if (is_array($options)) {
foreach ($options as $option) {
if (is_array($option)) {
$text = elgg_extract('text', $option, '');
unset($option['text']);
if (!$text) {
elgg_log('No text defined for input/select option', 'ERROR');
}
$option_attrs = [
'selected' => in_array((string)$text, $value),
];
$option_attrs = array_merge($option_attrs, $option);
} else {
$option_attrs = [
'selected' => in_array((string)$option, $value),
];
$text = $option;
}
$options_list .= elgg_format_element('option', $option_attrs, $text);
}
}
}
$value
Definition: select.php:43
$options
Definition: select.php:40
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
$text
Definition: default.php:25
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $options_list
Definition: select.php:56
elgg echo
Translates a string.
Definition: languages.js:48
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:1375
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1028
$vars['class']
Definition: select.php:26

Definition at line 80 of file select.php.