Fixed sorting on table style HEAD
authorSami Barakat <sami@sbarakat.co.uk>
Thu Nov 05 21:59:17 2009 +0000 (2009-11-05)
branchHEAD
changeset 7443cb0edbf9c9ac
parent 7442 5f5387780b30
child 7444 252d8d24012d
Fixed sorting on table style
system/classes/listfactory.class.php
     1.1 --- a/system/classes/listfactory.class.php	Thu Nov 05 21:35:39 2009 +0000
     1.2 +++ b/system/classes/listfactory.class.php	Thu Nov 05 21:59:17 2009 +0000
     1.3 @@ -694,6 +694,10 @@
     1.4                  }
     1.5                  else if ($this->_style == 'table')
     1.6                  {
     1.7 +                    $direction = $this->_sort_arr['direction'] == 'asc' ? 'desc' : 'asc';
     1.8 +                    $href = $this->_page_url . "results={$this->_per_page}&amp;" .
     1.9 +                        "order={$field['name']}&amp;direction=$direction";
    1.10 +
    1.11                      if ($show_sort && $field['sort'] != false)
    1.12                      {
    1.13                          $text = "<a href=\"$href\">$text</a>";
    1.14 @@ -702,8 +706,6 @@
    1.15                              $selected = $sort_selected;
    1.16                          }
    1.17                      }
    1.18 -                    $href = $this->_page_url . "results={$this->_per_page}&amp;" .
    1.19 -                                "order={$field['name']}&amp;direction=$direction";
    1.20  
    1.21                      // Write field
    1.22                      $list_templates->set_var('sort_text', $text);