$filter = new Filter(get_user_id());
if(count($_POST)) { // a FORM has been submitted
+ if(isset($_POST['global'])) { // FORM global
+ foreach($philter->config['global_plugins'] as $id=>$g_plugin)
+ if(isset($_POST['global'][$id]))
+ $filter->set_global_data($id,$_POST['global'][$id]);
+ $filter->rules[0]->sql_store(get_user_id(),0);
+ }
if(isset($_POST['emails'])) // FORM emails
if(!$mail_pool->handle_form())
echo "<p style=\"color:red;\">".$philter->error()."</p>\n";
?>
<div class="rubrique"><?php i18n('global_title'); ?></div>
<?php
-if(count($philter->config['global_plugin'])) {
+i18n('global_help');
+if(count($philter->config['global_plugins'])) {
echo "<form action=\"{$_SERVER['REQUEST_URI']}\" method=\"post\">\n"
."<table width=\"95%\" class=\"bicol\" cellspacing=\"1\" cellpadding=\"1\" align=\"center\">\n";
- foreach($philter->config['global_plugin'] as $g_plugin) {
+ foreach($philter->config['global_plugins'] as $id=>$g_plugin) {
echo "<tr><td>\n";
- echo $g_plugin->to_form(/* data */);
+ echo $g_plugin->to_form($filter->get_global_data($id));
echo "</td></tr>\n";
}
-
- echo "</table>\n"
+ echo "<tr><td align='center'><input type='submit' name='global[submit]' value='"._i18n('apply_changes')."'/></td></tr>\n"
+ ."</table>\n"
."</form>\n";
}
<br />
<div class="rubrique"><?php i18n('pool_title'); ?></div>
<?php
+i18n('pool_help');
echo $mail_pool->to_form();
/********** filters **********/
<br />
<div class="rubrique"><?php i18n('filter_title'); ?></div>
+<?php
+i18n('filter_help');
+?>
<table width="95%" cellspacing="0" cellpadding="2" align="center">
<tr><td width="25%" valign="top">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post" id="order" name="order" onsubmit="return false;">
<tr><td>
<?php
foreach($filter->rules as $id=>$rule)
- echo "<input type=\"hidden\" id=\"order$id\" name=\"order[$id]\" value=\"{$rule->rank}\" />\n";
+ if($id)
+ echo "<input type=\"hidden\" id=\"order$id\" name=\"order[$id]\" value=\"{$rule->rank}\" />\n";
$presel = (isset($_POST['rule']['id']) ? $_POST['rule']['id']
: (isset($_POST['order']['select']) ? $_POST['order']['select'] : 0));
echo "</option>\n";
foreach($filter->rules as $id=>$rule)
- echo "<option value=\"$id\""
- .($presel==$id ? " selected=\"selected\"":"")
- .">{$rule->name}</option>\n";
+ if($id)
+ echo "<option value=\"$id\""
+ .($presel==$id ? " selected=\"selected\"":"")
+ .">{$rule->name}</option>\n";
?>
</select>
</td></tr><tr><td>
<td valign="top">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post" id="rule" name="rule" onsubmit="return false;">
<table width="100%" class="bicol" cellspacing="1" cellpadding="1">
- <tr class="impair"><th><?php i18n('filter_rule_conf');?>
- </th></tr><tr class="impair"><td>
- <input type="hidden" value="0" id="ruleId" name="rule[id]" />
- Name of this rule :
- <input type="text" size="60" value="" id="ruleName" name="rule[name]"
+ <tr><th><?php i18n('rule_name'); ?>
+ </th></tr><tr><td>
+ <input type="text" value="" id="ruleName" name="rule[name]" style="width: 100%;"
onfocus="text_onfocus(this,'<?php i18n('new_rule');?>')"
onblur="text_onblur(this,'<?php i18n('new_rule');?>')" />
- <br />
+ </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="0" id="ruleAll0" name="rule[all]" /><?php i18n('one_match');?>
<br />
</td></tr><tr class="impair"><th><?php i18n('filter_actions_list');?>
</th></tr><tr class="impair"><td id="actionsRow">
</td></tr><tr class="impair"><td>
+ <input type="hidden" value="0" id="ruleId" name="rule[id]" />
<input type="submit" value="<?php i18n('new_match');?>" name="rule[new_match]" onclick="newMatch() "/>
<input type="submit" value="<?php i18n('new_action');?>" name="rule[new_action]" onclick="newAction()" />
<input type="submit" value="<?php i18n('submit');?>" name="rule[submit]" onclick="this.form.submit()" />