Skip to content

Commit

Permalink
Item8924: header and footer can also carry spearch-specific format to…
Browse files Browse the repository at this point in the history
…kens

git-svn-id: http://svn.foswiki.org/trunk@7519 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed May 23, 2010
1 parent 4682a03 commit 62b99fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/lib/Foswiki/Macros/FOREACH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package Foswiki;
use strict;
use warnings;

our $SEARCHTERMS = qr/\$(web|topic|parent|text|locked|date|isodate|rev|username|wikiname|wikiusername|createdate|createusername|createwikiname|createwikiusername|summary|changes|formname|formfield|pattern|count|ntopics|nhots|pager)\b/;

sub FOREACH {
my ( $this, $params, $topicObject ) = @_;

Expand All @@ -14,8 +16,12 @@ sub FOREACH {
# then the list is treated as a list of topic names. Otherwise it is treated
# as a list of strings.
my $format = $params->{format};
my $header = $params->{header} || '';
my $footer = $params->{footer} || '';
if ( !defined($format)
|| $format =~ /\$(web|topic|parent|text|locked|date|isodate|rev|username|wikiname|wikiusername|createdate|createusername|createwikiname|createwikiusername|summary|changes|formname|formfield|pattern|count|ntopics|nhots|pager)\b/) {
|| $format =~ /$SEARCHTERMS/o
|| $header =~ /$SEARCHTERMS/o
|| $footer =~ /$SEARCHTERMS/o ) {

# Treat as list of topic names

Expand Down

0 comments on commit 62b99fc

Please sign in to comment.