Code

Added layer menu to macro and blocklsits
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Nov 2007 06:54:24 +0000 (06:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Nov 2007 06:54:24 +0000 (06:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7735 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/macro/class_divListMacros.inc
plugins/gofon/macro/class_gofonMacroManagement.inc

index d72a44dd1c7dcb9ec34d748e337507d111fd3d01..8c7df503314b40986a6a055610f6bd732255cd75 100644 (file)
@@ -83,6 +83,33 @@ class blocklist 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'] == "goFaxBlocklist_new"){
+      $s_action = "new";
+    }
+
+    /* handle remove from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^remove_multiple/",$_POST['menu_action'])){
+      $s_action = "del_multiple";
+    }
+
 
     /***************
       Cancel some dialogs  
index e1ebc324d22a313c27001f415ba24302476ae8ea..f3812ff68730085072141f387629a1bb2ffa5cd9 100755 (executable)
@@ -131,28 +131,51 @@ class divListBlocklist extends MultiSelectWindow
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
-    /* Add snaphot icons, if allowed */
-    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-    }
-
-    /* Add create icon if allowed */
-    if(preg_match("/c/",$acl)){
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_blocklist.png' ".
-        "  title='"._("Create new blocklist")."' alt='"._("New Blocklist")."' name='goFaxBlocklist_new'>&nbsp;".
-        " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>";
-    }
-  
     /* Append department selector */
     $listhead .= "&nbsp;"._("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;";
 
+    /* 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_blocklist.png' alt=''>".
+        "&nbsp;"._("Blocklist")."|goFaxBlocklist_new|\n";
+    }
+
     /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected blocklists")."' alt='"._("Remove blocklists")."' name='remove_multiple_blocklists'>&nbsp;";
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Remove")."|"."remove_multiple|\n";
+
+    /* Add multiple copy & cut icons */
+    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";
+      }
+    }
+
+    /* Add snapshot icons */
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+      $s .= "..|---|\n";
+      $s .= $this->get_snapshot_header(TRUE);
+    }
 
-    $listhead .="</div>";
+    $this->SetDropDownHeaderMenu($s);
 
     $this->SetListHeader($listhead);
   }
index 3dae68dfee92b152e45224977dc5f6ea8efcb6b4..b66f327fd6aca1b7d27dca5869b0652cbba4e657 100755 (executable)
@@ -125,43 +125,54 @@ class divListMacro extends MultiSelectWindow
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
-
-    /* Get copy & paste icon */
-    $Copy_Paste ="";
-    if(preg_match("/(c.*w|w.*c)/",$acls) &&  $this->parent->CopyPasteHandler){
-      $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
-      $addsep = true;
-    }
-
-    if(preg_match("/w/",$acls) && preg_match("/c/",$acls)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-    }
-
-    $listhead .= $Copy_Paste;      
-
-    if(preg_match("/c/",$acls)){
-      $listhead .=  " <input class='center' type='image' align='middle' src='images/list_new_macro.png' 
-        title='"._("Create new phone macro")."' alt='"._("New")."' name='goFonMacro_new'>&nbsp;";
-      $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
     $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;";
     
+    /* 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/",$acls)){
+      $s.= "...|<input class='center' type='image' src='images/list_new_macro.png' alt=''>".
+        "&nbsp;"._("Macro")."|goFonMacro_new|\n";
+    }
+
     /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected macros")."' alt='"._("Remove macros")."' name='remove_multiple_macros'>&nbsp;";
+    $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 objects")."' alt='"._("Copy objects")."' name='multiple_copy_objects'>&nbsp;";
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
-        title='"._("cut selected objects")."' alt='"._("Cut objects")."' name='multiple_cut_objects'>&nbsp;";
-      $listhead .= "</div>";
+    if(preg_match("/(c.*w|w.*c)/",$acls) && is_object( $this->parent->CopyPasteHandler)){
+      $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";
+      }
+    }
+
+    /* Add snapshot icons */
+    if(preg_match("/(c.*w|w.*c)/",$acls)){
+      $s .= "..|---|\n";
+      $s .= $this->get_snapshot_header(TRUE);
     }
 
-    $listhead .="</div>";
+    $this->SetDropDownHeaderMenu($s);
+
+
+
+
     $this->SetListHeader($listhead);
   }
 
index f4394836bf07c7dc183486ee8189647279954161..a2a7858d3b4e23d5a7db5b2b4867eb122942ff90 100755 (executable)
@@ -108,6 +108,28 @@ class goFonMacro extends plugin
       Copy & Paste Handling  ...
      ********************/
 
+    
+    /* 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'] == "goFonMacro_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";
+    }
+
     /* Display the copy & paste dialog, if it is currently open */
     $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
     if($ret){