2 # Show simple body tests
4 require './spam-lib.pl';
6 &set_config_file_in(\%in);
7 &can_use_check("header");
8 &ui_print_header($header_subtext, $text{'simple_title'}, "");
11 print "$text{'simple_desc'}<p>\n";
12 &start_form("save_simple.cgi", $text{'simple_header'},
13 "<a href='edit_header.cgi?file=".&urlize($in{'file'}).
14 "&title=".&urlize($in{'title'}).
15 "'>$text{'simple_switch'}</a>");
17 # Find the tests we can handle
18 @simples = &get_simple_tests($conf);
20 $table = &ui_columns_start([ $text{'simple_name'},
22 $text{'simple_regexp'},
23 $text{'simple_score'},
24 $text{'simple_describe'} ], 100);
26 foreach $s (@simples, { }, { }, { }) {
27 $table .= &ui_columns_row([
28 &ui_textbox("name_$i", $s->{'name'}, 20),
29 &ui_select("header_$i", $s->{'header'},
30 [ [ "subject", "Subject: header" ],
31 [ "from", "From: header" ],
32 [ "to", "To: header" ],
33 [ "cc", "Cc: header" ],
34 [ "received", "Received: header" ],
35 [ "uri", "URL in message" ],
36 [ "body", "Message body" ],
37 [ "full", "Un-decoded body" ] ],
38 0, 0, $s->{'header'} ? 1 : 0),
39 "/".&ui_textbox("regexp_$i", $s->{'regexp'}, 25)."/".
40 &ui_textbox("flags_$i", $s->{'flags'}, 2),
41 &ui_textbox("score_$i", $s->{'score'}, 5),
42 &ui_textbox("describe_$i", $s->{'describe'}, 30)
46 $table .= &ui_columns_end();
47 print &ui_table_row(undef, $table, 2);
49 &end_form(undef, $text{'save'});
50 &ui_print_footer($redirect_url, $text{'index_return'});