63 |
|
|
64 |
my %field_usage; # counter for usage of each field |
my %field_usage; # counter for usage of each field |
65 |
|
|
66 |
|
# sort subrouting using order="" attribute |
67 |
|
sub by_order { |
68 |
|
return 0 if (! $config->{indexer}->{$a}->{order}); |
69 |
|
return 0 if (! $config->{indexer}->{$b}->{order}); |
70 |
|
|
71 |
|
return $config->{indexer}->{$a}->{order} <=> |
72 |
|
$config->{indexer}->{$b}->{order} ; |
73 |
|
} |
74 |
|
|
75 |
foreach my $field (keys %{$config->{indexer}}) { |
foreach my $field (sort by_order keys %{$config->{indexer}}) { |
76 |
|
|
77 |
$field_usage{$field}++; |
$field_usage{$field}++; |
78 |
|
|
80 |
my $display_data = ""; |
my $display_data = ""; |
81 |
my $line_delimiter = ""; |
my $line_delimiter = ""; |
82 |
|
|
83 |
|
my ($swish,$display); |
84 |
|
|
85 |
foreach my $x (@{$config->{indexer}->{$field}->{isis}}) { |
foreach my $x (@{$config->{indexer}->{$field}->{isis}}) { |
86 |
|
|
87 |
my $format = $x->{content}; |
my $format = $x->{content}; |
103 |
($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index"); |
($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index"); |
104 |
#print STDERR "## s: $s d: $d i: $i ## $format ##\n"; |
#print STDERR "## s: $s d: $d i: $i ## $format ##\n"; |
105 |
|
|
106 |
$display_data .= $line_delimiter if ($display_data && $display_data !~ /$line_delimiter$/); |
if ($x->{append}) { |
107 |
|
$line_delimiter = ' '; |
108 |
|
} else { |
109 |
|
$line_delimiter = '<br/>'; |
110 |
|
} |
111 |
|
|
112 |
my ($swish,$display) = (1,1); |
$display_data .= $line_delimiter if ($display_data && $display); |
113 |
|
# init vars so that we go into while... |
114 |
|
($swish,$display) = (1,1); |
115 |
|
|
116 |
while ($swish || $display) { |
while ($swish || $display) { |
117 |
($swish,$display) = parse_format($format,$row,$isis_i++); |
($swish,$display) = parse_format($format,$row,$isis_i++); |
128 |
# type="swish" ; field for swish |
# type="swish" ; field for swish |
129 |
if ($s && $swish) { |
if ($s && $swish) { |
130 |
if ($filter) { |
if ($filter) { |
131 |
print STDERR "using filter '$filter'\n"; |
#print STDERR "using filter '$filter'\n"; |
132 |
no strict 'refs'; |
no strict 'refs'; |
133 |
$swish_data .= join(" ",&$filter($swish)); |
$swish_data .= join(" ",&$filter($swish)); |
134 |
} else { |
} else { |
163 |
} |
} |
164 |
} |
} |
165 |
} |
} |
|
if ($x->{append}) { |
|
|
$line_delimiter = ' '; |
|
|
} else { |
|
|
$line_delimiter = '<br/>'; |
|
|
} |
|
166 |
} |
} |
167 |
|
|
168 |
|
|