Debian Codegraph @

Embperl/Form/Control/input.pm

raw
1
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2014 Gerald Richter
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9 #
10 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
11 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 #
14 # $Id$
15 #
16 ###################################################################################
17
18 package Embperl::Form::Control::input ;
19
20 use strict ;
21 use base 'Embperl::Form::Control' ;
22
23 use Embperl::Inline ;
24
25 1 ;
26
27 __EMBPERL__
28
29 [# ---------------------------------------------------------------------------
30 #
31 # show_control - output the control
32 #]
33
34 [$ sub show_control ($self, $req)
35
36 #$self -> {size} ||= 80 / ($self -> {width} || 2) ;
37 my $class = $self -> {class} ;
38 $]
39 <input type="text" name="[+ $self -> {force_name} || $self -> {name} +]" [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req) } +]
40 [$if $self -> {size} $]size="[+ $self->{size} +]"[$endif$]
41 [$if $self -> {maxlength} $]maxlength="[+ $self->{maxlength} +]"[$endif$]
42 >
43 [$endsub$]
44
45 __END__
46
47 =pod
48
49 =head1 NAME
50
51 Embperl::Form::Control::input - A text input control inside an Embperl Form
52
53
54 =head1 SYNOPSIS
55
56 {
57 type => 'input',
58 text => 'blabla',
59 name => 'foo',
60 size => 10,
61 maxlength => 50,
62 }
63
64 =head1 DESCRIPTION
65
66 Used to create an input control inside an Embperl Form.
67 See Embperl::Form on how to specify parameters.
68
69 =head2 PARAMETER
70
71 =head3 type
72
73 Needs to be 'input'
74
75 =head3 name
76
77 Specifies the name of the control
78
79 =head3 text
80
81 Will be used as label for the text input control
82
83 =head3 size
84
85 Gives the size in characters
86
87 =head3 maxlength
88
89 Gives the maximum possible input length in characters
90
91 =head3 class
92
93 Alternative CSS class name
94
95 =head1 Author
96
97 G. Richter (richter at embperl dot org)
98
99 =head1 See Also
100
101 perl(1), Embperl, Embperl::Form
102
103