Use forms.php functions.
[squirrelmail.git] / plugins / bug_report / bug_report.php
index 344b093b1adecb7d3e73019ea777ae428e9ca406..d7c890c9843e766d246f21e25b28396d49f18f7d 100644 (file)
@@ -8,12 +8,12 @@
  * a button to show the bug report mail message in order to actually
  * send it.
  *
- * Copyright (c) 1999-2003 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
  */
@@ -25,9 +25,18 @@ define('SM_PATH','../../');
 
 require_once(SM_PATH . 'include/validate.php');
 
-displayPageHeader($color, 'None');
+// loading form functions
+require_once(SM_PATH . 'functions/forms.php');
 
+displayPageHeader($color, 'None');
 
+/**
+ * converts array to string
+ *
+ * @param array $array array that has to be displayed
+ * @return string
+ * @access private
+ */
 function Show_Array($array) {
     $str = '';
     foreach ($array as $key => $value) {
@@ -45,6 +54,11 @@ $browscap = ini_get('browscap');
 if(!empty($browscap)) {
     $browser = get_browser();
 }
+
+sqgetGlobalVar('HTTP_USER_AGENT', $HTTP_USER_AGENT, SQ_SERVER);
+if ( ! sqgetGlobalVar('HTTP_USER_AGENT', $HTTP_USER_AGENT, SQ_SERVER) )
+    $HTTP_USER_AGENT="Browser information is not available.";
+
 $body_top = "I subscribe to the squirrelmail-users mailing list.\n" .
                 "  [ ]  True - No need to CC me when replying\n" .
                 "  [ ]  False - Please CC me when replying\n" .
@@ -60,7 +74,7 @@ $body_top = "I subscribe to the squirrelmail-users mailing list.\n" .
                 "(Optional) I got really bored and here's a fix:\n\n\n" .
                 "----------------------------------------------\n" .
             "\nMy browser information:\n" .
-            '  '.$_SERVER['HTTP_USER_AGENT'] . "\n" ;
+            '  '.$HTTP_USER_AGENT . "\n" ;
            if(isset($browser)) {
                 $body_top .= "  get_browser() information (List)\n" .
                 Show_Array((array) $browser);
@@ -99,7 +113,7 @@ if ($imap_stream) {
     array_shift($list);
     array_shift($list);
     $read = implode(' ', $list);
-    $body .= "  Cabailities:  $read";
+    $body .= "  Capabilities:  $read";
     fputs ($imap_stream, "a002 LOGOUT\r\n");
     fclose($imap_stream);
 } else {
@@ -136,15 +150,15 @@ $body = htmlspecialchars($body_top . $body);
 
 ?>
    <br>
-   <table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr>
+   <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0"><tr>
       <?php echo html_tag('td',"<b>"._("Submit a Bug Report")."</b>",'center',$color[0]); ?>
    </tr></table>
 
    <?PHP echo $warning_html; 
 
-   echo "<p><font size=\"+1\">";
+   echo '<p><big>';
    echo _("Before you send your bug report, please make sure to check this checklist for any common problems.");
-   echo "</font></p>";
+   echo "</big></p>\n";
 
    echo "<ul>";
    echo "<li>";
@@ -153,7 +167,7 @@ $body = htmlspecialchars($body_top . $body);
    echo "</li>\n";
 
    echo "<li>";
-   echo _("Check to see if you bug is already listed in the <a href=\"http://sourceforge.net/bugs/?group_id=311\">Bug List</a> on SourceForge. If it is, we already know about it and are trying to fix it.");
+   echo _("Check to see if your bug is already listed in the <a href=\"http://sourceforge.net/bugs/?group_id=311\">Bug List</a> on SourceForge. If it is, we already know about it and are trying to fix it.");
    echo "</li>\n";
    
    echo "<li>";
@@ -174,7 +188,7 @@ $body = htmlspecialchars($body_top . $body);
    echo "</p>\n";
 ?>
    <form action="../../src/compose.php" method=post>
-   <table align=center border=0>
+   <table align="center" border="0">
    <tr>
      <td>
        <?php echo _("This bug involves"); ?>: <select name="send_to">
@@ -186,15 +200,16 @@ $body = htmlspecialchars($body_top . $body);
      </td>
    </tr>
    <tr>
-     <td align=center>
-       <input type="hidden" name="send_to_cc" value="">
-       <input type="hidden" name="send_to_bcc" value="">
-       <input type="hidden" name="subject" value="Bug Report">
-       <input type="hidden" name="body" value="<?PHP echo $body ?>">
-       <input type="submit" value="<?php echo _("Start Bug Report Form"); ?>">
+     <td align="center">
+    <?php
+       echo addHidden("send_to_cc","");
+       echo addHidden("send_to_bcc","");
+       echo addHidden("subject","Bug Report");
+       echo addHidden("body",$body);
+       echo addSubmit(_("Start Bug Report Form"));
+    ?>
      </td>
    </tr>
    </table>
    </form>
-<?php noframes_bottom(); ?>
-
+</body></html>