Commit a06c7dd3 authored by Axel Beckert's avatar Axel Beckert

Imported Upstream version 2.5.0~rc4

parent 1b3e037b
......@@ -40,6 +40,13 @@
- Log Errors form Embperl::Syntax::Mail to error log
- Fix compile problem on non intel plattforms due to missing
-m32 flag.
- Added support for utf8 sourcefiles. By setting
input_charset => 'utf8' sponsored by Perlover.
- Added optChdirToSource = 0x10000000 which will cause
Embperl to change to the directory of the source file
prior to execution.
Adaptions to Perl 5.14/16 were sponsored by NUREG GmbH
=head 2.4.0 4. Oct 2010
......
......@@ -1895,6 +1895,10 @@ value is a blank string.
Disable the removal of spaces and empty lines from the output. This is useful
for sources other than HTML.
=item optChdirToSource = 0x10000000 (only 2.5 and above)
Change current working directory to the directory of the sourcefile,
before executing the source.
=back
......@@ -2044,10 +2048,9 @@ $component -> config -> input_charset
=back
NOT YET IMPLEMENTED!
If set to the value "utf8" the source is interpreted as utf8 encoded so
you can use utf8 literals. It has the same effect as adding "use utf8"
to a normal Perl script.
=head2 Embperl_Top_Include
......
......@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: Embperl.pm 1407811 2012-11-10 13:29:36Z richter $
# $Id: Embperl.pm 1432267 2013-01-11 20:27:37Z richter $
#
###################################################################################
......@@ -50,7 +50,7 @@ use vars qw(
@ISA = qw(Exporter DynaLoader);
$VERSION = '2.5.0_3' ;
$VERSION = '2.5.0_4' ;
if ($modperl = $ENV{MOD_PERL})
......
......@@ -88,12 +88,14 @@ sub sub_new
$self -> {fields2empty} = [] ;
$self -> {init_data} = [] ;
$self -> {prepare_fdat} = [] ;
$self -> {code_refs} = [] ;
}
else
{
$self -> {fields2empty} = $self -> parent_form -> {fields2empty} ;
$self -> {init_data} = $self -> parent_form -> {init_data} ;
$self -> {prepare_fdat} = $self -> parent_form -> {prepare_fdat} ;
$self -> {prepare_fdat} = $self -> parent_form -> {prepare_fdat} ;
$self -> {code_refs} = $self -> parent_form -> {code_refs} ;
}
$self -> new_controls ($controls, $options, undef, $id, $validate_rules, $options -> {masks}, $options -> {defaults}) ;
......@@ -311,7 +313,8 @@ sub new_controls
if (!$no_init)
{
push @{$self -> {init_data}}, $control if ($control -> can ('init_data')) ;
push @{$self -> {prepare_fdat}}, $control if ($control -> can ('prepare_fdat')) ;
push @{$self -> {prepare_fdat}}, $control if ($control -> can ('prepare_fdat')) ;
push @{$self -> {code_refs}}, $control if ($control -> has_code_refs) ;
}
}
$self -> {controlids}{$control->{id}} = $control ;
......@@ -502,6 +505,7 @@ sub show_controls
{
$req -> {form_options_masks} = ($options && $options -> {masks}) || {} ;
$req -> {uuid} ||= $form_cnt++ ;
@{$self -> {fields2empty}} = () ;
}
my $lines = $self -> {layout} ;
my %n ;
......@@ -600,6 +604,26 @@ sub prepare_fdat
}
}
# ---------------------------------------------------------------------------
#
# code_ref_fingerprint - returns a fingerprint of the result of all code refs
# can be used to check if is_readonly or is_disabled
# has dynamicly changed
#
sub code_ref_fingerprint
{
my ($self, $req) = @_ ;
my $fp ;
foreach my $control (@{$self -> {code_refs}})
{
$fp .= $control -> code_ref_fingerprint ($req) ;
}
return $fp ;
}
# ---------------------------------------------------------------------------
#
# validate - validate the form input
......
......@@ -87,7 +87,10 @@ sub is_disabled
{
my ($self, $req) = @_ ;
return $self -> {disable} || $req -> {form_options_masks}{$self->{name}}{disable} || $req -> {form_options_masks}{'*'}{disable} ;
my $disable = $self -> {disable} || $req -> {form_options_masks}{$self->{name}}{disable} || $req -> {form_options_masks}{'*'}{disable} ;
$disable = &{$disable}($self, $req) if (ref ($disable) eq 'CODE') ;
return $disable ;
}
# ---------------------------------------------------------------------------
......@@ -100,7 +103,10 @@ sub is_readonly
{
my ($self, $req) = @_ ;
return $self -> {readonly} || $req -> {form_options_masks}{$self->{name}}{readonly} || $req -> {form_options_masks}{'*'}{readonly} ;
my $redaonly = $self -> {readonly} || $req -> {form_options_masks}{$self->{name}}{readonly} || $req -> {form_options_masks}{'*'}{readonly} ;
$redaonly = &{$redaonly}($req) if (ref ($redaonly) eq 'CODE') ;
return $redaonly ;
}
# ---------------------------------------------------------------------------
......@@ -116,6 +122,33 @@ sub is_hidden
return ;
}
# ---------------------------------------------------------------------------
#
# has_code_refs - returns true if is_readonly or is_disabled are coderefs
#
sub has_code_refs
{
my ($self, $req) = @_ ;
return ref ($self -> {readonly}) eq 'CODE' || ref ($self -> {disable}) eq 'CODE' ;
}
# ---------------------------------------------------------------------------
#
# code_ref_fingerprint - returns fingerprint of is_readonly and is_disabled
#
sub code_ref_fingerprint
{
my ($self, $req) = @_ ;
return $self -> is_readonly?'R':'W' . $self -> is_disabled?'D':'E' ;
}
# ---------------------------------------------------------------------------
#
......@@ -442,7 +475,7 @@ $]
$value = $self -> {value} || $fdat{$self -> {name}} if (!defined($value)) ;
$]
<div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +]>[+ $value +]</div>
<div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] _ef_divname="[+$self -> {name}+]">[+ $value +]</div>
[$endsub$]
[# ---------------------------------------------------------------------------
......
......@@ -92,7 +92,8 @@ __EMBPERL__
push @{$self -> form -> {fields2empty}}, $name ;
$]
<input type="checkbox" name="[+ $ctlname +]" [+ do { local $escmode = 0 ; $ctlattrs } +] value="[+ $val +]"
>[$if ($self -> {trigger}) $]<script >$('#[+ $ctlid +]').ef_checkbox ()</script>[$endif$]
[$if ($self -> {trigger}) $]_ef_attach="ef_checkbox"[$endif$]
>
[$endsub$]
__END__
......
......@@ -87,7 +87,8 @@ $]
[$ foreach $val (@$values) $]
[$if !defined ($filter) || ($val =~ /$filter/i) $]
[$ if $tab $][$ if $colcnt == 0 $]<[# #]tr>[- $colcnt = $tab -][$endif$]<td>[$endif$]
<input type="checkbox" name="[+ $name +]" value="[+ $val +]" [+ do { local $escmode = 0 ; $ctlattrs } +]>
<input type="checkbox" name="[+ $name +]" value="[+ $val +]" [+ do { local $escmode = 0 ; $ctlattrs } +]
[$if ($self -> {trigger}) $]_ef_attach="ef_checkbox"[$endif$] >
[$ if $tab $]</td><td>[$endif$]
[+ $options ->[$i] || $val +]
[- $vert = $self -> {vert} -][$while $vert-- > 0 $]<br/>[$endwhile$]
......@@ -95,7 +96,6 @@ $]
[$endif$]
[* $i++ ; *]
[$endforeach$]
[$if ($self -> {trigger}) $]<script >$('#[+ $ctlid +]').ef_checkbox ()</script>[$endif$]
[$if $tab $]<[# #]/table>[$ endif $]
[$endsub$]
......
......@@ -121,21 +121,21 @@ sub init_data
}
}
my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
my $data;
my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
my $data;
my $i = 0 ;
my $j ;
my $col ;
my $colval ;
my @rowclass ;
my @rowclass ;
foreach my $entry (@entries)
{
$data = ref $entry eq 'ARRAY'?$entry:[$ldap?ecos::LdapBase -> splitAttrValue($entry):$entry];
if (ref $self -> {rowclass} eq 'CODE')
{
$rowclass[$i] = &{$self -> {rowclass}}($data, $self) ;
}
my $co = $coloffset ;
if (ref $self -> {rowclass} eq 'CODE')
{
$rowclass[$i] = &{$self -> {rowclass}}($data, $self) ;
}
my $co = $coloffset ;
shift @$data while ($co-- > 0) ;
$j = 0 ;
foreach my $field ((@$fields, ($line2?($line2):())))
......@@ -148,9 +148,9 @@ sub init_data
else
{
$fdat->{"__${name}_${j}_$i"} = $data->[$col] ;
}
}
if ($field -> can ('init_data'))
if ($field -> can ('init_data'))
{
local $field->{name} = "__${name}_${j}_$i" ;
local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
......@@ -161,8 +161,8 @@ sub init_data
$i++ ;
}
$fdat->{"__${name}_max"} = $i?$i:1;
$self -> {rowclasses} ||= \@rowclass ;
}
$self -> {rowclasses} ||= \@rowclass ;
}
# ------------------------------------------------------------------------------------------
#
......@@ -206,7 +206,7 @@ sub prepare_fdat
my $order ;
for (my $i = 0; $i < $max; $i++)
{
my $ok = 0 ;
my $ok = 0 ;
my $j = 0 ;
foreach my $field (@$fields, $line2?($line2):())
{
......@@ -216,11 +216,11 @@ sub prepare_fdat
local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
$field -> prepare_fdat ($req) ;
}
$ok++ ;
$ok++ ;
$j++ ;
}
next if (!$ok) ;
next if (!$ok) ;
$order = $fdat->{"__${name}_#row#_$i"} ;
next if (!defined($order)) ;
......@@ -230,7 +230,7 @@ sub prepare_fdat
$self -> prepare_fdat_sub ($req) if ((ref ($self) =~ /::/));
my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
foreach my $order (sort { $a <=> $b } keys %orders)
{
$i = $orders{$order} ;
......@@ -336,9 +336,8 @@ __EMBPERL__
my $span = ($self->{width_percent}) ;
my $nsprefix = $self -> form -> {jsnamespace} ;
my $max = $fdat{"__${name}_max"} ;
my $on_grid_change = $self -> {on_grid_change} ;
$self -> {fullid} = $req -> {uuid} . '_' . $self -> {id} ;
$]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' ' +][+ $self -> {state} +]">
$]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' ' +][+ $self -> {state} +]" _ef_attach="ef_grid">
<tr>
<td class="ui-label-box" colspan="[+ $span +]">
[-
......@@ -346,22 +345,19 @@ $]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' '
my $span = 0 ;
$self -> show_grid_title ($req);
-]
<input type="hidden" name="__[+ $self -> {name} +]_max" id="__[+ $self -> {fullid} +]_max">
<table class="cGridTable cBase [+ $self -> {state} +]" id="[+ $self -> {fullid} +]">
<input type="hidden" name="__[+ $self -> {name} +]_max" class="ef-control-grid-max">
<table class="cGridTable cBase ef-control-grid-table [+ $self -> {state} +]" >
[- $self -> show_grid_header ($req); -]
[- $self -> show_grid_table ($req) ; -]
</table>
[- $self -> show_grid_title ($req)
if ($max > $self -> {header_bottom} && !$self -> {disable_controls}) -]
<table id="__[+ $self -> {fullid} +]_newrow" style="display: none">
<table class="ef-control-grid-newrow" style="display: none">
[-
local $req -> {epf_no_script} = 1 ;
$self -> show_grid_table_row ($req, '%row%') ;
-]
</table>
<script>
$('#[+ $self -> {fullid} +]').eplgrid ([$if $on_grid_change $]{'onchange': [+ $on_grid_change +] }[$endif$]) ;
</script>
</td>
</tr>
</table>
......@@ -381,10 +377,10 @@ $]
[$if !($self -> is_readonly ($req)) && !$self -> {disable_controls} $]
<td class="cBase cGridControlBox">
<div>
<span class="ui-icon ui-icon-circle-triangle-n ef-icon" id="[+ $self -> {fullid} +]-up" title="Zeile Hoch"></span>
<span class="ui-icon ui-icon-circle-triangle-s ef-icon" id="[+ $self -> {fullid} +]-down" title="Zeile Runter"></span>
<span class="ui-icon ui-icon-circle-plus ef-icon" id="[+ $self -> {fullid} +]-add" title="Zeile Hinzuf&uuml;gen"></span>
<span class="ui-icon ui-icon-circle-minus ef-icon" id="[+ $self -> {fullid} +]-del" title="Markierte Zeile L&ouml;schen"></span>
<span class="ui-icon ui-icon-circle-triangle-n ef-icon ef-control-grid-up" title="Zeile Hoch"></span>
<span class="ui-icon ui-icon-circle-triangle-s ef-icon ef-control-grid-down" title="Zeile Runter"></span>
<span class="ui-icon ui-icon-circle-plus ef-icon ef-control-grid-add" title="Zeile Hinzuf&uuml;gen"></span>
<span class="ui-icon ui-icon-circle-minus ef-icon ef-control-grid-del" title="Markierte Zeile L&ouml;schen"></span>
</div>
</td>
[$endif$]
......@@ -404,7 +400,7 @@ $]
<thead>
<tr class="cGridHeader">
[$ foreach my $field (@$fields) $]
[* next if ($field -> is_hidden ) ; *]
[* next if ($field -> is_hidden ) ; *]
<td class="cGridHeader" style="[$if($width = $field->{width})$]width: [+$width+];[$endif$] [$if($width = $field->{min_width})$]min-width: [+$width+];[$endif$]" _colattr="[+ $field->{name} +]">[+ $self -> form -> convert_label ($self, $field->{name}, $field->{text}) +]</td>
[$ endforeach $]
</tr>
......@@ -427,14 +423,14 @@ $]
<tfoot>
<tr class="cGridFooter">
[$ foreach my $field (@$fields) $]
[* next if ($field -> is_hidden ) ; *]
[* next if ($field -> is_hidden ) ; *]
<td class="cGridFooter cGridCellReadonly">[-
local $field -> {name} = "__${name}_${j}_$i" ;
local $field -> {state} = $self -> {state} ;
local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
$field -> show_control_readonly ($req) if (!$field -> {nofooter}) ;
$j++ ;
-]</td>
$field -> show_control_readonly ($req) if (!$field -> {nofooter}) ;
$j++ ;
-]</td>
[$ endforeach $]
</tr>
</tfoot>
......@@ -459,11 +455,11 @@ $]
<tr class="cGridRow [+ $self -> {rowclasses}[$i] +]" id="[+ "$id-row-$i" +]">
[$foreach $field (@$fields)$]
[$if $field -> is_hidden $][-
[$if $field -> is_hidden $][-
local $field -> {name} = "__${name}_${j}_$i" ;
local $field -> {state} = $self -> {state} ;
local $field -> {fullid} = "${id}_${j}_$i" ;
$field -> show_control ($req) ;
$field -> show_control ($req) ;
$j++ ;
-][$else$]
[- $ro = $gridro || $field -> is_readonly () ; -]
......@@ -481,7 +477,7 @@ $]
}
$j++ ;
-]</td>
[$endif$]
[$endif$]
[$endforeach$]
</tr>
[$if $line2 $]
......@@ -579,10 +575,6 @@ string if set.
field defintion wich is show in a second line, full width.
=head3 on_grid_change
JavaScript function that is called whan grid changes (i.e. add row, delete row etc.)
=head3 disable_controls
If true, controls for add, delete, up and down will not be shown
......
......@@ -141,7 +141,6 @@ __EMBPERL__
my $jsname = $name ;
$jsname =~ s/[^a-zA-Z0-9]/_/g ;
$jsname .= 'Grid' ;
my $on_grid_change = $self -> {on_grid_change} ;
$]
[$ if ($max == 1 && $self -> is_readonly($req) ) $]
[-
......@@ -155,24 +154,18 @@ $]
$fdat{$name} = $self -> {default} if ($fdat{$name} eq '' && exists ($self -> {default})) ;
my $span = 0 ;
-]
<div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +]>
<input type="hidden" name="__[+ $self -> {name} +]_max" id="__[+ $self -> {fullid} +]_mult_max">
<table class="ef-control-mult-table" id="[+ $self -> {fullid} +]_mult">
<div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +] _ef_attach="ef_mult">
<input type="hidden" class="ef-control-mult-max" name="__[+ $self -> {name} +]_max" >
<table class="ef-control-mult-table" >
[- $self -> show_grid_table ($req) ; -]
</table>
<table id="__[+ $self -> {fullid} +]_mult_newrow" style="display: none">
<table class="ef-control-mult-newrow" style="display: none">
[-
local $req -> {epf_no_script} = 1 ;
$self -> show_grid_table_row ($req, '%row%') ;
-]
</table>
</div>
[$if (! $self -> is_readonly ($req)) $]
<[$if $noscript $]x-[$endif$]script>
$('#[+ $self -> {fullid} +]_mult').eplgrid ([$if $on_grid_change $]{'onchange': [+ $on_grid_change +] }[$endif$]) ;
</[$if $noscript $]x-[$endif$]script>
[$endif$]
[$endif$]
[$endsub$]
......@@ -222,8 +215,8 @@ $]
$]
[$if (! $self -> is_readonly ($req)) $]
<span class="ui-icon ui-icon-circle-plus ef-icon" id="[+ $self -> {fullid} +]_mult-add" title="Zeile Hinzuf&uuml;gen"></span>
<span class="ui-icon ui-icon-circle-minus ef-icon" id="[+ $self -> {fullid} +]_mult-del" title="Zeile L&ouml;schen"></span>
<span class="ui-icon ui-icon-circle-plus ef-icon" class="ef-control-mult-add" title="Zeile Hinzuf&uuml;gen"></span>
<span class="ui-icon ui-icon-circle-minus ef-icon" class="ef-control-mult-del" title="Zeile L&ouml;schen"></span>
[$endif$]
[$endsub$]
......
......@@ -56,6 +56,7 @@ __EMBPERL__
$]
<select name="[+ $ctlname +]" [+ $self->{multiple}?'multiple':''+] [+ do { local $escmode = 0 ; $ctlattrs } +]
[$if ($self -> {rows}) $] size="[+ $self->{rows} +]" [$endif$]
[$if ($self -> {trigger}) $]_ef_attach="ef_select"[$endif$]
>
[* $i = 0 ; *]
[$ foreach $val (@$values) $]
......@@ -65,7 +66,6 @@ $]
[* $i++ ; *]
[$endforeach$]
</select>
[$if ($self -> {trigger}) $]<script >$('#[+ $ctlid +]').ef_select ()</script>[$endif$]
[$endsub$]
__END__
......
......@@ -170,6 +170,7 @@ $( "#_inp_[+ $jsname +]" ).ef_selectdyn(
popup_url: '[+ do { local $escmode = 0 ; $self -> {popupurl} } +]',
datasrc_url: '[+ do { local $escmode = 0 ; $self -> {datasrcurl} } +]',
datasrc: '[+ $self->{datasrc} +]',
datasrc_term_max: [+ $self->{datasrctermmax} + 0 +],
use_ajax: '[+ $self->{use_ajax} +]',
show_on_select: [+ $self->{show_on_select}?'true':'false' +],
initial_id: "[+ $self -> get_id_from_value ($fdat{$name}) +]",
......
......@@ -108,11 +108,9 @@ __EMBPERL__
my $activeid = $self -> get_active_id ($req) ;
my $form = $self -> form ;
my $nsprefix = $form -> {jsnamespace} ;
my $uid = $req -> {uuid} ;
my $fullname = $uid . '_' . $name ;
my $tabs_per_line = $self -> {'tabs_per_line'} || 99;
$tabs_per_line = [$tabs_per_line, $tabs_per_line, $tabs_per_line, $tabs_per_line]
if (!ref $tabs_per_line) ;
if (!ref $tabs_per_line) ;
my $val ;
my $i = 0 ;
......@@ -121,7 +119,7 @@ __EMBPERL__
my $line = 0 ;
$]
<div class="ef-tabs-content-cell" colspan="[+ $span +]" id="[+ $fullname +]">
<div class="ef-tabs-content-cell" colspan="[+ $span +]" _ef_attach="ef_tabs">
[$ while ($more) $]
<table class="ef-tabs-selector" ><tr class="ef-tabs-selector-row">
[*
......@@ -143,28 +141,25 @@ $]
push @switch_code, $code if ($code) ;
}
my $js = join (';', @switch_code) ;
my $fullid = $uid . '_' . $id ;
*]
<td class="[+ $cellclass +]"><div class="ef-tabs-div [+ $divclass +]"
[$ if $i - $start_i == 0 $]style="border-left: black 1px solid" [$endif$]
id="__tabs_[+ $fullid +]">[+ $options ->[$i] || $val +]
[#<a href="#" onClick="[+ $nsprefix +]tab_selected(document, '[+ $fullid +]','[+ $fullname +]'); [+ do { local $escmode = 0 ; $js } +]" style="color:black; text-decoration: none;">[+ $options ->[$i] || $val +]</a>#]
>[+ $options ->[$i] || $val +]
</div></td>
[* $i++ ;
if ($i - $start_i >= $tabs && @$values > $i)
{
$more = 1 ;
$start_i = $i ;
last ;
}
*]
{
$more = 1 ;
$start_i = $i ;
last ;
}
*]
[$endwhile $]
[$if ($i == @$values) $]<td class="ef-tabs-cell-blank">&nbsp;</td>[$endif$]
</tr></table>
[$endwhile$]
[#<input type="hidden" name="[+ $name +]" id="[+ $fullname +]" class="ef-field-tab_select" value="[+ $uid +]_[+ $activeid +]">#]
</div>
<script >$('#[+ $fullname +]').ef_tabs ()</script>
[$endsub$]
__END__
......
......@@ -40,7 +40,6 @@ foreach my $k (keys %$options)
$v =~ s/\'/\"/g ;
$options -> {$k} = $v if ($v =~ s/%%(.+?)%%/$fdat{$1}/g) ;
}
::dbg(\%fdat) ;
$]
[- $ctrlid = $self -> SUPER::show_control ($req) ; -]
......
......@@ -103,7 +103,7 @@ sub get_all_values
if ($addtop)
{
push @values, map { $_ -> [0] } @$addtop ;
push @options, map { $_ -> [0] } @$addtop ;
push @options, map { $_ -> [1] } @$addtop ;
}
if ($values)
......@@ -115,7 +115,7 @@ sub get_all_values
if ($addbottom)
{
push @values, map { $_ -> [0] } @$addbottom ;
push @options, map { $_ -> [0] } @$addbottom ;
push @options, map { $_ -> [1] } @$addbottom ;
}
$req -> {$key} = [\@values, \@options] ;
......
......@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: Validate.pm 1383016 2012-09-10 18:09:28Z richter $
# $Id: Validate.pm 1411558 2012-11-20 06:19:58Z richter $
#
###################################################################################
......@@ -692,11 +692,15 @@ function epform_validate_$fname(return_msgs, failed_class)
var elems = document.$fname\[ids[key]\] ;
if (elems)
{
if (elems.constructor.name != 'NodeList')
if (!(elems instanceof NodeList))
elems = [elems] ;
if (elems[0] instanceof NodeList)
elems = elems[0] ;
for (i = 0; i < elems.length ;i++)
{
var elem = elems[i] ;
if (elem.getAttribute('type') == 'radio')
elem = elem.parentElement ;
var eclass = elem.getAttribute('class') ;
elem.setAttribute ('class', eclass + ' ' + failed_class) ;
elem.setAttribute ('title', msgs[key]) ;
......@@ -706,7 +710,10 @@ function epform_validate_$fname(return_msgs, failed_class)
}
if (return_msgs)
return msgs ;
{
var ret = [msgs, ids] ;
return ret ;
}
if (i)
alert (msgs.join('\\n')) ;
......
......@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: Default.pm 1382642 2012-09-10 05:33:29Z richter $
# $Id: Default.pm 1411558 2012-11-20 06:19:58Z richter $
#
###################################################################################
......@@ -151,7 +151,7 @@ sub getscript_required
{
my ($self, $arg, $pref) = @_ ;
return ('obj.value', ['validate_required']) ;
return ('obj instanceof NodeList?obj[0].value:obj.value', ['validate_required']) ;
}
# --------------------------------------------------------------
......
......@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: Syntax.pm 1382642 2012-09-10 05:33:29Z richter $
# $Id: Syntax.pm 1428624 2013-01-03 21:55:57Z richter $
#
###################################################################################
......@@ -326,7 +326,7 @@ sub CloneHash
embperl => {
perlcode => q{
# any initialisation could be put here
$DB::single = 1 ;
#$DB::single = 1 ;
$maxrow=100;$maxcol=10;
},
compiletimeperlcode => q{
......
......@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: EmbperlBlocks.pm 1382644 2012-09-10 05:43:51Z richter $
# $Id: EmbperlBlocks.pm 1432267 2013-01-11 20:27:37Z richter $
#
###################################################################################
......@@ -58,7 +58,7 @@ sub new
Init ($self, ref $exchange?$exchange:undef) ;
$self -> AddInitCode ('use Data::Dumper ;') ;
$self -> AddInitCode ('use Data::Dumper;') ;
}
return $self ;
......
......@@ -250,6 +250,7 @@ test/cmp/sub2.htm
test/cmp/subouttab.htm
test/cmp/changeattr.htm
test/cmp/chdir.htm
test/cmp/chdir2src.htm
test/cmp/clearsess.htm
test/cmp/cookieexpire.htm
test/cmp/crypto.htm
......@@ -480,6 +481,7 @@ test/html/sub2.htm
test/html/subouttab.htm
test/html/changeattr.htm
test/html/chdir.htm
test/html/chdir/chdir2src.htm
test/html/clearsess.htm
test/html/cookieexpire.htm
test/html/delrdsess.htm
......@@ -628,6 +630,9 @@ test/html/taint.htm
test/html/topinc.htm
test/html/unclosed.htm
test/html/upload.htm
test/html/utf8/epoutf8base.htm
test/html/utf8/epoutf8inc.htm
test/html/utf8/epoutf8main.pl
test/html/var.htm
test/html/varepvar.htm
test/html/varerr.htm
......@@ -705,3 +710,4 @@ eg/forms/css/EmbperlForm.css
eg/forms/README.txt
eg/forms/js/prototype.js
eg/forms/js/EmbperlForm.js
META.json Module JSON meta-data (added by MakeMaker)
{
"abstract" : "Embed Perl code in HTML documents",
"author" : [
"Gerald Richter <richter at embperl dot org>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120630",