From 6011af1ed8987c6f87b1d06083b3e7634571ebd3 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Nov 2007 13:33:09 +0000 Subject: [PATCH] Added objectGroup layer menu git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7717 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_divListOGroup.inc | 64 +++++++++++-------- .../admin/ogroups/class_ogroupManagement.inc | 23 +++++++ 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index ffc399d07..720f7530f 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -156,45 +156,53 @@ class divListOGroup extends MultiSelectWindow /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); - /* Add snapshot restore icons */ - if(preg_match("/(c.*w|w.*c)/",$acl_all)){ - $listhead .= $this->get_snapshot_header($this->selectedBase); - $add_sep = true; - } - - /* Create new ogroup icon */ - if(preg_match("/c/",$acls)) { - $listhead .=" "; - $add_sep = true; - } - - /* Add copy & paste icon */ - $listhead .= $Copy_Paste; - - /* Should we add a seperator here ? */ - if($add_sep){ - $listhead .="  "; - } /* Add department selector */ $listhead .= _("Base")." ". "  "; + + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acls)) { + $s.= "...|". + " "._("Object group")."|group_new|\n"; + } + /* Multiple options */ - $listhead .= "  "; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Edit")."|"."multiple_edit|\n"; /* Add multiple copy & cut icons */ - if(is_object($this->parent->CopyPasteHandler)){ - $listhead .= "  "; - $listhead .= "  "; + if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ + $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/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 29a0734eb..7ed769ac5 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -108,6 +108,29 @@ class ogroupManagement extends plugin } + + /* 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"; + } + + /**************** Copy & Paste handling ****************/ -- 2.30.2