15e6162e |
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 */ |
d79e01f5 |
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'; |
15e6162e |
26 | } |
27 | |
28 | |
29 | /* Show the button in the main bar */ |
d79e01f5 |
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 " \n"; |
15e6162e |
39 | } |
40 | |
41 | |
d79e01f5 |
42 | function bug_report_save() { |
43 | global $username,$data_dir; |
15e6162e |
44 | |
04f6008a |
45 | if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { |
46 | global $_POST; |
47 | } |
48 | |
49 | if(isset($_POST['bug_report_bug_report_visible'])) { |
d79e01f5 |
50 | setPref($data_dir, $username, 'bug_report_visible', '1'); |
51 | } else { |
52 | setPref($data_dir, $username, 'bug_report_visible', ''); |
53 | } |
15e6162e |
54 | } |
55 | |
56 | |
d79e01f5 |
57 | function bug_report_load() { |
58 | global $username, $data_dir; |
59 | global $bug_report_visible; |
15e6162e |
60 | |
d79e01f5 |
61 | $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible'); |
15e6162e |
62 | } |
63 | |
64 | |
d79e01f5 |
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"; |
15e6162e |
74 | } |
75 | |
04f6008a |
76 | ?> |