Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl-cvs

svn commit: r1228503 - in /perl/embperl/trunk/Embperl/Form/Control: displaylink.pm grid.pm selectdyn.pm textarea.pm

 

 

ModPerl embperl-cvs RSS feed   Index | Next | Previous | View Threaded


richter at apache

Jan 6, 2012, 3:53 PM

Post #1 of 1 (292 views)
Permalink
svn commit: r1228503 - in /perl/embperl/trunk/Embperl/Form/Control: displaylink.pm grid.pm selectdyn.pm textarea.pm

Author: richter
Date: Fri Jan 6 23:53:36 2012
New Revision: 1228503

URL: http://svn.apache.org/viewvc?rev=1228503&view=rev
Log:
Embperl::Form

Modified:
perl/embperl/trunk/Embperl/Form/Control/displaylink.pm
perl/embperl/trunk/Embperl/Form/Control/grid.pm
perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
perl/embperl/trunk/Embperl/Form/Control/textarea.pm

Modified: perl/embperl/trunk/Embperl/Form/Control/displaylink.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/displaylink.pm?rev=1228503&r1=1228502&r2=1228503&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/displaylink.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/displaylink.pm Fri Jan 6 23:53:36 2012
@@ -60,19 +60,19 @@ $displays = [$displays] if (!ref $displ

@hrefs = map { my $x = $_ ; $x =~ s/%%%name%%%/$fdat{$name}/g ; $x =~ s/%%(.+?)%%/$fdat{$1}/g ; $x } ref ($hrefs)?@$hrefs:($hrefs) ;
@opens = map { my $x = $_ ; $x =~ s/%%%name%%%/$fdat{$name}/g ; $x =~ s/%%(.+?)%%/$fdat{$1}/g ; $x } ref ($opens)?@$opens:($opens) ;
- [at] display = map { my $x = $_ ; $x =~ s/%%%name%%%/$fdat{$name}/g ; $x =~ s/%%(.+?)%%/$fdat{$1}/g ; $x } @$dispalys ;
+@displays = map { my $x = $_ ; $x =~ s/%%%name%%%/$fdat{$name}/g ; $x =~ s/%%(.+?)%%/$fdat{$1}/g ; $x } @$displays ;

my $dispn = 0 ;
$]
<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr('', 'readonly') } +]>
-[$ foreach $display (@$displays) $]
+[$ foreach $display (@displays) $]
[$if $opens[$dispn] $]
<a href="#" onclick="[+ $opens[$dispn] +][$if $hrefs[$dispn] $]('[+ $hrefs[$dispn] +]')[$endif$]" [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>
[$else$]
<a href="[+ do {local $escmode=0;$hrefs[$dispn]} +]"
[$if $targets -> [$dispn] $]target="[+ $targets -> [$dispn] +]"[$endif$]
[.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>
- [$endif$][+ $showoptions?$display:$form -> convert_text ($self, $display) +]</a>&nbsp;
+ [$endif$][$ if $showoptions < 0 $][.+ do { local $escmode = 0 ; $display } +][$else$][+ $showoptions?$display:$form -> convert_text ($self, $display) +][$endif$]</a>&nbsp;
[- $dispn++ -]
[$endforeach$]
</div>

Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=1228503&r1=1228502&r2=1228503&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Fri Jan 6 23:53:36 2012
@@ -342,7 +342,7 @@ $]
<tr class="cGridRow" id="[+ "$id-row-$i" +]">
[$foreach $field (@$fields)$]
[.- $ro = $gridro || $field -> is_readonly () ; -]
- <td class="[+ $ro?'cGridCellReadonly':'cGridCell' +]">[$if $n++ == 0$]<input type="hidden" name="[+ "__${name}_#row#_$i" +]" value="[+ $i +]">[$endif$][-
+ <td class="[+ $ro?'cGridCellReadonly':'cGridCell' +]" [$if $field->{width}$]style="width: [+ $field->{width} +]"[$endif$]>[$if $n++ == 0$]<input type="hidden" name="[+ "__${name}_#row#_$i" +]" value="[+ $i +]">[$endif$][.-
local $field -> {name} = "__${name}_${j}_$i" ;
if ($ro)
{

Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=1228503&r1=1228502&r2=1228503&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Fri Jan 6 23:53:36 2012
@@ -22,6 +22,24 @@ use base 'Embperl::Form::ControlMultValu

use Embperl::Inline ;

+# ------------------------------------------------------------------------------------------
+#
+# prepare_fdat - daten zusammenfuehren
+#
+
+sub prepare_fdat
+ {
+ my ($self, $req) = @_ ;
+
+ return if ($self -> is_readonly ($req)) ;
+
+ my $fdat = $req -> {form} || \%fdat ;
+ my $name = $self->{name} ;
+ my $val = $fdat -> {"_inp_$name"} ;
+ ::dbg ($fdat, $name, $val) ;
+ $fdat -> {$name} = '' if ($val eq '') ;
+ delete $fdat -> {"_inp_$name"} ;
+ }

# ---------------------------------------------------------------------------

@@ -103,7 +121,7 @@ control_link_setup($( "#_inp_[+ $self ->
$]
<div class="ui-widget">
[# --- input --- #]
-<input [.+ do { local $escmode = 0 ; $self -> get_std_control_attr("_inp_$jsname") } +] type="text"
+<input name="_inp_[+ $name +]" [.+ do { local $escmode = 0 ; $self -> get_std_control_attr("_inp_$jsname") } +] type="text"
[$if $self -> {size} $]size="[+ $self->{size} +]"[$endif$]
value="[+ $initval +]"
>

Modified: perl/embperl/trunk/Embperl/Form/Control/textarea.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/textarea.pm?rev=1228503&r1=1228502&r2=1228503&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/textarea.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/textarea.pm Fri Jan 6 23:53:36 2012
@@ -49,9 +49,14 @@ $]
[$ sub show_control_readonly ($self, $req, $value, $class) $]
[.-
$value //= $fdat{$self -> {name}} ;
+$value =~ s/\s*$// ;
+$value =~ s/^\s*// ;
@value = split (/\n/, $value) ;
--][$ foreach my $val (@value) $]
-[- $self -> SUPER::show_control_readonly ($req, $val, $class) -]<br>
+$i = 0 ;
+-][$ foreach my $val (@value) $]
+[$ if $val =~ /^\s*$/ $]<br>[$else$]
+[- $self -> SUPER::show_control_readonly ($req, $val, $class) -][# $ if ($i < @value - 1) $]<br>[$endif$ #]
+[$endif$]
[$endforeach$]
[$endsub$]
__END__



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe [at] perl
For additional commands, e-mail: embperl-cvs-help [at] perl

ModPerl embperl-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.