setup.php 1.9 KB

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