From 444e977d4f48712a05fee4fa43bb7d543dc7191d Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 30 Sep 2013 10:00:21 -0400
Subject: [PATCH] Also truncate the list of addresses in print view + add link to show them all

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

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index a7d9ca2..340292a 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1470,9 +1470,7 @@
     $mailto = rcube_idn_to_utf8($mailto);
 
     if ($PRINT_MODE) {
-      $out .= ($out ? ', ' : '') . sprintf('%s &lt;%s&gt;', Q($name), $mailto);
-      // for printing we display all addresses
-      continue;
+      $address = sprintf('%s &lt;%s&gt;', Q($name), Q($mailto));
     }
     else if ($valid) {
       if ($linked) {
@@ -1536,6 +1534,15 @@
   }
 
   if ($moreadrs) {
+    if ($PRINT_MODE) {
+      $out .= ' ' . html::a(array(
+        'href' => '#more',
+        'class' => 'morelink',
+        'onclick' => '$(this).hide().next().show()',
+      ), Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) .
+      html::span(array('style' => 'display:none'), join(', ', $allvalues));
+    }
+    else {
       $out .= ' ' . html::a(array(
           'href' => '#more',
           'class' => 'morelink',
@@ -1545,6 +1552,7 @@
             JQ($title))
         ),
         Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
+    }
   }
 
   return $out;

--
Gitblit v1.9.1