Mailing List Archive

svn commit: r1658158 - in /perl/embperl/trunk/Embperl/Form/Control: attachment.pm selectdyn.pm textarea.pm
Author: richter
Date: Sun Feb 8 12:38:40 2015
New Revision: 1658158

URL: http://svn.apache.org/r1658158
Log:
Enhancement controls

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

Modified: perl/embperl/trunk/Embperl/Form/Control/attachment.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/attachment.pm?rev=1658158&r1=1658157&r2=1658158&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/attachment.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/attachment.pm Sun Feb 8 12:38:40 2015
@@ -79,7 +79,7 @@ __EMBPERL__
my $name = $self -> {name};

$]
-<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +] _ef_attach="ef_attachment" _ef_dynid="<_id>" _ef_attr="[+ $name +]">
+<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +] _ef_attach="ef_attachment" _ef_dynid="<_id>" _ef_attr="[+ $name +]" _ef_always_download="[+ $self -> {always_download} +]">
[$if !$self -> {no_download} $]<a class="ef-attachment-download" href="#">Download</a>&nbsp;[$endif$]
[$if !$self -> {no_upload} $]<a class="ef-attachment-upload" href="#">Upload</a>&nbsp;[$endif$]
[$if !$self -> {no_delete} $]<a class="ef-attachment-delete" href="#">L&ouml;schen</a>&nbsp;[$endif$]
@@ -98,9 +98,49 @@ $]
my $name = $self -> {name};

$]
-<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +] _ef_attach="ef_attachment" _ef_dynid="<_id>" _ef_attr="[+ $name +]">
+<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +] _ef_attach="ef_attachment" _ef_dynid="<_id>" _ef_attr="[+ $name +] _ef_always_download="[+ $self -> {always_download} +]">
[$if !$self -> {no_download} $]<a class="ef-attachment-download" href="#">Download</a>&nbsp;[$endif$]
<input type="file" multiple style="display: none" name=[+ $name +]>&nbsp;
<div _ef_divname="[+ $name +]" class="ef-attachment-info"></div>
</div>
[$ endsub $]
+
+__END__
+
+=pod
+
+=head1 NAME Embperl::Form::Control::attachment - Download / Upload control
+
+
+=head1 SYNOPSIS
+
+ {
+ type => 'attachment',
+ text => 'blabla',
+ name => 'foo',
+ }
+
+=head1 DESCRIPTION
+
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be set to 'attachment'.
+
+=head3 text
+
+Will be used as label for the control.
+
+=head3 no_download
+
+=head3 no_upload
+
+=head3 no_delete
+
+=head3 always_download
+
+
+
+

Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=1658158&r1=1658157&r2=1658158&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Sun Feb 8 12:38:40 2015
@@ -104,6 +104,15 @@ sub get_datasource
return $self -> {datasrcobj} ;
}

+# ---------------------------------------------------------------------------
+
+sub add_query_param
+ {
+ my ($self, $req, $datasource) = @_ ;
+
+ return '' ;
+ }
+
1 ;

__EMBPERL__
@@ -134,6 +143,7 @@ if ($datasrc)

my ($constrain, $without_constrain) = $datasource -> get_constrain_value ($req, $self) ;
$datasrc .= '&constrain=' . $epreq->Escape ($constrain,6) . '&without_constrain=' . ($without_constrain?1:0) if ($constrain) ;
+ $datasrc .= $self -> add_query_param ($req, $datasource) ;

($self -> {url_from}, $self -> {url_to}) = $datasource -> get_url_modifier ($req, $self) ;
}

Modified: perl/embperl/trunk/Embperl/Form/Control/textarea.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/textarea.pm?rev=1658158&r1=1658157&r2=1658158&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/textarea.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/textarea.pm Sun Feb 8 12:38:40 2015
@@ -86,19 +86,26 @@ $]
# show_control_readonly - output the control as readonly
#]

-[$ sub show_control_readonly ($self, $req, $value, $class) $]
-[.-
-$value //= $fdat{$self -> {name}} ;
-$value =~ s/\s*$// ;
-$value =~ s/^\s*// ;
-@value = split (/\n/, $value) ;
-$i = 0 ;
--][$ foreach my $val (@value) $]
+[.$ sub show_control_readonly ($self, $req, $value, $suffix)
+
+my $text = $self -> get_display_text ($req, $value) ;
+$text =~ s/\s*$// ;
+$text =~ s/^\s*// ;
+@$text = split (/\n/, $text) ;
+my $name = $self -> {force_name} || $self -> {name} ;
+$]
+<div [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] _ef_divname="[+ $name +]">
+[$ foreach my $val (@text) $]
[$ if $val =~ /^\s*$/ $]<br>[$else$]
-[- $self -> SUPER::show_control_readonly ($req, $val, $class) -][# $ if ($i < @value - 1) $]<br>[$endif$ #]
+[+ $val +]
[$endif$]
[$endforeach$]
+</div>
+[$ if $self->{hidden} $]
+<input type="hidden" name="[+ $name +]" value="[+ $value +]">
+[$endif$]
[$endsub$]
+
__END__

=pod



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