e50488de4c3da5b299ee135aff2143a14ed462df
[old-projects.git] / philter / philter / include / plugin_bogofilter.inc.php
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; }
13 function name() { return _i18n('1_bogo'); }
14
15 /* the plugin is only global */
16 function is_global() { return true; }
17
18 function to_string($_data) {
19 $res = "\n";
20 return $res;
21 }
22
23 function to_form($_data) {
24 $res = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\">\n"
25 . "<tr><th width=\"25%\">"._i18n('1_bogo')."</th>\n";
26
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";
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 ?>