You are here

class weight_handler_sort in Weight 6

Same name and namespace in other branches
  1. 7 weight_handler_sort.inc \weight_handler_sort

@file Sort handler for Weight module.

Hierarchy

Expanded class hierarchy of weight_handler_sort

1 string reference to 'weight_handler_sort'
weight_views_data in views/weight.views.inc
Implementation of hook_views_data().

File

views/weight_handler_sort.inc, line 6
Sort handler for Weight module.

View source
class weight_handler_sort extends views_handler_sort {
  function query() {
    $this
      ->ensure_my_table();

    // Reverse ASC and DESC for weight order so that the sticky weights are ordered like real weights.
    if ($this->options['order'] == 'ASC') {
      $this->options['order'] = 'DESC';
    }
    elseif ($this->options['order'] == 'DESC') {
      $this->options['order'] = 'ASC';
    }
    $this->query
      ->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
  }

}

Members