Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f5db53cd

Von Sven Schöling vor fast 14 Jahren hinzugefügt

  • ID f5db53cd06c51ef10fea5aabfbee74f7f2b6d96f
  • Vorgänger f4f55336
  • Nachfolger 703161fc

tabbed ids müssen statisch vergebbar sein, sonst funktioniert persistent mode nicht.

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
55 55
}
56 56

  
57 57
sub attributes {
58
  my $self    = shift;
59
  my %options = _hashify(@_);
58
  my ($self, @slurp)    = @_;
59
  my %options = _hashify(@slurp);
60 60

  
61 61
  my @result = ();
62 62
  while (my ($name, $value) = each %options) {
......
69 69
}
70 70

  
71 71
sub html_tag {
72
  my $self       = shift;
73
  my $tag        = shift;
74
  my $content    = shift;
75
  my $attributes = $self->attributes(@_);
72
  my ($self, $tag, $content, @slurp) = @_;
73
  my $attributes = $self->attributes(@slurp);
76 74

  
77 75
  return "<${tag}${attributes}/>" unless defined($content);
78 76
  return "<${tag}${attributes}>${content}</${tag}>";
......
101 99
}
102 100

  
103 101
sub checkbox_tag {
104
  my $self             = shift;
105
  my $name             = shift;
106
  my %attributes       = _hashify(@_);
102
  my ($self, $name, @slurp) = @_;
103
  my %attributes       = _hashify(@slurp);
107 104

  
108 105
  $attributes{id}    ||= $self->name_to_id($name);
109 106
  $attributes{value}   = 1 unless defined $attributes{value};
......
307 304
sub tabbed {
308 305
  my ($self, $tabs, @slurp) = @_;
309 306
  my %params   = _hashify(@slurp);
310
  my $id       = 'tab_' . _tag_id();
307
  my $id       = $params{id} || 'tab_' . _tag_id();
311 308

  
312 309
  $params{selected} *= 1;
313 310

  
......
321 318
    next if $tab eq '';
322 319

  
323 320
    my $selected = $params{selected} == $i;
324
    my $tab_id = _tag_id();
321
    my $tab_id   = "__tab_id_$i";
325 322
    push @header, $self->li_tag(
326 323
      $self->link('', $tab->{name}, rel => $tab_id),
327 324
        ($selected ? (class => 'selected') : ())

Auch abrufbar als: Unified diff