<?php
-if(!empty($_POST['rule']))
- if(!$filter->handle_form())
- echo "<p style=\"color:red;\">".$philter->error()."</p>\n";
+if(count($_POST)) { // a FORM has been submitted
+ if(isset($_POST['emails'])) // FORM emails
+ if(!$mail_pool->handle_small_form())
+ echo "<p style=\"color:red;\">".$philter->error()."</p>\n";
+ if(!empty($_POST['order']['action'])) // FORM order
+ if($_POST['order']['action']=='submit') {
+ foreach($filter->rules as $id=>$rule)
+ if(isset($_POST['order'][$id]))
+ $filter->rules[$id]->move_to($_POST['order'][$id], $filter->uid, $id);
+ uasort($filter->rules, 'rule_cmp');
+ } elseif($_POST['order']['action']=='delete' && !empty($_POST['order']['select'])) {
+ $filter->delete_rule($_POST['order']['select']);
+ unset($_POST['order']['select']);
+ }
+ if(!empty($_POST['rule'])) // FORM rule
+ if(!$filter->handle_form())
+ echo "<p style=\"color:red;\">".$philter->error()."</p>\n";
+}
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('pool_title'); ?></div>
+<?php
+i18n('spool_help');
+echo $mail_pool->to_small_form();
?>
<br />
<div class="rubrique"><?php i18n('filter_title'); ?></div>
</td></tr>
<tr class="impair"><th><?php i18n('filter_rule_conf');?>
</th></tr><tr class="impair"><td>
- <input type="radio" value="1" id="ruleAll1" name="rule[all]" /><?php i18n('all_matches');?>
+ <input type="radio" value="1" id="ruleAll1" name="rule[all]" /><?php i18n('all_matches');?><br />
<input type="radio" value="0" id="ruleAll0" name="rule[all]" /><?php i18n('one_match');?>
<br />
<input type="checkbox" checked="checked" id="ruleBlock" name="rule[block]" />
</td>
</tr>
</table>
-
-<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>
+<?php
+i18n('filter_help2');
+?>
<script type="text/javascript">
createRuleForm();