From: <de...@de...> - 2006-07-11 16:12:42
|
Author: MeredithLesly Date: 2006-07-11 08:19:17 -0500 (Tue, 11 Jul 2006) New Revision: 10981 Added: twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/Fns/CHILDTOPICS.pm twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/Fns/CHILDTOPICS/ Removed: twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn.pm twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn/ Log: Copied: twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/Fns/CHILDTOPICS (from rev 10945, twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn) Copied: twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/Fns/CHILDTOPICS.pm (from rev 10945, twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn.pm) Deleted: twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn.pm =================================================================== --- twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn.pm 2006-07-11 13:18:21 UTC (rev 10980) +++ twiki/scratch/FnsFor4x1/twikiplugins/ChildTopicsFn/lib/TWiki/UserFns/ChildTopicsFn.pm 2006-07-11 13:19:17 UTC (rev 10981) @@ -1,55 +0,0 @@ -# Plugin for TWiki Enterprise Collaboration Platform, http://TWiki.org/ -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. For -# more details read LICENSE in the root of this distribution. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# For licensing info read LICENSE file in the TWiki root. -# -# '$Rev$' - -# Always use strict to enforce variable scoping -use strict; - -use TWiki::Contrib::MoreFuncContrib; -use TWiki::Func; - -use vars qw($fnname); - -$fnname = 'CHILDTOPICS'; - -sub CHILDTOPICS { - my ($session, $params, $topic, $web) = @_; - my $format = $params->{format} || ' * $topic'; - my $join = $params->{format} || "\n"; - my $searchWeb = $params->{web} || $web; - my $searchTopic = $params->{topic} || $topic; - my @eachtopic = (); - my @topics = TWiki::Func::getTopicList($searchWeb); - my $excludeTopic = $params->{excludetopic}; - - if (defined $excludeTopic) { - $excludeTopic = TWiki::Contrib::MoreFuncContrib::makeTopicPattern($excludeTopic); - if( $excludeTopic ) { - @topics = grep( !/$excludeTopic/i, @topics ); - } - } - - foreach my $t (@topics) { - my $meta = TWiki::Contrib::MoreFuncContrib::readTopicMeta($searchWeb, $t); - if ($meta->getParent() eq $searchTopic) { - push @eachtopic, TWiki::Contrib::MoreFuncContrib::formatString($format, - {'topic'=>$t, 'web'=>$searchWeb} - ); - } - } - return join($join, @eachtopic); -} - -return 'CHILDTOPICS'; |