Code

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

include/class_MultiSelectWindow.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/users/class_divListUsers.inc
plugins/admin/users/class_userManagement.inc

index 7c2be7aa5f1994778cd2d06a56b8a2d064280181..a239bfc134ab50b8e26fa646fbdf5a645b2c93dc 100644 (file)
@@ -607,7 +607,7 @@ class MultiSelectWindow{
         }
       }else{
         if($layer_menu){
-          $str = "..|<img class='center' src='images/restore_grey.png' alt=''>&nbsp;"._("Restore")."|RestoreDeletedSnapShot|\n";
+          $str = "..|<img class='center' src='images/restore_grey.png' alt=''>&nbsp;"._("Restore")."||\n";
         }else{
           $str = "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
         }
index af5ab8aaf3694969606187ca28f181fcd4346e43..ab0cef77764f633410fb8a72f7746bb0e6839d8d 100644 (file)
@@ -143,57 +143,58 @@ class divListGroup extends MultiSelectWindow
     $acls   = $ui->get_permissions($this->selectedBase,"groups/group");
     $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups");
 
-    /* If this is true add a seperator after added c&p and snapshot icons to header */
-    $addsep = 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();
-      $addsep = true;
-    }
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
     
-    /* Add snapshot restore icon and force a following seperator */
-    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-      $addsep = true;
-    }
-
-    /* Add Create group icon */
-    if(preg_match("/c/",$acls)) {
-      $listhead.=" <input type='image' class='center' src='images/list_new_group.png' 
-        title='"._("Create new group")."' alt='"._("New")."' name='group_new'>&nbsp;";
-      $addsep = true;
-    }
-
-    /* Assign copy & paste icons */
-    $listhead.=      $Copy_Paste;
-    
-    /* Append an additional seperator */
-    if($addsep){
-      $listhead.=" <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;";
-    }
-    
     /* Add department selection */
     $listhead .= _("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
       " <input type='image' class='center' src='images/list_submit.png' 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_all)) {
+      $s.= "...|<input class='center' type='image' src='images/list_new_group.png' alt=''>".
+        "&nbsp;"._("Group")."|group_new|\n";
+    }
+
     /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected groups")."' alt='"._("Remove groups")."' name='remove_multiple_groups'>&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) && preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcopy.png'
-        title='"._("Copy selected group")."' alt='"._("Copy groups")."' name='multiple_copy_groups'>&nbsp;";
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
-        title='"._("cut selected group")."' alt='"._("Cut groups")."' name='multiple_cut_groups'>&nbsp;";
-      $listhead .= "</div>";
+      $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);
+    }
+
+    $this->SetDropDownHeaderMenu($s);
+
     $this->SetListHeader($listhead);
   }
 
index ddadcf6a27fc4e65a88f70b875c72995116373ea..664084fd142ced5b358c9a7579a624647e080c58 100644 (file)
@@ -122,6 +122,29 @@ class groupManagement extends plugin
       $s_action = "edit";
     }
 
+    /* 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'] == "group_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";
+    }
+
+
+
     $smarty= get_smarty();
 
     /********************
index 5f4639e8e5ac5535ff0914989ebd6d01fbce6042..a571f5f07054437585cb65e100786a2994b6ffdd 100644 (file)
@@ -136,50 +136,61 @@ class divListUsers extends MultiSelectWindow
     /* Get copy & paste icon */
     $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users") ;
     $acl      = $ui->get_permissions($this->selectedBase,"users/user");
-    if(preg_match("/(c.*w|w.*c)/",$acl_all) && is_object($this->parent->CopyPasteHandler)){
-      $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
-    }else{
-      $Copy_Paste ="";
-    }
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
-    
-    if(preg_match("/(c.*w|w.*c)/",$acl_all)){ 
-      $listhead .= $this->get_snapshot_header($this->selectedBase);
-    }
-
-    if(preg_match("/c/",$acl)) {
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_user.png' 
-        title='"._("Create new user")."' alt='"._("New user")."' name='user_new'>&nbsp;";
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_new.png' 
-        title='"._("Create new template")."' alt='"._("New template")."'        name='user_tplnew'>&nbsp;";
-    }
-
-    $listhead .= $Copy_Paste;
-    
     $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/",$acl)) {
+      $s.= "...|<input class='center' type='image' src='images/list_new_user.png' alt=''>".
+        "&nbsp;"._("User")."|user_new|\n";
+      $s.= "...|<input class='center' type='image' src='images/list_new.png' alt=''>".
+        "&nbsp;"._("Template")."|user_tplnew|\n";
+    }
+
     /* Multiple options */ 
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected user")."' alt='"._("Remove user")."' name='remove_multiple_users'>&nbsp;";
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/list_password.png'
-        title='"._("Change password")."' alt='"._("Change password")."' name='multiple_password_change'>&nbsp;";
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edit.png'
-        title='"._("Edit")."' alt='"._("Edit")."' name='multiple_edit'>&nbsp;";
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/edit.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Edit")."|"."multiple_edit|\n";
+    $s.= "..|<img src='images/list_password.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Change password")."|"."multiple_password_change|\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) && preg_match("/(c.*w|w.*c)/",$acl_all)){
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcopy.png'
-        title='"._("Copy selected user")."' alt='"._("Copy users")."' name='multiple_copy_users'>&nbsp;";
-      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
-        title='"._("cut selected user")."' alt='"._("Cut users")."' name='multiple_cut_users'>&nbsp;";
+      $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 966d77718f9155118309b7f0fdfc31bda8b6ef1f..64fbb0707654100a3e1fae66fd674137eb29ec3a 100644 (file)
@@ -118,6 +118,35 @@ class userManagement extends plugin
       $s_tab = "user";
     }
 
+
+    /* 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'] == "user_new"){
+      $s_action = "new";
+    }
+    if(isset($_POST['menu_action']) && $_POST['menu_action'] == "user_tplnew"){
+      $s_action = "new_tpl";
+    }
+    if(isset($_POST['menu_action']) && $_POST['menu_action'] == "multiple_edit"){
+      $s_action = "multiple_edit";
+    }
+
+    /* handle remove from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){
+      $s_action = "del_multiple";
+    }
+
+
     /********************
       Copy & Paste 
      ********************/