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