From: <de...@de...> - 2017-02-12 01:16:43
|
Author: PeterThoeny Date: 2017-02-12 01:15:01 +0000 (Sun, 12 Feb 2017) New Revision: 30309 Trac url: http://develop.twiki.org/trac/changeset/30309 Modified: twiki/trunk/core/lib/TWiki.pm Log: Item7775: New exclude parameter for WEBLIST variable Modified: twiki/trunk/core/lib/TWiki.pm =================================================================== --- twiki/trunk/core/lib/TWiki.pm 2017-02-12 00:36:54 UTC (rev 30308) +++ twiki/trunk/core/lib/TWiki.pm 2017-02-12 01:15:01 UTC (rev 30309) @@ -4792,6 +4792,7 @@ my $separator = expandStandardEscapes($params->{separator} || "\n"); my $web = $params->{web} || ''; my $webs = $params->{webs} || 'public'; + my $exclude = $params->{exclude} || ''; my $selection = $params->{selection} || ''; $selection =~ s/\,/ /g; $selection = " $selection "; @@ -4826,10 +4827,19 @@ } } + if( $exclude ) { + # turn exclude into a regex: + $exclude =~ s/,\s*/|/g; # change comma list to regex "or" + $exclude =~ s/[^$regex{mixedAlphaNum}\_\.\/\*\|]//g; # filter out illegal chars + $exclude =~ s/\*/.*/g; # change wildcard to regex + } my @items; my $indent = CGI::span({class=>'twikiWebIndent'},''); my $i = 0; foreach my $item ( @list ) { + if( $exclude && $item =~ /^($exclude)$/ ) { + next; + } if( $i++ >= $limit ) { push( @items, $overlimit ) if $overlimit; last; |