<?php
- /**
- ** printer_friendly_main.php
- **
- ** Copyright (c) 1999-2000 The SquirrelMail development team
- ** Licensed under the GNU GPL. For full terms see the file COPYING.
- **
- ** $Id$
- **/
+/**
+ * printer_friendly frameset
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ */
-?><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
-<html>
- <head>
- <title>Print Email</title>
- </head>
- <frameset rows="50, *" noresize border="0">
- <frame src="printer_friendly_top.php" name="top_frame" scrolling="off">
- <frame src="printer_friendly_bottom.php?passed_ent_id=<?php
- echo $passed_ent_id . '&mailbox=' . urlencode($mailbox) .
- '&passed_id=' . $passed_id;
-?>" name="bottom_frame">
- </frameset>
-</html>
+/** This is the printer_friendly_main page */
+define('PAGE_NAME', 'printer_friendly_main');
+
+/**
+ * Include the SquirrelMail initialization file.
+ */
+include('../include/init.php');
+
+/* get those globals into gear */
+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) . '&mailbox=' . urlencode($mailbox) .
+ '&passed_id=' . $passed_id .
+ '&view_unsafe_images='.$view_unsafe_images .
+ '&show_html_default='.$show_html_default;
+
+ $oTemplate->assign('printer_friendly_url', $url);
+
+ $oTemplate->display('printer_friendly_main.tpl');
+
+}