public function contextual_range_filter_handler_argument_list_range::views_break_phrase_range in Views Contextual Range Filter 7
Break xfrom--xto+yfrom--yto+zfrom--zto into an array or ranges.
Parameters
string $str: The string to parse.
1 call to contextual_range_filter_handler_argument_list_range::views_break_phrase_range()
- contextual_range_filter_handler_argument_list_range::query in views/
contextual_range_filter_handler_argument_list_range.inc - Help build the query.
File
- views/
contextual_range_filter_handler_argument_list_range.inc, line 76 - Definition of contextual_filter_range_handler_argument_list_range.
Class
- contextual_range_filter_handler_argument_list_range
- Argument handler for arguments that are list ranges.
Code
public function views_break_phrase_range($str) {
if (empty($str)) {
return;
}
$this->value = preg_split('/[+ ]/', $str);
$this->operator = 'or';
// Keep an 'error' value if invalid ranges were given.
// A single non-empty value is ok, but a plus sign without values is not.
if (count($this->value) > 1 && (empty($this->value[0]) || empty($this->value[1]))) {
// Used in $this->title().
$this->value = FALSE;
}
}