/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/strings.php');
-require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'include/load_prefs.php');
require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/html.php');
/* get some of these globals */
sqgetGlobalVar('username', $username, SQ_SESSION);
}
/* end globals */
-$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
+$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', false);
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) {
/* now, if they choose to, we clean up the display a bit... */
-if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) {
+if ($pf_cleandisplay) {
$num_leading_spaces = 9; // nine leading spaces for indentation
/* --start pf-specific functions-- */
-/* $string = pf_clean_string($string, 9); */
+/**
+ * Function should clean layout of printed messages when user
+ * enables "Printer Friendly Clean Display" option.
+ *
+ * @param string unclean_string
+ * @param integer num_leading_spaces
+ * @return string
+ * @example $string = pf_clean_string($string, 9);
+ * @access private
+ */
function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
global $data_dir, $username;
$unclean_string = str_replace(' ',' ',$unclean_string);
} /* end pf_clean_string() function */
/* --end pf-specific functions */
-
?>
\ No newline at end of file
<?php
-
/**
- * printer_friendly_main.php
- *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
+ * printer_friendly frameset
*
+ * @copyright (c) 1999-2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
*/
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/page_header.php');
-
-displayHtmlHeader( _("Printer Friendly"), '', FALSE );
/* 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"),$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) . '&mailbox=' . urlencode($mailbox)
+ . '&passed_id=' . $passed_id
+ . '" name="bottom_frame" frameborder="0">' . "\n";
+ echo "</frameset>\n";
+}
?>
-<frameset rows="60, *" noresize="noresize" border="0">
- <frame src="printer_friendly_top.php" name="top_frame" scrolling="no" />
- <frame src="printer_friendly_bottom.php?passed_ent_id=<?php
- echo urlencode($passed_ent_id) . '&mailbox=' . urlencode($mailbox) .
- '&passed_id=' . $passed_id;
- ?>" name="bottom_frame" />
-</frameset>
</html>
<?php
-
/**
- * printer_friendly_top.php
- *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
+ * printer_friendly top frame
*
* top frame of printer_friendly_main.php
* displays some javascript buttons for printing & closing
*
+ * @copyright (c) 1999-2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
*/
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/strings.php');
-require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'include/load_prefs.php');
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/html.php');
displayHtmlHeader( _("Printer Friendly"),
"<script language=\"javascript\" type=\"text/javascript\">\n".