Code

Fixed msgs for applications / departments / fai
[gosa.git] / plugins / admin / applications / class_divListApplication.inc
index 525840bbfd0f156923f308b5243a601d6c3f93cf..8487f9b4dc55b6b27d1b36583a817f5e2e8efd2b 100755 (executable)
@@ -42,9 +42,14 @@ class divListApplication extends MultiSelectWindow
     $this->EnableSaveButton (false);
 
     /* set Page header */
+    $action_col_size = 70;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
+
     $this->AddHeader(array("string" => " ",                "attach" => "style='text-align:center;width:20px;'"));
     $this->AddHeader(array("string" => _("Application name")." / "._("Department"), "attach" => "style=''"));
-    $this->AddHeader(array("string" => _("Actions"),            "attach" => "style='width:110px;border-right:0px;text-align:right;'"));
+    $this->AddHeader(array("string" => _("Actions"),            "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"));
 
     /* Add SubSearch checkbox */
     $this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Ignore subtrees"), false);
@@ -99,13 +104,7 @@ class divListApplication extends MultiSelectWindow
       " <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' align='middle' 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 class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new").
       "' title='"._("Create new application")."' name='appl_new'>&nbsp;".
       $Copy_Paste.
@@ -139,8 +138,11 @@ class divListApplication extends MultiSelectWindow
     $applimg  = "<img class='center' src='images/select_application.png' alt='A'  title='"._("Application")."'>";
     $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
-
-
+    /* set Page header */
+    $action_col_size = 70;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
 
     /********************
       Attach objects
@@ -149,7 +151,7 @@ class divListApplication extends MultiSelectWindow
     foreach($list as $key => $val){
 
       /* Create action 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;";
@@ -158,6 +160,7 @@ class divListApplication extends MultiSelectWindow
       }
       $actions.= "<input class='center' type='image'
         src='images/edit.png' alt='"._("edit")."' name='appl_edit_%KEY%' title='"._("Edit this entry")."'>";
+      $actions.= $this->GetSnapShotActions($val['dn']);
       $actions.= "<input class='center' type='image'
         src='images/edittrash.png' alt='"._("delete")."' name='appl_del_%KEY%' title='"._("Delete this entry")."'>";
 
@@ -170,7 +173,7 @@ class divListApplication extends MultiSelectWindow
       }
       $field1 = array("string" => sprintf($applimg,$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, $actions), "attach" => "style='width:110px;border-right:0px;text-align:right;'");
+      $field3 = 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));
     }
   }