Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f89df736

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

  • ID f89df736066ebab90f8be7cfe5c43c86c322b41e
  • Vorgänger 9788b84f
  • Nachfolger 646042f6

Presenter: füge 'input_tag_trim' hinzu; entfernt Leerzeichen um Eingabe

Unterschiede anzeigen:

SL/Presenter/Tag.pm
html_tag input_tag hidden_tag javascript man_days_tag name_to_id select_tag
checkbox_tag button_tag submit_tag ajax_submit_tag input_number_tag
stringify_attributes textarea_tag link_tag date_tag
div_tag radio_button_tag img_tag multi_level_select_tag);
div_tag radio_button_tag img_tag multi_level_select_tag input_tag_trim);
our %EXPORT_TAGS = (ALL => \@EXPORT_OK);
use Carp;
......
html_tag('input', undef, %attributes, name => $name, value => $value);
}
sub input_tag_trim {
my ($name, $value, %attributes) = @_;
$attributes{'data-validate'} .= ' trimmed_whitespaces';
_set_id_attribute(\%attributes, $name);
$::request->layout->add_javascripts('kivi.Validator.js');
$::request->presenter->need_reinit_widgets($attributes{id});
input_tag($name, $value, %attributes);
}
sub hidden_tag {
my ($name, $value, %attributes) = @_;
input_tag($name, $value, %attributes, type => 'hidden');
......
C<$value> and with arbitrary HTML attributes from C<%attributes>. The
tag's C<id> defaults to C<name_to_id($name)>.
=item C<input_tag_trim $name, $value, %attributes>
This is a wrapper around C<input_tag> that adds ' trimmed_whitespaces' to
$attributes{'data-validate'} and loads C<js/kivi.Validator.js>. This will trim
the whitespaces around the input.
=item C<submit_tag $name, $value, %attributes>
Creates a HTML 'input type=submit class=submit' tag named C<$name> with the
SL/Template/Plugin/L.pm
sub select_tag { return _call_presenter('select_tag', @_); }
sub checkbox_tag { return _call_presenter('checkbox_tag', @_); }
sub input_tag { return _call_presenter('input_tag', @_); }
sub input_tag_trim{ return _call_presenter('input_tag_trim',@_); }
sub javascript { return _call_presenter('javascript', @_); }
sub truncate { return _call_presenter('truncate', @_); }
sub simple_format { return _call_presenter('simple_format', @_); }
......
=item * C<input_tag $name, $value, %attributes>
=item * C<input_tag_trim $name, $value, %attributes>
=item * C<hidden_tag $name, $value, %attributes>
=item * C<checkbox_tag $name, %attributes>

Auch abrufbar als: Unified diff