Permalink
Browse files

If tablelib is going to do fullname voodoo, it should allow us to mak…

…e the default order field something that makes up fullname (ie, firstname/lastname)
  • Loading branch information...
1 parent c38c0e3 commit f53fba389a67880c9b0b054d8e4e62c281a992be mjollnir_ committed Nov 18, 2005
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/tablelib.php
View
@@ -227,7 +227,10 @@ function setup() {
}
// If we didn't sort just now, then use the default sort order if one is defined and the column exists
- if(empty($this->sess->sortby) && !empty($this->sort_default_column) && isset($this->columns[$this->sort_default_column])) {
+ if(empty($this->sess->sortby) && !empty($this->sort_default_column) && (isset($this->columns[$this->sort_default_column])
+ || (in_array('fullname',$this->columns)
+ && in_array($this->sort_default_column,
+ array('firstname','lastname'))))) {
$this->sess->sortby = array ($this->sort_default_column => ($this->sort_default_order == SORT_DESC ? SORT_DESC : SORT_ASC));
}

0 comments on commit f53fba3

Please sign in to comment.