Use the new check_php_version function everywhere
[squirrelmail.git] / plugins / bug_report / setup.php
1 <?php
2
3 /**
4 * setup.php
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail development team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This is a standard Squirrelmail-1.2 API for plugins.
10 *
11 * $Id$
12 */
13
14 /* This button fills out a form with your setup information already
15 gathered -- all you have to do is type. */
16
17
18 /* Initialize the bug report plugin */
19 function squirrelmail_plugin_init_bug_report() {
20 global $squirrelmail_plugin_hooks;
21
22 $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
23 $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options';
24 $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save';
25 $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
26 }
27
28
29 /* Show the button in the main bar */
30 function bug_report_button() {
31 global $color, $bug_report_visible;
32
33 if (! $bug_report_visible) {
34 return;
35 }
36
37 displayInternalLink('plugins/bug_report/bug_report.php', 'Bug', '');
38 echo "&nbsp;&nbsp;\n";
39 }
40
41
42 function bug_report_save() {
43 global $username,$data_dir;
44
45 if ( !check_php_version(4,1) ) {
46 global $_POST;
47 }
48
49 if(isset($_POST['bug_report_bug_report_visible'])) {
50 setPref($data_dir, $username, 'bug_report_visible', '1');
51 } else {
52 setPref($data_dir, $username, 'bug_report_visible', '');
53 }
54 }
55
56
57 function bug_report_load() {
58 global $username, $data_dir;
59 global $bug_report_visible;
60
61 $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
62 }
63
64
65 function bug_report_options() {
66 global $bug_report_visible;
67
68 echo '<tr><td align=right nowrap>' . _("Bug Reports:") . "</td>\n" .
69 '<td><input name="bug_report_bug_report_visible" type=CHECKBOX';
70 if ($bug_report_visible) {
71 echo ' CHECKED';
72 }
73 echo '> ' . _("Show button in toolbar") . "</td></tr>\n";
74 }
75
76 ?>