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