| 
     
      
      
      From: Paul L. <pdo...@us...> - 2011-05-09 20:12:28
      
     
   | 
Update of /cvsroot/serverfilters/server_side_filters
In directory vz-cvs-3.sog:/tmp/cvs-serv15864
Modified Files:
	options.php 
Log Message:
Some browsers not sending submit image button coordinates consistently - this fixes that in most cases
Index: options.php
===================================================================
RCS file: /cvsroot/serverfilters/server_side_filters/options.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** options.php	7 May 2011 07:45:55 -0000	1.3
--- options.php	9 May 2011 20:12:26 -0000	1.4
***************
*** 113,116 ****
--- 113,142 ----
  
  
+ // Under some rather anomalous situations, the submit button coordinates
+ // are not being included with form submits, rendering user actions moot.
+ // As a half-ass fix for this, we have JavaScript on each of those buttons
+ // that sets a hidden input called "ssf_action" to the correct action name.
+ // We look for that here and force the needed coordinate POST variable if
+ // found.  Users who don't have JavaScript just have to hope the browser
+ // does what it should in regard to sending input button coordinates.
+ //
+ if (sqGetGlobalVar('ssf_action', $ssf_action, SQ_POST) && !empty($ssf_action))
+ {
+    switch ($ssf_action)
+    {
+       case 'add':         $_POST['add_x'] = 1;         break;
+       case 'create':      $_POST['create_x'] = 1;      break;
+       case 'modify':      $_POST['modify_x'] = 1;      break;
+       case 'delete':      $_POST['delete_x'] = 1;      break;
+       case 'up':          $_POST['up_x'] = 1;          break;
+       case 'up_num':      $_POST['up_num_x'] = 1;      break;
+       case 'up_top':      $_POST['up_top_x'] = 1;      break;
+       case 'down':        $_POST['down_x'] = 1;        break;
+       case 'down_num':    $_POST['down_num_x'] = 1;    break;
+       case 'down_bottom': $_POST['down_bottom_x'] = 1; break;
+    }
+ }
+ 
+ 
  // detect if this is being used in a minimal/popup window
  //
***************
*** 1108,1112 ****
         || (sqGetGlobalVar('up_num_x', $up_num_x, SQ_POST)
          && sqGetGlobalVar('up_target', $up_target, SQ_POST)
!         && is_numeric($up_target) && $move_up_x = TRUE)
         || (sqGetGlobalVar('up_top_x', $up_top_x, SQ_POST) && $move_up_top = TRUE))
        && sqGetGlobalVar('rule_number', $rule_number, SQ_POST)
--- 1134,1138 ----
         || (sqGetGlobalVar('up_num_x', $up_num_x, SQ_POST)
          && sqGetGlobalVar('up_target', $up_target, SQ_POST)
!         && is_numeric($up_target) && $move_up_x = TRUE) // intentional *assignment*
         || (sqGetGlobalVar('up_top_x', $up_top_x, SQ_POST) && $move_up_top = TRUE))
        && sqGetGlobalVar('rule_number', $rule_number, SQ_POST)
***************
*** 1244,1248 ****
         || (sqGetGlobalVar('down_num_x', $down_num_x, SQ_POST)
          && sqGetGlobalVar('down_target', $down_target, SQ_POST)
!         && is_numeric($down_target) && $move_down_x = TRUE)
         || (sqGetGlobalVar('down_bottom_x', $down_bottom_x, SQ_POST) && $move_down_bottom = TRUE))
        && sqGetGlobalVar('rule_number', $rule_number, SQ_POST)
--- 1270,1274 ----
         || (sqGetGlobalVar('down_num_x', $down_num_x, SQ_POST)
          && sqGetGlobalVar('down_target', $down_target, SQ_POST)
!         && is_numeric($down_target) && $move_down_x = TRUE) // intentional *assignment*
         || (sqGetGlobalVar('down_bottom_x', $down_bottom_x, SQ_POST) && $move_down_bottom = TRUE))
        && sqGetGlobalVar('rule_number', $rule_number, SQ_POST)
 |