Revision 14d5612b
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
757 | 757 |
::end_of_request(); |
758 | 758 |
} |
759 | 759 |
|
760 |
# write Trigger JavaScript-Code ($qty = quantity of Triggers) |
|
761 |
# changed it to accept an arbitrary number of triggers - sschoeling |
|
762 |
sub write_trigger { |
|
763 |
$main::lxdebug->enter_sub(); |
|
764 |
|
|
765 |
my $self = shift; |
|
766 |
my $myconfig = shift; |
|
767 |
my $qty = shift; |
|
768 |
|
|
769 |
# set dateform for jsscript |
|
770 |
# default |
|
771 |
my %dateformats = ( |
|
772 |
"dd.mm.yy" => "%d.%m.%Y", |
|
773 |
"dd/mm/yy" => "%d/%m/%Y", |
|
774 |
"mm/dd/yy" => "%m/%d/%Y", |
|
775 |
"yyyy-mm-dd" => "%Y-%m-%d", |
|
776 |
); |
|
777 |
|
|
778 |
my $ifFormat = defined($dateformats{$myconfig->{"dateformat"}}) ? |
|
779 |
$dateformats{$myconfig->{"dateformat"}} : "%d.%m.%Y"; |
|
780 |
|
|
781 |
my @triggers; |
|
782 |
while ($#_ >= 2) { |
|
783 |
push @triggers, qq| |
|
784 |
Calendar.setup( |
|
785 |
{ |
|
786 |
inputField : "| . (shift) . qq|", |
|
787 |
ifFormat :"$ifFormat", |
|
788 |
align : "| . (shift) . qq|", |
|
789 |
button : "| . (shift) . qq|" |
|
790 |
} |
|
791 |
); |
|
792 |
|; |
|
793 |
} |
|
794 |
my $jsscript = qq| |
|
795 |
<script type="text/javascript"> |
|
796 |
<!--| . join("", @triggers) . qq|//--> |
|
797 |
</script> |
|
798 |
|; |
|
799 |
|
|
800 |
$main::lxdebug->leave_sub(); |
|
801 |
|
|
802 |
return $jsscript; |
|
803 |
} #end sub write_trigger |
|
804 |
|
|
805 | 760 |
sub _store_redirect_info_in_session { |
806 | 761 |
my ($self) = @_; |
807 | 762 |
|
Auch abrufbar als: Unified diff
Veralteten Code entfernen