function views_handler_filter::prepare_filter_select_options
3.x views_handler_filter.inc | views_handler_filter::prepare_filter_select_options(&$options) |
Sanitizes the HTML select element's options.
The function is recursive to support optgroups.
1 call to views_handler_filter::prepare_filter_select_options()
- views_handler_filter::exposed_translate in handlers/
views_handler_filter.inc - Make some translations to a form item to make it more suitable to exposing.
File
- handlers/
views_handler_filter.inc, line 1094 - @todo.
Class
- views_handler_filter
- Base class for filters.
Code
function prepare_filter_select_options(&$options) {
foreach ($options as $value => $label) {
// Recurse for optgroups.
if (is_array($label)) {
$this->prepare_filter_select_options($options[$value]);
}
// FAPI has some special value to allow hierarchy.
// @see _form_options_flatten
elseif (is_object($label)) {
$this->prepare_filter_select_options($options[$value]->option);
}
else {
$options[$value] = strip_tags(decode_entities($label));
}
}
}