Skip to content

Commit

Permalink
* Change fly-page and fly-list so variables don't get parsed
Browse files Browse the repository at this point in the history
	  twice, but still get parsed before flypage substitutions.
	  Add opt variable to call for control; could be used in
	  future for other purposes.

	* Fix [fly-list] tag so that the options work; previously
	  they never would have.
  • Loading branch information
perusionmike committed Jul 17, 2001
1 parent 29124d9 commit 5e56e87
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
12 changes: 6 additions & 6 deletions lib/Vend/Interpolate.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
# $Id: Interpolate.pm,v 1.40.2.100 2001-07-17 15:37:25 heins Exp $
# $Id: Interpolate.pm,v 1.40.2.101 2001-07-17 16:57:19 heins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
Expand All @@ -27,7 +27,7 @@ package Vend::Interpolate;
require Exporter;
@ISA = qw(Exporter);

$VERSION = substr(q$Revision: 1.40.2.100 $, 10);
$VERSION = substr(q$Revision: 1.40.2.101 $, 10);

@EXPORT = qw (
Expand Down Expand Up @@ -589,15 +589,17 @@ sub vars_and_comments {
}

sub interpolate_html {
my ($html, $wantref) = @_;
my ($html, $wantref, $opt) = @_;
return undef if $Vend::NoInterpolate;
my ($name, @post);
my ($bit, %post);

defined $::Variable->{MV_AUTOLOAD}
and $html =~ s/^/$::Variable->{MV_AUTOLOAD}/;

vars_and_comments(\$html);
#::logDebug("opt=" . ::uneval($opt));
vars_and_comments(\$html)
unless $opt and $opt->{onfly};

# Returns, could be recursive
my $parse = new Vend::Parse;
Expand Down Expand Up @@ -5558,8 +5560,6 @@ sub fly_page {

my $selector;

vars_and_comments(\$page) if $page;

return $page if (! $code and $Vend::Flypart eq $Vend::FinalPath);

$code = $Vend::FinalPath
Expand Down
10 changes: 6 additions & 4 deletions lib/Vend/Page.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vend::Page - Handle Interchange page routing
#
# $Id: Page.pm,v 1.5.6.6 2001-06-29 02:19:25 jon Exp $
# $Id: Page.pm,v 1.5.6.7 2001-07-17 16:57:19 heins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
Expand Down Expand Up @@ -45,7 +45,7 @@ use strict;

use vars qw/$VERSION/;

$VERSION = substr(q$Revision: 1.5.6.6 $, 10);
$VERSION = substr(q$Revision: 1.5.6.7 $, 10);

my $wantref = 1;

Expand Down Expand Up @@ -88,13 +88,15 @@ sub display_page {
}
# END TRACK

my $opt;
# Try for on-the-fly if not there
if(! defined $page) {
$page = Vend::Interpolate::fly_page($name);
$page = Vend::Interpolate::fly_page($name)
and $opt->{onfly} = 1;
}

if (defined $page) {
::response(::interpolate_html($page, 1));
::response(::interpolate_html($page, 1, $opt));
return 1;
}
else {
Expand Down
7 changes: 4 additions & 3 deletions lib/Vend/Parse.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vend::Parse - Parse Interchange tags
#
# $Id: Parse.pm,v 1.12.2.28 2001-07-01 05:06:30 jon Exp $
# $Id: Parse.pm,v 1.12.2.29 2001-07-17 16:57:19 heins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
Expand Down Expand Up @@ -35,7 +35,7 @@ require Exporter;

@ISA = qw(Exporter Vend::Parser);

$VERSION = substr(q$Revision: 1.12.2.28 $, 10);
$VERSION = substr(q$Revision: 1.12.2.29 $, 10);

@EXPORT = ();
@EXPORT_OK = qw(find_matching_end);
Expand Down Expand Up @@ -167,7 +167,7 @@ my %Order = (
flag => [qw( type )],
time => [qw( locale )],
fly_tax => [qw( area )],
fly_list => [qw( code base )],
fly_list => [qw( code )],
goto => [qw( name if)],
harness => [qw( )],
html_table => [qw( )],
Expand Down Expand Up @@ -253,6 +253,7 @@ my %addAttr = (
warnings 1
export 1
flag 1
fly_list 1
harness 1
html_table 1
import 1
Expand Down
6 changes: 3 additions & 3 deletions lib/Vend/Table/DBI.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vend::Table::DBI - Access a table stored in an DBI/DBD database
#
# $Id: DBI.pm,v 1.25.2.40 2001-07-09 14:59:51 racke Exp $
# $Id: DBI.pm,v 1.25.2.41 2001-07-17 16:57:19 heins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
Expand All @@ -20,7 +20,7 @@
# MA 02111-1307 USA.

package Vend::Table::DBI;
$VERSION = substr(q$Revision: 1.25.2.40 $, 10);
$VERSION = substr(q$Revision: 1.25.2.41 $, 10);

use strict;

Expand Down Expand Up @@ -349,7 +349,7 @@ sub create {
}

for(@index) {
::logDebug("Running: $_");
#::logDebug("Running: $_");
$db->do($_)
or ::logError(
"DBI: Post creation query '%s' failed: %s" ,
Expand Down

0 comments on commit 5e56e87

Please sign in to comment.