Index: NatSkinPlugin.pm =================================================================== --- NatSkinPlugin.pm (revision 13078) +++ NatSkinPlugin.pm (working copy) @@ -49,7 +49,7 @@ $STARTWW = qr/^|(?<=[\s\(])/m; $ENDWW = qr/$|(?=[\s\,\.\;\:\!\?\)])/m; -$VERSION = '$Rev$'; +$VERSION = '$Rev: 13070 (06 Mar 2007) $'; $RELEASE = '3.00-pre12'; $NO_PREFS_IN_TOPIC = 1; $SHORTDESCRIPTION = 'Supplements the bare bones NatSkin theme for TWiki'; @@ -930,13 +930,22 @@ doInit(); my $theComponent = $params->{_DEFAULT}; + my $lineprefix = $params->{lineprefix}; + my $web = $params->{web}; + $web=$baseWeb unless defined($web); #Default to $baseWeb NOTE: don't use the currentWeb + my $multiple = $params->{multiple}; + $multiple=0 unless defined($multiple); + my $name = lc $theComponent; $name =~ s/^currentWeb//o; return '' if $skinState{$name} && $skinState{$name} eq 'off'; - my $text = getWebComponent($theComponent); - $text .= "\n" if $name eq 'sidebar'; # SMELL: extra linefeed hack for sidebars + my $text = getWebComponent($theComponent, $web, $multiple); + if (defined $lineprefix) + { + $text =~ s/[\n\r]+/\n$lineprefix/gs; + } return $text } @@ -950,11 +959,13 @@ # (like: TheComponent = WebSideBar) sub getWebComponent { my $component = shift; + my $web = shift; + my $multiple = shift; #writeDebug("called getWebComponent($component)"); # SMELL: why does preview call for components twice ??? - if ($seenWebComponent{$component} && $seenWebComponent{$component} > 2) { + if ($seenWebComponent{$component} && $seenWebComponent{$component} > 2 && !$multiple) { return ''. "ERROR: component '$component' already included". ''; @@ -967,7 +978,7 @@ my $mainWeb = &TWiki::Func::getMainWebname(); my $twikiWeb = &TWiki::Func::getTwikiWebname(); - my $theWeb = $baseWeb; # NOTE: don't use the currentWeb + my $theWeb = $web; my $theComponent = $component; if (&TWiki::Func::topicExists($theWeb, $theComponent) && &TWiki::Func::checkAccessPermission('VIEW',$currentUser,undef,$theComponent, $theWeb)) {