line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::TagGen; |
2
|
|
|
|
|
|
|
$HTML::Widgets::NavMenu::TagGen::VERSION = '1.1000'; |
3
|
1
|
|
|
1
|
|
54782
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
377
|
use parent 'HTML::Widgets::NavMenu::Object'; |
|
1
|
|
|
|
|
234
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
355
|
use HTML::Widgets::NavMenu::EscapeHtml qw/ escape_html /; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
260
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref( [qw(name attributes)] ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _init |
14
|
|
|
|
|
|
|
{ |
15
|
1
|
|
|
1
|
|
3
|
my ( $self, $args ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
5
|
$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
|
46
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
11
|
|
|
|
|
11
|
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
|
|
|
|
|
18
|
@tag_list = ( grep { defined( $attr_values->{$_} ) } @tag_list ); |
|
19
|
|
|
|
|
41
|
|
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
|
|
34
|
@tag_list = ( sort { $a cmp $b } @tag_list ); |
|
15
|
|
|
|
|
23
|
|
37
|
|
|
|
|
|
|
|
38
|
11
|
|
|
|
|
23
|
my $attr_spec = $self->attributes(); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
return "<" . $self->name() . join( |
41
|
|
|
|
|
|
|
"", |
42
|
|
|
|
|
|
|
map { |
43
|
11
|
100
|
|
|
|
33
|
" $_=\"" |
44
|
|
|
|
|
|
|
. ( |
45
|
|
|
|
|
|
|
$attr_spec->{$_}->{'escape'} |
46
|
|
|
|
|
|
|
? escape_html( $attr_values->{$_} ) |
47
|
19
|
100
|
|
|
|
85
|
: $attr_values->{$_} |
48
|
|
|
|
|
|
|
) |
49
|
|
|
|
|
|
|
. "\"" |
50
|
|
|
|
|
|
|
} @tag_list |
51
|
|
|
|
|
|
|
) . ( $is_standalone ? " /" : "" ) . ">"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |