Revision a56327d7
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Template/Plugin/L.pm | ||
---|---|---|
358 | 358 |
return $code; |
359 | 359 |
} |
360 | 360 |
|
361 |
my $date_tag_id_idx = 0; |
|
361 | 362 |
sub date_tag { |
362 | 363 |
my ($self, $name, $value, @slurp) = @_; |
364 |
|
|
363 | 365 |
my %params = _hashify(@slurp); |
364 |
my $name_e = _H($name); |
|
365 |
my $seq = _tag_id(); |
|
366 |
my $datefmt = apply { |
|
367 |
s/d+/\%d/gi; |
|
368 |
s/m+/\%m/gi; |
|
369 |
s/y+/\%Y/gi; |
|
370 |
} $::myconfig{"dateformat"}; |
|
371 |
|
|
372 |
my $cal_align = delete $params{cal_align} || 'BR'; |
|
373 |
my $onchange = delete $params{onchange}; |
|
374 |
my $str_value = blessed $value ? $value->to_lxoffice : $value; |
|
375 |
|
|
376 |
$self->input_tag($name, $str_value, |
|
377 |
id => $name_e, |
|
366 |
my $id = $self->name_to_id($name) . _tag_id(); |
|
367 |
my @onchange = $params{onchange} ? (onChange => delete $params{onchange}) : (); |
|
368 |
my @class = $params{no_cal} || $params{readonly} ? () : (class => 'datepicker'); |
|
369 |
|
|
370 |
return $self->input_tag( |
|
371 |
$name, blessed($value) ? $value->to_lxoffice : $value, |
|
372 |
id => $id, |
|
378 | 373 |
size => 11, |
379 |
title => _H($::myconfig{dateformat}), |
|
380 |
onBlur => 'check_right_date_format(this)', |
|
381 |
($onchange ? ( |
|
382 |
onChange => $onchange, |
|
383 |
) : ()), |
|
374 |
onblur => "check_right_date_format(this);", |
|
384 | 375 |
%params, |
385 |
) . ((!$params{no_cal} && !$params{readonly}) ? |
|
386 |
$self->html_tag('img', undef, |
|
387 |
src => 'image/calendar.png', |
|
388 |
alt => $::locale->text('Calendar'), |
|
389 |
id => "trigger$seq", |
|
390 |
title => _H($::myconfig{dateformat}), |
|
391 |
%params, |
|
392 |
) . |
|
393 |
$self->javascript( |
|
394 |
"Calendar.setup({ inputField: '$name_e', ifFormat: '$datefmt', align: '$cal_align', button: 'trigger$seq' });" |
|
395 |
) : ''); |
|
376 |
@class, @onchange, |
|
377 |
); |
|
396 | 378 |
} |
397 | 379 |
|
398 | 380 |
sub customer_picker { |
... | ... | |
829 | 811 |
JQuery selector and clicking this checkbox will also toggle all checkboxes |
830 | 812 |
matching the selector. |
831 | 813 |
|
832 |
=item C<date_tag $name, $value, cal_align =E<gt> $align_code, %attributes>
|
|
814 |
=item C<date_tag $name, $value, %attributes> |
|
833 | 815 |
|
834 | 816 |
Creates a date input field, with an attached javascript that will open a |
835 |
calendar on click. The javascript ist by default anchoered at the bottom right |
|
836 |
sight. This can be overridden with C<cal_align>, see Calendar documentation for |
|
837 |
the details, usually you'll want a two letter abbreviation of the alignment. |
|
838 |
Right + Bottom becomes C<BL>. |
|
817 |
calendar on click. |
|
839 | 818 |
|
840 | 819 |
=item C<radio_button_tag $name, %attributes> |
841 | 820 |
|
... | ... | |
861 | 840 |
with '.css' if it isn't already and prefixed with 'css/' if it doesn't |
862 | 841 |
contain a slash. |
863 | 842 |
|
864 |
=item C<date_tag $name, $value, cal_align =E<gt> $align_code, %attributes> |
|
865 |
|
|
866 |
Creates a date input field, with an attached javascript that will open a |
|
867 |
calendar on click. The javascript ist by default anchoered at the bottom right |
|
868 |
sight. This can be overridden with C<cal_align>, see Calendar documentation for |
|
869 |
the details, usually you'll want a two letter abbreviation of the alignment. |
|
870 |
Right + Bottom becomes C<BL>. |
|
871 |
|
|
872 | 843 |
=item C<tabbed \@tab, %attributes> |
873 | 844 |
|
874 | 845 |
Will create a tabbed area. The tabs should be created with the helper function |
Auch abrufbar als: Unified diff
Lokalisierungsdateien jquery-ui hinzugefügt
Fixt #2179.