From: cajus Date: Fri, 22 Jan 2010 14:41:13 +0000 (+0000) Subject: Updated sortable list - untested X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=35a408a4d9eb6d89bed2bccc92a5bdf4d641db3b;p=gosa.git Updated sortable list - untested git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15264 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc index 06d817806..36b44b67c 100644 --- a/gosa-core/include/class_sortableListing.inc +++ b/gosa-core/include/class_sortableListing.inc @@ -1,7 +1,7 @@ setListData($data, $displayData); + $this->setListData($data, $displayData, $modes); // Generate instance wide unique ID $tmp= gettimeofday(); @@ -67,7 +72,7 @@ class sortableListing { } - public function setListData($data, $displayData= null) + public function setListData($data, $displayData= null, $modes= null) { // Save data to display $this->setData($data); @@ -77,8 +82,15 @@ class sortableListing { $displayData[$key]= array($value); } } + if (!$modes) { + $modes= array(); + foreach ($data as $key => $value) { + $modes[$key]= LIST_NORMAL; + } + } $this->setDisplayData($displayData); + $this->setModes($modes); } @@ -88,6 +100,12 @@ class sortableListing { } + private function setModes($modes) + { + $this->modes= $modes; + } + + private function setDisplayData($data) { if (!is_array($data)) { @@ -233,16 +251,31 @@ class sortableListing { if (strpos($this->acl, 'r') !== false) { foreach ($this->mapping as $nr => $row) { $editable= $this->editable?" onclick='$(\"edit_".$this->id."_$nr\").click()'":""; - $result.= " \n"; + + $id= ""; + switch ($this->modes[$row]) { + case LIST_DISABLED: + $id= " sortableListItemDisabled"; + $editable= false; + break; + case LIST_MARKED: + $id= " sortableListItemMarked"; + break; + } + + $result.= " \n"; $first= " style='border:0'"; + foreach ($this->displayData[$row] as $column) { $result.= " ".htmlentities($column)."\n"; $first= ""; } + if ($action_width) { $result.= "".str_replace('%ID', "edit_".$this->id."_$nr", $edit_image). str_replace('%ID', "del_".$this->id."_$nr", $delete_image).""; } + $result.= " \n"; } }