From f5db53cd06c51ef10fea5aabfbee74f7f2b6d96f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 27 Dec 2010 14:03:24 +0100 Subject: [PATCH] =?utf8?q?tabbed=20ids=20m=C3=BCssen=20statisch=20vergebba?= =?utf8?q?r=20sein,=20sonst=20funktioniert=20persistent=20mode=20nicht.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Template/Plugin/L.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index b9098ec1a..068fc1a48 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -55,8 +55,8 @@ sub name_to_id { } sub attributes { - my $self = shift; - my %options = _hashify(@_); + my ($self, @slurp) = @_; + my %options = _hashify(@slurp); my @result = (); while (my ($name, $value) = each %options) { @@ -69,10 +69,8 @@ sub attributes { } sub html_tag { - my $self = shift; - my $tag = shift; - my $content = shift; - my $attributes = $self->attributes(@_); + my ($self, $tag, $content, @slurp) = @_; + my $attributes = $self->attributes(@slurp); return "<${tag}${attributes}/>" unless defined($content); return "<${tag}${attributes}>${content}"; @@ -101,9 +99,8 @@ sub textarea_tag { } sub checkbox_tag { - my $self = shift; - my $name = shift; - my %attributes = _hashify(@_); + my ($self, $name, @slurp) = @_; + my %attributes = _hashify(@slurp); $attributes{id} ||= $self->name_to_id($name); $attributes{value} = 1 unless defined $attributes{value}; @@ -307,7 +304,7 @@ sub javascript_tag { sub tabbed { my ($self, $tabs, @slurp) = @_; my %params = _hashify(@slurp); - my $id = 'tab_' . _tag_id(); + my $id = $params{id} || 'tab_' . _tag_id(); $params{selected} *= 1; @@ -321,7 +318,7 @@ sub tabbed { next if $tab eq ''; my $selected = $params{selected} == $i; - my $tab_id = _tag_id(); + my $tab_id = "__tab_id_$i"; push @header, $self->li_tag( $self->link('', $tab->{name}, rel => $tab_id), ($selected ? (class => 'selected') : ()) -- 2.20.1