Code

Use Js to submit menu actions, this allows us to handle POST vars
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 13:38:59 +0000 (13:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 13:38:59 +0000 (13:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7699 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js
ihtml/themes/default/MultiSelectWindow.tpl
include/accept-to-gettext.inc
include/php_layers_menu/templates/layersmenu-sub_menu.ihtml
plugins/admin/systems/class_divListSystem.inc
plugins/admin/systems/class_systemManagement.inc

index a13ccdf524c22080df776daf1b6a6c1eaed09785..29003ea5b62fb2800c0497bcf01686d0b415bbe5 100644 (file)
@@ -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
index 2352c45ed968444cf3ba3a486aa5a0b16082573f..9a4cd8b50f8bac3712d6799bd2e394c6449417b7 100644 (file)
 </div>
 {/if}
 
+<input type="hidden" name="menu_action" id='menu_action'>
 <input type="hidden" name="ignore">
 <input type="hidden" name="MultiSelectWindow{$filterName}" value="1">
index 7d39ecf934ca6253037335eb8bf4d51835e8c96f..f791e4de8754a8729fc8f49cc69960964db18680 100644 (file)
@@ -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;
 }
 
index 4bb3696ecbe0d717b304ef9e34467336c603f827..979ef2afa48aee1c644a555274fa713410b165cb 100644 (file)
@@ -39,13 +39,13 @@ you can safely remove it.
 <div class="subframe">
 <!-- BEGIN sub_menu_cell -->
 <div id="{refid}" class="item">
-<a href="{href}"{onmouseover}{title}{target}><img
+<div style='cursor: pointer;' onClick="send_menu_action('{href}');"{onmouseover}{title}{target}><img
 align="top" src="{imgwww}{transparent}" width="1" height="16" border="0"
 alt="" /><!-- BEGIN cell_icon --><img
 align="top" src="{iconsrc}" width="{iconwidth}" height="{iconheight}" border="0"
 alt="{iconalt}" />&nbsp;<!-- END cell_icon -->{text}<!-- BEGIN cell_arrow -->&nbsp;<img
 class="fwdarr" src="{imgwww}{arrowsrc}" width="{arrowwidth}" height="{arrowheight}"
-border="0" alt=">>" /><!-- END cell_arrow -->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
+border="0" alt=">>" /><!-- END cell_arrow -->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
 </div>
 <!-- END sub_menu_cell -->
 <!-- BEGIN separator -->
index 353956223a8e6469c94e5a1c4a4fef3a3d412733..096c7b1f9f58ff30bcccd99fbf220ed0799ead78 100644 (file)
@@ -177,44 +177,44 @@ class divListSystem extends MultiSelectWindow
       title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;";
 
     /* Handle create icons */ 
-    $l = "?plug=".$_GET['plug']."&act=";
     $s = ".|"._("Actions")."|\n";
     $s.= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
       $s.= "...|<img src='images/select_terminal.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Terminal")."|".$l."newsystem_terminal|\n";
+        "&nbsp;"._("Terminal")."|"."newsystem_terminal|\n";
     }
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
       $s.= "...|<img src='images/select_workstation.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Workstation")."|".$l."newsystem_workstation|\n";
+        "&nbsp;"._("Workstation")."|"."newsystem_workstation|\n";
     }
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
       $s.= "...|<img src='images/select_server.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Server")."|".$l."newsystem_server|\n";
+        "&nbsp;"._("Server")."|"."newsystem_server|\n";
     }
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
       $s.= "...|<img src='images/select_phone.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Phone")."|".$l."newsystem_phone|\n";
+        "&nbsp;"._("Phone")."|"."newsystem_phone|\n";
     }
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
       $s.= "...|<img src='images/select_printer.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Printer")."|".$l."newsystem_printer|\n";
+        "&nbsp;"._("Printer")."|"."newsystem_printer|\n";
     }
     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
       $s.= "...|<img src='images/select_component.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Component")."|".$l."newsystem_component|\n";
+        "&nbsp;"._("Component")."|"."newsystem_component|\n";
     }
     $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
-      "&nbsp;"._("Remove all")."|".$l."remvove_multiple|\n";
+      "&nbsp;"._("Remove all")."|"."remvove_multiple|\n";
 
     /* Add multiple copy & cut icons */
     if(is_object($this->parent->CopyPasteHandler)){
       $s.= "..|---|\n";
       $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy all")."|".$l."multiple_copy_systems|\n";
+        "&nbsp;"._("Copy all")."|"."multiple_copy_systems|\n";
       $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut all")."|".$l."multiple_cut_systems|\n";
+        "&nbsp;"._("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);
   }
index 268e5b33e2c0ee8634f14c2908195ef260715e04..b45f48782b6ee6201efa7fca05d6fdcebb03ab42 100644 (file)
@@ -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 */