line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::ToJSON::Data_Persistence; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1504
|
use 5.008; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
54
|
|
5
|
2
|
|
|
2
|
|
16
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
64
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use parent 'HTML::Widgets::NavMenu::Object'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref( |
10
|
|
|
|
|
|
|
[ |
11
|
|
|
|
|
|
|
qw( |
12
|
|
|
|
|
|
|
_data |
13
|
|
|
|
|
|
|
), |
14
|
|
|
|
|
|
|
] |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.0.7'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _get_id_persistence |
23
|
|
|
|
|
|
|
{ |
24
|
9
|
|
|
9
|
|
8
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
9
|
|
|
|
|
14
|
return $self->_data->{id_persistence}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _calc_initial_data |
30
|
|
|
|
|
|
|
{ |
31
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
6
|
return { id_persistence => { paths_ids => { }, next_id => 1, }, }; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub get_id_for_url |
37
|
|
|
|
|
|
|
{ |
38
|
9
|
|
|
9
|
1
|
11
|
my ($self, $url) = @_; |
39
|
|
|
|
|
|
|
|
40
|
9
|
|
|
|
|
15
|
my $ptr = $self->_get_id_persistence; |
41
|
|
|
|
|
|
|
|
42
|
9
|
50
|
|
|
|
17
|
if (! exists($ptr->{paths_ids}->{$url})) |
43
|
|
|
|
|
|
|
{ |
44
|
9
|
|
|
|
|
21
|
$ptr->{paths_ids}->{$url} = ($ptr->{next_id}++); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
9
|
|
|
|
|
21
|
return $ptr->{paths_ids}->{$url}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; # End of HTML::Widgets::NavMenu::ToJSON::Data_Persistence |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |