15e6162e |
1 | <?php |
2 | |
3 | /** |
4 | * setup.php |
5 | * |
9eb3fcb3 |
6 | * Copyright (c) 1999-2005 The SquirrelMail Project Team |
15e6162e |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
598294a7 |
9 | * This is a standard SquirrelMail 1.2 API for plugins. |
15e6162e |
10 | * |
2a880038 |
11 | * @version $Id$ |
ea5f4b8e |
12 | * @package plugins |
13 | * @subpackage bug_report |
15e6162e |
14 | */ |
15 | |
ea5f4b8e |
16 | /** |
17 | * Initialize the bug report plugin |
18 | * @return void |
2a880038 |
19 | * @access private |
ea5f4b8e |
20 | */ |
d79e01f5 |
21 | function squirrelmail_plugin_init_bug_report() { |
22 | global $squirrelmail_plugin_hooks; |
23 | |
24 | $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button'; |
d79e01f5 |
25 | $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load'; |
e1df9174 |
26 | $squirrelmail_plugin_hooks['optpage_loadhook_display']['bug_report'] = 'bug_report_block'; |
15e6162e |
27 | } |
28 | |
29 | |
2a880038 |
30 | /** |
31 | * Show the button in the main bar |
32 | * @access private |
33 | */ |
d79e01f5 |
34 | function bug_report_button() { |
ce68b76b |
35 | global $bug_report_visible; |
d79e01f5 |
36 | |
37 | if (! $bug_report_visible) { |
38 | return; |
39 | } |
40 | |
2a880038 |
41 | displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), ''); |
d79e01f5 |
42 | echo " \n"; |
15e6162e |
43 | } |
44 | |
2a880038 |
45 | /** |
46 | * Loads bug report options |
47 | * @access private |
48 | */ |
d79e01f5 |
49 | function bug_report_load() { |
50 | global $username, $data_dir; |
51 | global $bug_report_visible; |
15e6162e |
52 | |
e1df9174 |
53 | $bug_report_visible = (bool) getPref($data_dir, $username, 'bug_report_visible',false); |
15e6162e |
54 | } |
55 | |
2a880038 |
56 | /** |
e1df9174 |
57 | * Register bug report option block |
58 | * @since 1.5.1 |
2a880038 |
59 | * @access private |
60 | */ |
e1df9174 |
61 | function bug_report_block() { |
62 | global $optpage_data; |
63 | $optpage_data['grps']['bug_report'] = _("Bug Reports"); |
64 | $optionValues = array(); |
65 | // FIXME: option needs refresh in SMOPT_REFRESH_RIGHT |
66 | // (menulink is processed before options are saved/loaded) |
67 | $optionValues[] = array( |
68 | 'name' => 'bug_report_visible', |
69 | 'caption' => _("Show button in toolbar"), |
70 | 'type' => SMOPT_TYPE_BOOLEAN, |
71 | 'refresh' => SMOPT_REFRESH_ALL, |
72 | 'initial_value' => false |
73 | ); |
74 | $optpage_data['vals']['bug_report'] = $optionValues; |
15e6162e |
75 | } |
76 | |
f8a1ed5a |
77 | ?> |