From: Michael M Slusarz Date: Thu, 7 Jan 2010 21:06:30 +0000 (-0700) Subject: Use the 'compressed' metadata element to determine whether to offer a compressed... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0e2ddda553269d4883ef908b4b42488ec8940a8b;p=horde.git Use the 'compressed' metadata element to determine whether to offer a compressed download link --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 59c9db1c2..57792b666 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -681,9 +681,11 @@ class IMP_Contents * than 200 KB. */ if ($is_atc && $download_zip && - ($part['bytes'] > 204800) && - !in_array($mime_type, array('application/zip', 'application/x-zip-compressed'))) { - $part['download_zip'] = $this->linkView($mime_part, 'download_attach', null, array('class' => 'downloadZipAtc', 'dload' => true, 'jstext' => sprintf(_("Download %s in .zip Format"), $mime_part->getDescription(true)), 'params' => array('zip' => 1))); + ($part['bytes'] > 204800)) { + $viewer = Horde_Mime_Viewer::factory($mime_part, $mime_type); + if (!$viewer->getMetadata('compressed')) { + $part['download_zip'] = $this->linkView($mime_part, 'download_attach', null, array('class' => 'downloadZipAtc', 'dload' => true, 'jstext' => sprintf(_("Download %s in .zip Format"), $mime_part->getDescription(true)), 'params' => array('zip' => 1))); + } } /* Display the image save link if the required registry calls are