--- trunk/lib/WebPAC/Output/TT.pm 2005/11/30 23:15:28 199 +++ trunk/lib/WebPAC/Output/TT.pm 2005/12/17 22:32:28 280 @@ -8,7 +8,7 @@ use Template; use List::Util qw/first/; use Data::Dumper; -use URI::Escape; +use URI::Escape qw/uri_escape_utf8/; =head1 NAME @@ -16,11 +16,11 @@ =head1 VERSION -Version 0.02 +Version 0.05 =cut -our $VERSION = '0.02'; +our $VERSION = '0.05'; =head1 SYNOPSIS @@ -71,7 +71,8 @@ my $text = $tt->apply( template => 'text.tt', - data => $ds + data => $ds, + record_uri => 'database/prefix/mfn', ); It also has follwing template toolikit filter routies defined: @@ -196,12 +197,13 @@ } else { $s = $item->{'search'}->[0]; } - $s = uri_escape( $s ); + #$s =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg; + $s = uri_escape_utf8( $s ); my $d = $item->{'display'}->[$i] || die "can't find value $i for type display in field $display"; push @html, <<__JS_LINK_SEARCH__ -$d +$d __JS_LINK_SEARCH__ } @@ -222,6 +224,46 @@ $args->{'search'} = tt_filter_search($args); +=head3 load_rec + +Used mostly for onClick events like this: + + bar + +=cut + + $args->{'load_template'} = sub { + my $template = shift or return "Logger.error('load_template missing template name!'); return false;"; + return "load_template($template); return false;"; + }; + my $out; $self->{'tt'}->process(