File: setup.php

package info (click to toggle)
squirrelmail 2%3A1.4.9a-5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,772 kB
  • ctags: 6,643
  • sloc: php: 33,709; perl: 3,173; sh: 174; ansic: 122; makefile: 60
file content (72 lines) | stat: -rw-r--r-- 1,970 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php

/**
 * setup.php
 *
 * Copyright (c) 1999-2006 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This is a standard Squirrelmail-1.2 API for plugins.
 *
 * $Id: setup.php,v 1.6.2.5 2006/02/03 22:27:52 jervfors Exp $
 */

/* This button fills out a form with your setup information already
   gathered -- all you have to do is type. */


/* Initialize the bug report plugin */
function squirrelmail_plugin_init_bug_report() {
    global $squirrelmail_plugin_hooks;

    $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
    $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options';
    $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save';
    $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
}


/* Show the button in the main bar */
function bug_report_button() {
    global $color, $bug_report_visible;

    if (! $bug_report_visible) {
        return;
    }

    displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
    echo "&nbsp;&nbsp;\n";
}


function bug_report_save() {
    global $username,$data_dir;

    if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) {
        setPref($data_dir, $username, 'bug_report_visible', '1');
    } else {
        setPref($data_dir, $username, 'bug_report_visible', '');
    }
}


function bug_report_load() {
    global $username, $data_dir;
    global $bug_report_visible;

    $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
}


function bug_report_options() {
    global $bug_report_visible;

    echo '<tr>' . html_tag('td',_("Bug Reports:"),'right','','nowrap') . "\n" .
         '<td><input name="bug_report_bug_report_visible" type=checkbox';
    if ($bug_report_visible) {
        echo ' checked';
    }
    echo ' /> ' . _("Show button in toolbar") . "</td></tr>\n";
}

?>