| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * setup.php |
| 5 | * |
| 6 | * Copyright (c) 1999-2002 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 | */ |
| 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 */ |
| 19 | function squirrelmail_plugin_init_bug_report() |
| 20 | { |
| 21 | global $squirrelmail_plugin_hooks; |
| 22 | |
| 23 | $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button'; |
| 24 | $squirrelmail_plugin_hooks['options_display_inside']['bug_report'] = 'bug_report_options'; |
| 25 | $squirrelmail_plugin_hooks['options_display_save']['bug_report'] = 'bug_report_save'; |
| 26 | $squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load'; |
| 27 | } |
| 28 | |
| 29 | |
| 30 | /* Show the button in the main bar */ |
| 31 | function bug_report_button() |
| 32 | { |
| 33 | global $color, $bug_report_visible; |
| 34 | |
| 35 | if (! $bug_report_visible) |
| 36 | return; |
| 37 | |
| 38 | displayInternalLink('plugins/bug_report/bug_report.php', 'Bug', ''); |
| 39 | echo " \n"; |
| 40 | } |
| 41 | |
| 42 | |
| 43 | function bug_report_save() |
| 44 | { |
| 45 | global $username,$data_dir; |
| 46 | global $bug_report_bug_report_visible; |
| 47 | |
| 48 | if (isset($bug_report_bug_report_visible)) |
| 49 | { |
| 50 | setPref($data_dir, $username, 'bug_report_visible', '1'); |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | setPref($data_dir, $username, 'bug_report_visible', ''); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | |
| 59 | function bug_report_load() |
| 60 | { |
| 61 | global $username, $data_dir; |
| 62 | global $bug_report_visible; |
| 63 | |
| 64 | $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible'); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | function bug_report_options() |
| 69 | { |
| 70 | global $bug_report_visible; |
| 71 | |
| 72 | echo "<tr><td align=right nowrap>Bug Reports:</td>\n"; |
| 73 | echo "<td><input name=\"bug_report_bug_report_visible\" type=CHECKBOX"; |
| 74 | if ($bug_report_visible) |
| 75 | echo " CHECKED"; |
| 76 | echo "> Show button in toolbar</td></tr>\n"; |
| 77 | } |
| 78 | |
| 79 | ?> |