You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2007/09/29 13:05:56 UTC
svn commit: r580573 - in /perl/embperl/trunk: ./ Embperl/
Embperl/Form/Control/ Embperl/Syntax/ test/cmp/ test/html/
Author: richter
Date: Sat Sep 29 04:05:54 2007
New Revision: 580573
URL: http://svn.apache.org/viewvc?rev=580573&view=rev
Log:
- Include patch from Mark D. Anderson to make SSI syntax
behave more like mod_include.
- Improve XHTML/XML support. Tags that are parsed by Embperl
like input, are now only have one slash at the end, if there
is already a slash in the source and output_mode is set to
xml. In addition checked attributes for input tags are now
added as checked="checked" to be valid xml.
Spotted by Villu Roogna.
- Add Embperl::Form stuff
- Set version to 2.3.0
- Included patch from Andrew O'Brian to correctly retrieve
Cookie header when running under Apache 2.
Added:
perl/embperl/trunk/Embperl/Form/Control/mult.pm (with props)
Modified:
perl/embperl/trunk/Changes.pod
perl/embperl/trunk/Embperl.pm
perl/embperl/trunk/Embperl/Form.pm
perl/embperl/trunk/Embperl/Form/Control/grid.pm
perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
perl/embperl/trunk/Embperl/Syntax/HTML.pm
perl/embperl/trunk/Embperl/Syntax/SSI.pm
perl/embperl/trunk/MANIFEST
perl/embperl/trunk/Makefile.PL
perl/embperl/trunk/epcmd2.c
perl/embperl/trunk/epdat2.h
perl/embperl/trunk/test/cmp/epodiv.htm
perl/embperl/trunk/test/cmp/epoincdiv.htm
perl/embperl/trunk/test/cmp/xhtml.htm
perl/embperl/trunk/test/html/xhtml.htm
Modified: perl/embperl/trunk/Changes.pod
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Changes.pod?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Changes.pod (original)
+++ perl/embperl/trunk/Changes.pod Sat Sep 29 04:05:54 2007
@@ -1,29 +1,46 @@
=pod
-=head1 2.2.1_dev (Not yet released, only in the L<"SVN"|SVN.pod>)
+=head1 2.3.0 30. Sept. 2007
+ - Added support for Code ref in language message lookup hash.
+ That allows for internationalization to call a sub instead
+ of only looking up keys in a hash.
+ - Added UTF-8 messages to Embperl::Form::Validate.
+ - Include patch from Mark D. Anderson to make SSI syntax
+ behave more like mod_include.
+ - Make component -> curr_esc_mode available in Perl, requested
+ by Robert.
+ - Improve XHTML/XML support. Tags that are parsed by Embperl
+ like input, are now only have one slash at the end, if there
+ is already a slash in the source and output_mode is set to
+ xml. In addition checked attributes for input tags are now
+ added as checked="checked" to be valid xml.
+ Spotted by Villu Roogna.
+ - A lot of code was written for Embperl::Form a sophisticated
+ form creation/handling framework, which also contains some
+ nice AJAX and JS stuff like autocomplete input boxes,
+ grids and tabbed dialogs. Also the framework itself is ready
+ to use, there is not much documentation yet...
- Fixed wrong version numbers in make test files,
which caused make test to fail. Spotted by Matt Bockol.
- Use _stat() instead of stat() on Win32 to work around the problem
that Perl redefines stat() in an incompatibel way.
Spotted by Randy Korbes.
- - Added UTF-8 messages to Embperl::Form::Validate.
- Documented all options of embpexec.pl.
- Fixed default_language handling in Embperl::Form::Validate.
Patch from Kathryn Andersen.
- - Added support for Code ref in language message lookup hash.
- That allows for internationalization to call a sub instead
- of only looking up keys in a hash.
+ - In Makefile.PL check for mod_perl2.pm instead of mod_perl
+ when mod_perl 2.x is used. Spotted by Dan Clawson.
+ - Included patch from Andrew O'Brian to correctly retrieve
+ Cookie header when running under Apache 2.
- Fixed timezone compiletime error on Mac OS-X. Patch from
Wolfgang Kinkeldei.
- - Fixed segfault that might occurs when an value of an input
+ - Fixed segfault that might occur when an value of an input
attribute is removed. Spotted by Andrew Sitnikov.
- - Make component -> curr_esc_mode available in Perl, requested
- by Robert.
- Fixed missing Perl Stack setup which causes memory errors on
BSD systems. Patch from Doug Rayner.
- - Added internal check and error message when due to a syntax
- error in the source a node is parsed as attribute.
+ - Added internal check and error message when, due to a syntax
+ error in the source, a node is parsed as attribute.
Spotted by Kato M. Yoshiro.
- Fix segfault that occured during output of an error message
when not inside an Embperl request.
Modified: perl/embperl/trunk/Embperl.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl.pm (original)
+++ perl/embperl/trunk/Embperl.pm Sat Sep 29 04:05:54 2007
@@ -49,7 +49,7 @@
@ISA = qw(Exporter DynaLoader);
-$VERSION = '2.2.1_dev2' ;
+$VERSION = '2.3.0' ;
if ($modperl = $ENV{MOD_PERL})
@@ -76,6 +76,7 @@
require Apache2::RequestRec ;
require Apache2::RequestUtil ;
require Apache2::SubRequest ;
+ require APR::Table ;
$srv_rec = Apache2::ServerUtil -> server ;
}
else
@@ -352,7 +353,7 @@
my $debug = $appparam?$appparam -> {debug} & Embperl::Constant::dbgSession:0 ;
if (!$uid)
{
- my $cookie_val = $ENV{HTTP_COOKIE} || ($req_rec?$req_rec->header_in('Cookie'):undef) ;
+ my $cookie_val = $ENV{HTTP_COOKIE} || ($req_rec?$req_rec->headers_in -> {'Cookie'}:undef) ;
if ((defined ($cookie_val) && ($cookie_val =~ /$cookie_name=(.*?)(\;|\s|$)/)) || ($ENV{QUERY_STRING} =~ /$cookie_name=.*?:(.*?)(\;|\s|&|$)/) || $ENV{EMBPERL_UID} )
{
Modified: perl/embperl/trunk/Embperl/Form.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form.pm (original)
+++ perl/embperl/trunk/Embperl/Form.pm Sat Sep 29 04:05:54 2007
@@ -165,7 +165,7 @@
if (!defined (&{"$name\:\:new"}))
{
eval "require $name" ;
- warn $@ if ($@) ;
+ warn $@ if ($@ && ($@ !~ /Can\'t locate/)) ;
}
$obj = $name -> new ($args) ;
$ctlmod = $name ;
@@ -188,7 +188,7 @@
{
my $mod = "$package\:\:$name" ;
eval "require $mod" ;
- warn $@ if ($@) ;
+ warn $@ if ($@ && ($@ !~ /Can\'t locate/)) ;
if ($mod -> can('new'))
{
$obj = $mod -> new ($args) ;
@@ -496,7 +496,7 @@
{
my ($self, $req) = @_ ;
-
+warn "embperl::form::prepare_fdat c=@{$self->{prepare_fdat}}" ;
foreach my $control (@{$self -> {prepare_fdat}})
{
$control -> prepare_fdat ($req) ;
Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Sat Sep 29 04:05:54 2007
@@ -133,7 +133,7 @@
# show - output the control
#]
-[$ sub show ($self)
+[$ sub show ($self, $req)
my $name = $self -> {name} ;
my $span = ($self->{width_percent}) ;
@@ -151,13 +151,16 @@
-]
<input type="hidden" name="[+ $self -> {name} +]-max" id="[+ $self -> {id} +]-max">
<table class="cGridTable cBase" id="[+ $self -> {id} +]">
- [- $self -> show_grid_header (); -]
- [- $self -> show_grid_table () ; -]
+ [- $self -> show_grid_header ($req); -]
+ [- $self -> show_grid_table ($req) ; -]
</table>
[- $self -> show_grid_title ($jsname)
if ($max > $self -> {header_bottom}) -]
<table id="[+ $self -> {id} +]-newrow" style="display: none">
- [- $self -> show_grid_table_row ('%row%') ; -]
+ [-
+ local $req -> {epf_no_script} = 1 ;
+ $self -> show_grid_table_row ($req, '%row%') ;
+ -]
</table>
<script>
[+ $jsname +] = new [+ $nsprefix +]Grid (document.getElementById('[+ $self -> {id} +]'),
@@ -191,7 +194,7 @@
# show_grid_header Erzeugt den Tabellenkopf
#]
-[$ sub show_grid_header ($self)
+[$ sub show_grid_header ($self, $req)
my $fields = $self->{'fields'};
$]
@@ -207,7 +210,7 @@
# show_grid_table_row Erzeugt eine Grid-Tabelle-Zeile
#]
-[$ sub show_grid_table_row ($self, $i)
+[$ sub show_grid_table_row ($self, $req, $i)
$fields = $self -> {fields} ;
$id = $self -> {id};
@@ -230,7 +233,7 @@
# show_grid_table Erzeugt eine Grid-Tabelle
#]
-[$ sub show_grid_table ($self)
+[$ sub show_grid_table ($self, $req)
my $name = $self->{name} ;
my $fields = $self -> {fields} ;
my $id = $self -> {id};
@@ -239,7 +242,7 @@
$]
[* for ($i = 0; $i < $max ; $i++ ) { *]
- [- $self -> show_grid_table_row ($i) ; -]
+ [- $self -> show_grid_table_row ($req, $i) ; -]
[* } *]
[$endsub$]
Added: perl/embperl/trunk/Embperl/Form/Control/mult.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/mult.pm?rev=580573&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/mult.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/mult.pm Sat Sep 29 04:05:54 2007
@@ -0,0 +1,276 @@
+
+###################################################################################
+#
+# Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh www.ecos.de
+#
+# You may distribute under the terms of either the GNU General Public
+# License or the Artistic License, as specified in the Perl README file.
+#
+# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+# $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::mult ;
+
+use strict ;
+use base 'Embperl::Form::Control::grid' ;
+
+use vars qw{%fdat $epreq} ;
+
+use Embperl::Inline ;
+
+# ---------------------------------------------------------------------------
+#
+# new - create a new control
+#
+
+
+sub new
+
+ {
+ my ($class, $args) = @_ ;
+
+ my $self = Embperl::Form::ControlMultValue -> new($args) ;
+ bless $self, $class ;
+
+ $self -> init ;
+
+ return $self ;
+ }
+
+# ---------------------------------------------------------------------------
+#
+# init - init the new control
+#
+
+sub init
+
+ {
+ my ($self) = @_ ;
+
+ my $form = $self -> form ;
+ $self -> {fields} ||= [$self -> {field}] ;
+ $self -> {class} ||= 'cMult' ;
+ $form -> new_controls ($self -> {fields}, $form -> {options}) ;
+
+ return $self ;
+ }
+
+# ------------------------------------------------------------------------------------------
+#
+# init_data - daten aufteilen
+#
+
+sub init_data
+ {
+ my ($self, $req) = @_ ;
+
+ my $ldap = $req->{ldap};
+ my $name = $self->{name} ;
+ my @entries = split("\t",$fdat{$name});
+use Data::Dumper ;
+print STDERR 'init_data', Dumper (\%fdat, $name, \@entries) ;
+
+ my $i = 0 ;
+ foreach my $entry (@entries)
+ {
+ $fdat{"$name--$i"} = $entry ;
+warn "init_data mult field=$name--$i fd=" . $fdat{"$name--$i"} ;
+
+ $i++ ;
+ }
+ $fdat{"$name-max"} = $i?$i:1;
+ }
+
+# ------------------------------------------------------------------------------------------
+#
+# prepare_fdat - daten zusammenfuehren
+#
+
+sub prepare_fdat
+ {
+ my ($self, $req) = @_ ;
+ my $ldap = $req->{ldap};
+ my $name = $self->{name} ;
+ my $max = $fdat{"$name-max"} || 1 ;
+warn "prepare_dat mult name =$name, max=$max" ;
+use Data::Dumper ;
+print STDERR Dumper (\%fdat) ;
+
+ my @rows;
+ my $val ;
+ for (my $i = 0; $i < $max; $i++)
+ {
+warn "prepare_dat mult field=$name--$i fd=" . $fdat{"$name--$i"} ;
+ $val = $fdat{"$name--$i"} ;
+ push @rows, $val if ($val ne '') ;
+ }
+ $fdat{$name} = \@rows ;
+print STDERR Dumper (\%fdat, \@rows) ;
+ }
+
+sub show { Embperl::Form::Control::show (@_) }
+
+1 ;
+
+__EMBPERL__
+
+
+[# ---------------------------------------------------------------------------
+#
+# show_control - output the control
+#]
+
+[$ sub show_control ($self, $req)
+
+ my $name = $self -> {name} ;
+ my $span = ($self->{width_percent}) ;
+ my $nsprefix = $self -> form -> {jsnamespace} ;
+ my $jsname = $name ;
+ $jsname =~ s/[^a-zA-Z0-9]/_/g ;
+ $jsname .= 'Grid' ;
+ my $max = $fdat{"$name-max"} ;
+$]
+ [-
+ $fdat{$name} = $self -> {default} if ($fdat{$name} eq '' && exists ($self -> {default})) ;
+ my $span = 0 ;
+ -]
+ <input type="hidden" name="[+ $self -> {name} +]-max" id="[+ $self -> {id} +]-max">
+ <table class="[+ $self -> {class} +]Table cBase" id="[+ $self -> {id} +]">
+ [- $self -> show_grid_table ($req) ; -]
+ </table>
+ <table id="[+ $self -> {id} +]-newrow" style="display: none">
+ [-
+ local $req -> {epf_no_script} = 1 ;
+ $self -> show_grid_table_row ($req, '%row%') ;
+ -]
+ </table>
+ <script>
+ [+ $jsname +] = new [+ $nsprefix +]Grid (document.getElementById('[+ $self -> {id} +]'),
+ document.getElementById('[+ $self -> {id} +]-newrow'),
+ document.getElementById('[+ $self -> {id} +]-max')) ;
+ </script>
+[$endsub$]
+
+
+
+[# ---------------------------------------------------------------------------
+#
+# show_grid_table_row Erzeugt eine Grid-Tabelle-Zeile
+#]
+
+[$ sub show_grid_table_row ($self, $req, $i)
+
+ $field = $self -> {fields}[0] ;
+ $id = $self -> {id};
+ $name = $self -> {name} ;
+ my $jsname = $name ;
+ $jsname =~ s/[^a-zA-Z0-9]/_/g ;
+ $jsname .= 'Grid' ;
+ $]
+
+ <tr class="cGridRow" id="[+ "$id-row-$i" +]">
+
+ <td class="[+ $self -> {class} +]Cell">
+ [-
+ local $field -> {name} = "$name--$i" ;
+ $field -> show_control ($req)
+ -]
+ </td>
+ </tr>
+[$ endsub $]
+
+
+[$ sub show_label_icon ($self)
+ $name = $self -> {name} ;
+ my $jsname = $name ;
+ $jsname =~ s/[^a-zA-Z0-9]/_/g ;
+ $jsname .= 'Grid' ;
+
+
+ $]
+ <img src="/images/button_plus.gif" id="cmdAdd" name="-add" title="Zeile Hinzufügen" onclick="[+ $jsname +].addRow()">
+ <img src="/images/button_kreuz.gif" id="cmdDelete" name="-delete" title="Zeile Löschen" onclick="[+ $jsname +].delRow()">
+[$endsub$]
+
+[# ---------------------------------------------------------------------------
+#
+# show_grid_table Erzeugt eine Grid-Tabelle
+#]
+
+[$ sub show_grid_table ($self, $req)
+ my $name = $self->{name} ;
+ my $fields = $self -> {fields} ;
+ my $id = $self -> {id};
+ my $i = 0 ;
+ my $max = $fdat{"$name-max"} || 1 ;
+ $]
+
+ [* for ($i = 0; $i < $max ; $i++ ) { *]
+ [- $self -> show_grid_table_row ($req, $i) ; -]
+ [* } *]
+
+[$endsub$]
+
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::grid - A grid control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+Used to create a grid control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'grid'
+
+=head3 fields
+
+Array ref with field definitions
+
+=head3 header_bottom
+
+If grid has more rows as given in this parameter,
+a header line is also displayed at the bottom of the
+grid. Default is 10. Set to -1 to always get a
+header at the bottom.
+
+=head2 Example
+
+ {
+ name => 'provider-path',
+ text => 'Suchpfad',
+ type => 'grid',
+ fields =>
+ [
+ { name => 'active', text => 'Aktiv', type => 'checkbox', width => '30' },
+ { name => 'path', text => 'Pfad' },
+ ],
+ },
+
+=head1 Author
+
+G. Richter (richter@dev.ecos.de)
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+
Propchange: perl/embperl/trunk/Embperl/Form/Control/mult.pm
------------------------------------------------------------------------------
svn:executable = *
Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Sat Sep 29 04:05:54 2007
@@ -53,9 +53,17 @@
#$filter ||= $self -> {filter} ;
#my $addtop = $self -> {addtop} || [] ;
#my $addbottom= $self -> {addbottom} || [] ;
+ my $noscript = $req -> {epf_no_script} ;
my $nsprefix = $self -> form -> {jsnamespace} ;
my $jsname = $name ;
- $jsname =~ s/[^a-zA-Z0-9]/_/g ;
+ if ($noscript)
+ {
+ $jsname =~ s/[^a-zA-Z0-9%]/_/g ;
+ }
+ else
+ {
+ $jsname =~ s/[^a-zA-Z0-9]/_/g ;
+ }
$self -> {size} ||= 75 / ($self -> {width} || 2) ;
my $initval ;
my $fdatval = $fdat{$name} ;
@@ -104,18 +112,7 @@
</div>
[# --- interface --- #]
-<script type="text/javascript">
-
- function [+ $jsname +]savevalue(inputelem, lielem) {
- f = document.getElementById ('[+ $name +]') ;
- if (!lielem || inputelem.value == '' || lielem.value == '')
- {
- f.value = '' ;
- inputelem.value = '' ;
- }
- else
- f.value = lielem.id ;
- }
+<[$if $noscript $]x-[$endif$]script type="text/javascript">
[+ $jsname +]Popup = new [+ $nsprefix +]Popup (document.getElementById('_menu_[+ $jsname +]'),
document.getElementById('[+ $name +]'),
@@ -123,15 +120,15 @@
document.getElementById('_inp_[+ $jsname +]')) ;
[+ $jsname +]AutoComp = new [+ $nsprefix +]Ajax.Autocompleter(document.getElementById('_inp_[+ $jsname +]'),document.getElementById('_cont_[+ $jsname +]'),
- '/epfctrl/datasrc.exml', {paramName: "query", parameters: "datasrc=[+ $self -> {datasrc} +]", frequency: 0.3, afterUpdateElement: [+ $jsname +]savevalue}) ;
+ '/epfctrl/datasrc.exml', {paramName: "query", parameters: "datasrc=[+ $self -> {datasrc} +]", frequency: 0.3, update: document.getElementById('[+ $name +]')}) ;
[+ $jsname +]AutoComp.updateChoices ;
-</script>
+</[$if $noscript $]x-[$endif$]script>
[$endsub$]
__END__
-
+, afterUpdateElement: [+ $jsname +]savevalue
=pod
=head1 NAME
Modified: perl/embperl/trunk/Embperl/Syntax/HTML.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Syntax/HTML.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Syntax/HTML.pm (original)
+++ perl/embperl/trunk/Embperl/Syntax/HTML.pm Sat Sep 29 04:05:54 2007
@@ -83,7 +83,17 @@
} ;
$tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo, (ref($taginfo) eq 'HASH'?%{$taginfo->{procinfo}}:()) } if ($procinfo) ;
- my %inside = %{$self -> {-htmlQuotes}} ;
+ my %inside = (%{$self -> {-htmlQuotes}},
+ 'removeslash' =>
+ {
+ 'text' => "/",
+ 'nodetype' => 0,
+ 'cdatatype' => 0,
+ 'removespaces' => 0,
+ 'nodename' => '',
+ },
+
+ ) ;
my $addinside = 0 ;
if ($attrs)
{
Modified: perl/embperl/trunk/Embperl/Syntax/SSI.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Syntax/SSI.pm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Syntax/SSI.pm (original)
+++ perl/embperl/trunk/Embperl/Syntax/SSI.pm Sat Sep 29 04:05:54 2007
@@ -183,7 +183,7 @@
$ENV{DATE_GMT} = gmtime ;
$ENV{DATE_LOCAL} = localtime ;
$ENV{DOCUMENT_NAME} = basename ($fn = $Embperl::req -> component -> sourcefile) ;
- $ENV{DOCUMENT_URI} = $Embperl::req -> apache_req?$Embperl::req -> apache_req -> uri:'' ;
+ $ENV{DOCUMENT_URI} = $Embperl::req -> apache_req?$Embperl::req -> apache_req -> uri:$ENV{REQUEST_URI} ;
$ENV{LAST_MODIFIED} = format_time('', (stat ($fn))[9]) ;
}
@@ -194,14 +194,27 @@
#
# ---------------------------------------------------------------------------------
+sub map_ssi_ops_to_perl
+ {
+ my $val = shift ;
+
+ $val =~ s/\$(\w)([a-zA-Z0-9_]*)/\$ENV{'$1$2'}/g ;
+ $val =~ s/\$\{(\w)([a-zA-Z0-9_]*?)\}/\$ENV{'$1$2'}/g ;
+ $val =~ s,!=\s*/,!~ /,;
+ $val =~ s,=\s*/,=~ /,;
+ $val =~ s/!=/ne/;
+ $val =~ s/=([^~])/eq$1/;
+
+ return $val ;
+ }
sub InterpretVars
{
my $val = shift ;
my $esc = shift ;
- $val =~ s/\$(\w)([a-zA-Z0-9_]*)/\$ENV{'$1$2'}/g ;
- $val =~ s/\$\{(\w)([a-zA-Z0-9_]*?)\}/\$ENV{'$1$2'}/g ;
+ my @fields = ($val =~ m/\s* ("(?:(?!(?<!\\)").)*" | '(?:(?!(?<!\\)').)*' | \S+)/gx);
+ $val = join(' ', map {m/^[\"\']/ ? $_ : map_ssi_ops_to_perl($_)} @fields );
$val =~ s/\'/\\\'/g if ($esc) ;
return $val ;
}
Modified: perl/embperl/trunk/MANIFEST
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/MANIFEST?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/MANIFEST (original)
+++ perl/embperl/trunk/MANIFEST Sat Sep 29 04:05:54 2007
@@ -13,29 +13,33 @@
Embperl/Form/Control.pm
Embperl/Form/Control/addremove.pm
Embperl/Form/Control/blank.pm
+Embperl/Form/Control/button.pm
Embperl/Form/Control/checkbox.pm
+Embperl/Form/Control/checkboxes.pm
Embperl/Form/Control/display.pm
+Embperl/Form/Control/displaylink.pm
Embperl/Form/Control/dump.pm
-Embperl/Form/Control/blank.pm
-Embperl/Form/Control/tabs.pm
Embperl/Form/Control/table.pm
-Embperl/Form/Control/transparent.pm
-Embperl/Form/Control/radio.pm
Embperl/Form/Control/file.pm
Embperl/Form/Control/grid.pm
Embperl/Form/Control/hidden.pm
Embperl/Form/Control/info.pm
Embperl/Form/Control/input.pm
Embperl/Form/Control/label.pm
+Embperl/Form/Control/mult.pm
Embperl/Form/Control/number.pm
Embperl/Form/Control/password.pm
Embperl/Form/Control/radio.pm
Embperl/Form/Control/select.pm
+Embperl/Form/Control/selectdyn.pm
Embperl/Form/Control/submit.pm
Embperl/Form/Control/tabs.pm
Embperl/Form/Control/textarea.pm
+Embperl/Form/Control/table.pm
+Embperl/Form/Control/tinymce.pm
Embperl/Form/Control/transparent.pm
Embperl/Form/ControlMultValue.pm
+Embperl/Form/DataSource.pm
Embperl/Form/Validate.pm
Embperl/Form/Validate/Default.pm
Embperl/Form/Validate/Number.pm
Modified: perl/embperl/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Makefile.PL?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/Makefile.PL (original)
+++ perl/embperl/trunk/Makefile.PL Sat Sep 29 04:05:54 2007
@@ -1055,7 +1055,7 @@
### check for required modules ###
- if (($MPVer = CheckModule ("mod_perl", "-> Cannot build for mod_perl without mod_perl installed!!")))
+ if (($MPVer = CheckModule ("mod_perl" . ($mp2Apache2?'2':''), "-> Cannot build for mod_perl without mod_perl installed!!")))
{
if ($win32 && $MPVer lt "1.12")
{
Modified: perl/embperl/trunk/epcmd2.c
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/epcmd2.c?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/epcmd2.c (original)
+++ perl/embperl/trunk/epcmd2.c Sat Sep 29 04:05:54 2007
@@ -134,7 +134,10 @@
if (bEqual)
{
- Element_selfSetAttribut (r -> pApp, pDomTree, pNode, nRepeatLevel, sAttrName, nAttrLen, NULL, 0) ;
+ if (r -> Config.nOutputMode)
+ Element_selfSetAttribut (r -> pApp, pDomTree, pNode, nRepeatLevel, sAttrName, nAttrLen, sAttrName, nAttrLen) ;
+ else
+ Element_selfSetAttribut (r -> pApp, pDomTree, pNode, nRepeatLevel, sAttrName, nAttrLen, NULL, 0) ;
if (r -> Component.Config.bDebug & dbgInput)
lprintf (r -> pApp, "[%d]INPU: Set Attribut: Name: '%*.*s' Value: '%*.*s' Attribute: '%*.*s' nRepeatLevel=%d\n", r -> pThread -> nPid, nNameLen, nNameLen, pName, nValLen, nValLen, pVal, nAttrLen, nAttrLen, sAttrName, nRepeatLevel) ;
}
Modified: perl/embperl/trunk/epdat2.h
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/epdat2.h?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/epdat2.h (original)
+++ perl/embperl/trunk/epdat2.h Sat Sep 29 04:05:54 2007
@@ -107,7 +107,7 @@
CV * pUriMatch ;
char cMultFieldSep ;
AV * pPathAV ;
- int nOutputMode ;
+ int nOutputMode ; /**< 0 = html 1 = xml */
int nOutputEscCharset ; /**< 0 = utf-8 (min) 1 = latin1 2 = latin2 */
unsigned bDebug ;
unsigned bOptions ;
Modified: perl/embperl/trunk/test/cmp/epodiv.htm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/cmp/epodiv.htm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/test/cmp/epodiv.htm (original)
+++ perl/embperl/trunk/test/cmp/epodiv.htm Sat Sep 29 04:05:54 2007
@@ -280,7 +280,7 @@
</tr>
</table>
-^<P>(2\.2.*?|1\.3.*?)<P>
+^<P>(2\.3.*?|1\.3.*?)<P>
<P>17<P>
<P>1<P>
Modified: perl/embperl/trunk/test/cmp/epoincdiv.htm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/cmp/epoincdiv.htm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/test/cmp/epoincdiv.htm (original)
+++ perl/embperl/trunk/test/cmp/epoincdiv.htm Sat Sep 29 04:05:54 2007
@@ -284,7 +284,7 @@
</tr>
</table>
-^<P>2.2
+^<P>2.3
<P>17<P>
<P>1<P>
Modified: perl/embperl/trunk/test/cmp/xhtml.htm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/cmp/xhtml.htm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/test/cmp/xhtml.htm (original)
+++ perl/embperl/trunk/test/cmp/xhtml.htm Sat Sep 29 04:05:54 2007
@@ -22,6 +22,9 @@
<input type="hidden" name="a" value="1" /><input type="hidden" name="b" value="'2'" /><input type="hidden" name="c" value=""3"" />
+--- NO slashes in the source ---
+
+
<input type="text" name="b" value="'2'" />
<input type="text" name="c" value=""3"" />
@@ -30,6 +33,29 @@
<select name="a">
<option>xxx</option>
</select>
+
+--- slashes in the source ---
+
+<input type="text" name="b" value="'2'" />
+<input type="text" name="c" value=""3"" />
+
+<input type="checkbox" name="a" value="1" checked="checked" />
+<input type="checkbox" name="a" value="2" />
+<input type="checkbox" name="a" value="3" ="checked" />
+<input type="checkbox" name="b" value="'2'" />
+<input type="checkbox" name="c" value=""3"" />
+
+<a href="bla.htm">bla</a>
+
+<select name="a">
+ <option>xxx</option>
+</select>
+
+
+<blabla />
+<blabla/>
+
+
Modified: perl/embperl/trunk/test/html/xhtml.htm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/html/xhtml.htm?rev=580573&r1=580572&r2=580573&view=diff
==============================================================================
--- perl/embperl/trunk/test/html/xhtml.htm (original)
+++ perl/embperl/trunk/test/html/xhtml.htm Sat Sep 29 04:05:54 2007
@@ -36,6 +36,9 @@
[$hidden$]
+--- NO slashes in the source ---
+
+
<input type="text" name="b">
<input type="text" name="c">
@@ -44,6 +47,29 @@
<select name="a">
<option>xxx</option>
</select>
+
+--- slashes in the source ---
+
+<input type="text" name="b" />
+<input type="text" name="c"/>
+
+<input type="checkbox" name="a" value="1" />
+<input type="checkbox" name="a" value="2" />
+<input type="checkbox" name="a" value="3" checked="checked" />
+<input type="checkbox" name="b" />
+<input type="checkbox" name="c"/>
+
+<a href="bla.htm">bla</a>
+
+<select name="a">
+ <option>xxx</option>
+</select>
+
+
+<blabla />
+<blabla/>
+
+
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org