Mailing List Archive

svn commit: r1551873 - in /perl/embperl/trunk/Embperl: ./ Form/ Form/Control/
Author: richter
Date: Wed Dec 18 07:13:54 2013
New Revision: 1551873

URL: http://svn.apache.org/r1551873
Log:
Embperl::Forms

Modified:
perl/embperl/trunk/Embperl/Form.pm
perl/embperl/trunk/Embperl/Form/Control.pm
perl/embperl/trunk/Embperl/Form/Control/button.pm
perl/embperl/trunk/Embperl/Form/Control/displaylink.pm
perl/embperl/trunk/Embperl/Form/Control/dynlink.pm
perl/embperl/trunk/Embperl/Form/Control/grid.pm
perl/embperl/trunk/Embperl/Form/Control/icon.pm
perl/embperl/trunk/Embperl/Form/Control/info.pm
perl/embperl/trunk/Embperl/Form/Control/mult.pm
perl/embperl/trunk/Embperl/Form/Control/number.pm
perl/embperl/trunk/Embperl/Form/Control/table.pm
perl/embperl/trunk/Embperl/Form/Control/tabs.pm
perl/embperl/trunk/Embperl/Form/ControlMultValue.pm

Modified: perl/embperl/trunk/Embperl/Form.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form.pm (original)
+++ perl/embperl/trunk/Embperl/Form.pm Wed Dec 18 07:13:54 2013
@@ -48,11 +48,11 @@ use vars qw{$epreq} ;
sub sub_new

{
- my ($class, $controls, $options, $id, $validate_rules, $parentptr) = @_ ;
+ my ($class, $controls, $options, $id, $toplevel, $parentptr) = @_ ;

- my $toplevel = $validate_rules?0:1 ;
$id ||= 'topdiv' ;
- $options ||= {} ;
+ $options ||= {} ;
+ $toplevel = 1 if (!defined ($toplevel)) ;

my $self = ref $class?$class:{} ;

@@ -79,11 +79,6 @@ sub sub_new
$Embperl::FormData::forms{$self -> {formptr}} = $self ;
$Embperl::FormData::forms{$self -> {formptr}} = $self ;

- if (!$validate_rules)
- {
- $validate_rules = $self -> {validate_rules} = [] ;
- }
-
if ($toplevel)
{
$self -> {fields2empty} = [] ;
@@ -91,6 +86,7 @@ sub sub_new
$self -> {init_markup} = [] ;
$self -> {prepare_fdat} = [] ;
$self -> {code_refs} = [] ;
+ $self -> {do_validate} = [] ;
}
else
{
@@ -99,21 +95,16 @@ sub sub_new
$self -> {init_markup} = $self -> parent_form -> {init_markup} ;
$self -> {prepare_fdat} = $self -> parent_form -> {prepare_fdat} ;
$self -> {code_refs} = $self -> parent_form -> {code_refs} ;
+ $self -> {do_validate} = $self -> parent_form -> {do_validate} ;
}
push @{$self -> {code_refs}}, $self if ($self -> has_code_refs) ;

- $self -> new_controls ($controls, $options, undef, $id, $validate_rules, $options -> {masks}, $options -> {defaults}) ;
+ $self -> new_controls ($controls, $options, undef, $id, $options -> {masks}, $options -> {defaults}) ;

$self -> {noframe} = 1 if ($controls && @$controls > 0 &&
$controls -> [0] -> noframe) ;


- if ($toplevel)
- {
- my $epf = $self -> {validate} = Embperl::Form::Validate -> new ($validate_rules, $self -> {formname}, $options -> {language}, $options -> {charset}) if ($self -> {validate_rules}) ;
- $self -> add_code_at_bottom ($epf -> get_script_code) ;
- }
-
return $self ;
}

@@ -266,8 +257,8 @@ sub new_object
sub new_controls

{
- my ($self, $controls, $options, $id, $formid, $validate_rules, $masks, $defaults, $no_init) = @_ ;
-
+ my ($self, $controls, $options, $id, $formid, $masks, $defaults, $no_init) = @_ ;
+
my $n = 0 ;
my $packages = $self -> get_control_packages ;

@@ -321,12 +312,12 @@ sub new_controls
push @{$self -> {init_markup}}, $control if ($control -> can ('init_markup')) ;
push @{$self -> {prepare_fdat}}, $control if ($control -> can ('prepare_fdat')) ;
push @{$self -> {code_refs}}, $control if ($control -> has_code_refs) ;
+ push @{$self -> {do_validate}}, $control if ($control -> has_validate_rules) ;
}
}
$self -> {controlids}{$control->{id}} = $control ;

next if ($control -> is_disabled ()) ;
- push @{$validate_rules}, $control -> get_validate_rules ;
if ($control -> {sublines})
{
my $i = 0 ;
@@ -334,7 +325,7 @@ sub new_controls
foreach my $subcontrols (@{$control -> {sublines}})
{
next if (!$subcontrols) ;
- $self -> new_controls ($subcontrols, $options, "$name-$i", $formid, $validate_rules, $masks, $defaults, $no_init) ;
+ $self -> new_controls ($subcontrols, $options, "$name-$i", $formid, $masks, $defaults, $no_init) ;
$i++ ;
}
}
@@ -356,7 +347,7 @@ sub new_controls
}
my $class = ref $self ;
local $options -> {disable} = $control -> {disables}[$i] ;
- my $subform = $class -> sub_new ($subcontrols, $options, $ctlid, $validate_rules, $self -> {formptr}) ;
+ my $subform = $class -> sub_new ($subcontrols, $options, $ctlid, 0, $self -> {formptr}) ;
$subform -> {text} ||= $control -> {options}[$i] if (exists ($control -> {options}) && $control -> {options}[$i]) ;
$subform -> {parent_control} = $control ;
push @ids, $ctlid ;
@@ -561,6 +552,40 @@ sub show_controls
return ;
}

+# ---------------------------------------------------------------------------
+#
+# init_validate - init validate functions
+#
+
+sub init_validate
+
+ {
+ my ($self, $req, $options) = @_ ;
+
+ if ($self -> {toplevel})
+ {
+ my $epf = $self -> {validate} ;
+ if (!defined ($epf))
+ {
+ my @validate_rules ;
+ foreach my $control (@{$self -> {do_validate}})
+ {
+ push @validate_rules, $control -> get_validate_rules ($req) ;
+ }
+ if (@validate_rules)
+ {
+ $epf = $self -> {validate} = Embperl::Form::Validate -> new (\@validate_rules, $self -> {formname}, $options -> {language}, $options -> {charset}) ;
+ $self -> add_code_at_bottom ($epf -> get_script_code) ;
+ }
+ else
+ {
+ $self -> {validate} = 0 ;
+ }
+ }
+ }
+
+ return $self -> {validate}?1:0 ;
+ }

# ---------------------------------------------------------------------------
#
@@ -574,6 +599,7 @@ sub show

if ($self -> {toplevel})
{
+ $self -> init_validate ($req, $options) ;
$self -> init_data ($req) ;
$self -> show_form_begin ($req) ;
}
@@ -940,7 +966,7 @@ sub add_checkbox_subform

sub convert_label
{
- my ($self, $ctrl, $name, $text) = @_ ;
+ my ($self, $ctrl, $name, $text, $req) = @_ ;

return $text || $ctrl->{text} || $name || $ctrl->{name} ;
}
@@ -960,7 +986,7 @@ sub convert_label

sub convert_options
{
- my ($self, $ctrl, $values, $options) = @_ ;
+ my ($self, $ctrl, $values, $options, $req) = @_ ;

return $options ;
}
@@ -979,7 +1005,7 @@ sub convert_options

sub convert_text
{
- my ($self, $ctrl, $value) = @_ ;
+ my ($self, $ctrl, $value, $text, $req) = @_ ;

return $value || $ctrl->{text} || $ctrl->{name} ;
}

Modified: perl/embperl/trunk/Embperl/Form/Control.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control.pm Wed Dec 18 07:13:54 2013
@@ -260,12 +260,12 @@ sub get_id_for_control

sub label_text
{
- my ($self) = @_ ;
+ my ($self, $req) = @_ ;

return $self -> {label_text} if ($self -> {label_text}) ;

return $self -> {label_text} = $self -> {showtext}?($self->{text} ||
- $self->{name}):$self -> form -> convert_label ($self) ;
+ $self->{name}):$self -> form -> convert_label ($self, undef, undef, $req) ;
}


@@ -297,7 +297,7 @@ sub get_validate_rules
if ($self -> {validate})
{
@local_rules = ( -key => $self->{name} );
- push @local_rules, -name => $self -> label_text ;
+ push @local_rules, -name => $self -> label_text ($req);
push @local_rules, @{$self -> {validate}};
}
else
@@ -306,7 +306,7 @@ sub get_validate_rules
if ($auto)
{
@local_rules = ( -key => $self->{name} );
- push @local_rules, -name => $self -> label_text ;
+ push @local_rules, -name => $self -> label_text ($req) ;
push @local_rules, @{$auto};
}
}
@@ -315,6 +315,31 @@ sub get_validate_rules

# ---------------------------------------------------------------------------
#
+# has_validate_rules - check if there is anything to validate and
+# create auto rules
+#
+
+sub has_validate_rules
+ {
+ my ($self, $req) = @_ ;
+
+ if ($self -> {validate})
+ {
+ return scalar(@{$self -> {validate}}) ;
+ }
+ my $auto = $self -> get_validate_auto_rules ($req) ;
+ if ($auto)
+ {
+ $self -> {validate} = $auto ;
+ return scalar(@$auto) ;
+ }
+
+ $self -> {validate} = [] ;
+ return 0 ;
+ }
+
+# ---------------------------------------------------------------------------
+#
# has_auto_label_size - returns true if label should be auto sized for this control
#

@@ -463,11 +488,11 @@ $]

if ($self -> {showoptionslabel})
{
- my $opts = $self -> form -> convert_options ($self, [$self -> {value}]) ;
+ my $opts = $self -> form -> convert_options ($self, [$self -> {value}], undef, $req) ;
$self -> {text} = $opts -> [0] ;
$self -> {showtext} = 1 ;
}
--][+ $self -> label_text +][$endsub$]
+-][+ $self -> label_text ($req) +][$endsub$]

[# ---------------------------------------------------------------------------
#

Modified: perl/embperl/trunk/Embperl/Form/Control/button.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/button.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/button.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/button.pm Wed Dec 18 07:13:54 2013
@@ -31,7 +31,7 @@ __EMBPERL__
# show - output the control
#]

-[.$ sub show ($self, $data)
+[.$ sub show ($self, $req)

my $span = ($self->{width_percent}) ;
$self->{button} ||= [{}] ;
@@ -41,17 +41,17 @@ $]<table class="ef-element ef-element-wi
[$ foreach my $button (@{$self->{button}}) $]
[$if $self -> {symbol} $]
<div class="cControlButtonDiv"
- title="[+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self) +]"
+ title="[.+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self, undef, undef, $req) +]"
[$if $self -> {onclick} $] onClick="[.+ do { local $escmode = 0 ; $self -> {onclick} } +]" [$endif$]
[.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]><img class="cControlButtonSymbol" src="[+ $self -> {symbol} +]">
- [.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self) +]
+ [.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self, undef, undef, $req) +]
</div>
[$else$]
[# Workaround around segfault in Embperl 2.1.1-dev *grmpf* #]
<[# #]input
class="cBase cControl cControlButton" name="[+ $self->{name} +]"
- value="[.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self) +]"
- title="[+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self) +]"
+ value="[.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self, undef, undef, $req) +]"
+ title="[.+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self, undef, undef, $req) +]"
[$if $self -> {onclick} $] onClick="[.+ do { local $escmode = 0 ; $self -> {onclick} } +]" [$endif$]
[.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]
[$if $self -> {image} $]

Modified: perl/embperl/trunk/Embperl/Form/Control/displaylink.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/displaylink.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/displaylink.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/displaylink.pm Wed Dec 18 07:13:54 2013
@@ -43,7 +43,7 @@ __EMBPERL__
# show_control - output the control
#]

-[.$ sub show_control ($self)
+[.$ sub show_control ($self, $req)

my $name = $self->{name};
my $hrefs = $self -> {href} ;
@@ -74,7 +74,7 @@ $]
<a href="[+ do {local $escmode=0;$hrefs[$dispn]} +]" class="[+ $state +]"
[$if $targets -> [$dispn] $]target="[+ $targets -> [$dispn] +]"[$endif$]
[.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>
- [$endif$][$ if $showoptions < 0 $][.+ do { local $escmode = 0 ; $display } +][$else$][+ $showoptions?$display:$form -> convert_text ($self, $display) +][$endif$]</a>&nbsp;
+ [$endif$][$ if $showoptions < 0 $][.+ do { local $escmode = 0 ; $display } +][$else$][+ $showoptions?$display:$form -> convert_text ($self, $display, undef, $req) +][$endif$]</a>&nbsp;
[- $dispn++ -]
[$endforeach$]
</div>

Modified: perl/embperl/trunk/Embperl/Form/Control/dynlink.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/dynlink.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/dynlink.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/dynlink.pm Wed Dec 18 07:13:54 2013
@@ -43,7 +43,7 @@ __EMBPERL__
# show_control - output the control
#]

-[.$ sub show_control ($self)
+[.$ sub show_control ($self, $req)

my $name = $self->{name};
my $fields = $self -> {fields} ;
@@ -62,7 +62,7 @@ $]
[$if $field -> {href} $]href="[.+ do { local $escmode = 0 ; $field -> {href} } +]" _ef_xref="[.+ do { local $escmode = 0 ; $field -> {href} } +]" [$endif$]
[$if $field -> {click} $]_ef_click="[.+ do { local $escmode = 0 ; $field -> {click} } +]" [$if !$field -> {href} $]href="#"[$endif$][$endif$]
[.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>
- [$ if $showoptions < 0 $][.+ do { local $escmode = 0 ; $field -> {text} } +][$else$][.+ $showoptions?$field -> {text}:$form -> convert_text ($self, $field -> {name}) +][$endif$]
+ [$ if $showoptions < 0 $][.+ do { local $escmode = 0 ; $field -> {text} } +][$else$][.+ $showoptions?$field -> {text}:$form -> convert_text ($self, $field -> {name}, undef, $req) +][$endif$]
</a>&nbsp;
[$endforeach$]
[$ if $self->{hidden} $]

Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Wed Dec 18 07:13:54 2013
@@ -74,12 +74,11 @@ sub init
}
my $form = $self -> form ;
my $options = $form -> {options} ;
- my $validate_rules = $self -> {validate_rules} = [] ;
- $form -> new_controls ($fields, $options, undef, undef, $validate_rules, $options -> {masks}, $options -> {defaults}, 1) ;
+ $form -> new_controls ($fields, $options, undef, undef, $options -> {masks}, $options -> {defaults}, 1) ;
if ($self -> {line2})
{
my $ctl = [$self -> {line2}] ;
- $form -> new_controls ($ctl, $options, undef, undef, $validate_rules, $options -> {masks}, $options -> {defaults}, 1) ;
+ $form -> new_controls ($ctl, $options, undef, undef, $options -> {masks}, $options -> {defaults}, 1) ;
$self -> {line2} = $ctl -> [0] ;
}

@@ -470,7 +469,7 @@ $]<table class="ef-element ef-element-wi
$]
<table class="cBase cGridTitle [+ $self -> {state} +]">
<tr class="cTableRow">
- <td class="cBase cGridLabelBox">[+ $self -> form -> convert_label ($self) +]</td>
+ <td class="cBase cGridLabelBox">[.+ $self -> form -> convert_label ($self, undef, undef, $req) +]</td>
[$if !($self -> is_readonly ($req)) && !$self -> {disable_controls} $]
<td class="cBase cGridControlBox">
<div>
@@ -498,7 +497,7 @@ $]
<tr class="cGridHeader">
[$ foreach my $field (@$fields) $]
[* 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>
+ <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}, $req) +]</td>
[$ endforeach $]
</tr>
</thead>

Modified: perl/embperl/trunk/Embperl/Form/Control/icon.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/icon.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/icon.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/icon.pm Wed Dec 18 07:13:54 2013
@@ -41,7 +41,7 @@ $]<table class="ef-element ef-element-wi
<tr>
<td class="ef-control-box">
<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +]>
- <span class="ui-icon ui-icon-[+ $self -> {icon} +] ef-icon" title="[+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +]"></span>
+ <span class="ui-icon ui-icon-[+ $self -> {icon} +] ef-icon" title="[.+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self, undef, undef, $req) +]"></span>
</div>
</td>
</tr>

Modified: perl/embperl/trunk/Embperl/Form/Control/info.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/info.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/info.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/info.pm Wed Dec 18 07:13:54 2013
@@ -38,7 +38,7 @@ my $state = $self -> {state} ;
$state =~ s/[^-a-zA-Z0-9_]/_/g ;
$]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' '+][+ $state +]">
<tr>
-<td [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] >[$ if $self -> {image} $]<img class="cControlButtonSymbol" src="[+ $self -> {image} +]">[$endif$][+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +]&nbsp;</td>
+<td [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] >[$ if $self -> {image} $]<img class="cControlButtonSymbol" src="[+ $self -> {image} +]">[$endif$][.+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self, undef, undef, $req) +]&nbsp;</td>
</tr>
</table>[$endsub$]


Modified: perl/embperl/trunk/Embperl/Form/Control/mult.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/mult.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/mult.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/mult.pm Wed Dec 18 07:13:54 2013
@@ -57,8 +57,7 @@ sub init
$self -> {fields} ||= [$self -> {field}] ;
$self -> {class} ||= 'ef-control-mult' ;
my $options = $form -> {options} ;
- my $validate_rules = $self -> {validate_rules} = [] ;
- $form -> new_controls ($self -> {fields}, $options, undef, undef, $validate_rules, $options -> {masks}, $options -> {defaults}, 1) ;
+ $form -> new_controls ($self -> {fields}, $options, undef, undef, $options -> {masks}, $options -> {defaults}, 1) ;

return $self ;
}

Modified: perl/embperl/trunk/Embperl/Form/Control/number.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/number.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/number.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/number.pm Wed Dec 18 07:13:54 2013
@@ -42,7 +42,7 @@ sub show_control_readonly
my ($self, $req, $value) = @_ ;

my $unit = $self->{unit} ;
- my $unittext = $self -> form -> convert_text ($self, ($unit =~ /:/)?$unit:"unit:$unit", $unit) ;
+ my $unittext = !$unit?'':$self -> form -> convert_text ($self, ($unit =~ /:/)?$unit:"unit:$unit", $unit, $req) ;
$unittext =~ s/^unit:// ;
$value = $self -> {value} || $Embperl::fdat{$self -> {name}} if (!defined($value)) ;
$value .= $unittext if ($unit && $value ne '') ;
@@ -72,12 +72,12 @@ __EMBPERL__
# show_control - output the control
#]

-[.$ sub show_control ($self)
+[.$ sub show_control ($self, $req)

$self->{size} ||= 10 ;

my $unit = $self->{unit} ;
- my $unittext = $self -> form -> convert_text ($self, ($unit =~ /:/)?$unit:"unit:$unit", $unit) ;
+ my $unittext = !$unit?'':$self -> form -> convert_text ($self, ($unit =~ /:/)?$unit:"unit:$unit", $unit, $req) ;
$unittext =~ s/^unit:// ;
$]
[- $self -> SUPER::show_control ; -]

Modified: perl/embperl/trunk/Embperl/Form/Control/table.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/table.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/table.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/table.pm Wed Dec 18 07:13:54 2013
@@ -31,7 +31,7 @@ sub show

my $name = $self -> {name} ;
my $data = $Embperl::fdat{$name} ;
- $self -> show_table ($data) ;
+ $self -> show_table ($data, $req) ;
}

1 ;
@@ -46,7 +46,7 @@ __EMBPERL__
# show_table_head
#]

-[$ sub show_table_head ($self) $]
+[$ sub show_table_head ($self, $req) $]

<table width="100%" id="_table_[+ $self->{id} +]">

@@ -56,7 +56,7 @@ __EMBPERL__
[$foreach $line (@{$self->{columns}}) $]
<tr style="background: white">
[$foreach $c (@$line) $]
-<td colspan="[+ ref $c?$c -> [2] || 1:1 +]" class="[.+$self -> {line2} || (@{$self->{columns}} > 1 && $i == 0)?'cGridLabelBox':'cControlBox'+] cLdapReportColumnHead">[+ $showtext?(ref $c?$c -> [1] || $c -> [0]:$c):$self -> form -> convert_label ($self, undef, ref $c?$c -> [1]:$c) +]</td>
+<td colspan="[+ ref $c?$c -> [2] || 1:1 +]" class="[.+$self -> {line2} || (@{$self->{columns}} > 1 && $i == 0)?'cGridLabelBox':'cControlBox'+] cLdapReportColumnHead">[+ $showtext?(ref $c?$c -> [1] || $c -> [0]:$c):$self -> form -> convert_label ($self, undef, ref $c?$c -> [1]:$c, $req) +]</td>
[$endforeach$]
[- $i++ -]
</tr>
@@ -183,7 +183,7 @@ __EMBPERL__
# show_table - output the control
#]

-[.$ sub show_table ($self, $data)
+[.$ sub show_table ($self, $data, $req)

my $span = ($self->{width_percent}) ;
my $showtext = $self -> {showtext} ;
@@ -193,11 +193,11 @@ $]
[$if $self -> {text} $]
[# --- heading text --- #]
<table width="100%"><tr><td class="cLabelBox">
-[.+ $self -> {showtext}?($self->{text} || $self->{name}):$self -> form -> convert_label ($self) +]<br>
+[.+ $self -> {showtext}?($self->{text} || $self->{name}):$self -> form -> convert_label ($self, undef, undef, $req) +]<br>
</td></tr></table>
[$endif$]

-[- $self -> show_table_head -]
+[- $self -> show_table_head ($req) -]

[# --- data --- #]
[- $r = 0 -]

Modified: perl/embperl/trunk/Embperl/Form/Control/tabs.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/tabs.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/tabs.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/tabs.pm Wed Dec 18 07:13:54 2013
@@ -142,7 +142,7 @@ $]

[.$ sub show ($self, $req)

- my ($values, $options) = $self -> get_values ;
+ my ($values, $options) = $self -> get_values ($req) ;
my $span = ($self->{width_percent}) ;
my $name = $self -> {name} ;
my $dataval = $fdat{$name} || $values -> [0] ;

Modified: perl/embperl/trunk/Embperl/Form/ControlMultValue.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/ControlMultValue.pm?rev=1551873&r1=1551872&r2=1551873&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/ControlMultValue.pm (original)
+++ perl/embperl/trunk/Embperl/Form/ControlMultValue.pm Wed Dec 18 07:13:54 2013
@@ -89,7 +89,7 @@ sub get_all_values
{
$values = $self -> {values} ;
$options = $self -> {options} || $values ;
- $options = $self -> form -> convert_options ($self, $self -> {values}, $options)
+ $options = $self -> form -> convert_options ($self, $self -> {values}, $options, $req)
if (!$self -> {showoptions}) ;
}




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org