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; |
44 | global $bug_report_bug_report_visible; |
15e6162e |
45 | |
d79e01f5 |
46 | if (isset($bug_report_bug_report_visible)) { |
47 | setPref($data_dir, $username, 'bug_report_visible', '1'); |
48 | } else { |
49 | setPref($data_dir, $username, 'bug_report_visible', ''); |
50 | } |
15e6162e |
51 | } |
52 | |
53 | |
d79e01f5 |
54 | function bug_report_load() { |
55 | global $username, $data_dir; |
56 | global $bug_report_visible; |
15e6162e |
57 | |
d79e01f5 |
58 | $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible'); |
15e6162e |
59 | } |
60 | |
61 | |
d79e01f5 |
62 | function bug_report_options() { |
63 | global $bug_report_visible; |
64 | |
65 | echo '<tr><td align=right nowrap>' . _("Bug Reports:") . "</td>\n" . |
66 | '<td><input name="bug_report_bug_report_visible" type=CHECKBOX'; |
67 | if ($bug_report_visible) { |
68 | echo ' CHECKED'; |
69 | } |
70 | echo '> ' . _("Show button in toolbar") . "</td></tr>\n"; |
15e6162e |
71 | } |
72 | |
d79e01f5 |
73 | ?> |