From: Sven Schöling Date: Fri, 26 Mar 2021 18:22:31 +0000 (+0100) Subject: MaterialComponents: checkbox_tag X-Git-Tag: kivitendo-mebil_0.1-0~9^2~89 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=015d45ca807ddd6ba6e6a87e11ab8cda6250baad;p=kivitendo-erp.git MaterialComponents: checkbox_tag --- diff --git a/SL/Presenter/MaterialComponents.pm b/SL/Presenter/MaterialComponents.pm index a4eacc8d3..6259fe446 100644 --- a/SL/Presenter/MaterialComponents.pm +++ b/SL/Presenter/MaterialComponents.pm @@ -285,6 +285,22 @@ sub select_tag { ); } +sub checkbox_tag { + my ($name, %attributes) = @_; + + _set_id_attribute(\%attributes, $name); + + my $label = $attributes{label} + ? html_tag('span', delete $attributes{label}) + : ''; + + my $checkbox_html = SL::Presenter::Tag::checkbox_tag($name, %attributes); + + html_tag('label', + $checkbox_html . $label, + ); +} + 1; __END__