');
$action = 'edit';
}
setPref($data_dir, $username, "filter".$theid, $filter_where.",".$filter_what.",".$filter_folder);
$filters[$theid]["where"] = $filter_where;
$filters[$theid]["what"] = $filter_what;
$filters[$theid]["folder"] = $filter_folder;
} elseif (isset($action) && $action == 'delete') {
remove_filter($theid);
} elseif (isset($action) && $action == 'move_up') {
filter_swap($theid, $theid - 1);
} elseif (isset($action) && $action == 'move_down') {
filter_swap($theid, $theid + 1);
} elseif (isset($user_submit)) {
echo "
"._("Saved Scan type")."\n";
setPref($data_dir, $username, 'filters_user_scan', $filters_user_scan_set);
}
$filters = load_filters();
$filters_user_scan = getPref($data_dir, $username, 'filters_user_scan');
echo '
' .
''.
"".
'' . _("Options") . ' - ' . _("Message Filtering") . ''.
' |
'.
'
'.
'[' . _("New") .
'] - [' . _("Done") . ']
';
if (isset($action) && ($action == 'add' || $action == 'edit')) {
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
if ( !isset($theid) ) {
$theid = count($filters);
}
echo ''.
''.
'';
}
echo '';
for ($i=0; $i < count($filters); $i++) {
$clr = (($i % 2)?$color[0]:$color[9]);
$fdr = ($folder_prefix)?str_replace($folder_prefix, "", $filters[$i]["folder"]):$filters[$i]["folder"];
echo "".
"[" . _("Edit") . ']'.
' | '.
"[" . _("Delete") . ']'.
' | [';
if (isset($filters[$i + 1])) {
echo "" . _("Down") . '';
if ($i > 0) {
echo ' | ';
}
}
if ($i > 0) {
echo "" . _("Up") . '';
}
echo '] | - | ';
printf( _("If %s contains %s then move to %s"), _($filters[$i]['where']), $filters[$i]['what'], $fdr );
echo ' |
';
}
echo '
'.
'';
?>