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