Code

Some more layer menus
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 14:26:10 +0000 (14:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 14:26:10 +0000 (14:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7720 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/devices/class_deviceManagement.inc
plugins/admin/devices/class_divListDevices.inc
plugins/admin/mimetypes/class_divListMimeTypes.inc
plugins/admin/mimetypes/class_mimetypeManagement.inc

index c63d064a62ca44d586bb8ee916e0517d76ce9ef7..4715ea0f32a146e423645cb80386f87ef5113d3e 100644 (file)
@@ -87,6 +87,27 @@ class deviceManagement extends plugin
     $s_entry  = preg_replace("/_.$/","",$s_entry);
 
 
+    /* handle C&P from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
+      $s_action = "copy_multiple";
+    }
+    if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){
+      $s_action = "cut_multiple";
+    }
+    if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){
+      $s_action = "editPaste";
+    }
+
+    /* Create options */
+    if(isset($_POST['menu_action']) && $_POST['menu_action'] == "device_new"){
+      $s_action = "new";
+    }
+
+    /* handle remove from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){
+      $s_action = "del_multiple";
+    }
+
     /****************
       Copy & Paste handling
      ****************/
@@ -97,7 +118,6 @@ class deviceManagement extends plugin
       return($ret);
     }
 
-
     /****************
       Create a new device type
      ****************/
@@ -122,7 +142,7 @@ class deviceManagement extends plugin
      ****************/
 
     /* Cancel dialogs */
-    if (isset($_POST['edit_cancel'])){
+    if (isset($_POST['edit_cancel']) && is_object($this->devicetabs)){
       del_lock ($this->devicetabs->dn);
       unset ($this->devicetabs);
       $this->devicetabs= NULL;
index d95c65da61f4b837cf73e132f14c33d90cc25106..e2a8a34a47fc110a8a1e9945e8061a9f9451d9d0 100755 (executable)
@@ -125,58 +125,54 @@ class divListDevices extends MultiSelectWindow
 
 
     /* If this is true we add an additional seperator. Just look a few lines below */  
-    $add_sep = false;
-    /* Get copy & paste icon */
-    $Copy_Paste ="";
-    if(preg_match("/(c.*w|w.*c)/",$acl_all) &&  $this->parent->CopyPasteHandler){
-      $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
-      $add_sep = true;
-    }
-
-    /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
-    /* Create snapshot icons */
-    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-      $add_sep = true;
-    }
-    
-    /* Add create icon */
-    if(preg_match("/c/",$acl)){
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_device.png' alt='"._("new").
-        "' title='"._("Create new device")."' name='device_new'>&nbsp;";
-      $add_sep = true;
-    }
-  
-    /* Add copy & paste icons */
-    $listhead .= $Copy_Paste;
-
-    /* Add a seperator ? */
-    if($add_sep) {
-      $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
-    
     /* And at least add a department selection box */
     $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' 
         title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;";
 
-        /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected device")."' alt='"._("Remove device")."' name='remove_multiple_devices'>&nbsp;";
+    /* Create Layers menu */
+    $s  = ".|"._("Actions")."|\n";
+    $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Create")."|\n";
+
+    /* Append create options */
+    if(preg_match("/c/",$acl)) {
+      $s.= "...|<input class='center' type='image' src='images/list_new_device.png' alt=''>".
+        "&nbsp;"._("Device")."|device_new|\n";
+    }
+
+    /* Multiple options */
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Remove")."|"."remvove_multiple|\n";
 
     /* Add multiple copy & cut icons */
-    if(is_object($this->parent->CopyPasteHandler)){
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcopy.png'
-        title='"._("Copy selected object")."' alt='"._("Copy object")."' name='multiple_copy_devices'>&nbsp;";
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
-        title='"._("cut selected object")."' alt='"._("Cut object")."' name='multiple_cut_devices'>&nbsp;";
+    if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
+      $s.= "..|---|\n";
+      $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
+      $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
+
+      if($this->parent->CopyPasteHandler->entries_queued()){
+        $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."|editPaste|\n";
+      }else{
+        $img = "<img border='0' class='center' src='images/cant_editpaste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."\n";
+      }
     }
 
-    $listhead .="</div>";;
+    /* Add snapshot icons */
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+      $s .= "..|---|\n";
+      $s .= $this->get_snapshot_header(TRUE);
+    }
 
+    $this->SetDropDownHeaderMenu($s);
+                                                                       
     $this->SetListHeader($listhead);
   }
 
index 6a6d7447ef73d99aa24a3ff072cfad5c2a00b9a2..a34c10f786007f5de0528bd5af0c444daa621389 100755 (executable)
@@ -160,46 +160,51 @@ class divListMimeTypes extends MultiSelectWindow
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
-    /* Create snapshot icons */
-    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-      $add_sep = true;
-    }
-    
-    /* Add create icon */
-    if(preg_match("/c/",$acl)){
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_mime.png' alt='"._("new").
-        "' title='"._("Create new mime type")."' name='mime_new'>&nbsp;";
-      $add_sep = true;
-    }
-  
-    /* Add copy & paste icons */
-    $listhead .= $Copy_Paste;
-
-    /* Add a seperator ? */
-    if($add_sep) {
-      $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
-    
     /* And at least add a department selection box */
     $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' 
         title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;";
 
-        /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected mimetype")."' alt='"._("Remove mimetype")."' name='remove_multiple_mimetypes'>&nbsp;";
+    /* Create Layers menu */
+    $s  = ".|"._("Actions")."|\n";
+    $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Create")."|\n";
+
+    /* Append create options */
+    if(preg_match("/c/",$acl)) {
+      $s.= "...|<input class='center' type='image' src='images/list_new_mime.png' alt=''>".
+        "&nbsp;"._("Mime type")."|mime_new|\n";
+    }
+
+    /* Multiple options */
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Remove")."|"."remvove_multiple|\n";
 
     /* Add multiple copy & cut icons */
-    if(is_object($this->parent->CopyPasteHandler)){
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcopy.png'
-        title='"._("Copy selected object")."' alt='"._("Copy object")."' name='multiple_copy_mimetypes'>&nbsp;";
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
-        title='"._("cut selected object")."' alt='"._("Cut object")."' name='multiple_cut_mimetypes'>&nbsp;";
+    if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
+      $s.= "..|---|\n";
+      $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
+      $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
+
+      if($this->parent->CopyPasteHandler->entries_queued()){
+        $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."|editPaste|\n";
+      }else{
+        $img = "<img border='0' class='center' src='images/cant_editpaste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."\n";
+      }
     }
 
-    $listhead .="</div>";;
+    /* Add snapshot icons */
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+      $s .= "..|---|\n";
+      $s .= $this->get_snapshot_header(TRUE);
+    }
 
+    $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);
   }
 
index f192eb21d96c892b1c514070bf68c81aa43f077e..caee8ddf1c56ba28ec01843659335b09f18ae7cf 100755 (executable)
@@ -146,6 +146,28 @@ class mimetypeManagement extends plugin
     $s_entry  = preg_replace("/_.$/","",$s_entry);
 
 
+    /* handle C&P from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
+      $s_action = "copy_multiple";
+    }
+    if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){
+      $s_action = "cut_multiple";
+    }
+    if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){
+      $s_action = "editPaste";
+    }
+
+    /* Create options */
+    if(isset($_POST['menu_action']) && $_POST['menu_action'] == "mime_new"){
+      $s_action = "new";
+    }
+
+    /* handle remove from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){
+      $s_action = "del_multiple";
+    }
+
     /**************** 
       Copy & Paste handling  
      ****************/