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['template_construct_page_header.tpl']['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()) {
39 $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
40 $output = makeInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '')
42 return array('menuline' => $output);
46 * Loads bug report options
49 function bug_report_load() {
50 global $username, $data_dir;
51 global $bug_report_visible;
53 $bug_report_visible = (bool) getPref($data_dir, $username, 'bug_report_visible',false);
57 * Register bug report option block
61 function bug_report_block() {
62 include_once(SM_PATH
.'plugins/bug_report/functions.php');
63 if (bug_report_check_user()) {
65 $optpage_data['grps']['bug_report'] = _("Bug Reports");
66 $optionValues = array();
67 // FIXME: option needs refresh in SMOPT_REFRESH_RIGHT
68 // (menulink is processed before options are saved/loaded)
69 $optionValues[] = array(
70 'name' => 'bug_report_visible',
71 'caption' => _("Show button in toolbar"),
72 'type' => SMOPT_TYPE_BOOLEAN
,
73 'refresh' => SMOPT_REFRESH_ALL
,
74 'initial_value' => false
76 $optpage_data['vals']['bug_report'] = $optionValues;