Replacing tabs with spaces, trimming white space at EOL and newline at EOF
[squirrelmail.git] / src / printer_friendly_main.php
index faaedc9ce8e177681305d291bd4a6bb6a0f9feaa..6dc1bca5e1f0c52751fe1450c866ac8744c9108e 100644 (file)
@@ -1,26 +1,42 @@
 <?php
 
 /**
- * printer_friendly_main.php
+ * printer_friendly frameset
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
- * $Id$
+ * @copyright (c) 1999-2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
  */
 
-require_once('../src/validate.php');
-require_once('../functions/page_header.php');
-
-displayHtmlHeader( _("Printer Friendly"), '', FALSE );
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
+define('SM_PATH','../');
 
-echo "<frameset rows=\"60, *\" noresize border=\"0\">\n".
-     "<frame src=\"printer_friendly_top.php\" name=\"top_frame\" scrolling=\"off\">".
-     '<frame src="printer_friendly_bottom.php?passed_ent_id='.
-     $passed_ent_id . '&mailbox=' . urlencode($mailbox) .
-     '&passed_id=' . $passed_id .
-     "\" name=\"bottom_frame\">".
-     "</frameset>\n".
-     "</html>\n";
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
 
-?>
\ No newline at end of file
+/* get those globals into gear */
+global $color;
+if ( ! sqgetGlobalVar('passed_ent_id',$passed_ent_id,SQ_GET))
+    $passed_ent_id = 0;
+if ( ! sqgetGlobalVar('mailbox',$mailbox,SQ_GET) ||
+     ! sqgetGlobalVar('passed_id',$passed_id,SQ_GET)) {
+    error_box(_("Invalid URL"),$color);
+} else {
+    $passed_id= (int) $passed_id;
+/* end globals */
+    displayHtmlHeader( _("Printer Friendly"), '', false, true );
+    echo '<frameset rows="60, *">' . "\n";
+    echo '<frame src="printer_friendly_top.php" name="top_frame" '
+        . 'scrolling="no" noresize="noresize" frameborder="0" />' . "\n";
+    echo '<frame src="printer_friendly_bottom.php?passed_ent_id='
+        . urlencode($passed_ent_id) . '&amp;mailbox=' . urlencode($mailbox)
+        . '&amp;passed_id=' . $passed_id
+        . '" name="bottom_frame" frameborder="0" />' . "\n";
+    echo "</frameset>\n";
+}
+?>
+</html>
\ No newline at end of file