Commit | Line | Data |
---|---|---|
dd8de1ec PH |
1 | <?php |
2 | /******************************************************************************** | |
3 | * include/plugin_bogofilter.inc.php : A Match Plugin using bogofilter | |
4 | * --------------------------------- | |
5 | * | |
6 | * This file is part of the philter distribution | |
7 | * Copyright: See COPYING files that comes with this distribution | |
8 | ********************************************************************************/ | |
9 | ||
10 | class BogoPlugin extends MatchPlugin { | |
11 | function BogoPlugin($_glob=false) { $this->MatchPlugin($_glob); } | |
12 | function rtti() { return 1; } | |
de47756d | 13 | function name() { return _i18n('1_bogo'); } |
dd8de1ec PH |
14 | |
15 | /* the plugin is only global */ | |
16 | function is_global() { return true; } | |
17 | ||
dd8de1ec | 18 | function to_string($_data) { |
583e7202 | 19 | $res = "\n"; |
dd8de1ec PH |
20 | return $res; |
21 | } | |
22 | ||
de47756d | 23 | function to_form($_data) { |
86b5093c | 24 | $res = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\">\n" |
fe9450a2 | 25 | . "<tr><th width=\"25%\">"._i18n('1_bogo')."</th>\n"; |
dd8de1ec | 26 | |
de47756d PH |
27 | $res .= "<td><input type='hidden' name='global[1][0]' value='1' />\n" |
28 | . " <input type='radio' name='global[1][1]' value='0' " | |
29 | . ($_data[1]==0 ? 'checked="checked "' : '')."/>"._i18n('1_bogo_off')."<br />\n" | |
30 | . " <input type='radio' name='global[1][1]' value='1' " | |
31 | . ($_data[1]==1 ? 'checked="checked "' : '')."/>"._i18n('1_bogo_on')."<br />\n" | |
32 | . " <input type='radio' name='global[1][1]' value='2' " | |
33 | . ($_data[1]==2 ? 'checked="checked "' : '')."/>"._i18n('1_bogo_drop')."<br />\n" | |
34 | . "</td>\n"; | |
dd8de1ec PH |
35 | |
36 | $res .= "</tr>\n" | |
37 | . "</table>\n"; | |
38 | ||
39 | return $res; | |
40 | } | |
41 | } | |
42 | ||
43 | /******************************************************************************** | |
44 | * $Id$ | |
45 | * vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100: | |
46 | ********************************************************************************/ | |
47 | ?> |