Add preliminary printerfriendly-through-css feature. This adds a new print.css
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 8 May 2008 10:19:18 +0000 (10:19 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 8 May 2008 10:19:18 +0000 (10:19 +0000)
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.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13121 7612ce4b-ef26-0410-bec9-ea0150e637f0

css/print.css [new file with mode: 0644]
functions/page_header.php
templates/default/plugins/listcommands/read_body_header.tpl
templates/default/read_headers.tpl
templates/default_advanced/read_headers.tpl

diff --git a/css/print.css b/css/print.css
new file mode 100644 (file)
index 0000000..3a6acd3
--- /dev/null
@@ -0,0 +1,7 @@
+/* printer friendly style, currently only targeted at read_body */
+
+#page_header, .readMenuBar, .spacer, form, #listcommands, .field_Options { display: none; }
+
+
+
+
index e7cf9733b2acee565a97b4e735d59643adf2c966..22413f414ee552b5ba3a535222d27384bdb90887 100644 (file)
@@ -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
index 9bbcc08f0d9c31bcbbb1f745d07c298d4e1bb5d7..92eaeabf3d1fe4ebdf20db54e4f18591bf79018c 100644 (file)
@@ -24,7 +24,7 @@ extract($t);
 
 ?>
 
-<tr>
+<tr id="listcommands">
   <td class="fieldName">
     <b><?php echo _("Mailing List"); ?>:</b>
   </td>
index 0600e2fad9810e5f903c5a6c3150efff1892450e..5a24ccd67ea05721020a1bad909037fbb62b22f4 100644 (file)
@@ -43,7 +43,7 @@ extract($t);
             continue;
         }
         ?>
- <tr>
+ <tr class="field_<?php echo $field_name; ?>">
   <td class="fieldName">
    <?php echo $field_name; ?>:
   </td>
index da573fb2b9e2f2cbedf15014108a20609a657ac2..09af4150f6eedcdd85abb558af0f07ccf0ea307b 100644 (file)
@@ -92,7 +92,7 @@ extract($t);
                 continue;
             }
         ?>
- <tr>
+ <tr class="field_<?php echo $field_name; ?>">
   <td class="fieldName">
 <?php 
         if ($first_time)