line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::Tree::Node; |
2
|
|
|
|
|
|
|
$HTML::Widgets::NavMenu::Tree::Node::VERSION = '1.0902'; |
3
|
12
|
|
|
12
|
|
58416
|
use strict; |
|
12
|
|
|
|
|
31
|
|
|
12
|
|
|
|
|
281
|
|
4
|
12
|
|
|
12
|
|
49
|
use warnings; |
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
261
|
|
5
|
|
|
|
|
|
|
|
6
|
12
|
|
|
12
|
|
442
|
use parent 'HTML::Widgets::NavMenu::Object'; |
|
12
|
|
|
|
|
253
|
|
|
12
|
|
|
|
|
47
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref( |
9
|
|
|
|
|
|
|
[ |
10
|
|
|
|
|
|
|
qw( |
11
|
|
|
|
|
|
|
CurrentlyActive expanded hide host li_id role rec_url_type |
12
|
|
|
|
|
|
|
separator show_always skip subs text title url url_is_abs url_type |
13
|
|
|
|
|
|
|
) |
14
|
|
|
|
|
|
|
] |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
12
|
|
|
12
|
|
5245
|
use HTML::Widgets::NavMenu::ExpandVal (); |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
5162
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _init |
21
|
|
|
|
|
|
|
{ |
22
|
363
|
|
|
363
|
|
435
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
363
|
|
|
|
|
689
|
$self->subs( [] ); |
25
|
|
|
|
|
|
|
|
26
|
363
|
|
|
|
|
536
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub expand |
31
|
|
|
|
|
|
|
{ |
32
|
155
|
|
|
155
|
1
|
538
|
my $self = shift; |
33
|
155
|
100
|
|
|
|
449
|
my $v = |
34
|
|
|
|
|
|
|
@_ |
35
|
|
|
|
|
|
|
? ( shift(@_) ) |
36
|
|
|
|
|
|
|
: HTML::Widgets::NavMenu::ExpandVal->new( { capture => 1 } ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Don't set it to something if it's already capture_expanded(), |
39
|
|
|
|
|
|
|
# otherwise it can set as a non-capturing expansion. |
40
|
155
|
100
|
|
|
|
319
|
if ( !$self->capture_expanded() ) |
41
|
|
|
|
|
|
|
{ |
42
|
109
|
|
|
|
|
204
|
$self->expanded($v); |
43
|
|
|
|
|
|
|
} |
44
|
155
|
|
|
|
|
289
|
return 0; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub mark_as_current |
49
|
|
|
|
|
|
|
{ |
50
|
28
|
|
|
28
|
1
|
707
|
my $self = shift; |
51
|
28
|
|
|
|
|
72
|
$self->expand(); |
52
|
28
|
|
|
|
|
62
|
$self->CurrentlyActive(1); |
53
|
28
|
|
|
|
|
44
|
return 0; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _process_new_sub |
57
|
|
|
|
|
|
|
{ |
58
|
304
|
|
|
304
|
|
356
|
my $self = shift; |
59
|
304
|
|
|
|
|
339
|
my $sub = shift; |
60
|
304
|
|
|
|
|
435
|
$self->update_based_on_sub($sub); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub update_based_on_sub |
65
|
|
|
|
|
|
|
{ |
66
|
338
|
|
|
338
|
1
|
416
|
my $self = shift; |
67
|
338
|
|
|
|
|
373
|
my $sub = shift; |
68
|
338
|
100
|
|
|
|
687
|
if ( my $expand_val = $sub->expanded() ) |
69
|
|
|
|
|
|
|
{ |
70
|
55
|
|
|
|
|
99
|
$self->expand($expand_val); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub add_sub |
76
|
|
|
|
|
|
|
{ |
77
|
304
|
|
|
304
|
1
|
393
|
my $self = shift; |
78
|
304
|
|
|
|
|
354
|
my $sub = shift; |
79
|
304
|
|
|
|
|
368
|
push( @{ $self->subs }, $sub ); |
|
304
|
|
|
|
|
493
|
|
80
|
304
|
|
|
|
|
607
|
$self->_process_new_sub($sub); |
81
|
304
|
|
|
|
|
555
|
return 0; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub get_nth_sub |
86
|
|
|
|
|
|
|
{ |
87
|
104
|
|
|
104
|
1
|
144
|
my $self = shift; |
88
|
104
|
|
|
|
|
134
|
my $idx = shift; |
89
|
104
|
|
|
|
|
316
|
return $self->subs()->[$idx]; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub _num_subs |
93
|
|
|
|
|
|
|
{ |
94
|
105
|
|
|
105
|
|
145
|
my $self = shift; |
95
|
105
|
|
|
|
|
129
|
return scalar( @{ $self->subs() } ); |
|
105
|
|
|
|
|
308
|
|
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub list_regular_keys |
100
|
|
|
|
|
|
|
{ |
101
|
353
|
|
|
353
|
1
|
415
|
my $self = shift; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
return ( |
104
|
353
|
|
|
|
|
802
|
qw(host li_id rec_url_type role show_always text title url url_type)); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub list_boolean_keys |
109
|
|
|
|
|
|
|
{ |
110
|
353
|
|
|
353
|
1
|
430
|
my $self = shift; |
111
|
|
|
|
|
|
|
|
112
|
353
|
|
|
|
|
614
|
return (qw(hide separator skip url_is_abs)); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub set_values_from_hash_ref |
117
|
|
|
|
|
|
|
{ |
118
|
353
|
|
|
353
|
1
|
440
|
my $self = shift; |
119
|
353
|
|
|
|
|
410
|
my $sub_contents = shift; |
120
|
|
|
|
|
|
|
|
121
|
353
|
|
|
|
|
527
|
foreach my $key ( $self->list_regular_keys() ) |
122
|
|
|
|
|
|
|
{ |
123
|
3177
|
100
|
|
|
|
4982
|
if ( exists( $sub_contents->{$key} ) ) |
124
|
|
|
|
|
|
|
{ |
125
|
905
|
|
|
|
|
2019
|
$self->$key( $sub_contents->{$key} ); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
353
|
|
|
|
|
624
|
foreach my $key ( $self->list_boolean_keys() ) |
130
|
|
|
|
|
|
|
{ |
131
|
1412
|
100
|
|
|
|
2318
|
if ( $sub_contents->{$key} ) |
132
|
|
|
|
|
|
|
{ |
133
|
19
|
|
|
|
|
48
|
$self->$key(1); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub capture_expanded |
140
|
|
|
|
|
|
|
{ |
141
|
398
|
|
|
398
|
1
|
497
|
my $self = shift; |
142
|
|
|
|
|
|
|
|
143
|
398
|
100
|
|
|
|
714
|
if ( my $e = $self->expanded() ) |
144
|
|
|
|
|
|
|
{ |
145
|
73
|
|
|
|
|
158
|
return $e->is_capturing(); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
else |
148
|
|
|
|
|
|
|
{ |
149
|
325
|
|
|
|
|
780
|
return; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
1; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
__END__ |