Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 341fbe8b

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 341fbe8b28d2b9cb98934aed0336a99923cfefc0
  • Vorgänger 5551a36b
  • Nachfolger 2738c03e

L.button_tag: Support für 'confirm' & Doku

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
180 180
  $attributes{id}   ||= $self->name_to_id($attributes{name}) if $attributes{name};
181 181
  $attributes{type} ||= 'button';
182 182

  
183
  $onclick = 'if (!confirm("'. _J(delete($attributes{confirm})) .'")) return false; ' . $onclick if $attributes{confirm};
184

  
183 185
  return $self->html_tag('input', undef, %attributes, value => $value, onclick => $onclick);
184 186
}
185 187

  
......
572 574

  
573 575
If C<$attributes{confirm}> is set then a JavaScript popup dialog will
574 576
be added via the C<onclick> handler asking the question given with
575
C<$attributes{confirm}>. If request is only submitted if the user
577
C<$attributes{confirm}>. The request is only submitted if the user
576 578
clicks the dialog's ok/yes button.
577 579

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

  
582
Creates a HTML 'input type="button"' tag with an onclick handler
583
C<$onclick> and a value of C<$text>. The button does not have a name
584
nor an ID by default.
585

  
586
If C<$attributes{confirm}> is set then a JavaScript popup dialog will
587
be prepended to the C<$onclick> handler asking the question given with
588
C<$attributes{confirm}>. The request is only submitted if the user
589
clicks the dialog's "ok/yes" button.
590

  
578 591
=item C<textarea_tag $name, $value, %attributes>
579 592

  
580 593
Creates a HTML 'textarea' tag named C<$name> with the content

Auch abrufbar als: Unified diff