This file is indexed.

/usr/share/perl5/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm is in libhtml-widgets-navmenu-perl 1.0703-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package HTML::Widgets::NavMenu::Iterator::NavMenu::HeaderRole;

use strict;
use warnings;

use base qw(HTML::Widgets::NavMenu::Iterator::NavMenu);

__PACKAGE__->mk_acc_ref([qw(
    _was_role
)]);

=head1 NAME

HTML::Widgets::NavMenu::Iterator::NavMenu::HeaderRole - a nav-menu iterator
for the HeaderRole sub-class.

=head1 OVER-RIDED METHODS

=head2 $iter->_start_handle_role()

Handles the handling the role. Accepts the C<"header"> role and defaults to the
default behaviour with all others.

=cut

sub _start_handle_non_role
{
    my $self = shift;

    if ($self->_was_role())
    {
        $self->_add_tags(
            $self->gen_ul_tag({'depth' => $self->stack->len()-2})
        );
    }

    $self->_was_role(0);

    return $self->SUPER::_start_handle_non_role();
}

sub _start_handle_role
{
    my $self = shift;
    if ($self->get_role() eq "header")
    {
        if (! $self->_was_role())
        {
            $self->_add_tags("</ul>");
        }
        $self->_add_tags(
            "<h2>", $self->get_link_tag(), "</h2>",
            );

        $self->_was_role(1);
    }
    else
    {
        return $self->SUPER::_start_handle_role();
    }
}

=head2 $self->_end_handle_role()

Ends the role. Accepts the C<"header"> role and defaults to the
default behaviour with all others.

=cut

sub _end_handle_role
{
    my $self = shift;
    if ($self->get_role() eq "header")
    {
        # Do nothing;
    }
    else
    {
        return $self->SUPER::_end_handle_role();
    }
}

=head1 COPYRIGHT & LICENSE

Copyright 2006 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.

=cut

1;