From: hickert Date: Wed, 7 Apr 2010 11:52:08 +0000 (+0000) Subject: Updated trustModes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=108a375e839bb3273d451c720b93d3617141af90;p=gosa.git Updated trustModes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17513 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc index 64e122671..75de2bee5 100644 --- a/gosa-core/include/class_sortableListing.inc +++ b/gosa-core/include/class_sortableListing.inc @@ -478,6 +478,8 @@ class sortableListing { public function sortData() { + if(!count($this->data)) return; + // Extract data $tmp= array(); foreach($this->displayData as $item) { @@ -533,6 +535,23 @@ class sortableListing { $this->mapping[]= count($this->mapping); $this->modified= true; + // Find the number of coluns + reset($this->displayData); + $first= current($this->displayData); + if (is_array($first)) { + $this->columns= count($first); + } else { + $this->columns= 1; + } + + // Preset sort orders to 'down' + for ($column= 0; $column<$this->columns; $column++) { + if(!isset($this->sortDirection[$column])){ + $this->sortDirection[$column]= true; + } + } + + // Sort data after we've added stuff $this->sortData(); }