Skip to content

Commit

Permalink
* Add MV_AUTOEND capability as in MV_AUTOLOAD -- automatically append…
Browse files Browse the repository at this point in the history
…s something

  to an IC page first time it is run through interpolate_html(). This is
  arguably more useful than MV_AUTOLOAD, which happened at the beginning.

* Fix bug in init_page pragma capability. The flypage would be
  double-wrapped.
  • Loading branch information
Mike Heins committed Mar 25, 2014
1 parent 5e7f66d commit bf6412f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/Vend/Interpolate.pm
Expand Up @@ -653,6 +653,8 @@ sub interpolate_html {
if(defined $Vend::PageInit and ! $Vend::PageInit) {
defined $::Variable->{MV_AUTOLOAD}
and $html =~ s/^/$::Variable->{MV_AUTOLOAD}/;
defined $::Variable->{MV_AUTOEND}
and $html =~ s/$/$::Variable->{MV_AUTOEND}/;
$toplevel = 1;
}
#::logDebug("opt=" . uneval($opt));
Expand Down
6 changes: 4 additions & 2 deletions lib/Vend/Page.pm
Expand Up @@ -118,8 +118,10 @@ sub display_page {
my $inth_opt;
# Try for on-the-fly if not there
if(! defined $page) {
$Vend::PageInit = 0;
$page = Vend::Interpolate::fly_page($name)
and $inth_opt->{onfly} = 1;
and $inth_opt->{onfly} = 1
and undef $Vend::PageInit;
}

# Try one last time for page with index
Expand All @@ -130,7 +132,7 @@ sub display_page {
}

if (defined $page) {
$Vend::PageInit = 0;
$Vend::PageInit = 0 unless $inth_opt->{onfly};
if ($opt->{return}) {
return ::interpolate_html($page, 1, $inth_opt);
} else {
Expand Down

0 comments on commit bf6412f

Please sign in to comment.