
richter at apache
Oct 19, 2011, 3:17 AM
Post #1 of 1
(243 views)
Permalink
|
|
svn commit: r1186068 - in /perl/embperl/trunk/Embperl/Form/Control: button.pm checkbox.pm grid.pm info.pm mult.pm
|
|
Author: richter Date: Wed Oct 19 10:17:55 2011 New Revision: 1186068 URL: http://svn.apache.org/viewvc?rev=1186068&view=rev Log: Form controls Modified: perl/embperl/trunk/Embperl/Form/Control/button.pm perl/embperl/trunk/Embperl/Form/Control/checkbox.pm perl/embperl/trunk/Embperl/Form/Control/grid.pm perl/embperl/trunk/Embperl/Form/Control/info.pm perl/embperl/trunk/Embperl/Form/Control/mult.pm Modified: perl/embperl/trunk/Embperl/Form/Control/button.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/button.pm?rev=1186068&r1=1186067&r2=1186068&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/button.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/button.pm Wed Oct 19 10:17:55 2011 @@ -41,7 +41,7 @@ $] <div class="cControlButtonDiv" title="[+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self) +]" [$if $self -> {onclick} $] onClick="[.+ do { local $escmode = 0 ; $self -> {onclick} } +]" [$endif$] - ><img class="cControlButtonSymbol" src="[+ $self -> {symbol} +]"> + [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]><img class="cControlButtonSymbol" src="[+ $self -> {symbol} +]"> [.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self) +] </div> [$else$] @@ -51,6 +51,7 @@ $] value="[.+ $self -> {showvalue}?($self -> {value} || $self->{text}):$self -> form -> convert_label ($self) +]" title="[+ $self -> {showtext}?($self->{text}):$self -> form -> convert_label ($self) +]" [$if $self -> {onclick} $] onClick="[.+ do { local $escmode = 0 ; $self -> {onclick} } +]" [$endif$] + [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +] [$if $self -> {image} $] type="image" src="[+ $self -> {image} +]" [$else$] Modified: perl/embperl/trunk/Embperl/Form/Control/checkbox.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/checkbox.pm?rev=1186068&r1=1186067&r2=1186068&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/checkbox.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/checkbox.pm Wed Oct 19 10:17:55 2011 @@ -83,10 +83,14 @@ __EMBPERL__ my $name = $self -> {name} ; my $val = $self -> {value} || 1 ; my $nsprefix = $self -> form -> {jsnamespace} ; + my $class = $self -> {class} ||= '' ; + + $val =~ s/%%%name%%%/$fdat{$name}/g ; + $val =~ s/%%(.+?)%%/$fdat{$1}/g ; push @{$self -> form -> {fields2empty}}, $name ; $] -<input type="checkbox" class="cBase cControlCheckbox" name="[+ $name +]" value="[+ $val +]" +<input type="checkbox" class="cBase cControlCheckbox [+ $class +]" name="[+ $self -> {force_name} || $name +]" value="[+ $val +]" [$if ($self -> {sublines} || $self -> {subobjects}) $] OnClick="[+ $nsprefix +]show_checked(document, this)" [$endif$] [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]> [$endsub$] @@ -124,13 +128,29 @@ Needs to be 'checkbox' Specifies the name of the checkbox control +=head3 force_name + +overwrites the name of the control. This is especially usefull +inside grids, where you can force the name of all checkboxes +in all rows to be the same name. + =head3 text Will be used as label for the checkbox control =head3 value -Gives the value of the checkbox +Gives the value for the checkbox. + +%%<xx>%% is replaced by $fdat{<xx>} + +%%%name%%% is replaced by $fdat{<name>}, where <name> is the value that +is given with name parameter. Is is escepically usefull inside of grids +where the actual name of the html control is computed dynamicly. + +=head3 class + +Extra css class =head1 Author Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=1186068&r1=1186067&r2=1186068&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Wed Oct 19 10:17:55 2011 @@ -308,7 +308,7 @@ $] <thead> <tr class="cGridHeader"> [$ foreach my $field (@$fields) $] - <td class="cGridHeader" [$if($width = $field->{width})$]width="[+$width+]"[$endif$]>[+ $self -> form -> convert_label ($self, $field->{name}, $field->{text}) +]</td> + <td class="cGridHeader" [$if($width = $field->{width})$]width="[+$width+]"[$endif$] _colattr="[+ $field->{name} +]">[+ $self -> form -> convert_label ($self, $field->{name}, $field->{text}) +]</td> [$ endforeach $] </tr> </thead> Modified: perl/embperl/trunk/Embperl/Form/Control/info.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/info.pm?rev=1186068&r1=1186067&r2=1186068&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/info.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/info.pm Wed Oct 19 10:17:55 2011 @@ -34,8 +34,9 @@ __EMBPERL__ my $span = ($self->{width_percent}); my $section = $self->{section}; +my $class = $self -> {class} ; $] -<td class="cBase cInfoBox" colspan="[+ $span +]" [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>[$ if $section $]<b>[$ endif $][+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +] [$ if $section $]</b>[$ endif $]</td> +<td class="cBase cInfoBox [+ $class +]" colspan="[+ $span +]" [.+ do { local $escmode = 0 ; $self -> {eventattrs} } +]>[$ if $section $]<b>[$ endif $][$ if $self -> {image} $]<img class="cControlButtonSymbol" src="[+ $self -> {image} +]">[$endif$][+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +] [$ if $section $]</b>[$ endif $]</td> [$endsub$] @@ -52,7 +53,8 @@ Embperl::Form::Control::blank - A info a { type => 'info', - text => 'blabla' + text => 'blabla', + image => '/images/symbol.png' } =head1 DESCRIPTION @@ -70,6 +72,13 @@ Needs to be 'info' Could be used to give a text that should be displayed inside the blank area +=head3 image (optional) + +Add image to start of info area + +=head3 class + +css class =head1 Author Modified: perl/embperl/trunk/Embperl/Form/Control/mult.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/mult.pm?rev=1186068&r1=1186067&r2=1186068&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/mult.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/mult.pm Wed Oct 19 10:17:55 2011 @@ -213,8 +213,8 @@ $] $] [$if (! $self -> is_readonly ()) $] - <img src="[+ $self -> {imagedir} +]/btn_add.gif" id="[+ $self -> {id} +]-add" title="Zeile Hinzufügen"> - <img src="[+ $self -> {imagedir} +]/btn_del.gif" id="[+ $self -> {id} +]-del" title="Zeile Löschen"> + <img src="[+ $self -> {imagedir} +]/btn_pluss.gif" id="[+ $self -> {id} +]-add" title="Zeile Hinzufügen"> + <img src="[+ $self -> {imagedir} +]/btn_minus.gif" id="[+ $self -> {id} +]-del" title="Zeile Löschen"> [$endif$] [$endsub$] --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-cvs-unsubscribe [at] perl For additional commands, e-mail: embperl-cvs-help [at] perl
|