/[suikacvs]/test/html-webhacc/WebHACC/Output.pm
Suika

Diff of /test/html-webhacc/WebHACC/Output.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun Jul 20 14:58:24 2008 UTC revision 1.2 by wakaba, Sun Jul 20 16:53:10 2008 UTC
# Line 119  sub code ($$) { Line 119  sub code ($$) {
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
# Line 131  sub xref ($$%) { Line 131  sub xref ($$%) {
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">]);
# Line 140  sub nav_list ($) { Line 146  sub nav_list ($) {
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;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24