function _webform_select_options_callback in Webform 6.3
Same name and namespace in other branches
- 7.4 components/select.inc \_webform_select_options_callback()
- 7.3 components/select.inc \_webform_select_options_callback()
Execute a select option callback.
Parameters
$name: The name of the options group.
$component: The full Webform component.
$flat: Whether the information returned should exclude any nested groups.
$filter: Whether information returned should be sanitized. Defaults to TRUE.
1 call to _webform_select_options_callback()
- _webform_select_options in components/
select.inc - Generate a list of options for a select list.
File
- components/
select.inc, line 873 - Webform module multiple select component.
Code
function _webform_select_options_callback($name, $component, $flat = FALSE, $filter = TRUE) {
$info = _webform_select_options_info();
// Include any necessary files.
if (isset($info[$name]['file'])) {
$pathinfo = pathinfo($info[$name]['file']);
$path = ($pathinfo['dirname'] ? $pathinfo['dirname'] . '/' : '') . basename($pathinfo['basename'], '.' . $pathinfo['extension']);
module_load_include($pathinfo['extension'], $info[$name]['module'], $path);
}
// Execute the callback function.
if (isset($info[$name]['options callback']) && function_exists($info[$name]['options callback'])) {
$function = $info[$name]['options callback'];
$arguments = array();
if (isset($info[$name]['options arguments'])) {
$arguments = $info[$name]['options arguments'];
}
return $function($component, $flat, $filter, $arguments);
}
}