]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlistitem.php
Merge commit 'refs/merge-requests/41' of https://gitorious.org/social/mainline into...
[quix0rs-gnu-social.git] / lib / attachmentlistitem.php
index 320218b1a307b9cbd5c14af3e6f04cf5ec16ef34..919727bc1f8ff69beab70f7c573bdd6efad20974 100644 (file)
@@ -63,7 +63,7 @@ class AttachmentListItem extends Widget
     }
 
     function title() {
-        return $this->attachment->title ?: $this->attachment->filename;
+        return $this->attachment->getTitle();
     }
 
     function linkTitle() {
@@ -113,10 +113,11 @@ class AttachmentListItem extends Widget
                 case 'image/jpg':
                 case 'image/jpeg':
                     try {
-                        $thumb = $this->attachment->getThumbnail();
-                        $this->out->element('img', array('src' => $thumb->getUrl(), 'alt' => ''));
+                        // Tell getThumbnail that we can show an animated image if it has one (4th arg, "force_still")
+                        $thumb = $this->attachment->getThumbnail(null, null, false, false);
+                        $this->out->element('img', array('class'=>'u-photo', 'src' => $thumb->getUrl(), 'alt' => ''));
                     } catch (UseFileAsThumbnailException $e) {
-                        $this->out->element('img', array('src' => $e->file->getUrl(), 'alt' => $e->file->title));
+                        $this->out->element('img', array('class'=>'u-photo', 'src' => $e->file->getUrl(), 'alt' => $e->file->title));
                     } catch (UnsupportedMediaException $e) {
                         // FIXME: Show a good representation of unsupported/unshowable images
                     }
@@ -151,7 +152,7 @@ class AttachmentListItem extends Widget
                         $poster = null;
                     }
                     $this->out->elementStart($mediatype,
-                                        array('class'=>'attachment_player',
+                                        array('class'=>"attachment_player u-{$mediatype}",
                                             'poster'=>$poster,
                                             'controls'=>'controls'));
                     $this->out->element('source',