From: Michael M Slusarz Date: Tue, 18 Nov 2008 20:58:45 +0000 (-0700) Subject: Use new embeddedMimeParts() return format. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4ef575056ced285ff9e22cc860381e30590eee0a;p=horde.git Use new embeddedMimeParts() return format. --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 8c646e261..df91c6e1b 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -726,15 +726,18 @@ class IMP_Contents $mime_part = $this->getMIMEPart($id); $viewer->setMIMEPart($mime_part); $viewer->setParams(array('contents' => &$this)); - $new_part = $viewer->getEmbeddedMimeParts(); - if (!is_null($new_part)) { - if (is_a($new_part, 'Horde_Mime_Message')) { - $this->_message = $new_part; - $this->_build = false; - return $this->_buildMessage(); + $new_parts = $viewer->getEmbeddedMimeParts(); + if (!is_null($new_parts)) { + foreach (array_keys($new_parts) as $val) { + if (is_a($new_parts[$val], 'Horde_Mime_Message')) { + $this->_message = $new_parts[$val]; + $this->_build = false; + return $this->_buildMessage(); + } + + $this->_message->alterPart($val, $new_parts[$val]); + $to_process = array_merge($to_process, array_keys($new_parts[$val]->contentTypeMap())); } - $this->_message->alterPart($id, $new_part); - $to_process = array_merge($to_process, array_keys($new_part->contentTypeMap())); $last_id = $id; } } @@ -750,7 +753,7 @@ class IMP_Contents * * @param mixed $id The MIME part or a MIME ID string. * @param integer $mask One of the RENDER_ constants. - * @param string $type The type to use (overrides the MIME Id if $id is + * @param string $type The type to use (overrides the MIME ID if $id is * a MIME part). * * @return boolean True if the part can be displayed. diff --git a/imp/lib/Mime/Viewer/partial.php b/imp/lib/Mime/Viewer/partial.php index 6c8814c1a..5af624409 100644 --- a/imp/lib/Mime/Viewer/partial.php +++ b/imp/lib/Mime/Viewer/partial.php @@ -27,11 +27,11 @@ class IMP_Horde_Mime_Viewer_partial extends Horde_Mime_Viewer_Driver /** * If this MIME part can contain embedded MIME parts, and those embedded - * MIME parts exist, return an altered version of the Horde_Mime_Part that - * contains the embedded MIME part information. + * MIME parts exist, return a list of MIME parts that contain the embedded + * MIME part information. * - * @return mixed A Horde_Mime_Part with the embedded MIME part information - * or null if no embedded MIME parts exist. + * @return array An array of Horde_Mime_Part objects, with the key as + * the ID, or null if no embedded MIME parts exist. */ protected function _getEmbeddedMimeParts() { @@ -76,6 +76,8 @@ class IMP_Horde_Mime_Viewer_partial extends Horde_Mime_Viewer_Driver /* Combine the parts. */ $mime_message = Horde_Mime_Message::parseMessage(implode('', $parts)); - return ($mime_message === false) ? null : $mime_message; + return ($mime_message === false) + ? null + : array($id => $mime_message); } }