From 86eed2325ab7d7342ad0b832931cb8ada6efb5d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 27 Dec 2017 12:07:41 +0100 Subject: [PATCH] Presenter::Tag: textarea_tag aus Plugin/L verschoben --- SL/Presenter/Tag.pm | 12 +++++++++++- SL/Template/Plugin/L.pm | 12 +----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SL/Presenter/Tag.pm b/SL/Presenter/Tag.pm index 141be6cac..e5d8d27da 100644 --- a/SL/Presenter/Tag.pm +++ b/SL/Presenter/Tag.pm @@ -9,7 +9,7 @@ use Exporter qw(import); 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 link + stringify_attributes restricted_html textarea_tag link ); our %EXPORT_TAGS = (ALL => \@EXPORT_OK); @@ -312,6 +312,16 @@ sub restricted_html { return $html_restricter->process($value); } +sub textarea_tag { + my ($name, $content, %attributes) = @_; + + _set_id_attribute(\%attributes, $name); + $attributes{rows} *= 1; # required by standard + $attributes{cols} *= 1; # required by standard + + html_tag('textarea', $content, %attributes, name => $name); +} + sub link { my ($href, $content, %params) = @_; diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 8931541bb..f24ded25a 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -80,6 +80,7 @@ sub submit_tag { return _call_presenter('submit_tag', sub ajax_submit_tag { return _call_presenter('ajax_submit_tag', @_); } sub link { return _call_presenter('link', @_); } sub input_number_tag { return _call_presenter('input_number_tag', @_); } +sub textarea_tag { return _call_presenter('textarea_tag', @_); } sub _set_id_attribute { my ($attributes, $name, $unique) = @_; @@ -94,17 +95,6 @@ sub img_tag { return $self->html_tag('img', undef, %options); } -sub textarea_tag { - my ($self, $name, $content, %attributes) = _hashify(3, @_); - - _set_id_attribute(\%attributes, $name); - $attributes{rows} *= 1; # required by standard - $attributes{cols} *= 1; # required by standard - $content = $content ? _H($content) : ''; - - return $self->html_tag('textarea', $content, %attributes, name => $name); -} - sub radio_button_tag { my ($self, $name, %attributes) = _hashify(2, @_); -- 2.20.1