bugfix [ 904313 ] Problem with page-template preview in 6.0.0

This commit is contained in:
JT Smith 2004-03-25 19:14:29 +00:00
parent b0ae354c4e
commit ce8272c62e
3 changed files with 16 additions and 1 deletions

View file

@ -7,6 +7,9 @@ Andreas Graf).
- Bugfix 914825 / 912203: Bug in template system (LenK).
- Apache 2.0 is now the default web server for WebGUI. See gotcha.txt for
details.
- Bugfix [ 904313 ] Problem with page-template preview in 6.0.0
6.0.0

View file

@ -1388,6 +1388,12 @@ The unique identifier for the selected template. Defaults to "1".
The namespace for the list of templates to return. If this is omitted, all templates will be displayed.
=item extras
If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
'onChange="this.form.submit()"'
=back
=cut
@ -1398,7 +1404,8 @@ sub template {
return selectList({
name=>$name,
options=>WebGUI::Template::getList($_[0]->{namespace}),
value=>[$templateId]
value=>[$templateId],
extras=>$_[0]->{extras}
});
}

View file

@ -290,9 +290,14 @@ sub drawTemplate {
$template =~ s/\r//g;
$template =~ s/\'/\\\'/g;
$template = WebGUI::Macro::negate($template);
$template =~ s/\<style.*?\>.*?\<\/style\>//gi;
$template =~ s/\<script.*?\>.*?\<\/script\>//gi;
$template =~ s/\<table.*?\>/\<table cellspacing=0 cellpadding=3 width=100 height=80 border=1\>/ig;
$template =~ s/\<tmpl_loop\s+position(\d+)\_loop\>.*?\<\/tmpl\_loop\>/$1/ig;
$template =~ s/\<tmpl_if.*?\>.*?\<\/tmpl_if\>//ig;
$template =~ s/\<tmpl_if.*?\>//ig;
$template =~ s/\<\/tmpl_if\>//ig;
$template =~ s/\<tmpl_var.*?\>//ig;
return $template;
}