[interchange-cvs] interchange - heins modified 4 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Tue Aug 6 18:09:00 2002
User: heins
Date: 2002-08-06 22:08:04 GMT
Modified: lib/Vend Config.pm Interpolate.pm Menu.pm Util.pm
Log:
* Remove dependencies on '&' as the UrlSepChar.
* Enhance form_link to accept pre-formatted strings.
Revision Changes Path
2.62 +3 -3 interchange/lib/Vend/Config.pm
rev 2.62, prev_rev 2.61
Index: Config.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.61
retrieving revision 2.62
diff -u -r2.61 -r2.62
--- Config.pm 5 Aug 2002 06:04:49 -0000 2.61
+++ Config.pm 6 Aug 2002 22:08:04 -0000 2.62
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.61 2002/08/05 06:04:49 mheins Exp $
+# $Id: Config.pm,v 2.62 2002/08/06 22:08:04 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -44,7 +44,7 @@
use Vend::Parse;
use Vend::Util;
=20
-$VERSION =3D substr(q$Revision: 2.61 $, 10);
+$VERSION =3D substr(q$Revision: 2.62 $, 10);
=20
my %CDname;
=20
@@ -312,7 +312,7 @@
['Profiles', 'profile', ''],
['Catalog', 'catalog', ''],
['SubCatalog', 'catalog', ''],
- ['AutoVariable', 'autovar', ''],
+ ['AutoVariable', 'autovar', 'UrlJoiner'],
=20
];
return $directives;
2.101 +12 -3 interchange/lib/Vend/Interpolate.pm
rev 2.101, prev_rev 2.100
Index: Interpolate.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.100
retrieving revision 2.101
diff -u -r2.100 -r2.101
--- Interpolate.pm 5 Aug 2002 04:05:40 -0000 2.100
+++ Interpolate.pm 6 Aug 2002 22:08:04 -0000 2.101
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#=20
-# $Id: Interpolate.pm,v 2.100 2002/08/05 04:05:40 mheins Exp $
+# $Id: Interpolate.pm,v 2.101 2002/08/06 22:08:04 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.100 $, 10);
+$VERSION =3D substr(q$Revision: 2.101 $, 10);
=20
@EXPORT =3D qw (
=20
@@ -2954,7 +2954,16 @@
=20
$val =3D~ s/^\s+//mg;
$val =3D~ s/\s+$//mg;
- my @args =3D split /\n+/, $val;
+ my @args;
+ if($val =3D~ /^\S+=3D\S+=3D\S*$/) {
+ $val =3D unhexify($val);
+ @args =3D split $Global::UrlSplittor, $val;
+ }
+ else {
+ $val =3D~ s/^\s+//mg;
+ $val =3D~ s/\s+$//mg;
+ @args =3D split /\n+/, $val;
+ }
=20
for(@args) {
next if /^[\w=3D]+$/;
2.3 +7 -6 interchange/lib/Vend/Menu.pm
rev 2.3, prev_rev 2.2
Index: Menu.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Menu.pm,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- Menu.pm 5 Aug 2002 06:17:49 -0000 2.2
+++ Menu.pm 6 Aug 2002 22:08:04 -0000 2.3
@@ -1,6 +1,6 @@
# Vend::Menu - Interchange payment processing routines
#
-# $Id: Menu.pm,v 2.2 2002/08/05 06:17:49 mheins Exp $
+# $Id: Menu.pm,v 2.3 2002/08/06 22:08:04 mheins Exp $
#
# Copyright (C) 2002 Mike Heins, <mike@perusion.net>
#
@@ -21,7 +21,7 @@
=20
package Vend::Menu;
=20
-$VERSION =3D substr(q$Revision: 2.2 $, 10);
+$VERSION =3D substr(q$Revision: 2.3 $, 10);
=20
use Vend::Util;
use strict;
@@ -126,13 +126,13 @@
if(! $opt->{explode_url}) {
$u =3D Vend::Tags->history_scan( { var_exclude =3D> 'toggle,collapse,exp=
and' });
$opt->{explode_url} =3D $u;
- $opt->{explode_url} .=3D $u =3D~ /\?/ ? '&' : "?";
+ $opt->{explode_url} .=3D $u =3D~ /\?/ ? $Global::UrlJoiner : "?";
$opt->{explode_url} .=3D 'explode=3D1';
}
if(! $opt->{collapse_url}) {
$u ||=3D Vend::Tags->history_scan( { var_exclude =3D> 'toggle,collapse,e=
xpand' });
$opt->{collapse_url} =3D $u;
- $opt->{collapse_url} .=3D $u =3D~ /\?/ ? '&' : "?";
+ $opt->{collapse_url} .=3D $u =3D~ /\?/ ? $Global::UrlJoiner : "?";
$opt->{collapse_url} .=3D 'collapse=3D1';
}
=20
@@ -433,8 +433,8 @@
];
=20
if($row->{page}) {
- unless($row->{form} =3D~ /\r/) {
- $row->{form} =3D join "\n", split /\&/, $row->{form};
+ unless($row->{form} =3D~ /[\r\n]/) {
+ $row->{form} =3D join "\n", split $Global::UrlSplittor, $row->{form};
}
$row->{url} =3D Vend::Tags->area( { href =3D> $row->{page}, form =3D> $r=
ow->{form} });
}
@@ -446,7 +446,7 @@
$row->{link_style} ||=3D $opt->{link_style};
if($row->{mv_children}) {
my $u =3D $opt->{toggle_base_url};
- $u .=3D $u =3D~ /\?/ ? '&' : "?";
+ $u .=3D $u =3D~ /\?/ ? $Global::UrlJoiner : "?";
$u .=3D "toggle=3D$row->{code}";
$row->{toggle_url} =3D $u;
if($row->{mv_toggled}) {
@@ -568,6 +568,7 @@
return '<br>' unless $row->{name};
return $row->{name} if ! $row->{page} and $row->{name} =3D~ /^\s*</;
$row->{win} =3D $::Scratch->{win};
+ $row->{form} =3D~ tr/&/\n/;
$row->{href} =3D Vend::Tags->area( { href =3D> $row->{page}, form =3D> $r=
ow->{form} });
$row->{name} =3D errmsg($row->{name});
$row->{description} =3D~ s/"/"/g;
2.32 +12 -3 interchange/lib/Vend/Util.pm
rev 2.32, prev_rev 2.31
Index: Util.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.31
retrieving revision 2.32
diff -u -r2.31 -r2.32
--- Util.pm 22 Jul 2002 14:24:55 -0000 2.31
+++ Util.pm 6 Aug 2002 22:08:04 -0000 2.32
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
-# $Id: Util.pm,v 2.31 2002/07/22 14:24:55 jon Exp $
+# $Id: Util.pm,v 2.32 2002/08/06 22:08:04 mheins Exp $
#=20
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -82,7 +82,7 @@
use Safe;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION =3D substr(q$Revision: 2.31 $, 10);
+$VERSION =3D substr(q$Revision: 2.32 $, 10);
=20
BEGIN {
eval {
@@ -1268,14 +1268,23 @@
return vendUrl($_[0], $_[1], $Vend::Cfg->{SecureURL});
}
=20
+my %strip_vars;
+my $strip_init;
+
sub change_url {
my $url =3D shift;
return $url if $url =3D~ m{^\w+:};
return $url if $url =3D~ m{^/};
+ if(! $strip_init) {
+ for(qw/mv_session_id mv_pc/) {
+ $strip_vars{$_} =3D 1;
+ $strip_vars{$::IV->{$_}} =3D 1;
+ }
+ }
my $arg;
my @args;
($url, $arg) =3D split /[?&]/, $url, 2;
- @args =3D split $Global::UrlSplittor, $arg;
+ @args =3D grep ! $strip_vars{$_}, split $Global::UrlSplittor, $arg;
return Vend::Interpolate::tag_area( $url, '', {
form =3D> join "\n", @args,
} );