From 9cc5a522df25d7f98e578dc483e0ff067b6c1ded Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 30 Aug 2014 06:33:42 -0400
Subject: [PATCH] Fix so rcube_text2html class does not depend on rcmail_string_replacer

---
 program/steps/mail/func.inc |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 8774c08..a7c483b 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -117,7 +117,7 @@
             'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage',
             'copy', 'move', 'quota', 'replyall', 'replylist', 'stillsearching',
             'flagged', 'unflagged', 'unread', 'deleted', 'replied', 'forwarded',
-            'priority', 'withattachment');
+            'priority', 'withattachment', 'fileuploaderror');
     }
 
     $pagetitle = $RCMAIL->localize_foldername($mbox_name, true);
@@ -384,11 +384,16 @@
         $head_replace = true;
     }
 
-    // add 'folder' column to list on multi-folder searches
-    $search_set = $RCMAIL->storage->get_search_set();
+    $search_set  = $RCMAIL->storage->get_search_set();
     $multifolder = $search_set && $search_set[1]->multi;
+
+    // add/remove 'folder' column to the list on multi-folder searches
     if ($multifolder && !in_array('folder', $a_show_cols)) {
         $a_show_cols[] = 'folder';
+        $head_replace = true;
+    }
+    else if (!$multifolder && ($found = array_search('folder', $a_show_cols)) !== false) {
+        unset($a_show_cols[$found]);
         $head_replace = true;
     }
 
@@ -402,6 +407,7 @@
 
     // Make sure there are no duplicated columns (#1486999)
     $a_show_cols = array_unique($a_show_cols);
+    $_SESSION['list_attrib']['columns'] = $a_show_cols;
 
     // Plugins may set header's list_cols/list_flags and other rcube_message_header variables
     // and list columns
@@ -914,7 +920,7 @@
  */
 function rcmail_plain_body($body, $flowed = false)
 {
-    $options   = array('flowed' => $flowed, 'wrap' => !$flowed);
+    $options   = array('flowed' => $flowed, 'wrap' => !$flowed, 'replacer' => 'rcmail_string_replacer');
     $text2html = new rcube_text2html($body, false, $options);
     $body      = $text2html->get_html();
 
@@ -2075,6 +2081,7 @@
     ));
 
     $content = html::tag('input', array('type' => 'hidden', 'name' => '_unlock', 'value' => ''))
+        . html::tag('input', array('type' => 'hidden', 'name' => '_framed', 'value' => '1'))
         . html::div(null, $fileinput->show())
         . html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));
 

--
Gitblit v1.9.1