[interchange-cvs] interchange - pajamian modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Dec 19 07:33:45 EST 2007


User:      pajamian
Date:      2007-12-19 12:33:44 GMT
Modified:  .        WHATSNEW-5.5
Modified:  lib/Vend Parse.pm
Log:
New universal "hide" attribute.  You can now set the hide=1 attrbute for any tag
to supress its output.

In order to preserve backwards compatibility with existing individual tags' hide
attributes tag output is not reparsed if this is set regardless of the setting
of interpolate or reparse attributes.  The reasoning behind this is existing
hide=1 attributes clear the output of the tag before the output is reparsed so
setting hide=1 on those tags which used to support it had the effect of not
reparsing output (because there was no output left to reparse).  This can be
tested with the following line of ITL:

[tmp bar]bar[/tmp][calcn hide=1]'foo[tmp bar][area foo][/tmp]'[/calcn]::[scratchd bar]

In my testing the above line of html outputs:
::bar

Without the hide=1 attribute to calcn it outputs something like (url changed to
protect the guilty):
foo::http://www.example.com/foo.html

So hide=1 is effectively preventing reparsing as well as hiding the output.

Revision  Changes    Path
1.79      +4 -0      interchange/WHATSNEW-5.5


rev 1.79, prev_rev 1.78
Index: WHATSNEW-5.5
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.5,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- WHATSNEW-5.5	4 Dec 2007 07:59:06 -0000	1.78
+++ WHATSNEW-5.5	19 Dec 2007 12:33:44 -0000	1.79
@@ -76,6 +76,10 @@
   to create a new session for the user. As long as the file exists continuously,
   the lock kicks in and concurrent requests serialize appropriately.
 
+* New universal "hide" attribute.  You can now set the attribute hide=1 for any
+  tag to supress its output.  For example [calcn hide=1]$foo='bar'[/calcn] will
+  still set $foo to bar, but won't output bar from the tag itself.
+
 UserTag
 -------
 



2.44      +13 -7     interchange/lib/Vend/Parse.pm


rev 2.44, prev_rev 2.43
Index: Parse.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Parse.pm,v
retrieving revision 2.43
retrieving revision 2.44
diff -u -r2.43 -r2.44
--- Parse.pm	7 Dec 2007 22:38:30 -0000	2.43
+++ Parse.pm	19 Dec 2007 12:33:44 -0000	2.44
@@ -1,6 +1,6 @@
 # Vend::Parse - Parse Interchange tags
 # 
-# $Id: Parse.pm,v 2.43 2007/12/07 22:38:30 kwalsh Exp $
+# $Id: Parse.pm,v 2.44 2007/12/19 12:33:44 pajamian Exp $
 #
 # Copyright (C) 2002-2007 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -36,7 +36,7 @@
 
 @ISA = qw(Exporter Vend::Parser);
 
-$VERSION = substr(q$Revision: 2.43 $, 10);
+$VERSION = substr(q$Revision: 2.44 $, 10);
 
 @EXPORT = ();
 @EXPORT_OK = qw(find_matching_end);
@@ -808,18 +808,24 @@
 			$Vend::CurrentTag = $tagsave;
 			$tmpbuf = $p->{ABORT} ? '' : ${$p->{OUT}};
 		}
-		if($attr->{reparse} ) {
+		if ($attr->{'hide'}) {
+			$routine->(@args,$tmpbuf);
+		}
+		elsif($attr->{reparse} ) {
 			$$buf = ($routine->(@args,$tmpbuf)) . $$buf;
 		}
 		else {
-			${$self->{OUT}} .= &{$routine}(@args,$tmpbuf);
+			${$self->{OUT}} .= $routine->(@args,$tmpbuf);
 		}
 	}
-	elsif(! $attr->{interpolate}) {
-		${$self->{OUT}} .= &$routine( @args );
+	elsif ($attr->{'hide'}) {
+		$routine->(@args);
+	}
+	elsif($attr->{interpolate}) {
+		$$buf = $routine->(@args) . $$buf;
 	}
 	else {
-		$$buf = &$routine( @args ) . $$buf;
+		${$self->{OUT}} .= $routine->(@args);
 	}
 
 	$self->{SEND} = $attr->{'send'} || undef;








More information about the interchange-cvs mailing list