Przeglądaj źródła

Internationlization of print header

philippe_mingo 23 lat temu
rodzic
commit
0cb7c2bb2e

+ 16 - 12
functions/page_header.php

@@ -13,19 +13,23 @@
 
    // Always set up the language before calling these functions
 
-   function displayHtmlHeader ($title="SquirrelMail") {
-     global $theme_css;
-
-      echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
-           "\n\n<HTML>\n<HEAD>\n";
-      if ($theme_css != '') {
-        echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n"; 
-      }
-      
-      do_hook ("generic_header");
+   function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
+
+        global $theme_css;
+
+        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
+             "\n\n<HTML>\n<HEAD>\n";
+
+        if ($theme_css != '') {
+            echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
+        }
+
+        if( $do_hook ) {
+            do_hook ("generic_header");
+        }
+
+        echo "<title>$title</title>$xtra</head>\n\n";
 
-      echo "<TITLE>$title</TITLE>\n";
-      echo "</HEAD>\n\n";
    }
 
    function displayInternalLink ($path, $text, $target='') {

+ 91 - 57
po/squirrelmail.po

@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-11-16 15:50+0100\n"
+"POT-Creation-Date: 2001-11-17 14:56+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -64,7 +64,7 @@ msgstr ""
 msgid "All address books"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:69
+#: squirrelmail/functions/page_header.php:73
 #: squirrelmail/src/addrbook_search.php:185
 #: squirrelmail/src/addrbook_search_html.php:150
 #: squirrelmail/src/search.php:17 squirrelmail/src/search.php:73
@@ -174,6 +174,7 @@ msgstr ""
 #: squirrelmail/plugins/filters/options.php:189
 #: squirrelmail/src/compose.php:102 squirrelmail/src/download.php:120
 #: squirrelmail/src/download.php:126 squirrelmail/src/options_order.php:42
+#: squirrelmail/src/printer_friendly_bottom.php:82
 #: squirrelmail/src/search.php:58 squirrelmail/src/search.php:59
 msgid "Subject"
 msgstr ""
@@ -182,6 +183,7 @@ msgstr ""
 #: squirrelmail/plugins/filters/options.php:177
 #: squirrelmail/src/compose.php:103 squirrelmail/src/download.php:121
 #: squirrelmail/src/download.php:128 squirrelmail/src/options_order.php:40
+#: squirrelmail/src/printer_friendly_bottom.php:76
 #: squirrelmail/src/search.php:61 squirrelmail/src/search.php:62
 msgid "From"
 msgstr ""
@@ -189,16 +191,17 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:552
 #: squirrelmail/plugins/filters/options.php:180
 #: squirrelmail/src/compose.php:104 squirrelmail/src/download.php:122
-#: squirrelmail/src/download.php:130 squirrelmail/src/search.php:67
-#: squirrelmail/src/search.php:68
+#: squirrelmail/src/download.php:130
+#: squirrelmail/src/printer_friendly_bottom.php:77
+#: squirrelmail/src/search.php:67 squirrelmail/src/search.php:68
 msgid "To"
 msgstr ""
 
-#: squirrelmail/src/compose.php:248 squirrelmail/src/read_body.php:437
+#: squirrelmail/src/compose.php:248 squirrelmail/src/read_body.php:494
 msgid "From:"
 msgstr ""
 
-#: squirrelmail/src/compose.php:273 squirrelmail/src/read_body.php:453
+#: squirrelmail/src/compose.php:273 squirrelmail/src/read_body.php:510
 msgid "To:"
 msgstr ""
 
@@ -210,7 +213,7 @@ msgstr ""
 msgid "BCC:"
 msgstr ""
 
-#: squirrelmail/src/compose.php:297 squirrelmail/src/read_body.php:420
+#: squirrelmail/src/compose.php:297 squirrelmail/src/read_body.php:476
 msgid "Subject:"
 msgstr ""
 
@@ -230,7 +233,7 @@ msgstr ""
 msgid "Delete selected attachments"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:63 squirrelmail/src/compose.php:386
+#: squirrelmail/functions/page_header.php:67 squirrelmail/src/compose.php:386
 #: squirrelmail/src/compose.php:388 squirrelmail/src/compose.php:391
 msgid "Addresses"
 msgstr ""
@@ -239,19 +242,19 @@ msgstr ""
 msgid "Save Draft"
 msgstr ""
 
-#: squirrelmail/src/compose.php:402 squirrelmail/src/read_body.php:482
+#: squirrelmail/src/compose.php:402 squirrelmail/src/read_body.php:539
 msgid "Priority"
 msgstr ""
 
-#: squirrelmail/src/compose.php:403 squirrelmail/src/read_body.php:338
+#: squirrelmail/src/compose.php:403 squirrelmail/src/read_body.php:394
 msgid "High"
 msgstr ""
 
-#: squirrelmail/src/compose.php:404 squirrelmail/src/read_body.php:340
+#: squirrelmail/src/compose.php:404 squirrelmail/src/read_body.php:396
 msgid "Normal"
 msgstr ""
 
-#: squirrelmail/src/compose.php:405 squirrelmail/src/read_body.php:342
+#: squirrelmail/src/compose.php:405 squirrelmail/src/read_body.php:398
 msgid "Low"
 msgstr ""
 
@@ -299,6 +302,7 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:562
 #: squirrelmail/src/download.php:123 squirrelmail/src/download.php:132
 #: squirrelmail/src/options_order.php:41
+#: squirrelmail/src/printer_friendly_bottom.php:81
 msgid "Date"
 msgstr ""
 
@@ -317,8 +321,8 @@ msgstr ""
 msgid "None"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:65 squirrelmail/src/folders.php:28
-#: squirrelmail/src/left_main.php:162
+#: squirrelmail/functions/page_header.php:69 squirrelmail/src/folders.php:28
+#: squirrelmail/src/left_main.php:161
 msgid "Folders"
 msgstr ""
 
@@ -342,7 +346,7 @@ msgstr ""
 msgid "Renamed successfully!"
 msgstr ""
 
-#: squirrelmail/src/folders.php:52 squirrelmail/src/left_main.php:202
+#: squirrelmail/src/folders.php:52 squirrelmail/src/left_main.php:201
 msgid "refresh folder list"
 msgstr ""
 
@@ -352,7 +356,7 @@ msgstr ""
 
 #: squirrelmail/functions/mailbox_display.php:524
 #: squirrelmail/plugins/filters/options.php:93
-#: squirrelmail/src/folders.php:103 squirrelmail/src/read_body.php:370
+#: squirrelmail/src/folders.php:103 squirrelmail/src/read_body.php:426
 msgid "Delete"
 msgstr ""
 
@@ -417,7 +421,7 @@ msgstr ""
 msgid "Submit"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:71 squirrelmail/src/help.php:80
+#: squirrelmail/functions/page_header.php:75 squirrelmail/src/help.php:80
 msgid "Help"
 msgstr ""
 
@@ -440,7 +444,7 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:686
 #: squirrelmail/functions/mailbox_display.php:689
 #: squirrelmail/src/help.php:163 squirrelmail/src/help.php:164
-#: squirrelmail/src/read_body.php:389 squirrelmail/src/read_body.php:391
+#: squirrelmail/src/read_body.php:445 squirrelmail/src/read_body.php:447
 msgid "Previous"
 msgstr ""
 
@@ -448,7 +452,7 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:687
 #: squirrelmail/functions/mailbox_display.php:690
 #: squirrelmail/src/help.php:166 squirrelmail/src/help.php:167
-#: squirrelmail/src/read_body.php:393 squirrelmail/src/read_body.php:395
+#: squirrelmail/src/read_body.php:449 squirrelmail/src/read_body.php:451
 msgid "Next"
 msgstr ""
 
@@ -460,37 +464,37 @@ msgstr ""
 msgid "Viewing an image attachment"
 msgstr ""
 
-#: squirrelmail/src/left_main.php:136
+#: squirrelmail/src/left_main.php:135
 msgid "empty"
 msgstr ""
 
-#: squirrelmail/src/left_main.php:196
+#: squirrelmail/src/left_main.php:195
 msgid "Last Refresh"
 msgstr ""
 
-#: squirrelmail/src/login.php:104 squirrelmail/src/login.php:146
+#: squirrelmail/src/login.php:86 squirrelmail/src/login.php:138
 msgid "Login"
 msgstr ""
 
-#: squirrelmail/src/login.php:117
+#: squirrelmail/src/login.php:109
 #, c-format
 msgid "SquirrelMail version %s"
 msgstr ""
 
-#: squirrelmail/src/login.php:118
+#: squirrelmail/src/login.php:110
 msgid "By the SquirrelMail Development Team"
 msgstr ""
 
-#: squirrelmail/src/login.php:124
+#: squirrelmail/src/login.php:116
 #, c-format
 msgid "%s Login"
 msgstr ""
 
-#: squirrelmail/src/login.php:128
+#: squirrelmail/src/login.php:120
 msgid "Name:"
 msgstr ""
 
-#: squirrelmail/src/login.php:134
+#: squirrelmail/src/login.php:126
 msgid "Password:"
 msgstr ""
 
@@ -500,7 +504,7 @@ msgstr ""
 msgid "No messages were selected."
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:67
+#: squirrelmail/functions/page_header.php:71
 #: squirrelmail/plugins/filters/options.php:75
 #: squirrelmail/plugins/newmail/newmail_opt.php:41
 #: squirrelmail/plugins/translate/options.php:67
@@ -513,7 +517,7 @@ msgstr ""
 msgid "Options"
 msgstr ""
 
-#: squirrelmail/src/options.php:165 squirrelmail/src/options_display.php:27
+#: squirrelmail/src/options.php:167 squirrelmail/src/options_display.php:27
 msgid "Display Preferences"
 msgstr ""
 
@@ -622,7 +626,15 @@ msgstr ""
 msgid "Enable display of images with email, below attachment box"
 msgstr ""
 
-#: squirrelmail/src/options.php:181 squirrelmail/src/options_folder.php:30
+#: squirrelmail/src/options_display.php:200
+msgid "Printer Friendly: Subtle Link"
+msgstr ""
+
+#: squirrelmail/src/options_display.php:207
+msgid "Printer Friendly: Clean Display"
+msgstr ""
+
+#: squirrelmail/src/options.php:183 squirrelmail/src/options_folder.php:30
 msgid "Folder Preferences"
 msgstr ""
 
@@ -754,7 +766,7 @@ msgstr ""
 msgid "Plugin Options"
 msgstr ""
 
-#: squirrelmail/src/options.php:173 squirrelmail/src/options_highlight.php:49
+#: squirrelmail/src/options.php:175 squirrelmail/src/options_highlight.php:49
 msgid "Message Highlighting"
 msgstr ""
 
@@ -891,7 +903,7 @@ msgstr ""
 msgid "Move Up"
 msgstr ""
 
-#: squirrelmail/src/options.php:189 squirrelmail/src/options_order.php:31
+#: squirrelmail/src/options.php:191 squirrelmail/src/options_order.php:31
 msgid "Index Order"
 msgstr ""
 
@@ -931,7 +943,7 @@ msgstr ""
 msgid "Return to options page"
 msgstr ""
 
-#: squirrelmail/src/options.php:157 squirrelmail/src/options_personal.php:31
+#: squirrelmail/src/options.php:159 squirrelmail/src/options_personal.php:31
 msgid "Personal Information"
 msgstr ""
 
@@ -1007,93 +1019,115 @@ msgstr ""
 msgid "Successfully saved personal information!"
 msgstr ""
 
-#: squirrelmail/src/options.php:98
+#: squirrelmail/src/options.php:100
 msgid "Successfully saved display preferences!"
 msgstr ""
 
-#: squirrelmail/src/options.php:99
+#: squirrelmail/src/options.php:101
 msgid "Refresh Page"
 msgstr ""
 
-#: squirrelmail/src/options.php:145
+#: squirrelmail/src/options.php:147
 msgid "Successfully saved folder preferences!"
 msgstr ""
 
-#: squirrelmail/src/options.php:146
+#: squirrelmail/src/options.php:148
 msgid "Refresh Folder List"
 msgstr ""
 
-#: squirrelmail/src/options.php:159
+#: squirrelmail/src/options.php:161
 msgid ""
 "This contains personal information about yourself such as your name, your "
 "email address, etc."
 msgstr ""
 
-#: squirrelmail/src/options.php:167
+#: squirrelmail/src/options.php:169
 msgid ""
 "You can change the way that SquirrelMail looks and displays information to "
 "you, such as the colors, the language, and other settings."
 msgstr ""
 
-#: squirrelmail/src/options.php:175
+#: squirrelmail/src/options.php:177
 msgid ""
 "Based upon given criteria, incoming messages can have different background "
 "colors in the message list.  This helps to easily distinguish who the "
 "messages are from, especially for mailing lists."
 msgstr ""
 
-#: squirrelmail/src/options.php:183
+#: squirrelmail/src/options.php:185
 msgid ""
 "These settings change the way your folders are displayed and manipulated."
 msgstr ""
 
-#: squirrelmail/src/options.php:191
+#: squirrelmail/src/options.php:193
 msgid ""
 "The order of the message index can be rearanged and changed to contain the "
 "headers in any order you want."
 msgstr ""
 
+#: squirrelmail/src/printer_friendly_bottom.php:71
+#: squirrelmail/src/printer_friendly_main.php:15
+#: squirrelmail/src/printer_friendly_top.php:21
+msgid "Printer Friendly"
+msgstr ""
+
+#: squirrelmail/src/printer_friendly_bottom.php:79
+msgid "CC"
+msgstr ""
+
+#: squirrelmail/src/printer_friendly_top.php:36
+msgid "Print"
+msgstr ""
+
+#: squirrelmail/src/printer_friendly_top.php:37
+msgid "Close Window"
+msgstr ""
+
 #: squirrelmail/src/read_body.php:31
 msgid "Viewing full header"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:225
+#: squirrelmail/src/read_body.php:152
+msgid "View printable version"
+msgstr ""
+
+#: squirrelmail/src/read_body.php:281
 msgid "more"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:226
+#: squirrelmail/src/read_body.php:282
 msgid "less"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:363
+#: squirrelmail/src/read_body.php:419
 msgid "Message List"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:374
+#: squirrelmail/src/read_body.php:430
 msgid "Resume Draft"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:402
+#: squirrelmail/src/read_body.php:458
 msgid "Forward"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:405
+#: squirrelmail/src/read_body.php:461
 msgid "Reply"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:408
+#: squirrelmail/src/read_body.php:464
 msgid "Reply All"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:427 squirrelmail/src/read_body.php:429
+#: squirrelmail/src/read_body.php:483 squirrelmail/src/read_body.php:485
 msgid "View full header"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:445
+#: squirrelmail/src/read_body.php:502
 msgid "Date:"
 msgstr ""
 
-#: squirrelmail/src/read_body.php:498
+#: squirrelmail/src/read_body.php:555
 msgid "Mailer"
 msgstr ""
 
@@ -1126,7 +1160,7 @@ msgstr ""
 msgid "Cc"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:53 squirrelmail/src/signout.php:65
+#: squirrelmail/functions/page_header.php:57 squirrelmail/src/signout.php:65
 msgid "Sign Out"
 msgstr ""
 
@@ -1497,7 +1531,7 @@ msgstr ""
 #: squirrelmail/functions/imap_messages.php:192
 #: squirrelmail/functions/imap_messages.php:436
 #: squirrelmail/functions/imap_messages.php:486
-#: squirrelmail/functions/mailbox_display.php:734
+#: squirrelmail/functions/mailbox_display.php:737
 msgid "(no subject)"
 msgstr ""
 
@@ -1600,11 +1634,11 @@ msgstr ""
 msgid "No"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:55
+#: squirrelmail/functions/page_header.php:59
 msgid "Current Folder"
 msgstr ""
 
-#: squirrelmail/functions/page_header.php:61
+#: squirrelmail/functions/page_header.php:65
 msgid "Compose"
 msgstr ""
 
@@ -2612,7 +2646,7 @@ msgid "Try"
 msgstr ""
 
 #: squirrelmail/plugins/newmail/newmail_opt.php:126
-msgid "Local Media File :"
+msgid "Local Media File:"
 msgstr ""
 
 #: squirrelmail/plugins/newmail/newmail_opt.php:132

+ 13 - 21
src/login.php

@@ -57,6 +57,7 @@
     require_once('../functions/i18n.php');
     require_once('../functions/plugin.php');
     require_once('../functions/constants.php');
+    require_once('../functions/page_header.php');
 
     /*
      * $squirrelmail_language is set by a cookie when the user selects
@@ -73,36 +74,27 @@
      * In case the last session was not terminated properly, make sure
      * we get a new one.
      */
-    $cookie_params = session_get_cookie_params(); 
-    setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']); 
+    $cookie_params = session_get_cookie_params();
+    setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']);
     setcookie('username', '', 0, $base_uri);
     setcookie('key', '', 0, $base_uri);
     header ('Pragma: no-cache');
 
     do_hook('login_cookie');
 
-    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
-         "\n\n" .
-         "<HTML>\n" .
-         "<HEAD>\n";
-
-    if ($theme_css != '') {
-        echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
-    }
-
     /* Output the javascript onload function. */
-    echo "<SCRIPT LANGUAGE=\"JavaScript\">\n" .
-         "<!--\n".
-         "  function squirrelmail_loginpage_onload() {\n".
-         "    document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
-         "    document.forms[0].elements[0].focus();\n".
-         "  }\n".
-         "// -->\n".
-         "</script>\n";
+    displayHtmlHeader( "$org_name - " . _("Login"),
+                 "<SCRIPT LANGUAGE=\"JavaScript\">\n" .
+                 "<!--\n".
+                 "  function squirrelmail_loginpage_onload() {\n".
+                 "    document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
+                 "    document.forms[0].elements[0].focus();\n".
+                 "  }\n".
+                 "// -->\n".
+                 "</script>\n", FALSE );
 
     /* Set the title of this page. */
-    echo "<TITLE>$org_name - " . _("Login") . "</TITLE></HEAD>\n".
-         "<BODY TEXT=#000000 BGCOLOR=#FFFFFF LINK=#0000CC VLINK=#0000CC ALINK=#0000CC onLoad='squirrelmail_loginpage_onload();'>\n".
+    echo "<BODY TEXT=#000000 BGCOLOR=#FFFFFF LINK=#0000CC VLINK=#0000CC ALINK=#0000CC onLoad='squirrelmail_loginpage_onload();'>\n".
          "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
 
     $username_form_name = 'login_username';

+ 15 - 28
src/printer_friendly_bottom.php

@@ -19,6 +19,7 @@
     require_once('../config/config.php');
     require_once('../src/load_prefs.php');
     require_once('../functions/imap.php');
+    require_once('../functions/page_header.php');
 
 
     $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
@@ -63,39 +64,25 @@
 
     } // end cleanup
 
-// --end display setup--
+    // --end display setup--
 
 
-// --start browser output--
+    // --start browser output--
+    displayHtmlHeader( _("Printer Friendly"), '', FALSE );
 
-?>
-
-<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
-<html>
-<head><title>
-    <?php echo _("Printable View"); ?>
-</title></head>
-
-<?php
-
-    if ($theme_css != "")
-    {
-        printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">', $theme_css);
-        echo "\n";
+    echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
+         // headers (we use table becasue translations are not all the same width)
+         '<table>'.
+         '<tr><td>' . _("From") . ':</td><td>' . htmlentities($from) . "</td></td>\n".
+         '<tr><td>' . _("To") . ':</td><td>' . htmlentities($to) . "</td></td>\n";
+    if ( strlen($cc) > 0 ) { // only show CC: if it's there...
+         echo '<tr><td>' . _("CC") . ':</td><td>' . htmlentities($cc) . "</td></td>\n";
     }
+    echo '<tr><td>' . _("Date") . ':</td><td>' . htmlentities($date) . "</td></td>\n".
+         '<tr><td>' . _("Subject") . ':</td><td>' . htmlentities($subject) . "</td></td>\n".
+         '</table>'.
+         "\n<pre>";
 
-    printf('<body text="%s" bgcolor="%s" link="%s" vlink="%s" alink="%s">',
-            $color[8], $color[4], $color[7], $color[7], $color[7]);
-
-    echo "\n<pre>";
-
-     // headers
-    echo "   " . _("From") . ': ' . htmlentities($from) . "\n";
-    echo "     " . _("To") . ': ' . htmlentities($to) . "\n";
-    if ( strlen($cc) > 0 ) // only show CC: if it's there...
-        echo "     " . _("CC") . ': ' . htmlentities($cc) . "\n";
-    echo "   " . _("Date") . ': ' . htmlentities($date) . "\n";
-    echo _("Subject") . ': ' . htmlentities($subject) . "\n\n";
 
      // body
     echo "<hr noshade size=1>\n";

+ 15 - 13
src/printer_friendly_main.php

@@ -9,16 +9,18 @@
    **  $Id$
    **/
 
-?><!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>
+    require_once('../src/validate.php');
+    require_once('../functions/page_header.php');
+
+    displayHtmlHeader( _("Printer Friendly"), '', FALSE );
+
+    echo "<frameset rows=\"50, *\" noresize border=\"0\">\n".
+         "<frame src=\"printer_friendly_top.php\" name=\"top_frame\" scrolling=\"off\">".
+         '<frame src="printer_friendly_bottom.php?passed_ent_id=';
+    echo $passed_ent_id . '&mailbox=' . urlencode($mailbox) .
+         '&passed_id=' . $passed_id;
+    echo "\" name=\"bottom_frame\">".
+         "</frameset>\n".
+         "</html>\n";
+
+?>

+ 22 - 32
src/printer_friendly_top.php

@@ -16,39 +16,29 @@
     require_once('../functions/strings.php');
     require_once('../config/config.php');
     require_once('../src/load_prefs.php');
+    require_once('../functions/page_header.php');
 
-?>
-<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
-<html>
-  <head>
-  <script language="javascript">
-  <!--
-    function printPopup() {
-        parent.frames[1].focus();
-        parent.frames[1].print();
-    }
-  -->
-  </script>
-  </head>
-<?php
+    displayHtmlHeader( _("Printer Friendly"),
+                 "<script language=\"javascript\">\n".
+                 "<!--\n".
+                 "function printPopup() {\n".
+                    "parent.frames[1].focus();\n".
+                    "parent.frames[1].print();\n".
+                 "}\n".
+                 "-->\n".
+                 "</script>\n", FALSE );
 
-    if ($theme_css != "")
-    {
-        printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">', $theme_css);
-        echo "\n";
-    }
 
+    echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
+         //'<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"><tr><td valign="middle" align="center">'.
+         '<center><b>'.
+         '<form>'.
+         '<input type="button" value="' . _("Print") . '" onClick="printPopup()"> '.
+         '<input type="button" value="' . _("Close Window") . '" onClick="window.parent.close()">'.
+         '</form>'.
+         '</b>'.
+         //'</td></tr></table>'.
+         '</body>'.
+         "</html>\n";
 
-    printf('<body text="%s" bgcolor="%s" link="%s" vlink="%s" alink="%s">',
-        $color[8], $color[3], $color[7], $color[7], $color[7]);
-?>
-    <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"><tr><td valign="middle" align="center">
-      <b>
-      <form>
-      <input type="button" value="Print" onClick="printPopup()">
-      <input type="button" value="Close Window" onClick="window.parent.close()">
-      </form>
-      </b>
-    </td></tr></table>
-  </body>
-</html>
+?>

+ 17 - 17
src/read_body.php

@@ -141,16 +141,16 @@
    function printer_friendly_link($subtle) {
        global $passed_id, $mailbox, $ent_num, $color;
        global $pf_subtle_link;
-   
+
        if ($pf_subtle_link != $subtle) return;
-   
+
        if (strlen(trim($mailbox)) < 1)
            $mailbox = 'INBOX';
-   
+
        $params = '?passed_ent_id=' . $ent_num . '&mailbox=' . urlencode($mailbox) .
                  '&passed_id=' . $passed_id;
        $text = _("View printable version");
-   
+
        if (!$subtle) {
             // the link is large, on the bottom of the header panel
             echo '      <tr bgcolor="' . $color[0] . '">' . "\n" .
@@ -159,10 +159,10 @@
                  '        </td><td class="medText" valign="top" colspan="2">'."\n";
        } else {
             // the link is subtle, below "view full header"
-            echo '        <br>' . "\n";
+            echo "<br>\n";
        }
-   
-            // javascript
+
+       // javascript
        echo '        <script language="javascript">' . "\n" .
             '        <!--' . "\n" .
             '        function printFormat() {' . "\n" .
@@ -178,9 +178,9 @@
             '        <noscript>' . "\n" .
             '        <a target="_blank" href="../src/printer_friendly_bottom.php' .
                      $params . '">' .
-                     $text . "</a>\n" .
+                     "$text</a>\n" .
             '        </noscript>' . "\n";
-   
+
        if (!$subtle) {
             // the link is large, on the bottom of the header panel
             echo '        </td>' . "\n" .
@@ -191,28 +191,28 @@
    // main of read_boby.php
 
    if (isset($msgs)) {
-	   $currentArrayIndex = $passed_id;
-		/*
+       $currentArrayIndex = $passed_id;
+         /*
       for ($i=0; $i < count($msgs); $i++) {
          if ($msgs[$i]["ID"] == $passed_id) {
             $currentArrayIndex = $i;
             break;
          }
       }
-		*/
+        */
    } else {
       $currentArrayIndex = -1;
    }
 
-	for ($i = 0; $i < count($msgs); $i++) {
-		if ($msgs[$i]['ID'] == $passed_id)
-			$msgs[$i]['FLAG_SEEN'] = true;
-	}
+    for ($i = 0; $i < count($msgs); $i++) {
+        if ($msgs[$i]['ID'] == $passed_id)
+            $msgs[$i]['FLAG_SEEN'] = true;
+    }
 
    // $message contains all information about the message
    // including header and body
    $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
-   
+
    /** translate the subject and mailbox into url-able text **/
    $url_subj = urlencode(trim($message->header->subject));
    $urlMailbox = urlencode($mailbox);