[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Tue Jan 8 15:59:01 2002
User: heins
Date: 2002-01-08 20:58:07 GMT
Modified: lib/Vend Interpolate.pm
Log:
* Fix [if-item-param field eq string] which would not work due to improper
field pointer type.
* Add ability to create multiple Control spaces.
Revision Changes Path
2.35 +13 -6 interchange/lib/Vend/Interpolate.pm
rev 2.35, prev_rev 2.34
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -r2.34 -r2.35
--- Interpolate.pm 2001/12/28 17:55:44 2.34
+++ Interpolate.pm 2002/01/08 20:58:06 2.35
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.34 2001/12/28 17:55:44 mheins Exp $
+# $Id: Interpolate.pm,v 2.35 2002/01/08 20:58:06 mheins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.34 $, 10);
+$VERSION = substr(q$Revision: 2.35 $, 10);
@EXPORT = qw (
@@ -4965,8 +4965,8 @@
: pull_if($2)#ige;
1 while $run =~ s#$IB$QR{_param_if}$IE[-_]param\1\]#
(defined $fh->{$3} ? $row->[$fh->{$3}] : '')
- ? pull_if($5,$2,$4,$row->[$3])
- : pull_else($5,$2,$4,$row->[$3])#ige;
+ ? pull_if($5,$2,$4,$row->[$fh->{$3}])
+ : pull_else($5,$2,$4,$row->[$fh->{$3}])#ige;
$run =~ s#$B$QR{_param}#defined $fh->{$1} ? ed($row->[$fh->{$1}]) : ''#ige;
1 while $run =~ s#$IB$QR{_pos_if}$IE[-_]pos\1\]#
$row->[$3]
@@ -6393,12 +6393,19 @@
if(! $name) {
# Here we either reset the index or increment it
# Done this way for speed, no blocks to enter other than top one
- ($::Scratch->{control_index} = 0, return) if $opt->{reset};
- return set_tmp('control_index', ++$::Scratch->{control_index});
+ if($opt->{space}) {
+ $::Control = $Tmp->{$opt->{space}} ||= [];
+ return set_tmp('control_index', 0);
+ }
+ else {
+ ($::Scratch->{control_index} = 0, return) if $opt->{reset};
+ return set_tmp('control_index', ++$::Scratch->{control_index});
+ }
}
$name = lc $name;
$name =~ s/-/_/g;
+ $opt ||= {};
if (! defined $default and $opt->{set}) {
$::Control->[$::Scratch->{control_index}]{$name} = $::Scratch->{$name};
return;