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 e7cf973..22413f4 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 9bbcc08..92eaeab 100644 (file)
@@ -24,7 +24,7 @@ extract($t);
 
 ?>
 
-<tr>
+<tr id="listcommands">
   <td class="fieldName">
     <b><?php echo _("Mailing List"); ?>:</b>
   </td>
index 0600e2f..5a24ccd 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 da573fb..09af415 100644 (file)
@@ -92,7 +92,7 @@ extract($t);
                 continue;
             }
         ?>
- <tr>
+ <tr class="field_<?php echo $field_name; ?>">
   <td class="fieldName">
 <?php 
         if ($first_time)