10 |
use Config::IniFiles; |
use Config::IniFiles; |
11 |
use Text::Unaccent; |
use Text::Unaccent; |
12 |
use Data::Pageset; |
use Data::Pageset; |
13 |
|
use POSIX qw(locale_h); |
14 |
|
|
15 |
use lib '..'; |
use lib '..'; |
16 |
use index_DBI_filter; |
use index_DBI_filter; |
33 |
my $BASE_PATH =$cfg_global->val('webpac', 'base_path'); |
my $BASE_PATH =$cfg_global->val('webpac', 'base_path'); |
34 |
# for pager |
# for pager |
35 |
my $pages_per_set = $cfg_global->val('webpac', 'pages_per_set') || 10; |
my $pages_per_set = $cfg_global->val('webpac', 'pages_per_set') || 10; |
36 |
|
my $locale = $cfg_global->val('locale') || 'hr_HR'; |
37 |
|
|
38 |
Text::Iconv->raise_error(0); # Conversion errors raise exceptions |
Text::Iconv->raise_error(0); # Conversion errors raise exceptions |
39 |
|
|
40 |
my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET); |
my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET); |
41 |
|
|
42 |
|
setlocale(LC_CTYPE, $locale); |
43 |
|
setlocale(LC_COLLATE, $locale); |
44 |
|
|
45 |
if ($UNAC_FILTER) { |
if ($UNAC_FILTER) { |
46 |
require $UNAC_FILTER; |
require $UNAC_FILTER; |
47 |
} else { |
} else { |
191 |
foreach my $v (@persist_vars) { |
foreach my $v (@persist_vars) { |
192 |
foreach my $val ($q->param($v)) { |
foreach my $val ($q->param($v)) { |
193 |
next if (! $val || $val eq ''); |
next if (! $val || $val eq ''); |
194 |
|
$val =~ s/"/"/g; |
195 |
$hidden_vars .= '<input type="hidden" name="'.$v.'" value="'.$val.'"/>'."\n"; |
$hidden_vars .= '<input type="hidden" name="'.$v.'" value="'.$val.'"/>'."\n"; |
196 |
$hidden_search .= '<input type="hidden" name="'.$v.'" value="'.$val.'"/>'."\n" if ($v ne "rm"); |
$hidden_search .= '<input type="hidden" name="'.$v.'" value="'.$val.'"/>'."\n" if ($v ne "rm"); |
197 |
} |
} |
279 |
push @url_params_persist,"f$i=".$q->url_param("f$i") if ($persist); |
push @url_params_persist,"f$i=".$q->url_param("f$i") if ($persist); |
280 |
|
|
281 |
foreach my $v ($q->url_param("v$i")) { |
foreach my $v ($q->url_param("v$i")) { |
282 |
|
# escape quotes so that phrase search work |
283 |
|
$v =~ s/"/%22/g; |
284 |
push @url_params,"v$i=$v"; |
push @url_params,"v$i=$v"; |
285 |
push @url_params_persist,"v$i=$v" if ($persist); |
push @url_params_persist,"v$i=$v" if ($persist); |
286 |
} |
} |
490 |
$tmpl->param('field',$field); |
$tmpl->param('field',$field); |
491 |
$tmpl->param('limit',$limit); |
$tmpl->param('limit',$limit); |
492 |
$tmpl->param('total',$total); |
$tmpl->param('total',$total); |
493 |
|
$tmpl->param('filter',$filter); |
494 |
|
|
495 |
# FIXME I should set offset and leave out limit from fetch!! |
# FIXME I should set offset and leave out limit from fetch!! |
496 |
# if (! $q->param("PAGER_offset") { |
# if (! $q->param("PAGER_offset") { |