X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FL.pm;h=871e683bf19eda39e6cd76f131712d09c589bc73;hb=a3cf1d2381e1db5ab972e6f0c74ff157012b221a;hp=4ed65ab291ce78c8ecda644a452b1ec2cb70e8b4;hpb=1cd0721d9aa749dda37f3dccaa3da2ba0ebcd2cd;p=kivitendo-erp.git diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 4ed65ab29..871e683bf 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -6,6 +6,8 @@ use List::MoreUtils qw(apply); use List::Util qw(max); use Scalar::Util qw(blessed); +use SL::Presenter; + use strict; { # This will give you an id for identifying html tags and such. @@ -281,7 +283,8 @@ sub input_tag { } sub hidden_tag { - return shift->input_tag(@_, type => 'hidden'); + my ($self, $name, $value, @slurp) = @_; + return $self->input_tag($name, $value, _hashify(@slurp), type => 'hidden'); } sub div_tag { @@ -462,27 +465,15 @@ sub tabbed { next if $tab eq ''; - my $selected = $params{selected} == $i; - my $tab_id = "__tab_id_$i"; - push @header, $self->li_tag( - $self->link('', $tab->{name}, rel => $tab_id), - ($selected ? (class => 'selected') : ()) - ); - push @blocks, $self->div_tag($tab->{data}, - id => $tab_id, class => 'tabcontent'); + my $tab_id = "__tab_id_$i"; + push @header, $self->li_tag($self->link('#' . $tab_id, $tab->{name})); + push @blocks, $self->div_tag($tab->{data}, id => $tab_id); } return '' unless @header; - return $self->ul_tag( - join('', @header), id => $id, class => 'shadetabs' - ) . - $self->div_tag( - join('', @blocks), class => 'tabcontentstyle' - ) . - $self->javascript( - qq|var $id = new ddtabcontent("$id");$id.setpersist(true);| . - qq|$id.setselectedClassTarget("link");$id.init();| - ); + + my $ul = $self->ul_tag(join('', @header), id => $id); + return $self->div_tag(join('', $ul, @blocks), class => 'tabwidget'); } sub tab { @@ -675,9 +666,7 @@ sub paginate_controls { }, ); - my $output; - $controller->_template_obj->process('templates/webpages/common/paginate.html', \%template_params, \$output); - return $output; + return SL::Presenter->get->render('common/paginate', %template_params); } 1; @@ -890,9 +879,6 @@ C. Example: L.tab(LxERP.t8('Custom Variables'), 'part/_cvar_tab.html', if => SELF.display_cvar_tab), ]) %] -An optional attribute is C, which accepts the ordinal of a tab which -should be selected by default. - =item C Creates a generic input tag or textarea tag, depending on content size. The