| 1 | package HTML::Latemp::NavLinks::GenHtml; | ||||||||||
| 2 | 4 | $HTML::Latemp::NavLinks::GenHtml::VERSION = '0.2.8'; | |||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use 5.008; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use parent 'Class::Accessor'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 4 | __PACKAGE__->mk_accessors( | |||||||||
| 11 | qw( | ||||||||||
| 12 | nav_links_obj | ||||||||||
| 13 | root | ||||||||||
| 14 | ) | ||||||||||
| 15 | ); | ||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | sub new | ||||||||||
| 20 | { | ||||||||||
| 21 | 2 | ▶ | my $class = shift; | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 22 | 2 | my $self = {}; | |||||||||
| 23 | 2 | bless $self, $class; | |||||||||
| 24 | 2 | $self->_init(@_); | |||||||||
| 25 | 2 | return $self; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | sub _init | ||||||||||
| 29 | { | ||||||||||
| 30 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 2 | my (%args) = @_; | |||||||||
| 32 | |||||||||||
| 33 | 2 | $self->root( $args{root} ); | |||||||||
| 34 | 2 | $self->nav_links_obj( $args{nav_links_obj} ); | |||||||||
| 35 | |||||||||||
| 36 | 2 | return $self; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | |||||||||||
| 40 | sub _get_buttons | ||||||||||
| 41 | { | ||||||||||
| 42 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_get_buttons: called CC=3 SCAR=11.0
| |||||||||||
| 43 | |||||||||||
| 44 | 2 | my @buttons = ( | |||||||||
| 45 | { | ||||||||||
| 46 | 'dir' => "prev", | ||||||||||
| 47 | 'button' => "left", | ||||||||||
| 48 | 'title' => "Previous Page", | ||||||||||
| 49 | }, | ||||||||||
| 50 | { | ||||||||||
| 51 | 'dir' => "up", | ||||||||||
| 52 | 'button' => "up", | ||||||||||
| 53 | 'title' => "Up in the Site", | ||||||||||
| 54 | }, | ||||||||||
| 55 | { | ||||||||||
| 56 | 'dir' => "next", | ||||||||||
| 57 | 'button' => "right", | ||||||||||
| 58 | 'title' => "Next Page", | ||||||||||
| 59 | }, | ||||||||||
| 60 | ); | ||||||||||
| 61 | |||||||||||
| 62 | 2 | foreach my $button (@buttons) | |||||||||
| 63 | { | ||||||||||
| 64 | 6 | my $dir = $button->{'dir'}; | |||||||||
| 65 | 6 | ▶ | if ( $button->{'exists'} = exists( $self->nav_links_obj->{$dir} ) ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | { | ||||||||||
| 67 | 6 | $button->{'link_obj'} = $self->nav_links_obj->{$dir}; | |||||||||
| 68 | } | ||||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | 2 | return \@buttons; | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | |||||||||||
| 75 | 4 | 1; | |||||||||
| 76 | |||||||||||
| 77 | __END__ | ||||||||||