From b55c9da0cc1fed54d967f22d17380948e94d40a0 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Nov 2007 12:29:49 +0000 Subject: [PATCH] Some layer menus git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7716 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_MultiSelectWindow.inc | 2 +- plugins/admin/groups/class_divListGroup.inc | 77 ++++++++++--------- .../admin/groups/class_groupManagement.inc | 23 ++++++ plugins/admin/users/class_divListUsers.inc | 71 +++++++++-------- plugins/admin/users/class_userManagement.inc | 29 +++++++ 5 files changed, 133 insertions(+), 69 deletions(-) diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 7c2be7aa5..a239bfc13 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -607,7 +607,7 @@ class MultiSelectWindow{ } }else{ if($layer_menu){ - $str = "..| "._("Restore")."|RestoreDeletedSnapShot|\n"; + $str = "..| "._("Restore")."||\n"; }else{ $str = " "; } diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index af5ab8aaf..ab0cef777 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -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.="  "; - $addsep = true; - } - - /* Assign copy & paste icons */ - $listhead.= $Copy_Paste; - - /* Append an additional seperator */ - if($addsep){ - $listhead.="  "; - } - /* Add department selection */ $listhead .= _("Base")." ". "  "; + + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + + /* Append create options */ + if(preg_match("/c/",$acl_all)) { + $s.= "...|". + " "._("Group")."|group_new|\n"; + } + /* Multiple options */ - $listhead .= "  "; - + $s.= "..|---|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\n"; + /* Add multiple copy & cut icons */ if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ - $listhead .= "  "; - $listhead .= "  "; - $listhead .= ""; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Copy")."|"."multiple_copy_systems|\n"; + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; + + if($this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("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); } diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index ddadcf6a2..664084fd1 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -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(); /******************** diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 5f4639e8e..a571f5f07 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -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 .= "  "; - $listhead .= "  "; - } - - $listhead .= $Copy_Paste; - $listhead .= _("Base")." ". "  "; + + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acl)) { + $s.= "...|". + " "._("User")."|user_new|\n"; + $s.= "...|". + " "._("Template")."|user_tplnew|\n"; + } + /* Multiple options */ - $listhead .= "  "; - $listhead .= "  "; - $listhead .= "  "; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Edit")."|"."multiple_edit|\n"; + $s.= "..|". + " "._("Change password")."|"."multiple_password_change|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\n"; /* Add multiple copy & cut icons */ if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ - $listhead .= "  "; - $listhead .= "  "; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Copy")."|"."multiple_copy_systems|\n"; + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; + + if($this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("Paste")."\n"; + } + } + + /* Add snapshot icons */ + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $s .= "..|---|\n"; + $s .= $this->get_snapshot_header(TRUE); } - $listhead .="";; + $this->SetDropDownHeaderMenu($s); $this->SetListHeader($listhead); } diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 966d77718..64fbb0707 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -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 ********************/ -- 2.30.2