| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Simple filter to handle greater than/less than filters.
|
| 6 |
* It based on views_handler_filter_numeric but deals with
|
| 7 |
* float numbers.
|
| 8 |
*/
|
| 9 |
class views_handler_filter_float extends views_handler_filter_numeric {
|
| 10 |
function op_between($field) {
|
| 11 |
if ($this->operator == 'between') {
|
| 12 |
$this->query->add_where($this->options['group'], "$field >= %f", $this->value['min']);
|
| 13 |
$this->query->add_where($this->options['group'], "$field <= %f", $this->value['max']);
|
| 14 |
}
|
| 15 |
else {
|
| 16 |
$this->query->add_where($this->options['group'], "$field <= %f OR $field >= %f", $this->value['min'], $this->value['max']);
|
| 17 |
}
|
| 18 |
}
|
| 19 |
|
| 20 |
function op_simple($field) {
|
| 21 |
$this->query->add_where($this->options['group'], "$field $this->operator %f", $this->value['value']);
|
| 22 |
}
|
| 23 |
}
|