function global_filter_extract_alphanumeric_range in Views Global Filter 8
Same name and namespace in other branches
- 7 widgets/global_filter.rangewidget.inc \global_filter_extract_alphanumeric_range()
Convert "from" and "to" values on the form to a single range string.
Parameters
array $form_state: the form state
Return value
string range in the format from--to, from-- or --to
1 call to global_filter_extract_alphanumeric_range()
- global_filter_set_form_on_session in ./
global_filter.widgets.inc - Stashes the selected global filter value(s) in the user's session.
File
- widgets/
global_filter.rangewidget.inc, line 134 - global_filter.rangewidget.inc
Code
function global_filter_extract_alphanumeric_range($form_state, $name) {
$from = $form_state['values'][$name . '_from'];
$to = $form_state['values'][$name . '_to'];
return $from === $to ? $from : "{$from}--{$to}";
}