misunderstood use of second array_shift command
[squirrelmail.git] / plugins / bug_report / setup.php
CommitLineData
15e6162e 1<?php
2
3/**
4 * setup.php
5 *
9eb3fcb3 6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
15e6162e 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
598294a7 9 * This is a standard SquirrelMail 1.2 API for plugins.
15e6162e 10 *
2a880038 11 * @version $Id$
ea5f4b8e 12 * @package plugins
13 * @subpackage bug_report
15e6162e 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
ea5f4b8e 20/**
21 * Initialize the bug report plugin
22 * @return void
2a880038 23 * @access private
ea5f4b8e 24 */
d79e01f5 25function squirrelmail_plugin_init_bug_report() {
26 global $squirrelmail_plugin_hooks;
27
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';
15e6162e 32}
33
34
2a880038 35/**
36 * Show the button in the main bar
37 * @access private
38 */
d79e01f5 39function bug_report_button() {
ce68b76b 40 global $bug_report_visible;
d79e01f5 41
42 if (! $bug_report_visible) {
43 return;
44 }
45
2a880038 46 displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
d79e01f5 47 echo "&nbsp;&nbsp;\n";
15e6162e 48}
49
2a880038 50/**
51 * Saves bug report options
52 * @access private
53 */
d79e01f5 54function bug_report_save() {
55 global $username,$data_dir;
15e6162e 56
3c66c567 57 if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) {
d79e01f5 58 setPref($data_dir, $username, 'bug_report_visible', '1');
59 } else {
60 setPref($data_dir, $username, 'bug_report_visible', '');
61 }
15e6162e 62}
63
2a880038 64/**
65 * Loads bug report options
66 * @access private
67 */
d79e01f5 68function bug_report_load() {
69 global $username, $data_dir;
70 global $bug_report_visible;
15e6162e 71
d79e01f5 72 $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
15e6162e 73}
74
2a880038 75/**
76 * Adds bug report options to display page
77 * @access private
78 */
d79e01f5 79function bug_report_options() {
80 global $bug_report_visible;
81
c435f076 82 echo '<tr>' . html_tag('td',_("Bug Reports:"),'right','','style="white-space: nowrap;"') . "\n" .
feec0d68 83 '<td><input name="bug_report_bug_report_visible" type="checkbox"';
d79e01f5 84 if ($bug_report_visible) {
feec0d68 85 echo ' checked="checked"';
d79e01f5 86 }
2a880038 87 echo ' /> ' . _("Show button in toolbar") . "</td></tr>\n";
15e6162e 88}
89
f8a1ed5a 90?>