From d6a9eb6c8585b3e5160bbe304957079734706d50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 2 Mar 2021 11:35:55 +0100 Subject: [PATCH] Presenter::Tag: img_tag aus Plugin/L verschoben --- SL/Presenter/Tag.pm | 10 +++++++++- SL/Template/Plugin/L.pm | 9 +-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/SL/Presenter/Tag.pm b/SL/Presenter/Tag.pm index ab4586546..1896445a6 100644 --- a/SL/Presenter/Tag.pm +++ b/SL/Presenter/Tag.pm @@ -11,7 +11,7 @@ our @EXPORT_OK = qw( html_tag input_tag hidden_tag javascript man_days_tag name_to_id select_tag checkbox_tag button_tag submit_tag ajax_submit_tag input_number_tag stringify_attributes restricted_html textarea_tag link_tag date_tag - div_tag radio_button_tag); + div_tag radio_button_tag img_tag); our %EXPORT_TAGS = (ALL => \@EXPORT_OK); use Carp; @@ -407,6 +407,14 @@ sub div_tag { return html_tag('div', $content, %params); } +sub img_tag { + my (%params) = @_; + + $params{alt} ||= ''; + + return html_tag('img', undef, %params); +} + 1; __END__ diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index b88f7b9fe..1beeb0477 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -84,20 +84,13 @@ sub textarea_tag { return _call_presenter('textarea_tag', sub date_tag { return _call_presenter('date_tag', @_); } sub div_tag { return _call_presenter('div_tag', @_); } sub radio_button_tag { return _call_presenter('radio_button_tag', @_); } +sub img_tag { return _call_presenter('img_tag', @_); } sub _set_id_attribute { my ($attributes, $name, $unique) = @_; SL::Presenter::Tag::_set_id_attribute($attributes, $name, $unique); } -sub img_tag { - my ($self, %options) = _hashify(1, @_); - - $options{alt} ||= ''; - - return $self->html_tag('img', undef, %options); -} - sub ul_tag { my ($self, $content, @slurp) = @_; return $self->html_tag('ul', $content, @slurp); -- 2.20.1