Add ability to show login error from the IMAP server instead of traditional "Unknown...
[squirrelmail.git] / plugins / message_details / message_details_top.php
index e2808f0ecbaae1f5433fa46b0529309ef08a213c..1274890a33333f6c51cabb0a5b2366f640536535 100644 (file)
@@ -1,27 +1,27 @@
 <?php
 
-/** Message Source  
+/**
+ * Message Details plugin - top frame with buttons
  *
  * Plugin to view the RFC822 raw message output and the bodystructure of a message
  *
- * Copyright (c) 2002 Marc Groot Koerkamp, The Netherlands
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- * 
- * $Id$
+ * @author Marc Groot Koerkamp
+ * @copyright 2002 Marc Groot Koerkamp, The Netherlands
+ * @copyright 2002-2014 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
  * @package plugins
  * @subpackage message_details
  */
 
-/** @ignore */
-define('SM_PATH','../../');
-
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/strings.php');
-require_once(SM_PATH . 'config/config.php');
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
+require(SM_PATH . 'functions/forms.php');
 
 displayHtmlHeader( _("Message Details"),
-             "<script language=\"javascript\">\n".
+             "<script type=\"text/javascript\">\n".
              "<!--\n".
              "function printPopup() {\n".
                 "parent.frames[1].focus();\n".
@@ -30,21 +30,22 @@ displayHtmlHeader( _("Message Details"),
              "-->\n".
              "</script>\n", FALSE );
 
-sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
+if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
+    $passed_ent_id = 0;
 sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
 
 echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
-     '<center><b>' .
-     '<form action="' . SM_PATH . 'src/download.php" method="GET">' .     
-     '<input type="button" value="' . _("Print") . '" onClick="printPopup()" />&nbsp;&nbsp;'.
-     '<input type="button" value="' . _("Close Window") . '" onClick="window.parent.close()" />&nbsp;&nbsp;'.
-     '<input type="submit" value="' . _("Save Message") . '" /> '.
-     '<input type="hidden" name="mailbox" value="' . urlencode($mailbox) . '" />' .
-     '<input type="hidden" name="passed_id" value="' . urlencode($passed_id) . '" />' .
-     '<input type="hidden" name="ent_id" value="0" />' .
-     '<input type="hidden" name="absolute_dl" value="true" />' .
-     '</form>'.
-     '</b>'.
+     '<div style="text-align: center;">' .
+     addForm(SM_PATH . 'src/download.php', 'GET').
+     addHidden('mailbox', $mailbox).
+     addHidden('passed_id', $passed_id).
+     addHidden('ent_id', $passed_ent_id).
+     addHidden('absolute_dl', 'true').
+     (checkForJavascript() ?
+     '<input type="button" value="' . _("Print") . '" onclick="printPopup()" />&nbsp;&nbsp;'.
+     '<input type="button" value="' . _("Close Window") . '" onclick="window.parent.close()" />&nbsp;&nbsp;' :'').
+     addSubmit(_("Save Message")).
+     '</form></div>'.
      '</body>'.
      "</html>\n";
-?>