119 |
|
|
120 |
sub link ($$%) { |
sub link ($$%) { |
121 |
my ($self, $content, %opt) = @_; |
my ($self, $content, %opt) = @_; |
122 |
$self->html ('<a href="' . $htescape->($opt{url}) . '">'); |
$self->start_tag ('a', %opt, href => $opt{url}); |
123 |
$self->text ($content); |
$self->text ($content); |
124 |
$self->html ('</a>'); |
$self->html ('</a>'); |
125 |
} # link |
} # link |
131 |
$self->html ('</a>'); |
$self->html ('</a>'); |
132 |
} # xref |
} # xref |
133 |
|
|
134 |
|
sub link_to_webhacc ($$%) { |
135 |
|
my ($self, $content, %opt) = @_; |
136 |
|
$opt{url} = './?uri=' . $self->encode_url_component ($opt{url}); |
137 |
|
$self->link ($content, %opt); |
138 |
|
} # link_to_webhacc |
139 |
|
|
140 |
sub nav_list ($) { |
sub nav_list ($) { |
141 |
my $self = shift; |
my $self = shift; |
142 |
$self->html (q[<ul class="navigation" id="nav-items">]); |
$self->html (q[<ul class="navigation" id="nav-items">]); |
146 |
$self->html ('</ul>'); |
$self->html ('</ul>'); |
147 |
} # nav_list |
} # nav_list |
148 |
|
|
149 |
|
|
150 |
|
sub encode_url_component ($$) { |
151 |
|
shift; |
152 |
|
require Encode; |
153 |
|
my $s = Encode::encode ('utf8', shift); |
154 |
|
$s =~ s/([^0-9A-Za-z_.~-])/sprintf '%%%02X', ord $1/ge; |
155 |
|
return $s; |
156 |
|
} # encode_url_component |
157 |
|
|
158 |
1; |
1; |