Kommentar zum Payment-Helper
[kivitendo-erp.git] / SL / Template / Plugin / L.pm
index 7403ae4..7916b78 100644 (file)
@@ -78,10 +78,11 @@ sub simple_format { return _call_presenter('simple_format', @_); }
 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 link                     { return _call_presenter('link',                     @_); }
+sub link                     { return _call_presenter('link_tag',                 @_); }
 sub input_number_tag         { return _call_presenter('input_number_tag',         @_); }
 sub textarea_tag             { return _call_presenter('textarea_tag',             @_); }
 sub date_tag                 { return _call_presenter('date_tag',                 @_); }
+sub div_tag                  { return _call_presenter('div_tag',                  @_); }
 
 sub _set_id_attribute {
   my ($attributes, $name, $unique) = @_;
@@ -118,11 +119,6 @@ sub radio_button_tag {
   return $code;
 }
 
-sub div_tag {
-  my ($self, $content, @slurp) = @_;
-  return $self->html_tag('div', $content, @slurp);
-}
-
 sub ul_tag {
   my ($self, $content, @slurp) = @_;
   return $self->html_tag('ul', $content, @slurp);
@@ -304,9 +300,13 @@ JAVASCRIPT
     $filter    .= ".map(function(idx, str) { return str.replace('$params{with}_', ''); })";
 
     my $params_js = $params{params} ? qq| + ($params{params})| : '';
+    my $ajax_return = '';
+    if ($params{ajax_return}) {
+      $ajax_return = 'kivi.eval_json_result';
+    }
 
     $stop_event = <<JAVASCRIPT;
-        \$.post('$params{url}'${params_js}, { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() });
+        \$.post('$params{url}'${params_js}, { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() }, $ajax_return);
 JAVASCRIPT
   }
 
@@ -566,9 +566,13 @@ C<%params> can contain the following entries:
 =item C<url>
 
 The URL to POST an AJAX request to after a dragged element has been
-dropped. The AJAX request's return value is ignored. If given then
+dropped. The AJAX request's return value is ignored by default. If given then
 C<$params{with}> must be given as well.
 
+=item C<ajax_return>
+
+If trueish then the AJAX request's return is accepted.
+
 =item C<with>
 
 A string that is interpreted as the prefix of the children's ID. Upon