line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Date; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
692
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
5
|
1
|
|
|
1
|
|
5
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( config width ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $SPC = q( ); |
10
|
|
|
|
|
|
|
my $TTS = q( ~ ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
1
|
|
|
1
|
1
|
2
|
my ($self, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
7
|
$self->config ( { align => '"bR"', |
16
|
|
|
|
|
|
|
ifFormat => '"%d/%m/%Y"', |
17
|
|
|
|
|
|
|
singleClick => 'true' } ); |
18
|
1
|
|
|
|
|
9
|
$self->readonly( 1 ); |
19
|
1
|
|
|
|
|
6
|
$self->width ( 10 ); |
20
|
1
|
|
|
|
|
6
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub render_field { |
24
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; my $hacc = $self->hacc; |
|
1
|
|
|
|
|
3
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
10
|
$self->add_optional_js( 'calendar.js', 'calendar-setup.js' ); |
27
|
1
|
|
|
|
|
3
|
$self->add_literal_js ( 'calendars', $self->id, $self->config ); |
28
|
|
|
|
|
|
|
|
29
|
1
|
50
|
|
|
|
11
|
$args->{class} .= ($args->{class} ? $SPC : q()).'ifield calendars'; |
30
|
1
|
|
|
|
|
4
|
$args->{size } = $self->width; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
10
|
my $html = $hacc->textfield( $args ); |
33
|
1
|
|
|
|
|
49
|
my $hint = $self->hint_title.$TTS.$self->loc( 'dateWidgetTip' ); |
34
|
1
|
|
|
|
|
8
|
my $icon = $hacc->span( { class => 'calendar_icon' }, $SPC ); |
35
|
1
|
|
|
|
|
29
|
my $text = $hacc->span( { class => 'icon_button tips', |
36
|
|
|
|
|
|
|
id => $self->id.'_trigger', |
37
|
|
|
|
|
|
|
title => $hint }, $icon ); |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
37
|
$hint = $self->hint_title.$TTS.$self->loc( 'clearFieldTip' ); |
40
|
1
|
|
|
|
|
6
|
$icon = $hacc->span( { class => 'clear_field_icon' }, $SPC ); |
41
|
1
|
|
|
|
|
31
|
$text .= $hacc->span( { class => 'icon_button tips', |
42
|
|
|
|
|
|
|
id => $self->id.'_clear', |
43
|
|
|
|
|
|
|
title => $hint }, $icon ); |
44
|
1
|
|
|
|
|
35
|
$html .= $text; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
4
|
return $html; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|