Code

Udpated fai acls
[gosa.git] / plugins / admin / groups / class_divListGroup.inc
index 30b1df8a439aac22d4beb18a85b0c19bf7189c4c..1605e4cf1a2a88ccb240b17ad0fa756a13b2ddda 100644 (file)
@@ -44,11 +44,17 @@ class divListGroup extends MultiSelectWindow
     $this->EnableCloseButton(false);
     $this->EnableSaveButton (false);
 
+    /* Dynamic action col, depending on snapshot icons */
+    $action_col_size = 70;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
+
     /* set Page header */
     $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>_("Groupname / Department")));
     $this->AddHeader(array("string"=>_("Properties"),"attach"=>"style='width:136px;'"));
-    $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:110px;border-right:0px;'"));
+    $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'"));
 
     /*                  Text        ,Value    ,Name         ,Is selected */
     $this->AddCheckBox("ShowPrimaryGroups",     _("Select to see groups that are primary groups of users"),          _("Show primary groups"),      true);
@@ -67,26 +73,6 @@ class divListGroup extends MultiSelectWindow
   }
 
 
- function GetSnapShotActions($dn)
-  {
-    $str = "";
-
-    if($this->parent->snapshotEnabled()){
-
-      $str .="<input class='center' type='image' src='images/snapshot.png'
-        alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create a new snapshot from this object")."'>&nbsp;";
-
-      if(count($this->parent->Available_SnapsShots($dn))){
-        $str .="<input class='center' type='image' src='images/restore.png'
-          alt='"._("Restore snapshot")."' name='RestoreSnapShot_".base64_encode($dn)."' title='"._("Restore snapshot")."'>&nbsp;";
-      }else{
-        $str.= "<img src='images/empty.png' style='width:16px;' class='center'>&nbsp;";
-      }
-    }
-    return($str);
-  }
-
-
   function GenHeader()
   {
     /* Prepare departments,
@@ -115,14 +101,7 @@ class divListGroup extends MultiSelectWindow
       " <input type='image' class='center' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
       " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='".        _("Submit")."'>&nbsp;".
       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;";
-
-
-    if($this->parent->snapshotEnabled()){
-      $listhead .= "  <input class='center' type='image' align='middle' src='images/restore.png'
-        title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
-        " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
-
+    $listhead .= $this->get_snapshot_header($this->selectedBase);
     $listhead.=" <input type='image' class='center' src='images/list_new_group.png' title='"._("Create new group")."' alt='"._("New")."' name='group_new'>&nbsp;".
       $Copy_Paste.
       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;".
@@ -149,6 +128,12 @@ class divListGroup extends MultiSelectWindow
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
     $userimg  = "<img class='center' src='images/select_groups.png' alt='User'    title='%s'>";
 
+    /* Dynamic action col, depending on snapshot icons */
+    $action_col_size = 70;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
+
     /* Assign extension images */
     $posiximg = "<input type='image' class='center' src='images/select_groups.png'
                  name='group_group_edit_%KEY%' alt='P'  title='"._("Posix")  ."'>";
@@ -166,7 +151,6 @@ class divListGroup extends MultiSelectWindow
     // Space
     $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
-
     // User and Template  Images
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
@@ -174,7 +158,7 @@ class divListGroup extends MultiSelectWindow
     foreach($groups as $key => $val){
     
       /* Create action icons - copy & paste icons */
-      $actions = $this->GetSnapShotActions($val['dn']);
+      $actions= "";
       if($this->parent->CopyPasteHandler){
         $actions.= "<input class='center' type='image'
           src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
@@ -183,6 +167,7 @@ class divListGroup extends MultiSelectWindow
       }
       $actions.= "<input class='center' type='image'
         src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
+      $actions.= $this->GetSnapShotActions($val['dn']);
       $actions.= "<input class='center' type='image'
         src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
 
@@ -214,7 +199,7 @@ class divListGroup extends MultiSelectWindow
       $field1 = array("string" => sprintf($userimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
       $field3 = array("string" => preg_replace("/%KEY%/", $key, $posix."&nbsp;".$enviro."&nbsp;".$mail."&nbsp;".$samba."&nbsp;".$appl."&nbsp;".$phone),     "attach" => "style='width:136px;'");
-      $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:110px;border-right:0px;text-align:right;'");
+      $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
 
       $this->AddElement(array($field1,$field2,$field3,$field4));
     }