56 |
|
|
57 |
$webpac->open_import_xml(type => 'isis_hidra_ths'); |
$webpac->open_import_xml(type => 'isis_hidra_ths'); |
58 |
|
|
59 |
if(0) { # XXX |
if(1) { # XXX |
60 |
|
|
61 |
while (my $rec = $webpac->fetch_rec) { |
while (my $rec = $webpac->fetch_rec) { |
62 |
|
|
202 |
lookup_v900 => sub { shift }, |
lookup_v900 => sub { shift }, |
203 |
lookup_term => sub { shift @{$l->{"d:".$_[0]}} }, |
lookup_term => sub { shift @{$l->{"d:".$_[0]}} }, |
204 |
lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, |
lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, |
205 |
|
have_children => sub { $l->{"a:".$_[2].":".$_[1]} }, |
206 |
|
child_code => sub { return "a:".$_[2].":".$_[1] }, |
207 |
|
style => 'display: none', |
208 |
|
},{ |
209 |
|
# 3 uži pojam |
210 |
|
code_arr => sub { @{$l->{$_[0]}} }, |
211 |
|
filter_code => sub { shift }, |
212 |
|
lookup_v900 => sub { shift }, |
213 |
|
lookup_term => sub { shift @{$l->{"d:".$_[1]}} }, |
214 |
|
lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[1]}} }, |
215 |
have_children => sub { 0 }, |
have_children => sub { 0 }, |
216 |
child_code => sub { 0 }, |
child_code => sub { 0 }, |
|
|
|
217 |
}); |
}); |
218 |
|
|
219 |
unroll(0,''); |
unroll(0,''); |
245 |
|
|
246 |
$log->debug("$code -> $v900 : $term [$mfn]"); |
$log->debug("$code -> $v900 : $term [$mfn]"); |
247 |
|
|
248 |
print HTML " " x $level . |
|
249 |
qq{<li><a href="#mfn$mfn" onClick="return hide_show('mfn$mfn');">$term</a> <a href="thes/$mfn.html">»</a></li>\n} if (-e "out/thes/$mfn.html"); |
my $have_children = $tree[$level]->{'have_children'}->($code,$v900,$start_code); |
250 |
|
|
251 |
|
my ($link_start,$link_end) = ('',''); |
252 |
|
|
253 |
|
($link_start,$link_end) = (qq{<a href="#mfn$mfn" onClick="return hide_show('mfn$mfn');">},qq{</a>}) if ($have_children); |
254 |
|
|
255 |
unless ($tree[$level]->{'have_children'}->($code,$v900)) { |
my $mfn_link = "thes/$mfn.html"; |
256 |
$log->warn("can't find children of $code at level $level"); |
if (-e "out/$mfn_link") { |
257 |
|
print HTML " " x $level . |
258 |
|
qq{<li>${link_start}${term}${link_end}}. |
259 |
|
qq{ <a href="$mfn_link">»</a></li>\n}; |
260 |
|
} else { |
261 |
|
$log->warn("file 'out/$mfn_link' doesn't exist, skipping"); |
262 |
|
} |
263 |
|
|
264 |
|
unless ($have_children) { |
265 |
|
$log->warn("doesn't have_children($code,$v900,$start_code)"); |
266 |
next; |
next; |
267 |
} |
} |
268 |
|
|
271 |
($tree[$level]->{'style'} ? ' style="'.$tree[$level]->{'style'}.'"' : ''). |
($tree[$level]->{'style'} ? ' style="'.$tree[$level]->{'style'}.'"' : ''). |
272 |
qq{>\n}; |
qq{>\n}; |
273 |
|
|
274 |
unroll($level+1, $tree[$level]->{'child_code'}->($code,$v900)); |
unroll($level+1, $tree[$level]->{'child_code'}->($code,$v900,$start_code)); |
275 |
|
|
276 |
print HTML " " x $level . qq{</ul>\n}; |
print HTML " " x $level . qq{</ul>\n}; |
277 |
|
|
285 |
</html> |
</html> |
286 |
}; |
}; |
287 |
|
|
288 |
|
close(HTML); |
289 |
|
|
290 |
$index->close; |
$index->close; |
291 |
|
|
292 |
$log->info("elapsed time: ",$webpac->fmt_time(time() - $webpac->{'start_t'})); |
$log->info("elapsed time: ",$webpac->fmt_time(time() - $webpac->{'start_t'})); |