If tablelib is going to do fullname voodoo, it should allow us to make the default order field something that makes up fullname (ie, firstname/lastname)

This commit is contained in:
mjollnir_
2005-11-18 04:19:58 +00:00
parent c38c0e3b7b
commit f53fba389a
+4 -1
View File
@@ -227,7 +227,10 @@ class flexible_table {
}
// 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));
}