diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 7d12f4878cbea635510366f2966057b571777804..a30758ebc3c3ccba455edc2e079eeecb61530b65 100644 (file)
// 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);
switch ($this->modes[$row]) {
case LIST_DISABLED:
$id= " sortableListItemDisabled";
- $editable= false;
+ $editable= "";
break;
case LIST_MARKED:
$id= " sortableListItemMarked";
$this->sortData();
}
}
+ }
+
+
+ public function save_object()
+ {
+ // Do not do anything if this is not our PID, or there's even no PID available...
+ if(!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->id) {
+ return;
+ }
// Do not do anything if we're not posted - or have no permission
if (strpos($this->acl, 'w') !== false && isset($_POST['reorder_'.$this->id])){
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);
}
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";
}
}