From 9ed1603716e43626c764d45c3714ce9aaf4afe32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 25 Jan 2018 11:56:56 +0100 Subject: [PATCH] Presenter::Tag::link - umbenannt in link_tag um Namenskonflikte mit dem link builtin zu vermeiden --- SL/Presenter/Tag.pm | 6 ++++-- SL/Template/Plugin/L.pm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SL/Presenter/Tag.pm b/SL/Presenter/Tag.pm index 696ec561e..80dca58f6 100644 --- a/SL/Presenter/Tag.pm +++ b/SL/Presenter/Tag.pm @@ -10,7 +10,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 textarea_tag link date_tag + stringify_attributes restricted_html textarea_tag link_tag date_tag ); our %EXPORT_TAGS = (ALL => \@EXPORT_OK); @@ -323,13 +323,15 @@ sub textarea_tag { html_tag('textarea', $content, %attributes, name => $name); } -sub link { +sub link_tag { my ($href, $content, %params) = @_; $href ||= '#'; html_tag('a', $content, %params, href => $href); } +# alias for compatibility +sub link { goto &link_tag } sub date_tag { my ($name, $value, %params) = @_; diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 7403ae4dc..b38365bf3 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -78,7 +78,7 @@ sub simple_format { return _call_presenter('simple_format', @_); } sub button_tag { return _call_presenter('button_tag', @_); } 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 link { return _call_presenter('link_tag', @_); } sub input_number_tag { return _call_presenter('input_number_tag', @_); } sub textarea_tag { return _call_presenter('textarea_tag', @_); } sub date_tag { return _call_presenter('date_tag', @_); } -- 2.20.1