Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 86a76ea5

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 86a76ea5ef69b72b777298ca2335e980a216f377
  • Vorgänger f509d946
  • Nachfolger 7b35c53f

L: neue Funktion ajax_submit_tag()

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
185 185
  return $self->html_tag('input', undef, %attributes, value => $value, onclick => $onclick);
186 186
}
187 187

  
188
sub ajax_submit_tag {
189
  my ($self, $url, $form_selector, $text, @slurp) = @_;
190

  
191
  $url           = _J($url);
192
  $form_selector = _J($form_selector);
193
  my $onclick    = qq|submit_ajax_form('${url}', '${form_selector}')|;
194

  
195
  return $self->button_tag($onclick, $text, @slurp);
196
}
197

  
188 198
sub yes_no_tag {
189 199
  my ($self, $name, $value) = splice @_, 0, 3;
190 200
  my %attributes            = _hashify(@_);
......
577 587
C<$attributes{confirm}>. The request is only submitted if the user
578 588
clicks the dialog's ok/yes button.
579 589

  
590
=item C<ajax_submit_tag $url, $form_selector, $text, %attributes>
591

  
592
Creates a HTML 'input type="button"' tag with a very specific onclick
593
handler that submits the form given by the jQuery selector
594
C<$form_selector> to the URL C<$url> (the actual JavaScript function
595
called for that is C<submit_ajax_form()> in C<js/client_js.js>). The
596
button's label will be C<$text>.
597

  
580 598
=item C<button_tag $onclick, $text, %attributes>
581 599

  
582 600
Creates a HTML 'input type="button"' tag with an onclick handler

Auch abrufbar als: Unified diff