Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Namespaces | Variables
select.php File Reference

Go to the source code of this file.

Namespaces

 Elgg
 Save menu items.
 

Variables

 $vars ['class'] = (array) elgg_extract('class', $vars, [])
 
 $vars ['class'][] = '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

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

Definition at line 29 of file select.php.

$options = $vars['options']

Definition at line 41 of file select.php.

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

Definition at line 57 of file select.php.

$options_values = $vars['options_values']

Definition at line 38 of file select.php.

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

Definition at line 44 of file select.php.

$vars = (array) elgg_extract('class', $vars, [])

Definition at line 26 of file select.php.

$vars['class'][] = 'elgg-input-dropdown'

Definition at line 27 of file select.php.

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

Definition at line 48 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:44
$options
Definition: select.php:41
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:218
$text
Definition: default.php:25
if($vars['multiple']&&!empty($vars['name'])&&is_string($vars['name'])) $options_list
Definition: select.php:57
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:1310
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1000
$vars['class']
Definition: select.php:26

Definition at line 81 of file select.php.