3 * Bug Report plugin - setup script
5 * @copyright © 1999-2007 The SquirrelMail Project Team
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @subpackage bug_report
13 * Initialize the bug report plugin
17 function squirrelmail_plugin_init_bug_report() {
18 global $squirrelmail_plugin_hooks;
20 $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
21 $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
22 $squirrelmail_plugin_hooks['optpage_loadhook_display']['bug_report'] = 'bug_report_block';
27 * Show the button in the main bar
30 function bug_report_button() {
31 include_once(SM_PATH
.'plugins/bug_report/functions.php');
32 global $bug_report_visible;
34 if (! $bug_report_visible ||
! bug_report_check_user()) {
38 displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
39 echo " \n";
43 * Loads bug report options
46 function bug_report_load() {
47 global $username, $data_dir;
48 global $bug_report_visible;
50 $bug_report_visible = (bool) getPref($data_dir, $username, 'bug_report_visible',false);
54 * Register bug report option block
58 function bug_report_block() {
59 include_once(SM_PATH
.'plugins/bug_report/functions.php');
60 if (bug_report_check_user()) {
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
73 $optpage_data['vals']['bug_report'] = $optionValues;