6 * This is a standard SquirrelMail 1.2 API for plugins.
8 * @copyright © 1999-2005 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
12 * @subpackage bug_report
16 * Initialize the bug report plugin
20 function squirrelmail_plugin_init_bug_report() {
21 global $squirrelmail_plugin_hooks;
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';
30 * Show the button in the main bar
33 function bug_report_button() {
34 global $bug_report_visible;
36 if (! $bug_report_visible) {
40 displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
41 echo " \n";
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() {
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;