*** /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin.pm Fri Jan 23 15:19:08 2004 --- lib/TWiki/Plugins/TreePlugin.pm Tue Feb 3 14:59:58 2004 *************** *** 122,128 **** # ok. make the topic list and return it (use this routine for now) # hopefully there'll be an optimized one later ! return TWiki::Func::expandCommonVariables( "%SEARCH{search=\"$searchVal\" web=\"$searchWeb\" format=\"$searchTmpl\" scope=\"$searchScope\" regex=\"on\" nosearch=\"on\" nototal=\"on\" noempty=\"on\"}%"); } --- 122,128 ---- # ok. make the topic list and return it (use this routine for now) # hopefully there'll be an optimized one later ! return TWiki::Func::expandCommonVariables("%SEARCH{search=\"$searchVal\" web=\"$searchWeb\" format=\"$searchTmpl\" scope=\"$searchScope\" regex=\"on\" nosearch=\"on\" nototal=\"on\" noempty=\"on\"}%"); } *************** *** 167,172 **** --- 167,173 ---- my $attrFormatting = TWiki::Func::extractNameValuePair( $attributes, "formatting" ) || ""; my $attrStoplevel = TWiki::Func::extractNameValuePair( $attributes, "stoplevel" ) || 999; my $doBookView = TWiki::Func::extractNameValuePair( $attributes, "bookview" ) || ""; + my $attrPathView = TWiki::Func::extractNameValuePair( $attributes, "pathview" ) || 0; cgiOverride(\$attrFormatting, "formatting"); *************** *** 191,196 **** --- 192,216 ---- my %nodes = (); my $root = _findTWikiNode($RootLabel, \%nodes); # make top dog node + my $pathview; + + if($attrPathView){ # determin nodes on path + my $ptopic = $topic; + $pathview->{$ptopic} = 1; + do{ + # get parent + my( $meta, $text ) = &TWiki::Func::readTopic( $attrWeb, $ptopic ); + my %par = $meta->findOne( "TOPICPARENT" ); + my $parent = ( %par ) + ? _findTWikiNode($par{"name"}, \%nodes) # yes i have a parent, get it + : $root; # otherwise root's my parent + $ptopic = $parent->name; + $pathview->{$ptopic} = 1; + }while($ptopic ne $RootLabel); + } + + $formatter->data("pathview", $pathview); + # loop thru topics foreach (split /\n/, $search) { my ($topic, $modTime, $author, $summary) = split /\|/; # parse out data diff -crbB --exclude=*~ /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm *** /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm Fri Jul 4 03:58:24 2003 --- lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm Tue Feb 3 14:16:43 2004 *************** *** 87,93 **** push @{$this->images}, $this->images->[1] if ($this->imagesTotal == 1); # copy last image to be in folder mode $mode = FOLDER_MODE if ($this->imagesTotal == 2); ! $mode = THREAD_MODE if ($this->imagesTotal == 3); ; $mode = THREADEXP_MODE if ($this->imagesTotal == 7); } # use user-defined mode or calculated mode or just the default --- 87,93 ---- push @{$this->images}, $this->images->[1] if ($this->imagesTotal == 1); # copy last image to be in folder mode $mode = FOLDER_MODE if ($this->imagesTotal == 2); ! $mode = THREAD_MODE if ($this->imagesTotal == 3); $mode = THREADEXP_MODE if ($this->imagesTotal == 7); } # use user-defined mode or calculated mode or just the default *************** *** 175,183 **** my $b = (scalar(@{$node->children})) ? 1 : 0 ; # unopened branch? ! $b = 2 if ($b == 1 # if branch ! && ($this->data("stoplevel") == $level ) # and we're at the bottom level ! ); return $b; } --- 175,186 ---- my $b = (scalar(@{$node->children})) ? 1 : 0 ; # unopened branch? ! if($b == 1){ # if branch ! if($this->data("stoplevel") == $level || !defined($this->data("pathview")->{$node->name}) ){ # and we're at the bottom level ! $b = 2; ! } ! } ! return $b; } diff -crbB --exclude=*~ /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/Node.pm lib/TWiki/Plugins/TreePlugin/Node.pm *** /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/Node.pm Fri Jul 4 04:10:54 2003 --- lib/TWiki/Plugins/TreePlugin/Node.pm Tue Feb 3 14:42:23 2004 *************** *** 131,134 **** 1; - --- 131,133 ---- diff -crbB --exclude=*~ /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/TWikiNode.pm lib/TWiki/Plugins/TreePlugin/TWikiNode.pm *** /disk/rainforest-user2/archiv/FTP/twiki/TreePlugin311/lib/TWiki/Plugins/TreePlugin/TWikiNode.pm Fri Jul 4 03:58:24 2003 --- lib/TWiki/Plugins/TreePlugin/TWikiNode.pm Tue Feb 3 14:37:35 2004 *************** *** 83,89 **** $formatter->initNode($this, $num, $level); my $childrenText = ""; ! if ( scalar(@{$this->children()}) ) { my $count = 0; foreach my $node (@{$this->children()} ){ # accumulate childrens' format $node->data("count", $count++); # remember this node's sibling order --- 83,90 ---- $formatter->initNode($this, $num, $level); my $childrenText = ""; ! my $deeper = 1 if $formatter->data("pathview") && defined($formatter->data("pathview")->{$this->name}); ! if(scalar(@{$this->children()}) && ($deeper || !$formatter->data("pathview"))) { my $count = 0; foreach my $node (@{$this->children()} ){ # accumulate childrens' format $node->data("count", $count++); # remember this node's sibling order *************** *** 96,104 **** } 1; - - - - - - --- 97,99 ----