setup.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * setup.php
  4. *
  5. * Copyright (c) 1999-2004 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. * @version $Id$
  11. * @package plugins
  12. * @subpackage bug_report
  13. */
  14. /* This button fills out a form with your setup information already
  15. gathered -- all you have to do is type. */
  16. /**
  17. * Initialize the bug report plugin
  18. * @return void
  19. * @access private
  20. */
  21. function squirrelmail_plugin_init_bug_report() {
  22. global $squirrelmail_plugin_hooks;
  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. * Show the button in the main bar
  30. * @access private
  31. */
  32. function bug_report_button() {
  33. global $color, $bug_report_visible;
  34. if (! $bug_report_visible) {
  35. return;
  36. }
  37. displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
  38. echo "&nbsp;&nbsp;\n";
  39. }
  40. /**
  41. * Saves bug report options
  42. * @access private
  43. */
  44. function bug_report_save() {
  45. global $username,$data_dir;
  46. if( sqgetGlobalVar('bug_report_bug_report_visible', $vis, SQ_POST) ) {
  47. setPref($data_dir, $username, 'bug_report_visible', '1');
  48. } else {
  49. setPref($data_dir, $username, 'bug_report_visible', '');
  50. }
  51. }
  52. /**
  53. * Loads bug report options
  54. * @access private
  55. */
  56. function bug_report_load() {
  57. global $username, $data_dir;
  58. global $bug_report_visible;
  59. $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
  60. }
  61. /**
  62. * Adds bug report options to display page
  63. * @access private
  64. */
  65. function bug_report_options() {
  66. global $bug_report_visible;
  67. echo '<tr>' . html_tag('td',_("Bug Reports:"),'right','','nowrap') . "\n" .
  68. '<td><input name="bug_report_bug_report_visible" type=checkbox';
  69. if ($bug_report_visible) {
  70. echo ' checked';
  71. }
  72. echo ' /> ' . _("Show button in toolbar") . "</td></tr>\n";
  73. echo '<tr><td></td>' .
  74. '<td><a href="' . SM_PATH . 'plugins/bug_report/show_system_specs.php" target="_blank"><small>' . _("Show system specs") . '</small></a></td></tr>';
  75. }
  76. ?>