Initial groundwork to use phpdocumentor.
[squirrelmail.git] / plugins / bug_report / setup.php
1 <?php
2
3 /**
4 * setup.php
5 *
6 * Copyright (c) 1999-2003 The SquirrelMail development team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This is a standard Squirrelmail-1.2 API for plugins.
10 *
11 * $Id$
12 * @package plugins
13 * @subpackage bug_report
14 */
15
16 /* This button fills out a form with your setup information already
17 gathered -- all you have to do is type. */
18
19
20 /**
21 * Initialize the bug report plugin
22 * @return void
23 */
24 function squirrelmail_plugin_init_bug_report() {
25 global $squirrelmail_plugin_hooks;
26
27 $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
28 $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options';
29 $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save';
30 $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
31 }
32
33
34 /* Show the button in the main bar */
35 function bug_report_button() {
36 global $color, $bug_report_visible;
37
38 if (! $bug_report_visible) {
39 return;
40 }
41
42 displayInternalLink('plugins/bug_report/bug_report.php', 'Bug', '');
43 echo "&nbsp;&nbsp;\n";
44 }
45
46
47 function bug_report_save() {
48 global $username,$data_dir;
49
50 if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) {
51 setPref($data_dir, $username, 'bug_report_visible', '1');
52 } else {
53 setPref($data_dir, $username, 'bug_report_visible', '');
54 }
55 }
56
57
58 function bug_report_load() {
59 global $username, $data_dir;
60 global $bug_report_visible;
61
62 $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
63 }
64
65
66 function bug_report_options() {
67 global $bug_report_visible;
68
69 echo '<tr><td align=right nowrap>' . _("Bug Reports:") . "</td>\n" .
70 '<td><input name="bug_report_bug_report_visible" type=CHECKBOX';
71 if ($bug_report_visible) {
72 echo ' CHECKED';
73 }
74 echo '> ' . _("Show button in toolbar") . "</td></tr>\n";
75 }
76
77 ?>