]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/attachment.php
ConversationTree is now a plugin (not oldschool setting)
[quix0rs-gnu-social.git] / actions / attachment.php
index f149ca19d987978e4067bf6497431860e0071c74..d9cacb11931d560ddb662e00f365b7fd8032e5c2 100644 (file)
@@ -60,18 +60,17 @@ class AttachmentAction extends Action
      * @return success flag
      */
 
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
         if ($id = $this->trimmed('attachment')) {
-            $this->attachment = File::staticGet($id);
+            $this->attachment = File::getKV($id);
         }
 
         if (empty($this->attachment)) {
             // TRANS: Client error displayed trying to get a non-existing attachment.
             $this->clientError(_('No such attachment.'), 404);
-            return false;
         }
         return true;
     }
@@ -97,50 +96,23 @@ class AttachmentAction extends Action
         return $a->title();
     }
 
-    function extraHead()
-    {
-        $this->element('link',array('rel'=>'alternate',
-            'type'=>'application/json+oembed',
-            'href'=>common_local_url(
-                'oembed',
-                array(),
-                array('format'=>'json', 'url'=>
-                    common_local_url('attachment',
-                        array('attachment' => $this->attachment->id)))),
-            'title'=>'oEmbed'),null);
-        $this->element('link',array('rel'=>'alternate',
-            'type'=>'text/xml+oembed',
-            'href'=>common_local_url(
-                'oembed',
-                array(),
-                array('format'=>'xml','url'=>
-                    common_local_url('attachment',
-                        array('attachment' => $this->attachment->id)))),
-            'title'=>'oEmbed'),null);
-    }
-
     /**
      * Handle input
      *
      * Only handles get, so just show the page.
      *
-     * @param array $args $_REQUEST data (unused)
-     *
      * @return void
      */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
+        parent::handle();
 
         if (empty($this->attachment->filename)) {
-
             // if it's not a local file, gtfo
-
             common_redirect($this->attachment->url, 303);
-
-        } else {
-            $this->showPage();
         }
+
+        $this->showPage();
     }
 
     /**