More global cleanup. Now all SESSION and COOKIE use sqgetglobalvar, what's
[squirrelmail.git] / plugins / bug_report / setup.php
CommitLineData
15e6162e 1<?php
2
3/**
4 * setup.php
5 *
76911253 6 * Copyright (c) 1999-2003 The SquirrelMail development team
15e6162e 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 */
13
14/* This button fills out a form with your setup information already
15 gathered -- all you have to do is type. */
16
17
18/* Initialize the bug report plugin */
d79e01f5 19function squirrelmail_plugin_init_bug_report() {
20 global $squirrelmail_plugin_hooks;
21
22 $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
23 $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options';
24 $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save';
25 $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
15e6162e 26}
27
28
29/* Show the button in the main bar */
d79e01f5 30function bug_report_button() {
31 global $color, $bug_report_visible;
32
33 if (! $bug_report_visible) {
34 return;
35 }
36
37 displayInternalLink('plugins/bug_report/bug_report.php', 'Bug', '');
38 echo "&nbsp;&nbsp;\n";
15e6162e 39}
40
41
d79e01f5 42function bug_report_save() {
43 global $username,$data_dir;
15e6162e 44
3c66c567 45 if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) {
d79e01f5 46 setPref($data_dir, $username, 'bug_report_visible', '1');
47 } else {
48 setPref($data_dir, $username, 'bug_report_visible', '');
49 }
15e6162e 50}
51
52
d79e01f5 53function bug_report_load() {
54 global $username, $data_dir;
55 global $bug_report_visible;
15e6162e 56
d79e01f5 57 $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
15e6162e 58}
59
60
d79e01f5 61function bug_report_options() {
62 global $bug_report_visible;
63
64 echo '<tr><td align=right nowrap>' . _("Bug Reports:") . "</td>\n" .
65 '<td><input name="bug_report_bug_report_visible" type=CHECKBOX';
66 if ($bug_report_visible) {
67 echo ' CHECKED';
68 }
69 echo '> ' . _("Show button in toolbar") . "</td></tr>\n";
15e6162e 70}
71
04f6008a 72?>