From: Sven Schöling Date: Tue, 17 May 2011 13:15:41 +0000 (+0200) Subject: checkall attribut in L.checkbox_tag X-Git-Tag: release-2.6.3~25^2~22 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4edfabd24a6c8e2747519c323bd99092bc6fa5a4;p=kivitendo-erp.git checkall attribut in L.checkbox_tag --- diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index b78ebb015..e0631b863 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -106,6 +106,7 @@ sub checkbox_tag { $attributes{id} ||= $self->name_to_id($name); $attributes{value} = 1 unless defined $attributes{value}; my $label = delete $attributes{label}; + my $checkall = delete $attributes{checkall}; if ($attributes{checked}) { $attributes{checked} = 'checked'; @@ -115,6 +116,7 @@ sub checkbox_tag { my $code = $self->html_tag('input', undef, %attributes, name => $name, type => 'checkbox'); $code .= $self->html_tag('label', $label, for => $attributes{id}) if $label; + $code .= $self->javascript(qq|\$('#$attributes{id}').checkall('$checkall');|) if $checkall; return $code; } @@ -578,6 +580,10 @@ If C<%attributes> contains a key C