--- trunk2/lib/WebPAC/Tree.pm 2004/11/01 17:19:48 574 +++ trunk2/lib/WebPAC/Tree.pm 2004/11/01 18:00:26 575 @@ -133,7 +133,7 @@ my $path = "thes/${mfn}.html"; return $path if (-e "./out/$path"); }, - iframe_base => '../', + nodes_dir => 'nodes', ); C is tree array with levels of tree described above. @@ -144,8 +144,8 @@ 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). +C is relative path from output directory where tree nodes for +iframes will be created. =cut @@ -164,6 +164,15 @@ $self->{'show_ids'} = []; $self->{'hide_ids'} = []; + # figure out relative URL to other content from nodes_dir + my $iframe_base = $self->{'nodes_dir'}; + if ($iframe_base) { + $iframe_base = s#[^/]*##g; + $iframe_base = '../' x ( length($iframe_base) ); + $self->{'iframe_base'} = $iframe_base; + $log->debug("nodes dir is '",$self->{'nodes_dir'},"' so iframe_base is '",$self->{'iframe_base'},"'"); + } + $self->{'tree_html'} = $self->unroll(0,()); if (! $self->{'tree_html'}) { @@ -184,7 +193,6 @@ template_dir => './output_template/', template_tree => 'tree.tt', template_node => 'node.tt', - nodes => 'nodes', js => 'tree-ids.js', ); @@ -200,9 +208,6 @@ C is (optional) name of template for node (if C}; + qq{}; @{$self->{'iframe_mfn'}->{$mfn}} = @{$self->{'mfn_arr'}}; - $log->debug("in this iframe: ", sub { Dump($self->{'iframe_mfn'}->{$mfn}) }); } else { # unroll at base HTML @@ -427,7 +440,7 @@ 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 " ",join(",",map { "[$_:$if]" } @{$self->{'iframe_mfn'}->{$if}}),",\n"; } print JS " null\n]\n";