From ccf31bf8c9a0fdb8e679870226127e1ef6635fb8 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 31 Oct 2007 13:38:59 +0000 Subject: [PATCH] Use Js to submit menu actions, this allows us to handle POST vars git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7699 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/focus.js | 10 +++++++++ ihtml/themes/default/MultiSelectWindow.tpl | 1 + include/accept-to-gettext.inc | 8 +++---- .../templates/layersmenu-sub_menu.ihtml | 4 ++-- plugins/admin/systems/class_divListSystem.inc | 21 ++++++++++--------- .../admin/systems/class_systemManagement.inc | 4 ++-- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/html/include/focus.js b/html/include/focus.js index a13ccdf52..29003ea5b 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -620,4 +620,14 @@ function move_div_by_cursor(e) } } +function send_menu_action(str) +{ + if(str != "" && str != "#"){ + if(document.getElementById('menu_action')){ + document.getElementById('menu_action').value=str; + document.mainform.submit(); + } + } +} + // vim:ts=2:syntax diff --git a/ihtml/themes/default/MultiSelectWindow.tpl b/ihtml/themes/default/MultiSelectWindow.tpl index 2352c45ed..9a4cd8b50 100644 --- a/ihtml/themes/default/MultiSelectWindow.tpl +++ b/ihtml/themes/default/MultiSelectWindow.tpl @@ -128,5 +128,6 @@ {/if} + diff --git a/include/accept-to-gettext.inc b/include/accept-to-gettext.inc index 7d39ecf93..f791e4de8 100644 --- a/include/accept-to-gettext.inc +++ b/include/accept-to-gettext.inc @@ -198,11 +198,11 @@ function al2gt($gettextlangs, $mime) $gtparts=@preg_split("/\./",$curgtlang); $tmp=strtolower($gtparts[0]); $lang=preg_replace("/\_/", "-", $tmp); - $charset=$gtparts[1]; - header("Content-Language: $lang"); - header("Content-Type: $mime; charset=$charset"); - + if(isset($gtparts[1])){ + $charset=$gtparts[1]; + header("Content-Type: $mime; charset=$charset"); + } return $curgtlang; } diff --git a/include/php_layers_menu/templates/layersmenu-sub_menu.ihtml b/include/php_layers_menu/templates/layersmenu-sub_menu.ihtml index 4bb3696ec..979ef2afa 100644 --- a/include/php_layers_menu/templates/layersmenu-sub_menu.ihtml +++ b/include/php_layers_menu/templates/layersmenu-sub_menu.ihtml @@ -39,13 +39,13 @@ you can safely remove it.
-{iconalt} {text} >>       +border="0" alt=">>" />      
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 353956223..096c7b1f9 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -177,44 +177,44 @@ class divListSystem extends MultiSelectWindow title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> "; /* Handle create icons */ - $l = "?plug=".$_GET['plug']."&act="; $s = ".|"._("Actions")."|\n"; $s.= "..|". " "._("Create")."|\n"; if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){ $s.= "...|". - " "._("Terminal")."|".$l."newsystem_terminal|\n"; + " "._("Terminal")."|"."newsystem_terminal|\n"; } if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){ $s.= "...|". - " "._("Workstation")."|".$l."newsystem_workstation|\n"; + " "._("Workstation")."|"."newsystem_workstation|\n"; } if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){ $s.= "...|". - " "._("Server")."|".$l."newsystem_server|\n"; + " "._("Server")."|"."newsystem_server|\n"; } if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){ $s.= "...|". - " "._("Phone")."|".$l."newsystem_phone|\n"; + " "._("Phone")."|"."newsystem_phone|\n"; } if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){ $s.= "...|". - " "._("Printer")."|".$l."newsystem_printer|\n"; + " "._("Printer")."|"."newsystem_printer|\n"; } if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){ $s.= "...|". - " "._("Component")."|".$l."newsystem_component|\n"; + " "._("Component")."|"."newsystem_component|\n"; } $s.= "..|". - " "._("Remove all")."|".$l."remvove_multiple|\n"; + " "._("Remove all")."|"."remvove_multiple|\n"; /* Add multiple copy & cut icons */ if(is_object($this->parent->CopyPasteHandler)){ $s.= "..|---|\n"; $s.= "..|". - " "._("Copy all")."|".$l."multiple_copy_systems|\n"; + " "._("Copy all")."|"."multiple_copy_systems|\n"; $s.= "..|". - " "._("Cut all")."|".$l."multiple_cut_systems|\n"; + " "._("Cut all")."|"."multiple_cut_systems|\n"; + $s.= "..|"._("Cut all")."|"."multiple_cut_systems||editcut.png|\n"; } /* Get copy & paste icon */ @@ -229,6 +229,7 @@ class divListSystem extends MultiSelectWindow } } + $this->SetDropDownHeaderMenu($s); $this->SetListHeader($listhead); } diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 268e5b33e..b45f48782 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -125,9 +125,9 @@ class systems extends plugin $s_entry = $_GET['id']; } /* Create options */ - if(isset($_GET['act']) && preg_match("/^newsystem_/",$_GET['act'])){ + if(isset($_POST['menu_action']) && preg_match("/^newsystem_/",$_POST['menu_action'])){ $s_action = "newsystem"; - $s_entry = preg_replace("/^newsystem_/","",$_GET['act']); + $s_entry = preg_replace("/^newsystem_/","",$_POST['menu_action']); } /* Check for exeeded sizelimit */ -- 2.30.2