Jelajahi Sumber

r2l by Yoav

philippe_mingo 23 tahun lalu
induk
melakukan
7bafa36bee
2 mengubah file dengan 42 tambahan dan 22 penghapusan
  1. 32 14
      src/printer_friendly_bottom.php
  2. 10 8
      src/printer_friendly_top.php

+ 32 - 14
src/printer_friendly_bottom.php

@@ -20,6 +20,7 @@ require_once('../config/config.php');
 require_once('../src/load_prefs.php');
 require_once('../src/load_prefs.php');
 require_once('../functions/imap.php');
 require_once('../functions/imap.php');
 require_once('../functions/page_header.php');
 require_once('../functions/page_header.php');
+require_once('../functions/html.php');
 
 
 $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
 $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
 
 
@@ -93,23 +94,40 @@ displayHtmlHeader( _("Printer Friendly"), '', FALSE );
 
 
 echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
 echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
      /* headers (we use table because translations are not all the same width) */
      /* headers (we use table because translations are not all the same width) */
-     '<table>'.
-     '<tr><td>' . _("From") . ':</td><td>' . htmlentities($from) . "</td></tr>\n".
-     '<tr><td>' . _("To") . ':</td><td>' . htmlentities($to) . "</td></tr>\n";
-if ( strlen($cc) > 0 ) { /* only show CC: if it's there... */
-     echo '<tr><td>' . _("CC") . ':</td><td>' . htmlentities($cc) . "</td></tr>\n";
-}
-echo '<tr><td>' . _("Date") . ':</td><td>' . htmlentities($date) . "</td></tr>\n".
-     '<tr><td>' . _("Subject") . ':</td><td>' . htmlentities($subject) . "</td></tr>\n".
-     '</table>'.
-     "\n";
-/* body */
-echo "<hr noshade size=1>\n";
-echo $body;
+     html_tag( 'table', '', '', '', 'width="100%" cellspacing="0" cellpadding="0" border="0"' ) .
+     html_tag( 'tr',
+         html_tag( 'td', _("From"), 'left' ) .
+         html_tag( 'td', htmlentities($from), 'left' )
+     ) . "\n" .
+     html_tag( 'tr',
+         html_tag( 'td', _("To"), 'left' ) .
+         html_tag( 'td', htmlentities($to), 'left' )
+     ) . "\n";
+    if ( strlen($cc) > 0 ) { /* only show CC: if it's there... */
+         echo html_tag( 'tr',
+             html_tag( 'td', _("CC"), 'left' ) .
+             html_tag( 'td', htmlentities($cc), 'left' )
+         );
+     }
+     echo html_tag( 'tr',
+         html_tag( 'td', _("Date"), 'left' ) .
+         html_tag( 'td', htmlentities($date), 'left' )
+     ) . "\n" .
+     html_tag( 'tr',
+         html_tag( 'td', _("Subject"), 'left' ) .
+         html_tag( 'td', htmlentities($subject), 'left' )
+     ) . "\n" .
+
+     /* body */
+     html_tag( 'tr',
+         html_tag( 'td', '<hr noshade size=1><br>' . "\n" . $body, 'left', '', 'colspan="2"' )
+     ) . "\n" .
+
+     '</table>' . "\n" .
+     '</body></html>';
 
 
 /* --end browser output-- */
 /* --end browser output-- */
 
 
-echo '</body></html>';
 
 
 /* --start pf-specific functions-- */
 /* --start pf-specific functions-- */
 
 

+ 10 - 8
src/printer_friendly_top.php

@@ -17,6 +17,7 @@ require_once('../functions/strings.php');
 require_once('../config/config.php');
 require_once('../config/config.php');
 require_once('../src/load_prefs.php');
 require_once('../src/load_prefs.php');
 require_once('../functions/page_header.php');
 require_once('../functions/page_header.php');
+require_once('../functions/html.php');
 
 
 displayHtmlHeader( _("Printer Friendly"),
 displayHtmlHeader( _("Printer Friendly"),
              "<script language=\"javascript\" type=\"text/javascript\">\n".
              "<script language=\"javascript\" type=\"text/javascript\">\n".
@@ -31,14 +32,15 @@ displayHtmlHeader( _("Printer Friendly"),
 
 
 echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\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">'.
      //'<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>'.
+     html_tag( 'div',
+         '<b>'.
+         '<form>'.
+         '<input type="button" value="' . _("Print") . '" onClick="printPopup()"> '.
+         '<input type="button" value="' . _("Close Window") . '" onClick="window.parent.close()">'.
+         '</form>'.
+         '</b>',
+     'center' );
      //'</td></tr></table>'.
      //'</td></tr></table>'.
-     '</center></body>'.
-     "</html>\n";
+     '</body></html>'. "\n";
 
 
 ?>
 ?>