bad ksort-ing, valid/cancel must be on the top of the page, even if the
authorPierre Habouzit <madcoder@debian.org>
Thu, 11 Sep 2003 12:33:25 +0000 (12:33 +0000)
committerPierre Habouzit <madcoder@debian.org>
Thu, 11 Sep 2003 12:33:25 +0000 (12:33 +0000)
    filter form is too deep in the page

philter/philter/include/form_filter.inc.php
philter/philter/include/rule.inc.php

index 71aa8c4..e81acad 100644 (file)
@@ -5,6 +5,15 @@ if(!empty($_POST['rule']))
 
 require("include/js_factory.inc.php");
 ?>
+<div class="rubrique"><?php i18n('filter_sync'); ?></div>
+<?php i18n('filter_sync_txt') ?>
+<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
+<center>
+    <input type="submit" value='<?php i18n('filter_valid') ?>' name="filter_valid" />
+    <input type="submit" value='<?php i18n('filter_cancel') ?>' name="filter_cancel" />
+</center>
+</form>
+<br />
 <div class="rubrique"><?php i18n('filter_title'); ?></div>
 <?php
 i18n('filter_help');
@@ -80,16 +89,6 @@ i18n('filter_help');
 i18n('filter_help2');
 ?>
 
-<br />
-<div class="rubrique"><?php i18n('filter_sync'); ?></div>
-<?php i18n('filter_sync_txt') ?>
-<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
-<center>
-    <input type="submit" value='<?php i18n('filter_valid') ?>' name="filter_valid" />
-    <input type="submit" value='<?php i18n('filter_cancel') ?>' name="filter_cancel" />
-</center>
-</form>
-
 <script type="text/javascript">
     createRuleForm();
 </script>
index 402b198..d03d888 100644 (file)
@@ -125,8 +125,8 @@ class Rule {
 
     function to_js() {
         $matches = array();
-        ksort($this->matches);
         foreach($this->matches as $data) {
+            ksort($data);
             $data = array_map('to_js_str', $data);
             $matches[] = '[' . implode(',', $data) . ']';
         }
@@ -134,6 +134,7 @@ class Rule {
 
         $actions = array();
         foreach($this->actions as $data) {
+            ksort($data);
             $data = array_map('to_js_str', $data);
             $actions[] = '[' . implode(',', $data) . ']';
         }