From 3f2ee479a08cd294fd114d2f5e57675185e09d77 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Nov 2007 14:26:10 +0000 Subject: [PATCH] Some more layer menus git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7720 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/devices/class_deviceManagement.inc | 24 +++++- .../admin/devices/class_divListDevices.inc | 76 +++++++++---------- .../mimetypes/class_divListMimeTypes.inc | 65 ++++++++-------- .../mimetypes/class_mimetypeManagement.inc | 22 ++++++ 4 files changed, 115 insertions(+), 72 deletions(-) diff --git a/plugins/admin/devices/class_deviceManagement.inc b/plugins/admin/devices/class_deviceManagement.inc index c63d064a6..4715ea0f3 100644 --- a/plugins/admin/devices/class_deviceManagement.inc +++ b/plugins/admin/devices/class_deviceManagement.inc @@ -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; diff --git a/plugins/admin/devices/class_divListDevices.inc b/plugins/admin/devices/class_divListDevices.inc index d95c65da6..e2a8a34a4 100755 --- a/plugins/admin/devices/class_divListDevices.inc +++ b/plugins/admin/devices/class_divListDevices.inc @@ -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 .= "  "; - $add_sep = true; - } - - /* Add copy & paste icons */ - $listhead .= $Copy_Paste; - - /* Add a seperator ? */ - if($add_sep) { - $listhead .= "  "; - } - /* And at least add a department selection box */ $listhead .= _("Base")." ". "  "; - /* Multiple options */ - $listhead .= "  "; + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acl)) { + $s.= "...|". + " "._("Device")."|device_new|\n"; + } + + /* Multiple options */ + $s.= "..|---|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\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"; + } } - $listhead .="";; + /* 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/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index 6a6d7447e..a34c10f78 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -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 .= "  "; - $add_sep = true; - } - - /* Add copy & paste icons */ - $listhead .= $Copy_Paste; - - /* Add a seperator ? */ - if($add_sep) { - $listhead .= "  "; - } - /* And at least add a department selection box */ $listhead .= _("Base")." ". "  "; - /* Multiple options */ - $listhead .= "  "; + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acl)) { + $s.= "...|". + " "._("Mime type")."|mime_new|\n"; + } + + /* Multiple options */ + $s.= "..|---|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\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"; + } } - $listhead .="";; + /* 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/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc index f192eb21d..caee8ddf1 100755 --- a/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -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 ****************/ -- 2.30.2