/[drupal]/contributions/modules/weight/weight_handler_sort.inc
ViewVC logotype

Diff of /contributions/modules/weight/weight_handler_sort.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.2, Mon Jan 26 00:28:54 2009 UTC revision 1.2.2.3, Wed Sep 9 20:39:28 2009 UTC
# Line 1  Line 1 
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  }  }

Legend:
Removed from v.1.2.2.2  
changed lines
  Added in v.1.2.2.3

  ViewVC Help
Powered by ViewVC 1.1.2