diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 7d12f4878cbea635510366f2966057b571777804..cbb2334586a8d0cb5e27c269ff11c1dbef1b361d 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);
public function render()
{
$result= "<div class='sortableListContainer' id='scroll_".$this->id."' style='min-width:".$this->width.";height: ".$this->height."'>\n";
- $result.= "<table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%' ".(!empty($this->cssclass)?" class='".$this->cssclass."'":"").">\n";
+ $result.= "<table summary='"._("Sortable list")."' border='0' cellpadding='0' cellspacing='0' width='100%' style='width:100%' ".(!empty($this->cssclass)?" class='".$this->cssclass."'":"").">\n";
$action_width= 0;
if (strpos($this->acl, 'w') === false) {
$edit_image= $this->editable?"<img class='center' src='images/lists/edit-grey.png' alt='"._("Edit")."'>":"";
if ($this->colspecs) {
$result.= " <colgroup>\n";
for ($i= 0; $i<$this->columns; $i++) {
- $result.= " <col style='width:".(isset($this->colspecs[$i])?$this->colspecs[$i]:"*")."'/>\n";
+ if(isset($this->colspecs[$i]) && $this->colspecs[$i] != '*'){
+ $result.= " <col style='width:".($this->colspecs[$i])."'>\n";
+ }else{
+ $result.= " <col>\n";
+ }
}
// Extend by another column if we've actions specified
if ($action_width) {
- $result.= " <col style='width:".$action_width."px'/>\n";
+ $result.= " <col style='width:".$action_width."px' >\n";
}
$result.= " </colgroup>\n";
}
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])){
}
// Delete requested?
+ $this->action = "";
if (strpos($this->acl, 'd') !== false){
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";
}
}