forked from GNUsocial/gnu-social
[AttachmentShowRelated] Move Attachment related to plugin
This commit is contained in:
@@ -59,16 +59,11 @@ class Attachment extends Controller
|
||||
$attachment = DB::findOneBy('attachment', ['id' => $id]);
|
||||
return $this->attachment($id, function ($res) use ($id, $attachment) {
|
||||
return [
|
||||
'_template' => 'attachments/show.html.twig',
|
||||
'title' => $res['title'],
|
||||
'download' => Router::url('attachment_download', ['id' => $id]),
|
||||
'attachment' => $attachment,
|
||||
'related_notes' => DB::dql('select n from attachment_to_note an ' .
|
||||
'join note n with n.id = an.note_id ' .
|
||||
'where an.attachment_id = :attachment_id', ['attachment_id' => $id]),
|
||||
'related_tags' => DB::dql('select distinct t.tag ' .
|
||||
'from attachment_to_note an join note_tag t with an.note_id = t.note_id ' .
|
||||
'where an.attachment_id = :attachment_id', ['attachment_id' => $id]),
|
||||
'_template' => 'attachments/show.html.twig',
|
||||
'title' => $res['title'],
|
||||
'download' => Router::url('attachment_download', ['id' => $id]),
|
||||
'attachment' => $attachment,
|
||||
'right_panel_vars' => ['attachment_id' => $id],
|
||||
];
|
||||
});
|
||||
} catch (NotFoundException) {
|
||||
|
Reference in New Issue
Block a user