210 |
|
|
211 |
# placeholder for all repeatable entries for index |
# placeholder for all repeatable entries for index |
212 |
|
|
|
sub chk_eval($) { |
|
|
my $data = shift; |
|
|
return if (! defined($data)); |
|
|
if ($data && $data =~ s/\s*eval{([^}]+)}\s*//) { |
|
|
if (eval "$1") { |
|
|
return $data; |
|
|
} else { |
|
|
return undef; |
|
|
} |
|
|
} else { |
|
|
return $data; |
|
|
} |
|
|
} |
|
|
|
|
213 |
sub mkformat($$) { |
sub mkformat($$) { |
214 |
my $x = shift || die "mkformat needs tag reference"; |
my $x = shift || die "mkformat needs tag reference"; |
215 |
my $data = shift || return; |
my $data = shift || return; |
216 |
my $format_name = x($x->{format_name}) || return chk_eval($data); |
my $format_name = x($x->{format_name}) || return $data; |
217 |
my $fmt = x($config->{format}->{$format_name}->{content}) || die "<format name=\"$format_name\"> is not defined!"; |
my $fmt = x($config->{format}->{$format_name}->{content}) || die "<format name=\"$format_name\"> is not defined!"; |
218 |
my $format_delimiter = x($x->{format_delimiter}); |
my $format_delimiter = x($x->{format_delimiter}); |
219 |
my @data; |
my @data; |
226 |
if ($fmt) { |
if ($fmt) { |
227 |
my $nr = scalar $fmt =~ s/%s/%s/g; |
my $nr = scalar $fmt =~ s/%s/%s/g; |
228 |
if (($#data+1) == $nr) { |
if (($#data+1) == $nr) { |
229 |
return chk_eval(sprintf($fmt,@data)); |
return sprintf($fmt,@data); |
230 |
} else { |
} else { |
231 |
#print STDERR "mkformat: [$data] can't be split on [$format_delimiter] to $nr fields!\n"; |
#print STDERR "mkformat: [$data] can't be split on [$format_delimiter] to $nr fields!\n"; |
232 |
return chk_eval($data); |
return $data; |
233 |
} |
} |
234 |
} else { |
} else { |
235 |
print STDERR "usage of link '$format_name' without defined format (<link> tag)\n"; |
print STDERR "usage of link '$format_name' without defined format (<link> tag)\n"; |
284 |
$tmp = join(" ",&$filter($tmp)) if ($s || $se); |
$tmp = join(" ",&$filter($tmp)) if ($s || $se); |
285 |
} |
} |
286 |
|
|
|
$tmp = chk_eval($tmp); |
|
287 |
$swish_data .= $tmp if ($s && $tmp); |
$swish_data .= $tmp if ($s && $tmp); |
288 |
$swish_exact_data .= "xxbxx $tmp xxexx " if ($tmp && $tmp ne "" && $se); |
$swish_exact_data .= "xxbxx $tmp xxexx " if ($tmp && $tmp ne "" && $se); |
289 |
} |
} |
318 |
no strict 'refs'; |
no strict 'refs'; |
319 |
$idisplay = &$filter($idisplay); |
$idisplay = &$filter($idisplay); |
320 |
} |
} |
|
$idisplay = chk_eval($idisplay); |
|
321 |
push @index_data, $idisplay if ($idisplay && !$iterate_by_page); |
push @index_data, $idisplay if ($idisplay && !$iterate_by_page); |
322 |
} |
} |
323 |
|
|