Indentation
[squirrelmail.git] / plugins / bug_report / setup.php
index a9eb570c7ab8ec542733267a629dd6b81fedac60..5e77776e9bb2dc304cacb9238ae9c91f5de1ec09 100644 (file)
@@ -3,77 +3,91 @@
 /**
  * setup.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail development team
+ * Copyright (c) 1999-2004 The SquirrelMail development team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This is a standard Squirrelmail-1.2 API for plugins.
  *
- * $Id$
+ * @version $Id$
+ * @package plugins
+ * @subpackage bug_report
  */
 
 /* 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;
+/**
+ * Initialize the bug report plugin
+ * @return void
+ * @access private
+ */
+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';
+    $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 "  \n";
-}
-
+/**
+ * Show the button in the main bar
+ * @access private
+ */
+function bug_report_button() {
+    global $color, $bug_report_visible;
 
-function bug_report_save() 
-{
-  global $username,$data_dir;
-  global $bug_report_bug_report_visible;
+    if (! $bug_report_visible) {
+        return;
+    }
 
-  if (isset($bug_report_bug_report_visible)) 
-  {
-    setPref($data_dir, $username, 'bug_report_visible', '1');
-  } 
-  else 
-  {
-    setPref($data_dir, $username, 'bug_report_visible', '');
-  }
+    displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
+    echo "  \n";
 }
 
+/**
+ * Saves bug report options
+ * @access private
+ */
+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;
+/**
+ * Loads bug report options
+ * @access private
+ */
+function bug_report_load() {
+    global $username, $data_dir;
+    global $bug_report_visible;
 
-  $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
+    $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible');
 }
 
-
-function bug_report_options()
-{
-  global $bug_report_visible;
-  
-  echo "<tr><td align=right nowrap>Bug Reports:</td>\n";
-  echo "<td><input name=\"bug_report_bug_report_visible\" type=CHECKBOX";
-  if ($bug_report_visible)
-    echo " CHECKED";
-  echo "> Show button in toolbar</td></tr>\n";
+/**
+ * Adds bug report options to display page
+ * @access private
+ */
+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";
+
+    echo '<tr><td></td>' .
+         '<td><a href="' . SM_PATH . 'plugins/bug_report/show_system_specs.php" target="_blank"><small>' . _("Show system specs") . '</small></a></td></tr>';
 }
 
 ?>