From 4edfabd24a6c8e2747519c323bd99092bc6fa5a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 17 May 2011 15:15:41 +0200 Subject: [PATCH] checkall attribut in L.checkbox_tag --- SL/Template/Plugin/L.pm | 6 ++++++ 1 file changed, 6 insertions(+) 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