All images must have an alternate text.
[squirrelmail.git] / src / printer_friendly_main.php
index f7339257a7be3b71b9c5b000cc3b031053a1c84b..8632c630a1680ac67df08ae7b0cbcdd3e954a9dc 100644 (file)
@@ -1,37 +1,43 @@
 <?php
 
 /**
- * printer_friendly_main.php
+ * printer_friendly frameset
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
- * $Id$
+ * @copyright &copy; 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
  * @package squirrelmail
  */
 
-/** Path for SquirrelMail required files. */
-define('SM_PATH','../');
-
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/page_header.php');
-
-displayHtmlHeader( _("Printer Friendly"), '', FALSE );
+/**
+ * Include the SquirrelMail initialization file.
+ */
+include('../include/init.php');
 
 /* get those globals into gear */
-$passed_ent_id = $_GET['passed_ent_id'];
-$passed_id = (int) $_GET['passed_id'];
-$mailbox = $_GET['mailbox'];
+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"));
+} else {
+    $passed_id= (int) $passed_id;
+    $view_unsafe_images = (bool) $_GET['view_unsafe_images'];
+    sqgetGlobalVar('show_html_default', $show_html_default, SQ_FORM);
 /* end globals */
+    displayHtmlHeader( _("Printer Friendly"), '', false, true );
+    
+    $oErrorHandler->setDelayedErrors(true);
+    
+    $url = 'printer_friendly_bottom.php?passed_ent_id=' .
+           urlencode($passed_ent_id) . '&amp;mailbox=' . urlencode($mailbox) .
+           '&amp;passed_id=' . $passed_id .
+           '&amp;view_unsafe_images='.$view_unsafe_images .
+           '&amp;show_html_default='.$show_html_default;
+           
+    $oTemplate->assign('printer_friendly_url', $url);
 
-echo "<frameset rows=\"60, *\" noresize border=\"0\">\n".
-     '<frame src="printer_friendly_top.php" name="top_frame" scrolling="no" />'.
-     '<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" />'.
-     "\n</frameset>\n".
-     "</html>\n";
+    $oTemplate->display('printer_friendly_main.tpl');
 
-?>
+}