49aac89c212a4c844ab1a714c69a9dda80447bfc
2 if(count($_POST)) { // a FORM has been submitted
3 if(!empty($_POST['order']['action'])) // FORM order
4 if($_POST['order']['action']=='submit') {
5 foreach($filter->rules
as $id=>$rule)
6 if(isset($_POST['order'][$id]))
7 $filter->rules
[$id]->move_to($_POST['order'][$id], $filter->uid
, $id);
8 uasort($filter->rules
, 'rule_cmp');
9 } elseif($_POST['order']['action']=='delete' && !empty($_POST['order']['select'])) {
10 $filter->delete_rule($_POST['order']['select']);
11 $_POST['order']['select'] = min(count($filter->rules
),$_POST['order']['select']);
13 if(!empty($_POST['rule']))
14 if(!$filter->handle_form())
15 echo "<p style=\"color:red;\">".$philter->error()."</p>\n";
18 require("include/js_factory.inc.php");
20 <div
class="rubrique"><?php
i18n('filter_sync'); ?
></div
>
21 <?php
i18n('filter_sync_txt') ?
>
22 <form action
="<?php echo $_SERVER['REQUEST_URI'] ?>" method
="post">
24 <input type
="submit" value
='<?php i18n('filter_valid
') ?>' name
="filter_valid" />
25 <input type
="submit" value
='<?php i18n('filter_cancel
') ?>' name
="filter_cancel" />
29 <div
class="rubrique"><?php
i18n('filter_title'); ?
></div
>
33 <table width
="95%" cellspacing
="0" cellpadding
="2" align
="center">
34 <tr
><td width
="25%" valign
="top">
35 <form action
="<?php echo $_SERVER['REQUEST_URI']?>" method
="post" id
="order" name
="order" onsubmit
="return false;">
36 <table
class="bicol" width
="100%" cellpadding
="1" cellspacing
="1">
37 <tr
><th
><?php
i18n('filter_list_title');?
></th
></tr
>
40 foreach($filter->rules
as $id=>$rule)
42 echo "<input type=\"hidden\" id=\"order$id\" name=\"order[$id]\" value=\"{$rule->rank}\" />\n";
44 $presel = (isset($_POST['rule']['id']) ?
$_POST['rule']['id']
45 : (isset($_POST['order']['select']) ?
$_POST['order']['select'] : 0));
47 echo "<select size=\"16\" style=\"width:100%;\" id=\"orderSelect\" name=\"order[select]\" onchange=\"createRuleForm()\">\n";
48 echo "<option value=\"0\" ".($presel ?
"" : " selected=\"selected\"").">";
52 foreach($filter->rules
as $id=>$rule)
54 echo "<option value=\"$id\""
55 .($presel==$id ?
" selected=\"selected\"":"")
56 .">{$rule->name}</option>\n";
60 <input type
="submit" value
="<?php i18n('up');?>" name
="order[up]" onclick
="order_up();" />
61 <input type
="submit" value
="<?php i18n('dn');?>" name
="order[dn]" onclick
="order_dn();" /><br
/>
62 <input type
="submit" value
="<?php i18n('del');?>" name
="order[delete]" onclick
="order_submit(this)" />
63 <input type
="submit" value
="<?php i18n('submit');?>" name
="order[submit]" onclick
="order_submit(this)" />
64 <input type
="hidden" value
="" name
="order[action]" />
70 <form action
="<?php echo $_SERVER['REQUEST_URI']?>" method
="post" id
="rule" name
="rule" onsubmit
="return false;">
71 <table width
="100%" class="bicol" cellspacing
="1" cellpadding
="1">
72 <tr
><th
><?php
i18n('rule_name'); ?
>
74 <input type
="text" value
="" id
="ruleName" name
="rule[name]" style
="width: 100%;"
75 onfocus
="text_onfocus(this,'<?php i18n('new_rule');?>')"
76 onblur
="text_onblur(this,'<?php i18n('new_rule');?>')" />
78 <tr
class="impair"><th
><?php
i18n('filter_rule_conf');?
>
79 </th
></tr
><tr
class="impair"><td
>
80 <input type
="radio" value
="1" id
="ruleAll1" name
="rule[all]" /><?php
i18n('all_matches');?
>
81 <input type
="radio" value
="0" id
="ruleAll0" name
="rule[all]" /><?php
i18n('one_match');?
>
83 <input type
="checkbox" checked
="checked" id
="ruleBlock" name
="rule[block]" />
84 <?php
i18n('blocking_rule');?
>
85 </td
></tr
><tr
class="impair"><th
><?php
i18n('filter_matches_list');?
>
86 </th
></tr
><tr
class="impair"><td id
="matchesRow">
87 </td
></tr
><tr
class="impair"><th
><?php
i18n('filter_actions_list');?
>
88 </th
></tr
><tr
class="impair"><td id
="actionsRow">
89 </td
></tr
><tr
class="impair"><td
>
90 <input type
="hidden" value
="0" id
="ruleId" name
="rule[id]" />
91 <input type
="submit" value
="<?php i18n('new_match');?>" name
="rule[new_match]" onclick
="newMatch() "/>
92 <input type
="submit" value
="<?php i18n('new_action');?>" name
="rule[new_action]" onclick
="newAction()" />
93 <input type
="submit" value
="<?php i18n('submit');?>" name
="rule[submit]" onclick
="this.form.submit()" />
101 i18n('filter_help2');
104 <script type
="text/javascript">