From 7a8a2ccb2ad33407ece7372f107b6ae0ee1e1d86 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 14 Dec 2005 18:55:44 +0000 Subject: [PATCH] r11687@llin: dpavlin | 2005-12-14 21:52:48 +0100 added load_rec('database/prefix/mfn','template.tt') and load_template('template.tt') for use in TT git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@239 07558da8-63fa-0310-ba24-9fe276d99e06 --- conf/output/tt/html_ffzg_results_nonstd.tt | 6 +-- conf/output/tt/html_ffzg_results_short.tt | 4 +- lib/WebPAC/Output/TT.pm | 43 +++++++++++++++++++++- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/conf/output/tt/html_ffzg_results_nonstd.tt b/conf/output/tt/html_ffzg_results_nonstd.tt index ede59ad..241b5e6 100644 --- a/conf/output/tt/html_ffzg_results_nonstd.tt +++ b/conf/output/tt/html_ffzg_results_nonstd.tt @@ -74,9 +74,9 @@

Oblik zapisa

diff --git a/conf/output/tt/html_ffzg_results_short.tt b/conf/output/tt/html_ffzg_results_short.tt index 016f4f0..1af44f1 100644 --- a/conf/output/tt/html_ffzg_results_short.tt +++ b/conf/output/tt/html_ffzg_results_short.tt @@ -36,8 +36,8 @@ diff --git a/lib/WebPAC/Output/TT.pm b/lib/WebPAC/Output/TT.pm index ccb558c..c19a29b 100644 --- a/lib/WebPAC/Output/TT.pm +++ b/lib/WebPAC/Output/TT.pm @@ -71,7 +71,8 @@ Create output from in-memory data structure using Template Toolkit template. 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: @@ -223,6 +224,46 @@ __JS_LINK_SEARCH__ $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( -- 2.20.1