line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::Tree::Node; |
2
|
|
|
|
|
|
|
$HTML::Widgets::NavMenu::Tree::Node::VERSION = '1.0901'; |
3
|
12
|
|
|
12
|
|
55588
|
use strict; |
|
12
|
|
|
|
|
28
|
|
|
12
|
|
|
|
|
284
|
|
4
|
12
|
|
|
12
|
|
56
|
use warnings; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
297
|
|
5
|
|
|
|
|
|
|
|
6
|
12
|
|
|
12
|
|
405
|
use parent 'HTML::Widgets::NavMenu::Object'; |
|
12
|
|
|
|
|
255
|
|
|
12
|
|
|
|
|
45
|
|
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
|
|
5353
|
use HTML::Widgets::NavMenu::ExpandVal (); |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
5284
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _init |
21
|
|
|
|
|
|
|
{ |
22
|
363
|
|
|
363
|
|
477
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
363
|
|
|
|
|
610
|
$self->subs( [] ); |
25
|
|
|
|
|
|
|
|
26
|
363
|
|
|
|
|
563
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub expand |
31
|
|
|
|
|
|
|
{ |
32
|
155
|
|
|
155
|
1
|
410
|
my $self = shift; |
33
|
155
|
100
|
|
|
|
451
|
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
|
|
|
|
301
|
if ( !$self->capture_expanded() ) |
41
|
|
|
|
|
|
|
{ |
42
|
109
|
|
|
|
|
187
|
$self->expanded($v); |
43
|
|
|
|
|
|
|
} |
44
|
155
|
|
|
|
|
290
|
return 0; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub mark_as_current |
49
|
|
|
|
|
|
|
{ |
50
|
28
|
|
|
28
|
1
|
490
|
my $self = shift; |
51
|
28
|
|
|
|
|
75
|
$self->expand(); |
52
|
28
|
|
|
|
|
63
|
$self->CurrentlyActive(1); |
53
|
28
|
|
|
|
|
62
|
return 0; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _process_new_sub |
57
|
|
|
|
|
|
|
{ |
58
|
304
|
|
|
304
|
|
354
|
my $self = shift; |
59
|
304
|
|
|
|
|
392
|
my $sub = shift; |
60
|
304
|
|
|
|
|
463
|
$self->update_based_on_sub($sub); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub update_based_on_sub |
65
|
|
|
|
|
|
|
{ |
66
|
338
|
|
|
338
|
1
|
397
|
my $self = shift; |
67
|
338
|
|
|
|
|
370
|
my $sub = shift; |
68
|
338
|
100
|
|
|
|
673
|
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
|
413
|
my $self = shift; |
78
|
304
|
|
|
|
|
349
|
my $sub = shift; |
79
|
304
|
|
|
|
|
351
|
push( @{ $self->subs }, $sub ); |
|
304
|
|
|
|
|
485
|
|
80
|
304
|
|
|
|
|
689
|
$self->_process_new_sub($sub); |
81
|
304
|
|
|
|
|
549
|
return 0; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub get_nth_sub |
86
|
|
|
|
|
|
|
{ |
87
|
104
|
|
|
104
|
1
|
156
|
my $self = shift; |
88
|
104
|
|
|
|
|
136
|
my $idx = shift; |
89
|
104
|
|
|
|
|
285
|
return $self->subs()->[$idx]; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub _num_subs |
93
|
|
|
|
|
|
|
{ |
94
|
105
|
|
|
105
|
|
148
|
my $self = shift; |
95
|
105
|
|
|
|
|
123
|
return scalar( @{ $self->subs() } ); |
|
105
|
|
|
|
|
324
|
|
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub list_regular_keys |
100
|
|
|
|
|
|
|
{ |
101
|
353
|
|
|
353
|
1
|
400
|
my $self = shift; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
return ( |
104
|
353
|
|
|
|
|
753
|
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
|
433
|
my $self = shift; |
111
|
|
|
|
|
|
|
|
112
|
353
|
|
|
|
|
608
|
return (qw(hide separator skip url_is_abs)); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub set_values_from_hash_ref |
117
|
|
|
|
|
|
|
{ |
118
|
353
|
|
|
353
|
1
|
428
|
my $self = shift; |
119
|
353
|
|
|
|
|
410
|
my $sub_contents = shift; |
120
|
|
|
|
|
|
|
|
121
|
353
|
|
|
|
|
546
|
foreach my $key ( $self->list_regular_keys() ) |
122
|
|
|
|
|
|
|
{ |
123
|
3177
|
100
|
|
|
|
5266
|
if ( exists( $sub_contents->{$key} ) ) |
124
|
|
|
|
|
|
|
{ |
125
|
905
|
|
|
|
|
1965
|
$self->$key( $sub_contents->{$key} ); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
353
|
|
|
|
|
619
|
foreach my $key ( $self->list_boolean_keys() ) |
130
|
|
|
|
|
|
|
{ |
131
|
1412
|
100
|
|
|
|
2330
|
if ( $sub_contents->{$key} ) |
132
|
|
|
|
|
|
|
{ |
133
|
19
|
|
|
|
|
61
|
$self->$key(1); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub capture_expanded |
140
|
|
|
|
|
|
|
{ |
141
|
398
|
|
|
398
|
1
|
515
|
my $self = shift; |
142
|
|
|
|
|
|
|
|
143
|
398
|
100
|
|
|
|
695
|
if ( my $e = $self->expanded() ) |
144
|
|
|
|
|
|
|
{ |
145
|
73
|
|
|
|
|
161
|
return $e->is_capturing(); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
else |
148
|
|
|
|
|
|
|
{ |
149
|
325
|
|
|
|
|
781
|
return; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
1; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
__END__ |