From: hickert Date: Mon, 5 Nov 2007 06:54:24 +0000 (+0000) Subject: Added layer menu to macro and blocklsits X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a5fcc57157e51662a4019338e58885c1faad9c8c;p=gosa.git Added layer menu to macro and blocklsits git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7735 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index d72a44dd1..8c7df5033 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -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 diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index e1ebc324d..f3812ff68 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -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 .= "  ". - " "; - } - /* Append department selector */ $listhead .= " "._("Base")." ". "  "; + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acl)) { + $s.= "...|". + " "._("Blocklist")."|goFaxBlocklist_new|\n"; + } + /* Multiple options */ - $listhead .= "  "; + $s.= "..|---|\n"; + $s.= "..|". + " "._("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.= "..|". + " "._("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/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index 3dae68dfe..b66f327fd 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -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 .= "  "; - $listhead .= "  "; - } $listhead .= _("Base")." ". "  "; + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acls)){ + $s.= "...|". + " "._("Macro")."|goFonMacro_new|\n"; + } + /* Multiple options */ - $listhead .= "  "; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\n"; /* Add multiple copy & cut icons */ - if(is_object($this->parent->CopyPasteHandler)){ - $listhead .= "  "; - $listhead .= "  "; - $listhead .= ""; + if(preg_match("/(c.*w|w.*c)/",$acls) && is_object( $this->parent->CopyPasteHandler)){ + $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)/",$acls)){ + $s .= "..|---|\n"; + $s .= $this->get_snapshot_header(TRUE); } - $listhead .=""; + $this->SetDropDownHeaderMenu($s); + + + + $this->SetListHeader($listhead); } diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index f4394836b..a2a7858d3 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -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){