/usr/share/perl5/HTML/Widgets/NavMenu/TagGen.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 | package HTML::Widgets::NavMenu::TagGen;
use strict;
use warnings;
use base 'HTML::Widgets::NavMenu::Object';
use HTML::Widgets::NavMenu::EscapeHtml;
__PACKAGE__->mk_acc_ref([
qw(name attributes)]
);
=head1 NAME
HTML::Widgets::NavMenu::TagGen - class to generate tags.
=head1 SYNOPSIS
For internal use only.
=head1 METHODS
=head2 name
For internal use.
=head2 attributes
For internal use.
=cut
sub _init
{
my ($self, $args) = @_;
$self->name($args->{'name'});
$self->attributes($args->{'attributes'});
return 0;
}
=head2 $self->gen($attribute_values, $is_standalone)
Generate the tag.
=cut
sub gen
{
my $self = shift;
my $attr_values = shift;
my $is_standalone = shift || 0;
my @tag_list = keys(%$attr_values);
@tag_list = (grep { defined($attr_values->{$_}) } @tag_list);
@tag_list = (sort { $a cmp $b } @tag_list);
my $attr_spec = $self->attributes();
return "<" . $self->name() .
join("", map { " $_=\"" .
($attr_spec->{$_}->{'escape'} ?
escape_html($attr_values->{$_})
: $attr_values->{$_}
) . "\""
} @tag_list) .
($is_standalone ? " /" : "") . ">";
}
1;
|