From c0f5c64faafea3e8e96efc8c8848179dbf941e5f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 30 Oct 2009 17:03:46 -0600 Subject: [PATCH] Indicate when an inline viewable part is empty. --- imp/lib/Contents.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index c397ae16f..806d762e9 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -442,10 +442,21 @@ class IMP_Contents $ret[$mime_id]['name'] = $mime_part->getName(true); } - /* If this is a text/* part, AND the browser does not support UTF-8, - * give the user a link to open the part in a new window with the - * correct character set. */ - if (($mode != 'full') && ($mime_part->getPrimaryType() == 'text')) { + if (($textmode == 'inline') && !strlen($ret[$mime_id]['data'])) { + if (empty($ret[$mime_id]['status'])) { + $ret[$mime_id]['status'] = array( + array( + 'text' => array( + _("This inline viewable part is empty.") + ) + ) + ); + } + } elseif (($textmode != 'full') && + ($mime_part->getPrimaryType() == 'text')) { + /* If this is a text/* part, AND the browser does not support + * UTF-8, give the user a link to open the part in a new window + * with the correct character set. */ $default_charset = Horde_String::upper(Horde_Nls::getCharset()); if ($default_charset !== 'UTF-8') { $charset_upper = Horde_String::upper($mime_part->getCharset()); -- 2.11.0