From 6591d78a9c23cb6c4aa47fb9ca7feba46b57297e Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 5 May 2021 13:35:02 +0000 Subject: [PATCH] [TWIG] Remove unused Twig function 'get_note_other_content' --- src/Twig/Extension.php | 1 - src/Twig/Runtime.php | 15 --------------- templates/note/view.html.twig | 10 +++++----- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/Twig/Extension.php b/src/Twig/Extension.php index 1595c7b87a..5501665190 100644 --- a/src/Twig/Extension.php +++ b/src/Twig/Extension.php @@ -54,7 +54,6 @@ class Extension extends AbstractExtension new TwigFunction('active', [Runtime::class, 'isCurrentRouteActive']), new TwigFunction('is_route', [Runtime::class, 'isCurrentRoute']), new TwigFunction('get_note_actions', [Runtime::class, 'getNoteActions']), - new TwigFunction('get_note_other_content', [Runtime::class, 'getNoteOtherContent']), new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']), new TwigFunction('handle_event', [Runtime::class, 'handleEvent']), new TwigFunction('config', [Runtime::class, 'getConfig']), diff --git a/src/Twig/Runtime.php b/src/Twig/Runtime.php index eeac1e66fc..6507df30df 100644 --- a/src/Twig/Runtime.php +++ b/src/Twig/Runtime.php @@ -68,21 +68,6 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface return $actions; } - /** - * get extra note content - * - * @param Note $note - * - * @return array|mixed note content - */ - public function getNoteOtherContent(Note $note) - { - $other = []; - Event::handle('show_note_content', [$this->request, $note, &$other]); - - return $other; - } - public function getConfig(...$args) { return Common::config(...$args); diff --git a/templates/note/view.html.twig b/templates/note/view.html.twig index 1b8f75dee0..4d36fe05d9 100644 --- a/templates/note/view.html.twig +++ b/templates/note/view.html.twig @@ -16,11 +16,11 @@ {{ note.getContent() }} {% endapply %} {% endblock %} -
- {% for other in get_note_other_content(note) %} - {% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %} - {% endfor %} -
+ {#
#} + {# {% for other in get_note_other_content(note) %} #} + {# {% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %} #} + {# {% endfor %} #} + {#
#} {% if hide_attachments is not defined %}
{% for attachment in note.getAttachments() %}