summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f63b39b)
raw | patch | inline | side by side (parent: f63b39b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Apr 2010 11:52:08 +0000 (11:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Apr 2010 11:52:08 +0000 (11:52 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17513 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_sortableListing.inc | patch | blob | history |
diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 64e122671193b01ebd1cba60d1bac349b157ab23..75de2bee55a554c2a227037a69c831217179bd85 100644 (file)
public function sortData()
{
+ if(!count($this->data)) return;
+
// Extract data
$tmp= array();
foreach($this->displayData as $item) {
$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();
}