--- /Data/Projects_Arthur/TWiki Subversion/twiki/lib/TWiki/Search.pm 2005-04-27 11:20:55.000000000 +0200 +++ /Data/Projects_Arthur/TWiki Subversion/TWiki patches/MySearch.pm 2005-05-01 00:24:59.000000000 +0200 @@ -415,11 +415,12 @@ my $store = $session->{store}; my @webList = (); - + my @excludedWebList = (); # temporary stores the webs to be excluded from search + # A value of 'all' or 'on' by itself gets all webs, # otherwise ignored (unless there is a web called 'All'.) my $searchAllFlag = ( $theWebName =~ /(^|[\,\s])(all|on)([\,\s]|$)/i ); - + # Search what webs? '' current web, list gets the list, all gets # all (unless marked in WebPrefs as NOSEARCHALL) - build up list of # webs to be searched in @webList. @@ -427,7 +428,14 @@ foreach my $web ( split( /[\,\s]+/, $theWebName ) ) { # the web processing loop filters for valid web names, # so don't do it here. - + + # check if web is excluded - store and remove it later from the webs list + if ( $web =~ /^-/i ) { + $web =~ s/^-//; # removes minus character from name + push ( @excludedWebList, $web ); + next; + } + if( $web =~ /^(all|on)$/i ) { # Get list of all webs my @tmpList = $store->getListOfWebs( 'user' ); @@ -446,6 +454,20 @@ #default to current web push @webList, $session->{webName}; } + + # Remove exluded webs from the web list + if ( @excludedWebList ) { + foreach my $excludeWeb ( @excludedWebList ) { + my $i = 0; + foreach my $web ( @webList ) { + if( $web eq $excludeWeb ) { + splice (@webList, $i, 1); + next; + } + $i++; + } + } + } $theTopic = _makeTopicPattern( $theTopic ); # E.g. "Bug*, *Patch" ==> "^(Bug.*|.*Patch)$" $theExclude = _makeTopicPattern( $theExclude ); # E.g. "Web*, FooBar" ==> "^(Web.*|FooBar)$"