Changeset 4140
- Timestamp:
- 06/15/09 08:47:52 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HolidaylistPlugin/lib/Foswiki/Plugins/HolidaylistPlugin.pm
r4099 r4140 48 48 ); 49 49 50 # This should always be $Rev: 1810 0$ so that TWiki can determine the checked-in50 # This should always be $Rev: 18101 $ so that TWiki can determine the checked-in 51 51 # status of the plugin. It is used by the build automation tools, so 52 52 # you should leave it alone. 53 $VERSION = '$Rev: 1810 0$';53 $VERSION = '$Rev: 18101 $'; 54 54 55 55 # This is a free-form string you can use to "name" your own plugin version. … … 1543 1543 } 1544 1544 1545 $text =~ s/%BASETOPIC%/${theTopic}/sg; 1546 $text =~ s/%BASEWEB%/${theWeb}/sg; 1545 1547 $text =~ s/%INCLUDE{(.*?)}%/&expandIncludedEvents($1, \@processedTopics, $web, $topic)/geo; 1546 1548 $text =~s/\%HOLIDAYLIST({(.*?)})?%//sg; 1547 1549 $text = Foswiki::Func::expandCommonVariables($text,$web,$topic); 1550 1548 1551 1549 1552 return $text; … … 1567 1570 sub expandIncludedEvents 1568 1571 { 1569 my( $theAttributes, $theProcessedTopicsRef, $ theWeb, $theTopic ) = @_;1570 1571 my $webTopic = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes ), $t heTopic, $theWeb );1572 my $section = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes, 'section'), $t heTopic, $theWeb );1573 my $pattern = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes, 'pattern'), $t heTopic, $theWeb );1572 my( $theAttributes, $theProcessedTopicsRef, $web, $topic ) = @_; 1573 1574 my $webTopic = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes ), $topic, $web ); 1575 my $section = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes, 'section'), $topic, $web ); 1576 my $pattern = Foswiki::Func::expandCommonVariables( Foswiki::Func::extractNameValuePair( $theAttributes, 'pattern'), $topic, $web ); 1574 1577 1575 1578 1576 1579 if( $webTopic =~ /^([^\.]+)[\.\/](.*)$/ ) { 1577 $ theWeb = $1;1578 $t heTopic = $2;1580 $web = $1; 1581 $topic = $2; 1579 1582 } else { 1580 $t heTopic = $webTopic;1583 $topic = $webTopic; 1581 1584 } 1582 1585 1583 1586 # prevent recursive loop: 1584 grep (/^\Q$ theWeb.$theTopic\E$/, @{$theProcessedTopicsRef}) and return "";1585 1586 push( @{$theProcessedTopicsRef}, "$ theWeb.$theTopic" );1587 1588 my $text = &readTopicText( $ theWeb, $theTopic );1587 grep (/^\Q$web.$topic\E$/, @{$theProcessedTopicsRef}) and return ""; 1588 1589 push( @{$theProcessedTopicsRef}, "$web.$topic" ); 1590 1591 my $text = &readTopicText( $web, $topic ); 1589 1592 1590 1593 $text = getTopicSectionText($text, $section) if (defined $section && $section ne ""); … … 1594 1597 $text = getTopicIncludeText($text); 1595 1598 1599 # fix base topic: 1600 $text =~ s/%BASETOPIC%/${theTopic}/sg; 1601 $text =~ s/%BASEWEB%/${theWeb}/sg; 1602 1596 1603 # recursively expand includes: 1597 $text =~ s/%INCLUDE{(.*?)}%/&expandIncludedEvents( $1, $theProcessedTopicsRef, $ theWeb, $theTopic )/geo;1604 $text =~ s/%INCLUDE{(.*?)}%/&expandIncludedEvents( $1, $theProcessedTopicsRef, $web, $topic )/geo; 1598 1605 1599 1606 # expand common variables:
Note: See TracChangeset
for help on using the changeset viewer.
