From 30694e4a1201c5e72fb52e59ecc79a1a06296f9b Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 04 Sep 2008 09:50:11 -0400
Subject: [PATCH] - Truncate very long (above 50 characters) attachment filenames when displaying

---
 CHANGELOG                   |    6 ++++++
 program/steps/mail/show.inc |   11 ++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 02289eb..3bba337 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,12 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2008/09/04 (alec)
+----------
+- Truncate very long (above 50 characters) attachment filenames when displaying
+- Support \" and \\ in quoted strings when parsing BODYSTRUCTURE (mime.inc)
+- Allow 'readonly' atributes in input and textarea (#1485312)
+
 2008/09/03 (thomasb)
 ----------
 - Allow to auto-detect client language if none set (#1484434)
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index b0dcf38..822934a 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -150,6 +150,14 @@
         $ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size))));
       }
       else {
+	if (rc_strlen($attach_prop->filename) > 50) {
+          $filename = rc_substr($attach_prop->filename, 0, 25) . '...' . rc_substr($attach_prop->filename, strlen($attach_prop->filename)-20, 20);
+	  $title = $attach_prop->filename;
+	} else {
+	  $filename = $attach_prop->filename;
+	  $title = '';
+	}
+		  
         $ol .= html::tag('li', null,
           html::a(array(
             'href' => $MESSAGE->get_part_url($attach_prop->mime_id),
@@ -158,8 +166,9 @@
               JS_OBJECT_NAME,
               $attach_prop->mime_id,
               $attach_prop->mimetype),
+	    'title' => Q($title),  
             ),
-            Q($attach_prop->filename)));
+            Q($filename)));
       }
     }
 

--
Gitblit v1.9.1