From: Michael M Slusarz Date: Fri, 30 Oct 2009 23:03:46 +0000 (-0600) Subject: Indicate when an inline viewable part is empty. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c0f5c64faafea3e8e96efc8c8848179dbf941e5f;p=horde.git Indicate when an inline viewable part is empty. --- 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());