X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b5f4fac196509681df791bc5e4ee3d8c7d2a4a41..a76881ea1f88482d4df36d75b33c556cee18ffdb:/SL/Template/Plugin/L.pm diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index bd3edda55..56dd4fbe8 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -73,6 +73,9 @@ sub part_picker { return _call_presenter('part_picker', @_); } sub chart_picker { return _call_presenter('chart_picker', @_); } sub customer_vendor_picker { return _call_presenter('customer_vendor_picker', @_); } sub project_picker { return _call_presenter('project_picker', @_); } +sub button_tag { return _call_presenter('button_tag', @_); } +sub submit_tag { return _call_presenter('submit_tag', @_); } +sub ajax_submit_tag { return _call_presenter('ajax_submit_tag', @_); } sub _set_id_attribute { my ($attributes, $name, $unique) = @_; @@ -143,37 +146,6 @@ sub link { return $self->html_tag('a', $content, %params, href => $href); } -sub submit_tag { - my ($self, $name, $value, %attributes) = _hashify(3, @_); - - if ( $attributes{confirm} ) { - $attributes{onclick} = 'return confirm("'. _J(delete($attributes{confirm})) .'");'; - } - - return $self->input_tag($name, $value, %attributes, type => 'submit', class => 'submit'); -} - -sub button_tag { - my ($self, $onclick, $value, %attributes) = _hashify(3, @_); - - _set_id_attribute(\%attributes, $attributes{name}) if $attributes{name}; - $attributes{type} ||= 'button'; - - $onclick = 'if (!confirm("'. _J(delete($attributes{confirm})) .'")) return false; ' . $onclick if $attributes{confirm}; - - return $self->html_tag('input', undef, %attributes, value => $value, onclick => $onclick); -} - -sub ajax_submit_tag { - my ($self, $url, $form_selector, $text, @slurp) = @_; - - $url = _J($url); - $form_selector = _J($form_selector); - my $onclick = qq|kivi.submit_ajax_form('${url}', '${form_selector}')|; - - return $self->button_tag($onclick, $text, @slurp); -} - sub yes_no_tag { my ($self, $name, $value, %attributes) = _hashify(3, @_); @@ -528,36 +500,6 @@ Creates a HTML 'input type=hidden' tag named C<$name> with the value C<$value> and with arbitrary HTML attributes from C<%attributes>. The tag's C defaults to C. -=item C - -Creates a HTML 'input type=submit class=submit' tag named C<$name> with the -value C<$value> and with arbitrary HTML attributes from C<%attributes>. The -tag's C defaults to C. - -If C<$attributes{confirm}> is set then a JavaScript popup dialog will -be added via the C handler asking the question given with -C<$attributes{confirm}>. The request is only submitted if the user -clicks the dialog's ok/yes button. - -=item C - -Creates a HTML 'input type="button"' tag with a very specific onclick -handler that submits the form given by the jQuery selector -C<$form_selector> to the URL C<$url> (the actual JavaScript function -called for that is C in -C). The button's label will be C<$text>. - -=item C - -Creates a HTML 'input type="button"' tag with an onclick handler -C<$onclick> and a value of C<$text>. The button does not have a name -nor an ID by default. - -If C<$attributes{confirm}> is set then a JavaScript popup dialog will -be prepended to the C<$onclick> handler asking the question given with -C<$attributes{confirm}>. The request is only submitted if the user -clicks the dialog's "ok/yes" button. - =item C Creates a HTML 'textarea' tag named C<$name> with the content