Mailing List Archive

svn commit: r1631394 - /perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
Author: richter
Date: Mon Oct 13 13:56:26 2014
New Revision: 1631394

URL: http://svn.apache.org/r1631394
Log:
selectdyn control enhancements

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

Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=1631394&r1=1631393&r2=1631394&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Mon Oct 13 13:56:26 2014
@@ -101,9 +101,27 @@ __EMBPERL__

my $name = $self -> {name} ;
my $class = $self -> {class} ;
+
+my $doctypes ;
+my $datasrc = $self -> {datasrc} ;
+if ($datasrc)
+ {
+ my %doctypes ;
+ my $datasource = CouchDB::AppServ::DataSource -> get_datasource ($datasrc) ;
+ my $docclasses = $datasource -> get_doctypes_for_datasrc () ;
+ foreach my $doctype (@$docclasses)
+ {
+ my $docclass = CouchDB::AppServ::Docclass -> find_docclass ($doctype) ;
+ next if (!$docclass || $docclass -> abstract_doctype eq ref $docclass) ;
+ #next if ($subclass -> is_allowed ('new', $reqdata, $reqdata -> {document}) != 1) ;
+ $doctypes{$docclass -> title ($reqdata -> {i18n})} = $docclass -> doctype ;
+ }
+ $doctypes = join (',', map {( $doctypes{$_}, $_) } sort keys %doctypes) ;
+ }
+
$]

-<input name="_opt_[+ $name +]" [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +]
+<input name="_opt_[+ $name +]" [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, undef, undef, 'ef-context-menu') } +]
type="text" _ef_attach="ef_selectdyn"
[$if $self -> {size} $]size="[+ $self->{size} +]" [$endif$]
[$if $self -> {showurl} $]_ef_show_url="[+ $self -> {showurl} +]" [$endif$]
@@ -113,7 +131,9 @@ type="text" _ef_attach="ef_selectdyn"
[$if $self -> {datasrctermmax} $]_ef_datasrc_term_max="[+ $self -> {datasrctermmax} +]" [$endif$]
[$if $self -> {use_ajax} $]_ef_use_ajax="[+ $self -> {use_ajax} +]" [$endif$]
[$if $self -> {show_on_select} $]_ef_show_on_select="[+ $self -> {show_on_select}?'1':'' +]" [$endif$]
+[$if $doctypes $]_ef_doctypes="[+ $doctypes +]" [$endif$]
>
+[$if !$self -> {no_button} $]<span class="ui-icon ui-icon-triangle-1-s ef-icon ef-control-selectdyn-ctrl ef-context-menu"></span>[$endif$]
<input type="hidden" name="[+ $name +]">
<input type="hidden" name="_id_[+ $name +]">
[$endsub$]



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