Added: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,470 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::grid ;
+
+use strict ;
+use base 'Embperl::Form::ControlMultValue' ;
+
+use vars qw{%fdat $epreq} ;
+
+use Embperl::Inline ;
+
+# ---------------------------------------------------------------------------
+#
+#   new - create a new control
+#
+
+
+sub new
+
+    {
+    my ($class, $args) = @_ ;
+    
+    my $self = Embperl::Form::ControlMultValue -> new($args) ;
+    bless $self, $class ;
+    
+    $self -> {width} = 1 ;
+    return $self ;
+    }
+
+
+# ---------------------------------------------------------------------------
+#
+#   get_on_show_code 
+#
+#   retuns js code that should be excuted when form becomes visible
+#
+
+sub get_on_show_code 
+    {
+    my ($self) = @_ ;
+    return "switch_grid('$self->{id}')";
+    }
+
+# ---------------------------------------------------------------------------
+    
+sub get_object
+    {
+    my $self = shift;
+    return 'grid-entry';
+    }    
+
+# 
--------------------------------------------------------------------------------------
 ----    
+
+sub gridname
+    {
+    return 'cGridSimple';
+    }   
+    
+# 
------------------------------------------------------------------------------------------
    
+
+sub prepare_fdat
+    {
+    my $self = shift;
+    
+    my %list;
+    my $gridname = $self->gridname;
+    my $ldap = $epreq->{ldap}; 
+ 
+
+    foreach my $entry (keys %fdat)
+        {
+
+        next if ($entry !~ /_($gridname)_/);
+ 
+        if( $entry =~ /^_grid_[^_]+_([^_]+)_(\d+)/ )
+            {
+
+            my $name  = $1;
+            my $index = $2;
+            my $value = $fdat{$entry};
+            $list{$index}->{$name} = $value;
+            delete $fdat{$entry};
+            }
+        }    
+    
+    my @entries;
+            
+    foreach my $index (keys %list)
+        {
+        my $entry = $list{$index};
+        $entry->{address}   =~ s/^--(.*)--$//;
+        $entry->{param}     =~ s/^--(.*)--$//;        
+        my $attr = 
$ldap->joinAttrValue([$index,$entry->{active},$entry->{param}]);
+        push @entries,$attr;
+        } 
+ 
+    $fdat{$self->get_object} = join ("\t",@entries);
+    }
+
+
+
+# 
------------------------------------------------------------------------------------------
+
+sub get_data
+    {
+    my $self = shift;
+    my $ldap = $epreq->{ldap}; 
+    my @data;        
+    my @create =
+                (
+                    {
+                    param => '-- Bitte Daten eintragen --',                    
                  
+                    active  => 0,
+                    }
+                ) ;
+                                            
+    my @entries     = split("\t",$fdat{$self->get_object});
+                
+    foreach my $entry (@entries)
+        {
+        my ($index,$active,$param) = $ldap->splitAttrValue($entry);     
+        my $field           = {};
+        $param              ||= $self->empty_line;
+        $field->{active}    = $active;
+        $field->{param}     = $param;       
+         
+        push @data,$field;
+        }        
+                         
+    @data = @create if (! @data);    
+    
+    return ([EMAIL PROTECTED], [EMAIL PROTECTED]) ;
+    }
+    
+sub init
+    {
+    my ($self) = @_;            
+    $self -> {gridname} = $self -> gridname ;  
+    ($self -> {data}, $self -> {create}) = $self -> get_data ;    
+    }
+
+sub trclass { 'cGridData' }
+sub hiddentrclass { '' }
+sub gridname { 'default' }
+sub onSubmit {'post_grid_data();return 1;'};
+sub prepare_fdat {}
+#sub empty_line {'         '}
+sub empty_line {'                           '}
+sub passmask {'****'}
+sub passmask {'****'}
+sub compare_pw_list
+    {
+    my ($self,$dn,$attrname,$attr2write,$attrindex,$savedindex) = @_;
+    my $ldap    = $epreq->{ldap};
+    my $attrs   = [$attrname];
+    my $ldap_obj = $ldap->search($dn,'objectclass=*','base',$attrs);
+    my $attrsaved = $ldap_obj->{$dn}->{$attrname};
+    my %attrsaved;
+    my %attr2write;
+    my $passmask = $self->passmask;
+
+#print STDERR 'START';
+#print STDERR Data::Dumper::Dumper($attr2write);
+#print STDERR Data::Dumper::Dumper($attrsaved);
+
+    foreach my $entry (@$attrsaved)
+        {
+        my @entry = $ldap->splitAttrValue($entry);
+        my $index = $entry[$savedindex];
+        my $pass  = $entry[$attrindex];
+        $attrsaved{$index} = $pass;
+        }
+
+#print STDERR Data::Dumper::Dumper(\%attrsaved);
+
+    my $i = 0;
+    foreach my $entry (@$attr2write)
+        {
+        my @entry = $ldap->splitAttrValue($entry);
+        my $index = $entry[$savedindex];
+        my $pass  = $entry[$attrindex];
+        if ($pass eq $passmask)
+            {
+            $pass = $attrsaved{$index};
+            $entry[$attrindex] = $pass;
+            }
+        my $entry2write = $ldap->joinAttrValue([EMAIL PROTECTED]);
+        $attr2write->[$i] = $entry2write;
+        $i++;
+        }
+#print STDERR Data::Dumper::Dumper($attr2write);
+    return $attr2write;
+    }
+    
+
+
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self) 
+
+my $span = ($self->{width_percent})  ;
+$]
+  <td class="cBase cLabelBox" colspan="[+ $span +]">
+  [- shift -> showgrid (@_) -]
+  </td>
+[$endsub$]
+
+
+
+[# 
################################################################################################
+    draw_additional_div
+   
################################################################################################
 #]
+[$ sub draw_additional_div $]
+<div id="additional[- $self->draw_table_id; -]"  class="cGridHidden">
+</div>
+[$ endsub $]
+[# #--- draw_additional_div ----# #]
+
+[# 
################################################################################################
+    draw_auto_table
+   
################################################################################################
 #]
+[$ sub draw_auto_table $]
+<table id="auto_table" class="cGridHidden"></table>
+[$ endsub $]
+[# #--- draw_auto_table ----# #]
+
+[# 
################################################################################################
+    draw_grid_table     Erzeugt eine Grid-Tabelle
+    in                  hidden wenn gestetzt wird eine dynamische Tabelle 
erzeugt
+   
################################################################################################
 #]
+[$ sub draw_grid_table $]
+    [-
+    my ($self,$hidden) = @_;
+
+    if($hidden)
+        { 
+        $grid_data = $self -> {create};
+        $trclass   = $self ->  hiddentrclass ;
+        }
+    else
+        {
+        $grid_data = $self -> {data};
+        $trclass   = $self ->  trclass ;
+        }
+    $fields = $self -> {fields} ;
+    $id = $self->{currentid};
+    $id ||= 1 ;
+    -]
+    [$foreach $entry (@$grid_data)$]
+
+    <TR [$if( $trclass )$]class="[+ $trclass +]"[$endif$]>
+
+        [$foreach $field (@$fields)$]
+            [-
+            $val    = $entry->{$field->{'name'}};
+            $domid  = '_grid_'.$self->{gridname}.'_'.$field->{name}."_$id" ;
+            if($field->{type} && $epreq -> can ($field->{type}))
+                {
+                my $method = $field -> {type} ;
+                $epreq -> $method ($field);
+                }
+
+            -] 
+
+         [$if($field->{'type'} eq 'checkbox')$]
+            <TD id="[+$domid+]" class="cGrid[+ 
ucfirst(lc($field->{'type'}))+]"><input name="[+$domid+]" type="checkbox" 
value="1" [$if($val)$]checked[$endif$]></TD>
+         [$elsif($field->{'type'} eq 'select')$]
+[-
+#use Data::Dumper;
+#print STDERR Dumper($field);
+-]
+               <TD id="[+$domid+]" class="cGrid[+ 
ucfirst(lc($field->{'type'}))+]">
+               <select name="[+$domid+]" size="[+ $field->{size} | 1 +]">
+                    [-$i=0-]
+                    [$foreach my $option (@{$field->{options}}) $][-$value = 
$field->{values}->[$i] -]
+                        <option value="[+$value+]" [$ if( $val eq 
$value)$]selected[$endif$]>[+$option+]</option>
+                    [-$i++-]
+                    [$endforeach$]
+                  </select></TD>
+         [$elsif($field->{'type'} eq 'blank')$]
+            <TD id="[+$domid+]" class="cGrid[+ 
ucfirst(lc($field->{'type'}))+]" width="[+$field->{'width'}+]"></TD>
+         [$elsif($field->{'type'} eq 'hidden')$]
+           <TD style="display:none;"> <input type="hidden" name="[+$domid+]" 
value="[+$val+]"></TD>
+         [$else$]
+            <TD id="[+$domid+]" class="cGrid[+ 
ucfirst(lc($field->{'type'}))+]" width="[+$field->{'width'}+]">[+$val+]</TD>
+         [$endif$]
+                [$endforeach$]
+
+        </TR>
+        [- $id++;-]
+           [$endforeach$]
+      [-$self->{currentid} = $id;-]       
+[$ endsub $]
+[# #--- draw_grid_table ----# #]
+
+[# 
################################################################################################
+    draw_grid_control    Erzeugt die Buttons zur Grid Steuerung 
+   
################################################################################################
 #]
+[$ sub draw_grid_control $]
+  [-
+  ($self) = @_;
+  -]
+  <table class="control" align="center" cellpadding=0 cellspacing=0 border=0 
rules="none" >
+   <TR class="control">
+     <TD colspan="[+self->{'control_colspan'}+]" align="center">
+      <input class="cStandardButton" type="button" id="cmdAdd" name="-add" 
value="Hinzuf&uuml;gen" onclick="appendRow('[+$self->{'appendline_for_js'}+]')" 
title="Hinzuf&uuml;gen">
+      <input class="cStandardButton" type="button" id="cmdDelete"  
name="-delete" value="L&ouml;schen" 
onclick="delete_from_form('[+$self->{'appendline_for_js'}+]')" 
title="L&ouml;schen">
+     </TD>
+    </TR>
+   </table> 
+[$ endsub $]
+[# #--- draw_grid_control ----# #]
+
+[# 
################################################################################################
+    draw_grid_header    Erzeugt den Tabellenkopf  
+   
################################################################################################
 #]
+[$ sub draw_grid_header $]
+  [-
+  ($self) = @_;
+  $gridfields = $self->{'fields'};
+  -]
+         <TR class="cGridHeader">[-$i=0-]
+         [* for (my $i = 0; $i < @$gridfields ; $i++) { *]
+            [$if ($gridfields->[$i]->{text} )$]<TD class="cGridHeader" [$ if 
($gridfields->[$i]->{sorted})$]axis="sorted"[$endif$] [$if($width = 
$gridfields->[$i]->{width})$]width="[+$width+]"[$endif$]>[+$gridfields->[$i]->{text}+]</TD>[$endif$]
+         [* } *]
+         </TR>
+[$ endsub $] 
+[# #--- draw_grid_header ----# #]
+
+[# 
-----------------------------------------------------------------------------
+#
+#   show_grid_title - Zeigt den Titel der Tabelle an
+#]
+
+[$ sub show_grid_title $]
+[- 
+($self) = @_;
+-]
+<table class="cBase cGridTitle">
+  <tr class="cTableRow">
+    <td class="cBase cGridLabelBox">[+ $self->{text} +]</td> 
+    <td class="cBase cGridControlBox">
+        <img src="button_neu.gif" id="cmdAdd" name="-add" title="Zeile 
Hinzuf&uuml;gen" onclick="appendRow('[+$self->{'appendline_for_js'}+]')">
+        <img src="button_loeschen.gif"  id="cmdDelete"  name="-delete" 
title="Markierte Zeile L&ouml;schen" 
onclick="delete_from_form('[+$self->{'appendline_for_js'}+]')">
+    </td> 
+  </tr>
+</table>    
+[$ endsub $]
+
+[# 
################################################################################################
+    draw_table_id   Zeigt die DOM Id der Tabelle an  
+   
################################################################################################
 #]   
+
+[$ sub draw_table_id $][- ($self) = @_;-][+$self -> {id} +][$ endsub $]
+[# #--- draw_title ----# #]
+
+
+
+[# 
################################################################################################
+    show    Erzeugt eine dynamische Tabelle 
+        
+    in      objektspezifische Grid-Daten Struktur :
+    
+            gridfields      =  Felder der Grid-Tabelle (angelehnt an das 
fields Format)
+            griddata        =  Datensatz mit den Werten der Tabelle
+            initdata        =  Datensatz mit den initialen Werten der Tabelle
+            names2display   =  (optional) Arrayref mit den Titeln des 
Tabellenkopfes
+            title           =  Titel der Grid-Tabelle
+            trclass         =  css Klasse der Tabellenzeilen
+            hiddentrclass   =  (optional) css Klasse für versteckte 
Tabellenfelder  
+   
################################################################################################
 #]
+   
+[$ sub showgrid $]
+[-
+($self) = @_;
+
+$self -> init() ;
+$epreq -> {'onSubmitLdapData'} = $self -> onSubmit ; 
+
+-]
+
+[#
+<link rel="stylesheet" type="text/css" href="/grid.css">
+<link rel="stylesheet" type="text/css" href="/base.css">
+<SCRIPT src="/js/TableCtrl.js"></SCRIPT>
+#]
+
+[- $self->show_grid_title; -]
+<table class="cBase cGridTable" id="[- $self->draw_table_id; -]" name="[- 
$self->draw_table_id; -]">
+[- $self->draw_grid_header; -]
+[- $self-> draw_grid_table; -]
+</table>
+
+[- $self->draw_auto_table;-]
+[- $self->draw_additional_div;  -]
+
+<div id="hidden_table_container[- $self->draw_table_id; -]"  
class="cGridHidden">
+
+<table id="hidden[- $self->draw_table_id; -]" class="cGridHidden">
+[- $self-> draw_grid_table(1); -]
+</table>
+</div>
+
+<div id="temp[- $self->draw_table_id; -]">
+</div>
+
+<SCRIPT language="javascript">
+init('[- $self->draw_table_id; -]');
+</SCRIPT>
+
+[$endsub$]
+[# #--- show ----# #]
+
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::grid - A grid control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+Used to create a grid control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'grid'
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/grid.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/info.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/info.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/info.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/info.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,81 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::info ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self, $data)
+
+my $span = ($self->{width_percent})  ;
+$]
+<td class="cBase cInfoBox" colspan="[+ $span +]">[+ $self->{text} +]</td>
+[$endsub$]
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::blank - A info area inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'info',
+  text => 'blabla' 
+  }
+
+=head1 DESCRIPTION
+
+Used to create a info area with optional text inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'info'
+
+=head3 text (optional)
+
+Could be used to give a text that should be displayed inside the blank area
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Added: perl/embperl/trunk/Embperl/Form/Control/input.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/input.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/input.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/input.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,92 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::input ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) 
+$self -> {size} ||= 80 / ($self -> {width} || 2) ;
+$]
+
+<input type="text"  class="cBase cControl"  name="[+ $self->{name} +]"
+[$if $self -> {size} $]size="[+ $self->{size} +]"[$endif$]
+[$if $self -> {maxlength} $]size="[+ $self->{maxlength} +]"[$endif$]
+>
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::input - A text input control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'input',
+  text => 'blabla', 
+  name => 'foo',
+  size => 10,
+  }
+
+=head1 DESCRIPTION
+
+Used to create an input control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'input'
+
+=head3 text 
+
+Will be used as label for the text input control
+
+=head3 size
+
+Gives the size in characters
+
+=head3 maxlength
+
+Gives the maximun length in characters
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/input.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/label.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/label.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/label.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/label.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,81 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::label ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self, $data)
+
+my $span = ($self->{width_percent})  ;
+$]
+<td class="cBase cLabelBox" colspan="[+ $span +]">[+ $self->{text} +]</td>
+[$endsub$]
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::blank - A label area inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'label',
+  text => 'blabla' 
+  }
+
+=head1 DESCRIPTION
+
+Used to create a label area with optional text inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'label'
+
+=head3 text (optional)
+
+Could be used to give a text that should be displayed inside the blank area
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/label.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/number.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/number.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/number.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/number.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,98 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::number ;
+
+use strict ;
+use base 'Embperl::Form::Control::input' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) 
+
+    $self->{size} ||= 10 ;
+$]    
+[-     $self -> SUPER::show_control ;
+-]
+[+ do { use Data::Dumper ; Dumper ([EMAIL PROTECTED]) }+]
+[$if ($self->{unit}) $][+ $self ->{unit} +][$endif$] ;
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::number - A numeric input control with optional unit 
inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'input',
+  text => 'blabla', 
+  name => 'foo',
+  unit => 'sec',
+  }
+
+=head1 DESCRIPTION
+
+Used to create a numeric input control inside an Embperl Form.
+Optionaly it can display an unit after the input field.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'number'
+
+=head3 text 
+
+Will be used as label for the numeric input control
+
+=head3 size
+
+Gives the size in characters. (Default: 10)
+
+=head3 maxlength
+
+Gives the maximun length in characters
+
+=head3 unit
+
+Gives a string that should be displayed right of the input field.
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/number.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/password.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/password.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/password.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/password.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,90 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::password ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) $]
+
+<input type="password"  class="cBase cControl"  name="[+ $self->{name} +]"
+[$if $self -> {size} $]size="[+ $self->{size} +]"[$endif$]
+[$if $self -> {maxlength} $]size="[+ $self->{maxlength} +]"[$endif$]
+>
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::password - A password input control inside an Embperl 
Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'password',
+  text => 'blabla', 
+  name => 'foo',
+  size => 10,
+  }
+
+=head1 DESCRIPTION
+
+Used to create a password control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'password'
+
+=head3 text 
+
+Will be used as label for the text input control
+
+=head3 size
+
+Gives the size in characters
+
+=head3 maxlength
+
+Gives the maximun length in characters
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/password.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/radio.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/radio.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/radio.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/radio.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,115 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::radio ;
+
+use strict ;
+use base 'Embperl::Form::ControlMultValue' ;
+
+use Embperl::Inline ;
+
+
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) 
+
+    my ($values, $options) = $self -> get_values ;
+    my $name     = $self -> {name} ;
+    my $max      = @$values ;
+
+    my $val ;     
+    my $i = 0 ;
+$]    
+[$ foreach $val (@$values) $]
+    <input type="radio" name="[+ $name +]" value="[+ $val +]"
+    [$if ($self -> {sublines} || $self -> {subobjects}) $] 
OnClick="show_radio_checked(this,[+ $i +],[+ $max +])" [$endif$]
+    >[+ $options ->[$i] || $val +]
+    [- $vert = $self -> {vert} -][$while $vert-- > 0 $]<br/>[$endwhile$]
+    [* $i++ ; *]
+[$endforeach$]
+
+
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::radio - A radio control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type    => 'radio',
+  text    => 'blabla', 
+  name    => 'foo',
+  values  => [1,2,3],
+  options => ['foo', 'bar', 'none'],
+  }
+
+=head1 DESCRIPTION
+
+Used to create an radio control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'radio'
+
+=head3 name
+
+Specifies the name of the radio control
+
+=head3 text 
+
+Will be used as label for the radio control
+
+=head3 values
+
+Gives the values as an array ref of the radio control.
+
+=head3 options
+
+Gives the options as an array ref that should be displayed to the user.
+If no options are given, the values from values are used.
+
+=head3 vert
+
+If specified arranges the radio button vertically. The number given specifies
+the number of <br>'s used the separate the radio buttons.
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/radio.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/select.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/select.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/select.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/select.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,111 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::select ;
+
+use strict ;
+use base 'Embperl::Form::ControlMultValue' ;
+
+use Embperl::Inline ;
+
+
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) 
+
+    my ($values, $options) = $self -> get_values ;
+    my $name     = $self -> {name} ;
+    my $val ;     
+$]    
+<select  class="cBase cControl" name="[+ $name +]" id="[+ $name +]"
+[$if ($self -> {sublines} || $self -> {subobjects}) $] 
OnChange="show_selected(this)" [$endif$]
+[$if ($self -> {rows}) $] size="[+ $self->{rows} +]" [$endif$]
+>
+    <option value="[+ do { $val = $values -> [$row] } +]">[+ $options ->[$row] 
|| $val +]</option>
+</select>
+
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::select - A select control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type    => 'select',
+  text    => 'blabla', 
+  name    => 'foo',
+  values  => [1,2,3],
+  options => ['foo', 'bar', 'none'],
+  rows    => 5
+  }
+
+=head1 DESCRIPTION
+
+Used to create an select control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'select'
+
+=head3 name
+
+Specifies the name of the select control
+
+=head3 text 
+
+Will be used as label for the select control
+
+=head3 values
+
+Gives the values as an array ref of the select control.
+
+=head3 options
+
+Gives the options as an array ref that should be displayed to the user.
+If no options are given, the values from values are used.
+
+=head3 rows
+
+If specified a select box is display with the given number of lines.
+If not specified or undef, a drop down list is shown.
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/select.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/submit.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/submit.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/submit.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/submit.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,109 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::submit ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self, $data)
+
+my $span = ($self->{width_percent})  ;
+$]
+<td class="cBase cControlBox cControlButtonBox" colspan="[+ $span +]">
+<input class="cBase cControl cControlButton"  name="[+ $self->{name} +]"
+value="[+ $self->{value} || $self->{text} +]"
+title="[+ $self->{text} +]"
+[$if $self -> {novalidate} $] onClick="doValidate = 0;" [$endif$]
+[$if $self -> {image} $]
+type="image" src="[+ $self -> {image} +]"
+[$else$]
+type="submit"
+[$endif$]
+>
+</td>
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::submit - A submit button inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'submit',
+  text => 'send', 
+  name => 'foo',
+  value => 'xxx',
+  image => 'xxx',
+  }
+
+=head1 DESCRIPTION
+
+Used to create an submit control inside an Embperl Form.
+If an image is given it will create an image button.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'submit'
+
+=head3 name
+
+Name of the button
+
+=head3 text 
+
+Will be used as label for the submit button or tool tip
+in case of an image button
+
+=head3 value
+
+Gives the value to send
+
+=head3 image
+
+URL of an image. If given an image button will be created,
+if absent, an normal submit button will be created.
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/submit.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/tabs.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/tabs.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/tabs.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/tabs.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,196 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::tabs ;
+
+use strict ;
+use vars qw{%fdat} ;
+
+use Embperl::Form::ControlMultValue ;
+use base 'Embperl::Form::ControlMultValue' ;
+
+use Embperl::Inline ;
+
+# ---------------------------------------------------------------------------
+#
+#   new - create a new control
+#
+
+
+sub new
+
+    {
+    my ($class, $args) = @_ ;
+    
+    my $self = Embperl::Form::ControlMultValue -> new($args) ;
+    bless $self, $class ;
+    
+    $self -> {width} = 1 ;
+    return $self ;
+    }
+
+# ---------------------------------------------------------------------------
+#
+#   noframe - do not draw frame border if this is the first control
+#
+
+
+sub noframe
+
+    {
+    return 1 ;
+    }
+
+# ---------------------------------------------------------------------------
+#
+#   get_active_id - get the id of the value which is currently active
+#
+
+sub get_active_id
+
+    {
+    my ($self)   = @_ ;
+
+    my ($values, $options) = $self -> get_values ;
+    my $name     = $self -> {name} ;
+    my $dataval  = $fdat{$name} || $values -> [0] ;
+    my $activeid ;
+
+    my $i = 0 ;
+    foreach my $val (@$values)
+        {
+        if ($val eq $dataval || $self -> {subids}[$i] eq $dataval)
+            {
+            $activeid = $self -> {subids}[$i] ;
+            last ;
+            }
+        $i++ ;
+        }
+
+    return $activeid || $self -> {subids}[0];
+    }
+
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self) 
+
+    my ($values, $options) = $self -> get_values ;
+    my $span = ($self->{width_percent})  ;
+    my $name     = $self -> {name} ;
+    my $dataval  = $fdat{$name} || $values -> [0] ;
+    my $activeid = $self -> get_active_id ;
+    
+    my $val ;     
+    my $i = 0 ;
+$]    
+
+<td class="cBase cTabTD" colspan="[+ $span +]">
+    <table  class="cBase cTabTable" ><tr  class="cBase cTabRow">
+    [$ foreach $val (@$values) $]
+        [*
+        my $id        = $self -> {subids}[$i] ;
+        my $cellclass = $id eq $activeid?'cTabCellOn':'cTabCellOff' ;
+        my $divclass  = $id eq $activeid?'cTabDivOn':'cTabDivOff' ;
+
+        my $form = $self -> form ;
+        my @switch_code ;
+    
+        foreach my $sub (@{$form -> {controls}})
+            {
+            my $code = $sub -> get_on_show_code ;
+            push @switch_code, $code if ($code) ;
+            }
+        my $js = join (';', @switch_code) ;    
+        *]   
+        <td class="cBase $cellclass"><div class="cBase [+ $divclass +]" 
id="__tabs_[+ $id +]">
+        <a href="#" onClick="tab_selected('[+ $id +]','[+ $name +]'); [+ do { 
local $escmode = 0 ; $js } +]" style="color:black; text-decoration: none;">[+ 
$options ->[$i] || $val +]</a></div></td>
+        [* $i++ *]
+    [$endforeach $]
+    <td class="cBase cTabCellBlank">&nbsp;</td>
+    <input type="hidden" name="[+ $name +]" id="[+ $name +]" value="[+ 
$activeid +]">
+    </tr></table>
+</td>
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::tabs - A tab control inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+            Embperl::Form -> add_tabs ( 
+                [
+                    {
+                    text => 'First Tab',
+                    fields => [
+                              ...
+                              ]
+                    },
+                    { 
+                    text => 'Second Tab',
+                    fields => [
+                              ...
+                              ]
+                    }
+                ])
+
+
+
+=head1 DESCRIPTION
+
+Control to display tabs at the top of the form and control the switching 
between sub forms.
+The switching is done by Javascript, so it can only be used in environment 
where 
+Javascript is available.
+
+You can use the method Embperl::Form -> add_tabs
+to setup a tabbed form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+
+=head3 text 
+
+Text that will be displayed on the tab
+
+=head3 fields
+
+List of fields that should be displayed in this subform. 
+Given in the same form as form Embperl::Form.
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/tabs.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/textarea.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/textarea.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/textarea.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/textarea.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,91 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::textarea ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show_control - output the control
+#]
+
+[$ sub show_control ($self) $]
+
+<textarea type="text"  class="cBase cControl"  name="[+ $self->{name} +]"
+[$if $self -> {cols} $]cols="[+ $self->{cols} +]"[$endif$]
+[$if $self -> {rows} $]rows="[+ $self->{rows} +]"[$endif$]
+></textarea>
+[$endsub$]
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::textarea - A textarea input control inside an Embperl 
Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'textarea',
+  text => 'blabla', 
+  name => 'foo',
+  rows => 10,
+  cols => 80,
+  }
+
+=head1 DESCRIPTION
+
+Used to create an input control inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'textarea'
+
+=head3 text 
+
+Will be used as label for the text input control
+
+=head3 cols
+
+Number of columns
+
+=head3 rows
+
+Number of rows
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/textarea.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/Control/transparent.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/Control/transparent.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/transparent.pm (added)
+++ perl/embperl/trunk/Embperl/Form/Control/transparent.pm Mon Dec  5 23:45:12 
2005
@@ -0,0 +1,81 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::Control::transparent ;
+
+use strict ;
+use base 'Embperl::Form::Control' ;
+
+use Embperl::Inline ;
+
+1 ;
+
+__EMBPERL__
+    
+[# ---------------------------------------------------------------------------
+#
+#   show - output the control
+#]
+
+[$ sub show ($self, $data)
+
+my $span = ($self->{width_percent})  ;
+$]
+<td class="cBase cTransparentBox" colspan="[+ $span +]">[+ $self->{text} 
+]&nbsp;</td>
+[$endsub$]
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::Control::transparent - A transparent area inside an Embperl Form
+
+
+=head1 SYNOPSIS
+
+  { 
+  type => 'transparent',
+  text => 'blabla' 
+  }
+
+=head1 DESCRIPTION
+
+Used to create a transparent area with optional text inside an Embperl Form.
+See Embperl::Form on how to specify parameters.
+
+=head2 PARAMETER
+
+=head3 type
+
+Needs to be 'transparent'
+
+=head3 text (optional)
+
+Could be used to give a text that should be displayed inside the transparent 
area
+
+
+=head1 Author
+
+G. Richter ([EMAIL PROTECTED])
+
+=head1 See Also
+
+perl(1), Embperl, Embperl::Form
+
+

Propchange: perl/embperl/trunk/Embperl/Form/Control/transparent.pm
------------------------------------------------------------------------------
    svn:executable = *

Added: perl/embperl/trunk/Embperl/Form/ControlMultValue.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Form/ControlMultValue.pm?rev=354348&view=auto
==============================================================================
--- perl/embperl/trunk/Embperl/Form/ControlMultValue.pm (added)
+++ perl/embperl/trunk/Embperl/Form/ControlMultValue.pm Mon Dec  5 23:45:12 2005
@@ -0,0 +1,69 @@
+
+###################################################################################
+#
+#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ecos gmbh   www.ecos.de
+#
+#   You may distribute under the terms of either the GNU General Public
+#   License or the Artistic License, as specified in the Perl README file.
+#
+#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#   $Id$
+#
+###################################################################################
+
+package Embperl::Form::ControlMultValue ;
+
+use strict ;
+use vars qw{%fdat} ;
+
+use base 'Embperl::Form::Control' ;
+
+# ---------------------------------------------------------------------------
+#
+#   get_values - returns the values and options
+#
+
+sub get_values
+
+    {
+    my ($self) = @_ ;
+
+    return ($self -> {values}, $self -> {options}) ;
+    }
+
+
+# ---------------------------------------------------------------------------
+#
+#   get_active_id - get the id of the value which is currently active
+#
+
+sub get_active_id
+
+    {
+    my ($self)   = @_ ;
+
+    my ($values, $options) = $self -> get_values ;
+    my $name     = $self -> {name} ;
+    my $dataval  = $fdat{$name} || $values -> [0] ;
+    my $activeid ;
+
+    my $i = 0 ;
+    foreach my $val (@$values)
+        {
+        if ($val eq $dataval)
+            {
+            $activeid = "$name-$i" ;
+            last ;
+            }
+        $i++ ;
+        }
+
+    return $activeid ;
+    }
+
+
+  1 ;
+  
\ No newline at end of file

Propchange: perl/embperl/trunk/Embperl/Form/ControlMultValue.pm
------------------------------------------------------------------------------
    svn:executable = *

Modified: perl/embperl/trunk/Embperl/Syntax/EmbperlBlocks.pm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Embperl/Syntax/EmbperlBlocks.pm?rev=354348&r1=354347&r2=354348&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Syntax/EmbperlBlocks.pm (original)
+++ perl/embperl/trunk/Embperl/Syntax/EmbperlBlocks.pm Mon Dec  5 23:45:12 2005
@@ -56,6 +56,8 @@
         $self -> AddToRoot ($self -> {-epbBlocks}) ;
 
         Init ($self, ref $exchange?$exchange:undef) ;
+
+        $self -> AddInitCode ('use Data::Dumper ;') ;
         }
 
     return $self ;
@@ -360,6 +362,47 @@
                 perlcode => '_ep_hid(%$n%,%&\'<noname>%);', 
                 removenode => 8,
                 }) ;
+    $self -> AddMetaCmd ('dump',
+                { 
+                compiletimeperlcode => q[ 
+                   {
+                   my $line = __LINE__ - 2 ;
+                   my $code ;
+                   my $out ;
+                   my ($dest, @vars) = split (/\s*,\s*/, %&'<noname>%) ;
+                   if ($dest ne 'pre' && $dest ne 'out' && $dest ne 'log' && 
$dest ne 'err')
+                        {
+                        unshift @vars, $dest ;
+                        $dest = 'pre' ;
+                        }
+
+                   if ($vars[0] =~ /^\'|\"/)
+                        {
+                        $out = (shift @vars) . '.' ;
+                        } 
+                   $out = "Data::Dumper -> Dump ([" . join (',', map { 
s/^(\@|\%%)/\\\\$1/; $_ } @vars) . "],['" . join ("','", @vars) . "'])" ;
+                   if ($dest eq 'pre')
+                        {
+                        $code = '%$c%' . "{ local \$escmode = 0; print OUT 
'<pre>' ; \$escmode = 7; my \$o = $out ; print OUT \$o, \"\\n\"; \$escmode = 0; 
print OUT \"<pre>\\n\" ; }" ; 
+                        }
+                   elsif ($dest eq 'out')
+                        {
+                        $code = '%$c%' . "{my \$o = $out ; print OUT \$o, 
\"\\n\"; }" ; 
+                        }
+                   elsif ($dest eq 'err')
+                        {
+                        $code = "{my \$o = $out . ' in " .  __FILE__ . " line 
" . $line . "'. \"\\n\"; print STDERR \$o ;}" ; 
+                        }
+                   elsif ($dest eq 'log')
+                        {
+                        $code = "{my \$o = $out . ' in " .  __FILE__ . " line 
" . $line . "'. \"\\n\"; print LOG \$o ;}" ; 
+                        }
+                   $Embperl::req -> component -> code ($code) ;
+                   }
+                   ],
+                removenode => 3,
+                compilechilds => 0,
+                }) ;
     $self -> AddMetaCmd ('syntax',
                 { 
                 compiletimeperlcode => '$Embperl::req -> component -> syntax 
(Embperl::Syntax::GetSyntax(%&\'<noname>%, $Embperl::req -> component -> syntax 
-> name));', 
@@ -384,7 +427,7 @@
                                                 $Embperl::req -> component -> 
code ("sub _ep_sub_$1 { $2 ") ;
                                                 }
                                          ], 
-                perlcodeend => ' };  sub #subname# { my @_ep_save ; 
Embperl::Cmd::SubStart($_ep_DomTree,%$q%,[EMAIL PROTECTED]); my @_ep_ret = 
_ep_sub_#subname# (@_); Embperl::Cmd::SubEnd($_ep_DomTree,[EMAIL PROTECTED]); 
return @_ep_ret } ; $_ep_exports{%^"subname%} = \&#subname# ; ', 
+                perlcodeend => ' };  sub #subname# { my @_ep_save ; 
Embperl::Cmd::SubStart($_ep_DomTree,%$q%,[EMAIL PROTECTED]); my @_ep_ret ; my 
$_ep_ret ;  if (wantarray()) { @_ep_ret = _ep_sub_#subname# (@_)}else {$_ep_ret 
= _ep_sub_#subname# (@_);} Embperl::Cmd::SubEnd($_ep_DomTree,[EMAIL 
PROTECTED]); return wantarray()[EMAIL PROTECTED]:$_ep_ret } ; 
$_ep_exports{%^"subname%} = \&#subname# ; ', 
                 compiletimeperlcodeend => q[ 
                                           my $args = %^'subname% ;
                                           $args =~ s/\s+.+$//s ;

Modified: perl/embperl/trunk/MANIFEST
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/MANIFEST?rev=354348&r1=354347&r2=354348&view=diff
==============================================================================
--- perl/embperl/trunk/MANIFEST (original)
+++ perl/embperl/trunk/MANIFEST Mon Dec  5 23:45:12 2005
@@ -9,6 +9,26 @@
 Embperl.xs
 Embperl/App.pm
 Embperl/Constant.pm
+Embperl/Form.pm
+Embperl/Form/Control/select.pm
+Embperl/Form/Control/checkbox.pm
+Embperl/Form/Control/blank.pm
+Embperl/Form/Control/tabs.pm
+Embperl/Form/Control/transparent.pm
+Embperl/Form/Control/radio.pm
+Embperl/Form/Control/file.pm
+Embperl/Form/Control/submit.pm
+Embperl/Form/Control/password.pm
+Embperl/Form/Control/label.pm
+Embperl/Form/Control/grid.pm
+Embperl/Form/Control/textarea.pm
+Embperl/Form/Control/addremove.pm
+Embperl/Form/Control/display.pm
+Embperl/Form/Control/info.pm
+Embperl/Form/Control/number.pm
+Embperl/Form/Control/input.pm
+Embperl/Form/ControlMultValue.pm
+Embperl/Form/Control.pm
 Embperl/Form/Validate.pm
 Embperl/Form/Validate/Default.pm
 Embperl/Form/Validate/Number.pm



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to