add PAGE_NAME constant to every page under src/.
[squirrelmail.git] / src / printer_friendly_top.php
index 1a9b20724e16593cfb47502faabf79aad6c9e57d..2473f1a55346d15ca063947b61534b2eaec45bfa 100644 (file)
@@ -6,38 +6,23 @@
  * top frame of printer_friendly_main.php
  * displays some javascript buttons for printing & closing
  *
- * @copyright (c) 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
 
+/** This is the printer_friendly_top page */
+define('PAGE_NAME', 'printer_friendly_top');
+
 /**
- * Path for SquirrelMail required files.
- * @ignore
+ * Include the SquirrelMail initialization file.
  */
-define('SM_PATH','../');
-
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
+include('../include/init.php');
 
-displayHtmlHeader( _("Printer Friendly"),
-             "<script language=\"javascript\" type=\"text/javascript\">\n".
-             "<!--\n".
-             "function printPopup() {\n".
-                "parent.frames[1].focus();\n".
-                "parent.frames[1].print();\n".
-             "}\n".
-             "-->\n".
-             "</script>\n", FALSE );
+displayHtmlHeader( _("Printer Friendly"));
+$oErrorHandler->setDelayedErrors(true);
 
+$oTemplate->display('printer_friendly_top.tpl');
 
-echo '<body text="'.$color[8].'" bgcolor="'.$color[3].'" link="'.$color[7].'" vlink="'.$color[7].'" alink="'.$color[7]."\">\n" .
-     html_tag( 'div',
-         '<form>'.
-         '<input type="button" value="' . _("Print") . '" onclick="printPopup()" /> '.
-         '<input type="button" value="' . _("Close") . '" onclick="window.parent.close()" />'.
-         '</form>',
-     'right' );
-?>
-</body></html>
+$oTemplate->display('footer.tpl');