From: Jan Schneider Date: Fri, 12 Nov 2010 12:38:45 +0000 (+0100) Subject: Load background images from related mime parts. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=940d62332dba8346d1fa55b067706fab4aa4d894;p=horde.git Load background images from related mime parts. --- diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index 9e0f2504f..43175aac7 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -295,7 +295,7 @@ class IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html } if ($node instanceof DOMElement) { - $tag = strtolower($node->tagName); + $tag = Horde_String::lower($node->tagName); switch ($tag) { case 'a': @@ -359,11 +359,25 @@ class IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html case 'body': case 'td': - if ($this->_imptmp['img'] && + if ($this->_imptmp && $node->hasAttribute('background')) { - $node->setAttribute('htmlimgblocked', $node->getAttribute('background')); - $node->setAttribute('background', $this->_imptmp['blockimg']); - $this->_imptmp['imgblock'] = true; + $val = $node->getAttribute('background'); + + /* Multipart/related. */ + if (isset($this->_imptmp['cid'][$val])) { + $val = $this->getConfigParam('imp_contents')->urlView(null, 'view_attach', array('params' => array( + 'id' => $this->_imptmp['cid'][$val], + 'imp_img_view' => 'data' + ))); + $node->setAttribute('background', $val); + } + + /* Block images.*/ + if ($this->_imptmp['img']) { + $node->setAttribute('htmlimgblocked', $val); + $node->setAttribute('background', $this->_imptmp['blockimg']); + $this->_imptmp['imgblock'] = true; + } } break; }