Fix SMIL viewing
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 16 Aug 2010 08:20:23 +0000 (02:20 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 16 Aug 2010 19:44:20 +0000 (13:44 -0600)
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Smil.php
imp/lib/Mime/Viewer/Smil.php

index 542bc1c..a3943b3 100644 (file)
@@ -36,27 +36,26 @@ class Horde_Mime_Viewer_Smil extends Horde_Mime_Viewer_Base
     protected $_capability = array(
         'full' => true,
         'info' => false,
-        'inline' => false,
+        'inline' => true,
         'raw' => false
     );
 
     /**
-     * Metadata for the current viewer/data.
+     * Return the full rendered version of the Horde_Mime_Part object.
      *
-     * @var array
+     * @return array  See parent::render().
      */
-    protected $_metadata = array(
-        'compressed' => false,
-        'embedded' => false,
-        'forceinline' => true
-    );
+    protected function _render()
+    {
+        return $this->_renderFullReturn($this->_renderInline());
+    }
 
     /**
-     * Return the full rendered version of the Horde_Mime_Part object.
+     * Return the rendered inline version of the Horde_Mime_Part object.
      *
      * @return array  See parent::render().
      */
-    protected function _render()
+    protected function _renderInline()
     {
         $this->_content = '';
 
index a7127fd..e580228 100644 (file)
@@ -28,7 +28,7 @@ class IMP_Mime_Viewer_Smil extends Horde_Mime_Viewer_Smil
         case 'IMG':
             if (isset($attrs['SRC']) &&
                 (($rp = $this->_getRelatedLink($attrs['SRC'])) !== false)) {
-                $this->_content .= '<img src="' . $this->getConfigParam('imp_contents')->urlView($rp, 'view_attach') . '" alt="" /><br />';
+                $this->_content .= '<img src="' . $this->getConfigParam('imp_contents')->urlView($rp, 'view_attach', array('params' => array('imp_img_view' => 'data'))) . '" /><br />';
             }
             break;
 
@@ -50,9 +50,11 @@ class IMP_Mime_Viewer_Smil extends Horde_Mime_Viewer_Smil
      */
     protected function _getRelatedLink($cid)
     {
-        if ($related_part = $this->findMimeType($this->_mimepart->getMimeId(), 'multipart/related') &&
-            (($key = array_search(trim($cid, '<>', $related_part->getMetadata('related_cids')))) !== false)) {
-            return $this->getConfigParam('imp_contents')->getMIMEPart($key);
+        if ($related_part = $this->getConfigParam('imp_contents')->findMimeType($this->_mimepart->getMimeId(), 'multipart/related')) {
+            $key = array_search('<' . trim($cid, '<>') . '>', $related_part->getMetadata('related_cids'));
+            if ($key !== false) {
+                return $this->getConfigParam('imp_contents')->getMIMEPart($key);
+            }
         }
 
         return false;