From e9c553ad35dffaf5a6585b0411f55fabbacb39bb Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Sun, 7 Jun 2009 12:48:39 +0200 Subject: [PATCH] MFB: Show photos inline if possible. --- framework/Mime/lib/Horde/Mime/Viewer/Vcard.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/framework/Mime/lib/Horde/Mime/Viewer/Vcard.php b/framework/Mime/lib/Horde/Mime/Viewer/Vcard.php index e7a7c3b84..70fe970af 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/Vcard.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/Vcard.php @@ -124,13 +124,20 @@ class Horde_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Driver $photos = $vc->getAllAttributes('PHOTO'); foreach ($photos as $photo) { - if (!isset($photo['params']['VALUE']) || - String::upper($photo['params']['VALUE']) != 'URI') { - continue; + if (isset($photo['params']['VALUE']) && + String::upper($photo['params']['VALUE']) == 'URI') { + $html .= $this->_row(_("Photo"), + '', + false); + } elseif (isset($photo['params']['ENCODING']) && + String::upper($photo['params']['ENCODING']) == 'B' && + isset($photo['params']['TYPE']) && + ($GLOBALS['browser']->hasFeature('datauri') === true || + $GLOBALS['browser']->hasFeature('datauri') >= strlen($photo['value']))) { + $html .= $this->_row(_("Photo"), + '', + false); } - $html .= $this->_row(_("Photo"), - '', - false); } $labels = $vc->getAllAttributes('LABEL'); -- 2.11.0