*** 0501release/wiki.pm Mon May 15 21:59:38 2000 --- 0515prf/wiki.pm Mon May 15 23:31:52 2000 *************** *** 52,63 **** $doLogTopicAttach $doLogTopicUpload $doLogTopicRdiff $doLogTopicChanges $doLogTopicSearch $doLogRegistration @isoMonth $TranslationToken $code @code $depth ! $scriptSuffix ); # =========================== # TWiki version: ! $wikiversion = "01 May 2000"; # =========================== # read the configuration part --- 52,63 ---- $doLogTopicAttach $doLogTopicUpload $doLogTopicRdiff $doLogTopicChanges $doLogTopicSearch $doLogRegistration @isoMonth $TranslationToken $code @code $depth ! $scriptSuffix $hiddenTopics ); # =========================== # TWiki version: ! $wikiversion = "01 May 2000 patched by PeterFokkinga"; # =========================== # read the configuration part *************** *** 797,802 **** --- 797,847 ---- return ""; } + + # ========================= + sub createTopicDropdown + { + my( $theWeb ) = @_; + + my $topic; + my $result = "\n\n"; + } + + + # ========================= + sub getTopicList + { + my( $theWeb ) = @_; + + opendir DATADIR, "$dataDir/$theWeb" + or die "invalid directory in wiki::getTopicList -> $dataDir/$theWeb"; + + my @textFiles = sort grep /.+\.txt$/ , readdir DATADIR; + + closedir DATADIR; + + my @topicList = map { /(.*)\.txt$/; $_ = $1; } @textFiles; + + my $topic; + my @visibleTopics; + + foreach $topic ( @topicList ) { + next if $hiddenTopics =~ /$topic/; + + push @visibleTopics, $topic; + } + return @visibleTopics; + } + + # ========================= sub handleIncludeFile { *************** *** 892,897 **** --- 937,948 ---- $text =~ s/%NOTIFYTOPIC%/$notifyTopicname/go; $text =~ s/%STATISTICSTOPIC%/$statisticsTopicname/go; $text =~ s/%SEARCH{(.*?)}%/&handleSearchWeb($1)/geo; + + # prevent unnecessary diskaccess; only create topicbox when asked for + if( $text =~ /%TOPICSBOX%/ ) { + my $topicBox = &createTopicDropdown( $webName ); + $text =~ s/%TOPICSBOX%/$topicBox/go; + } return $text; }