--- trunk2/lib/WebPAC/Tree.pm 2004/11/01 15:29:17 573 +++ trunk2/lib/WebPAC/Tree.pm 2004/11/01 17:19:48 574 @@ -130,9 +130,10 @@ log => 'log4perl.conf', detail_url => sub { my $mfn = shift; - my $path = "./out/thes/${mfn}.html"; - return $path if (-e $path); + my $path = "thes/${mfn}.html"; + return $path if (-e "./out/$path"); }, + iframe_base => '../', ); C is tree array with levels of tree described above. @@ -143,6 +144,9 @@ C code ref to check if detail html exists (and return URL if it does). +C is relative path from C defiend in C to root +(which is inserted in all html). + =cut sub new { @@ -180,6 +184,7 @@ template_dir => './output_template/', template_tree => 'tree.tt', template_node => 'node.tt', + nodes => 'nodes', js => 'tree-ids.js', ); @@ -195,6 +200,9 @@ C is (optional) name of template for node (if C}; + @{$self->{'iframe_mfn'}->{$mfn}} = @{$self->{'mfn_arr'}}; + $log->debug("in this iframe: ", sub { Dump($self->{'iframe_mfn'}->{$mfn}) }); } else { # unroll at base HTML @@ -404,6 +424,13 @@ open(JS, ">", $js_file) || $log->logdie("can't open '$js_file': $!"); print JS "var show = ['",join("','",@{$self->{'show_ids'}}),"'];\n"; print JS "var hide = ['",join("','",@{$self->{'hide_ids'}}),"'];\n"; + + print JS "var mfn_iframe = [\n"; + foreach my $if (keys %{$self->{'iframe_mfn'}}) { + print JS " ",join(",",map { "[$_:$if]" } @{$self->{'iframe_mfn'}->{$if}}),",\n"; + } + print JS " null\n]\n"; + close(JS); $log->debug("stored ",scalar @{$self->{'show_ids'}}," shown and ",scalar @{$self->{'hide_ids'}}," hidden elements");