| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Sort handler for Weight module.
|
| 6 |
*/
|
| 7 |
class weight_handler_sort extends views_handler_sort {
|
| 8 |
|
| 9 |
function query() {
|
| 10 |
$this->ensure_my_table();
|
| 11 |
// Reverse ASC and DESC for weight order so that the sticky weights are ordered like real weights.
|
| 12 |
if ($this->options['order'] == 'ASC') {
|
| 13 |
$this->options['order'] = 'DESC';
|
| 14 |
}
|
| 15 |
elseif ($this->options['order'] == 'DESC') {
|
| 16 |
$this->options['order'] = 'ASC';
|
| 17 |
}
|
| 18 |
$this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
|
| 19 |
}
|
| 20 |
}
|