]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Display more oembed info in attachment popup.
authorRobin Millette <millette@controlyourself.ca>
Thu, 18 Jun 2009 10:02:12 +0000 (06:02 -0400)
committerRobin Millette <millette@controlyourself.ca>
Thu, 18 Jun 2009 10:02:12 +0000 (06:02 -0400)
lib/attachmentlist.php
theme/base/css/display.css

index 45e4fa319687761ee9dc31d3b617b7cfc18a2e5e..a781c3092c9fb7215f68610bc5756fb7f2fbf478 100644 (file)
@@ -244,6 +244,42 @@ class AttachmentListItem extends Widget
 
 class Attachment extends AttachmentListItem
 {
+    function showLink() {
+        $this->out->elementStart('a', $this->linkAttr());
+        $this->out->element('span', null, $this->linkTitle());
+        $this->showRepresentation();
+        $this->out->elementEnd('a');
+
+        if (empty($this->oembed->author_name) && empty($this->oembed->provider)) {
+            return;
+        }
+
+        $this->out->elementStart('dl', 'oembed_info');
+        
+        if (!empty($this->oembed->author_name)) {
+            $this->out->element('dt', null, _('Author:'));
+
+            $this->out->elementStart('dd');
+            if (empty($this->oembed->author_url)) {
+                $this->out->text($this->oembed->author_name);
+            } else {
+                $this->out->element('a', array('href' => $this->oembed->author_url), $this->oembed->author_name);
+            }
+            $this->out->elementEnd('dd');
+        }
+        if (!empty($this->oembed->provider)) {
+            $this->out->element('dt', null, _('Provider:'));
+            $this->out->elementStart('dd');
+            if (empty($this->oembed->provider_url)) {
+                $this->out->text($this->oembed->provider);
+            } else {
+                $this->out->element('a', array('href' => $this->oembed->provider_url), $this->oembed->provider);
+            }
+            $this->out->elementEnd('dd');
+        }
+        $this->out->elementEnd('dl');
+    }
+
     function show() {
         $this->showNoticeAttachment();
     }
index 9e35d015d1a0296d1f464fe580e0f66339fed9ca..dd787f5e2919dee7f87b783e5c1888fa1d95c943 100644 (file)
@@ -1276,3 +1276,9 @@ display:none;
 .guide {
 clear:both;
 }
+
+dl.oembed_info dt,
+dl.oembed_info dd {
+display: inline;
+}
+