]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Oembed/OembedPlugin.php
think I have managed to show oEmbed images better now
[quix0rs-gnu-social.git] / plugins / Oembed / OembedPlugin.php
index f9bd2af896c31818109506c40c7a158074ab89dd..7d66bdebefac568c7148392decc56b9693e523b7 100644 (file)
@@ -187,7 +187,7 @@ class OembedPlugin extends Plugin
         return true;
     }
     
-    public function onStartShowAttachmentRepresentation(HTMLOutputter $out, File $file)
+    public function onShowUnsupportedAttachmentRepresentation(HTMLOutputter $out, File $file)
     {
         try {
             $oembed = File_oembed::getByFile($file);
@@ -195,6 +195,7 @@ class OembedPlugin extends Plugin
             return true;
         }
 
+        // the 'photo' type is shown through ordinary means, using StartShowAttachmentRepresentation!
         switch ($oembed->type) {
         case 'rich':
         case 'video':
@@ -207,15 +208,11 @@ class OembedPlugin extends Plugin
                     'elements'=>'*+object+embed');
                 $out->raw(htmLawed($oembed->html,$config));
             }
+            return false;
             break;
-
-        case 'photo':
-            $out->element('img', array('src' => $oembed->url, 'width' => $oembed->width, 'height' => $oembed->height, 'alt' => 'alt'));
-            break;
-
-        default:
-            Event::handle('ShowUnsupportedAttachmentRepresentation', array($out, $file));
         }
+
+        return true;
     }
 
     public function onCreateFileImageThumbnailSource(File $file, &$imgPath, $media=null)