6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This is a standard SquirrelMail 1.2 API for plugins.
13 * @subpackage bug_report
16 /* This button fills out a form with your setup information already
17 gathered -- all you have to do is type. */
21 * Initialize the bug report plugin
25 function squirrelmail_plugin_init_bug_report() {
26 global $squirrelmail_plugin_hooks;
28 $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
29 $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options';
30 $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save';
31 $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
36 * Show the button in the main bar
39 function bug_report_button() {
40 global $bug_report_visible;
42 if (! $bug_report_visible) {
46 displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
47 echo " \n";
51 * Saves bug report options
54 function bug_report_save() {
55 global $username,$data_dir;
57 if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST
) ) {
58 setPref($data_dir, $username, 'bug_report_visible', '1');
60 setPref($data_dir, $username, 'bug_report_visible', '');
65 * Loads bug report options
68 function bug_report_load() {
69 global $username, $data_dir;
70 global $bug_report_visible;
72 $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
76 * Adds bug report options to display page
79 function bug_report_options() {
80 global $bug_report_visible;
82 echo '<tr>' . html_tag('td',_("Bug Reports:"),'right','','style="white-space: nowrap;"') . "\n" .
83 '<td><input name="bug_report_bug_report_visible" type="checkbox"';
84 if ($bug_report_visible) {
85 echo ' checked="checked"';
87 echo ' /> ' . _("Show button in toolbar") . "</td></tr>\n";