Sfoglia il codice sorgente

Add preliminary printerfriendly-through-css feature. This adds a new print.css
stylesheet that is used when using the browser's print (or print preview) function.
A problem is that due to the frames, it won't work if selecting File -> Print because
this will print webmail.php instead of read_body. To see it in action, open read_body
on its own and use File -> Print Preview.

It would be nice if this could replace the printer_friendly function over time, because
it's purely css based and thus doesn't require extra code. For that we need to finetune
the sheet and most importantly, conquer the frames-problem in some smart way.

Thijs Kinkhorst 17 anni fa
parent
commit
811297b6ed

+ 7 - 0
css/print.css

@@ -0,0 +1,7 @@
+/* printer friendly style, currently only targeted at read_body */
+
+#page_header, .readMenuBar, .spacer, form, #listcommands, .field_Options { display: none; }
+
+
+
+

+ 3 - 0
functions/page_header.php

@@ -96,6 +96,9 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE
         $header_tags .= $oTemplate->fetch_right_to_left_stylesheet_link();
     }
 
+    // 5. Printer friendly stylesheet
+    $header_tags .= create_css_link($base_uri . 'css/print.css', 'printerfriendly', false, 'print');
+
     if ($squirrelmail_language == 'ja_JP') {
         /*
          * force correct detection of charset, when browser does not follow

+ 1 - 1
templates/default/plugins/listcommands/read_body_header.tpl

@@ -24,7 +24,7 @@ extract($t);
 
 ?>
 
-<tr>
+<tr id="listcommands">
   <td class="fieldName">
     <b><?php echo _("Mailing List"); ?>:</b>
   </td>

+ 1 - 1
templates/default/read_headers.tpl

@@ -43,7 +43,7 @@ extract($t);
             continue;
         }
         ?>
- <tr>
+ <tr class="field_<?php echo $field_name; ?>">
   <td class="fieldName">
    <?php echo $field_name; ?>:
   </td>

+ 1 - 1
templates/default_advanced/read_headers.tpl

@@ -92,7 +92,7 @@ extract($t);
                 continue;
             }
         ?>
- <tr>
+ <tr class="field_<?php echo $field_name; ?>">
   <td class="fieldName">
 <?php 
         if ($first_time)