[TWIG] Remove unused Twig function 'get_note_other_content'

This commit is contained in:
Hugo Sales 2021-05-05 13:35:02 +00:00
parent f0c6aa761b
commit 6591d78a9c
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 5 additions and 21 deletions

View File

@ -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']),

View File

@ -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);

View File

@ -16,11 +16,11 @@
{{ note.getContent() }}
{% endapply %}
{% endblock %}
<div class="note-other-content">
{% for other in get_note_other_content(note) %}
{% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %}
{% endfor %}
</div>
{# <div class="note-other-content"> #}
{# {% for other in get_note_other_content(note) %} #}
{# {% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %} #}
{# {% endfor %} #}
{# </div> #}
{% if hide_attachments is not defined %}
<div class="note-attachments">
{% for attachment in note.getAttachments() %}