15e6162e |
1 | <?php |
2 | |
3 | /** |
4 | * setup.php |
5 | * |
82d304a0 |
6 | * Copyright (c) 1999-2004 The SquirrelMail development team |
15e6162e |
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 | * |
2a880038 |
11 | * @version $Id$ |
ea5f4b8e |
12 | * @package plugins |
13 | * @subpackage bug_report |
15e6162e |
14 | */ |
15 | |
16 | /* This button fills out a form with your setup information already |
17 | gathered -- all you have to do is type. */ |
18 | |
19 | |
ea5f4b8e |
20 | /** |
21 | * Initialize the bug report plugin |
22 | * @return void |
2a880038 |
23 | * @access private |
ea5f4b8e |
24 | */ |
d79e01f5 |
25 | function squirrelmail_plugin_init_bug_report() { |
26 | global $squirrelmail_plugin_hooks; |
27 | |
28 | $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button'; |
29 | $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options'; |
30 | $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save'; |
31 | $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load'; |
15e6162e |
32 | } |
33 | |
34 | |
2a880038 |
35 | /** |
36 | * Show the button in the main bar |
37 | * @access private |
38 | */ |
d79e01f5 |
39 | function bug_report_button() { |
40 | global $color, $bug_report_visible; |
41 | |
42 | if (! $bug_report_visible) { |
43 | return; |
44 | } |
45 | |
2a880038 |
46 | displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), ''); |
d79e01f5 |
47 | echo " \n"; |
15e6162e |
48 | } |
49 | |
2a880038 |
50 | /** |
51 | * Saves bug report options |
52 | * @access private |
53 | */ |
d79e01f5 |
54 | function bug_report_save() { |
55 | global $username,$data_dir; |
15e6162e |
56 | |
3c66c567 |
57 | if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) { |
d79e01f5 |
58 | setPref($data_dir, $username, 'bug_report_visible', '1'); |
59 | } else { |
60 | setPref($data_dir, $username, 'bug_report_visible', ''); |
61 | } |
15e6162e |
62 | } |
63 | |
2a880038 |
64 | /** |
65 | * Loads bug report options |
66 | * @access private |
67 | */ |
d79e01f5 |
68 | function bug_report_load() { |
69 | global $username, $data_dir; |
70 | global $bug_report_visible; |
15e6162e |
71 | |
d79e01f5 |
72 | $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible'); |
15e6162e |
73 | } |
74 | |
2a880038 |
75 | /** |
76 | * Adds bug report options to display page |
77 | * @access private |
78 | */ |
d79e01f5 |
79 | function bug_report_options() { |
80 | global $bug_report_visible; |
81 | |
a75e70b1 |
82 | echo '<tr>' . html_tag('td',_("Bug Reports:"),'right','','nowrap') . "\n" . |
feec0d68 |
83 | '<td><input name="bug_report_bug_report_visible" type="checkbox"'; |
d79e01f5 |
84 | if ($bug_report_visible) { |
feec0d68 |
85 | echo ' checked="checked"'; |
d79e01f5 |
86 | } |
2a880038 |
87 | echo ' /> ' . _("Show button in toolbar") . "</td></tr>\n"; |
595848f9 |
88 | |
89 | echo '<tr><td></td>' . |
15ee328a |
90 | '<td><a href="' . SM_PATH . 'plugins/bug_report/show_system_specs.php" target="_blank"><small>' . _("Show system specs") . '</small></a></td></tr>'; |
15e6162e |
91 | } |
92 | |
595848f9 |
93 | ?> |