/usr/share/perl5/HTML/Widgets/NavMenu/Iterator/JQTreeView.pm is in libhtml-widgets-navmenu-perl 1.0702-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 92 93 94 95 96 97 98 99 100 101 102 103 104 | package HTML::Widgets::NavMenu::Iterator::JQTreeView;
use strict;
use warnings;
# For escape_html().
use HTML::Widgets::NavMenu::EscapeHtml;
use base qw(HTML::Widgets::NavMenu::Iterator::NavMenu);
sub _init
{
my $self = shift;
my $args = shift;
$self->SUPER::_init($args);
# Make a fresh copy just to be on the safe side.
$self->_ul_classes([ @{$args->{'ul_classes'}} ]);
return 0;
}
=head1 NAME
HTML::Widgets::NavMenu::Iterator::JQTreeView - an iterator for JQuery
TreeView's navigation menus.
=head1 SYNOPSIS
See L<http://bassistance.de/jquery-plugins/jquery-plugin-treeview/> .
For internal use only.
=head1 METHODS
=cut
sub _calc_open_li_tag
{
my $self = shift;
my $id_attr = $self->_calc_li_id_attr();
return
(
$self->_is_expanded_for_treeview()
? (qq{<li class="open"$id_attr>})
: ("<li$id_attr>")
);
return;
}
=head2 get_currently_active_text ( $node )
Calculates the highlighted text for the node C<$node>. Normally surrounds it
with C<<< <b> ... </b> >>> tags.
=cut
sub _start_handle_non_role
{
my $self = shift;
my $top_item = $self->top;
my @tags_to_add = ($self->_calc_open_li_tag(), $self->get_link_tag());
if ($top_item->_num_subs_to_go() && $self->_is_expanded())
{
push @tags_to_add, ($self->get_open_sub_menu_tags());
}
$self->_add_tags(@tags_to_add);
return;
}
sub _start_handle_role
{
my $self = shift;
return $self->_start_handle_non_role();
}
sub _is_expanded
{
return 1;
}
sub _is_expanded_for_treeview
{
my $self = shift;
my $node = $self->top->_node();
return ($node->expanded() || $self->top->_accum_state->{'show_always'});
}
=head1 COPYRIGHT & LICENSE
Copyright 2006 Shlomi Fish, all rights reserved.
This program is released under the following license: MIT X11.
=cut
1;
|