浏览代码

Remove printer friendly clean display option, following a proposal of
mine on the devel list to which no objections arose. The option is
totally unclear to end users, and has very little impact. The cleaning
is now always done.
If it turns out this is really missed, or if people really want to turn
the cleaning off, it can of course always be reintroduced - that's
why this is devel.

Thijs Kinkhorst 20 年之前
父节点
当前提交
e253f071b4
共有 4 个文件被更改,包括 15 次插入29 次删除
  1. 2 0
      ChangeLog
  2. 1 2
      include/load_prefs.php
  3. 1 8
      include/options/display.php
  4. 11 19
      src/printer_friendly_bottom.php

+ 2 - 0
ChangeLog

@@ -181,6 +181,8 @@ Version 1.5.1 -- CVS
     unlimited. (#1094569).
   - Security: Added hook for Preferences Backend to resolve potential
     file inclusions. [CAN-2005-0075] 
+  - Remove Printer Friendly Clean Display config option, the cleaning
+    is now always done.
 
 Version 1.5.0
 --------------------

+ 1 - 2
include/load_prefs.php

@@ -231,7 +231,6 @@ $enable_forward_as_attachment =
 $show_xmailer_default =
     getPref($data_dir, $username, 'show_xmailer_default', SMPREF_OFF );
 $attachment_common_show_images = getPref($data_dir, $username, 'attachment_common_show_images', SMPREF_OFF );
-$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', SMPREF_OFF);
 
 /* message disposition notification support setting */
 $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', SMPREF_ON);
@@ -298,4 +297,4 @@ $delete_prev_next_display = getPref($data_dir, $username, 'delete_prev_next_disp
 
 do_hook('loading_prefs');
 
-?>
+?>

+ 1 - 8
include/options/display.php

@@ -361,13 +361,6 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE
     );
 
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'pf_cleandisplay',
-        'caption' => _("Enable Printer Friendly Clean Display"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_NONE
-    );
-
     if ($default_use_mdn) {
         $optvals[SMOPT_GRP_MESSAGE][] = array(
             'name'    => 'mdn_user_support',
@@ -536,4 +529,4 @@ function save_option_reply_prefix($option) {
 
 }
 
-?>
+?>

+ 11 - 19
src/printer_friendly_bottom.php

@@ -38,7 +38,6 @@ if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) {
 }
 /* end globals */
 
-$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', false);
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
 if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) {
@@ -79,27 +78,20 @@ if ($ent_ar[0] != '') {
   $body = _("Message not printable");
 }
 
- /* now, if they choose to, we clean up the display a bit... */
+/* now we clean up the display a bit... */
 
-if ($pf_cleandisplay) {
+$num_leading_spaces = 9; // nine leading spaces for indentation
 
-    $num_leading_spaces = 9; // nine leading spaces for indentation
+// sometimes I see ',,' instead of ',' seperating addresses *shrug*
+$cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces);
+$to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces);
 
-     // sometimes I see ',,' instead of ',' seperating addresses *shrug*
-    $cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces);
-    $to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces);
+// clean up everything else...
+$subject = pf_clean_string($subject, $num_leading_spaces);
+$from = pf_clean_string($from, $num_leading_spaces);
+$date = pf_clean_string($date, $num_leading_spaces);
 
-     // the body should have no leading zeros
-    // disabled because it destroys html mail
-
-//    $body = pf_clean_string($body, 0);
-
-     // clean up everything else...
-    $subject = pf_clean_string($subject, $num_leading_spaces);
-    $from = pf_clean_string($from, $num_leading_spaces);
-    $date = pf_clean_string($date, $num_leading_spaces);
-
-} // end cleanup
+// end cleanup
 
 $to = decodeHeader($to);
 $cc = decodeHeader($cc);
@@ -194,4 +186,4 @@ function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
 } /* end pf_clean_string() function */
 
 /* --end pf-specific functions */
-?>
+?>