From 2b654646b8881d14ff82b88dc82921a821ecdb8d Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 25 Jan 2010 13:20:43 +0000 Subject: [PATCH] Added modes to list to mark, enable or disable entries git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15280 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_sortableListing.inc | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc index b0539c202..a30758ebc 100644 --- a/gosa-core/include/class_sortableListing.inc +++ b/gosa-core/include/class_sortableListing.inc @@ -100,8 +100,12 @@ class sortableListing { // Transfer information $this->displayData= array(); + $this->modes= array(); foreach ($data as $key => $value) { $this->displayData[]= $value['data']; + if (isset($value['mode'])) { + $this->modes[]= $value['mode']; + } } $this->keys= array_keys($data); @@ -246,7 +250,7 @@ class sortableListing { switch ($this->modes[$row]) { case LIST_DISABLED: $id= " sortableListItemDisabled"; - $editable= false; + $editable= ""; break; case LIST_MARKED: $id= " sortableListItemMarked"; @@ -365,7 +369,17 @@ class sortableListing { foreach ($_POST as $key => $value) { if (preg_match('/^del_'.$this->id.'_([0-9]+)_x.*$/', $key, $matches)) { $this->active_index= $this->mapping[$matches[1]]; + + // Ignore request if mode requests it + if (isset($this->modes[$this->active_index]) && $this->modes[$this->active_index] == LIST_DISABLED) { + $this->active_index= null; + continue; + } + + // Set action $this->action= "delete"; + + // Remove value if requested if ($this->instantDelete) { $this->deleteEntry($this->active_index); } @@ -378,6 +392,13 @@ class sortableListing { foreach ($_POST as $key => $value) { if (preg_match('/^edit_'.$this->id.'_([0-9]+)_x.*$/', $key, $matches)) { $this->active_index= $this->mapping[$matches[1]]; + + // Ignore request if mode requests it + if (isset($this->modes[$this->active_index]) && $this->modes[$this->active_index] == LIST_DISABLED) { + $this->active_index= null; + continue; + } + $this->action= "edit"; } } -- 2.30.2