Code

Fixed snapshot entry in layers menu
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 07:34:31 +0000 (07:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 07:34:31 +0000 (07:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7707 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_MultiSelectWindow.inc
include/class_plugin.inc
plugins/admin/systems/class_divListSystem.inc

index e267b3ded553e827844ae0881a29c9f0afcef086..7c2be7aa5f1994778cd2d06a56b8a2d064280181 100644 (file)
@@ -589,7 +589,7 @@ class MultiSelectWindow{
 
 
   /* Create header snapshot value */
-  function get_snapshot_header()
+  function get_snapshot_header($layer_menu = FALSE)
   {
     $str = "&nbsp;";
     if($this->parent->snapshotEnabled()){
@@ -598,13 +598,20 @@ class MultiSelectWindow{
         $ok |= count($this->parent->getAllDeletedSnapshots($base)) >= 1 ;
       }
       if($ok){
-        $str = "<input class='center' type='image' align='middle' src='images/restore.png'
-          title='"._("Restore snapshopts of already deleted objects")."' 
-          alt='"._("Restore")."' name='RestoreDeletedSnapShot'>&nbsp;"; 
+        if($layer_menu){
+          $str = "..|<img class='center' src='images/restore.png'>&nbsp;"._("Restore")."|RestoreDeletedSnapShot|\n";
+        }else{
+          $str = "<input class='center' type='image' align='middle' src='images/restore.png'
+            title='"._("Restore snapshopts of already deleted objects")."' 
+            alt='"._("Restore")."' name='RestoreDeletedSnapShot'>&nbsp;"; 
+        }
       }else{
-        $str = "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
+        if($layer_menu){
+          $str = "..|<img class='center' src='images/restore_grey.png' alt=''>&nbsp;"._("Restore")."|RestoreDeletedSnapShot|\n";
+        }else{
+          $str = "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
+        }
       }
-
 #      $str .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
     }
     return($str);
index 58cec70eea89b1dc07b20aae2db6382120a67c79..bb4863c3e30f7ff4c1102434a4b2d13a1c1013d1 100644 (file)
@@ -1383,7 +1383,8 @@ class plugin
       }
 
       /* Restore one of the already deleted objects */
-      if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){
+      if(((isset($_POST['menu_action']) && $_POST['menu_action'] == "RestoreDeletedSnapShot") 
+          || preg_match("/^RestoreDeletedSnapShot_/",$name)) && $once){
         $once = false;
         $this->snapDialog = new SnapShotDialog($this->config,"",$this);
         $this->snapDialog->set_snapshot_bases($baseSuffixe);
index e64d25ba3c9e955bb4bfe364d2a5b63aadc94f41..92109423b3347ed36b63a3a55b0bf93276290aa1 100644 (file)
@@ -165,12 +165,6 @@ class divListSystem extends MultiSelectWindow
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
-    /* Add snapshot icons */
-    if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-      $add_sep = true;
-    }
-
     /* Add base selection */
     $listhead .= _("Base")."&nbsp; <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
       " <input class='center' type='image' src='images/list_submit.png' align='middle'
@@ -228,6 +222,10 @@ class divListSystem extends MultiSelectWindow
       }
     }
 
+    /* Add snapshot icons */
+    if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
+      $s .= $this->get_snapshot_header(TRUE);
+    }
 
     $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);