line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::TagGen; |
2
|
|
|
|
|
|
|
$HTML::Widgets::NavMenu::TagGen::VERSION = '1.0902'; |
3
|
1
|
|
|
1
|
|
56423
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
347
|
use parent 'HTML::Widgets::NavMenu::Object'; |
|
1
|
|
|
|
|
249
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
373
|
use HTML::Widgets::NavMenu::EscapeHtml qw/ escape_html /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
232
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref( [qw(name attributes)] ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _init |
14
|
|
|
|
|
|
|
{ |
15
|
1
|
|
|
1
|
|
4
|
my ( $self, $args ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
6
|
$self->name( $args->{'name'} ); |
18
|
1
|
|
|
|
|
3
|
$self->attributes( $args->{'attributes'} ); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
2
|
return 0; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub gen |
25
|
|
|
|
|
|
|
{ |
26
|
11
|
|
|
11
|
1
|
24
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
11
|
|
|
|
|
15
|
my $attr_values = shift; |
29
|
|
|
|
|
|
|
|
30
|
11
|
|
100
|
|
|
33
|
my $is_standalone = shift || 0; |
31
|
|
|
|
|
|
|
|
32
|
11
|
|
|
|
|
29
|
my @tag_list = keys(%$attr_values); |
33
|
|
|
|
|
|
|
|
34
|
11
|
|
|
|
|
19
|
@tag_list = ( grep { defined( $attr_values->{$_} ) } @tag_list ); |
|
19
|
|
|
|
|
39
|
|
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
|
|
25
|
@tag_list = ( sort { $a cmp $b } @tag_list ); |
|
15
|
|
|
|
|
24
|
|
37
|
|
|
|
|
|
|
|
38
|
11
|
|
|
|
|
21
|
my $attr_spec = $self->attributes(); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
return "<" . $self->name() . join( |
41
|
|
|
|
|
|
|
"", |
42
|
|
|
|
|
|
|
map { |
43
|
11
|
100
|
|
|
|
31
|
" $_=\"" |
44
|
|
|
|
|
|
|
. ( |
45
|
|
|
|
|
|
|
$attr_spec->{$_}->{'escape'} |
46
|
|
|
|
|
|
|
? escape_html( $attr_values->{$_} ) |
47
|
19
|
100
|
|
|
|
76
|
: $attr_values->{$_} |
48
|
|
|
|
|
|
|
) |
49
|
|
|
|
|
|
|
. "\"" |
50
|
|
|
|
|
|
|
} @tag_list |
51
|
|
|
|
|
|
|
) . ( $is_standalone ? " /" : "" ) . ">"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |