fieldset.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« container.pm ↑ Summary header.pm »
1 package HTML::GUI::fieldset;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 HTML::GUI::fieldset - Create and control a whole fieldset for web application
9  
10 =head1 VERSION
11  
12 Version 0.01
13  
14 =cut
15  
16 our $VERSION = '0.01';
17  
18 0 ▶use HTML::GUI::container;
Subroutine BEGIN: called CC=1 SCAR=2.6
19 use UNIVERSAL qw(isa);
20 our @ISA = qw(HTML::GUI::container);
21  
22  
23  
24 =head1 FIELDSET
25  
26 A fieldset widget can contain input widgets (i.e. text input).
27 A fieldset cannot contains a fieldset nor a screen (because the screen MUST be the top element of the widget tree)
28  
29 =cut
30  
31 =head1 PUBLIC ATTRIBUTES
32  
33 =pod
34  
35  
36  
37 =cut
38  
39  
40 =head1 PUBLIC METHODS
41  
42 =pod
43  
44 =head3 new
45  
46 create a new fieldset
47  
48 =cut
49  
50 sub new
51 {
52 my($class,$params) = @_;
53  
54 my $this = $class->SUPER::new($params);
55 $this->{type} = "fieldset";
56  
57 return undef unless defined $this;
58  
59 bless($this, $class);
60 }
61  
62  
63 =pod
64  
65 =head3 getHtml
66  
67 Description :
68 Return the html of the widget.
69  
70 =cut
71  
72 sub getHtml
73 {
74 my($self) = @_;
75 my %tagProp=();
76 my %styleProp=();
77
78  
79 if (exists $self->{display} && 0==$self->{display}){
80 $styleProp{display} = 'none';
81 }
82  
83 $tagProp{style} = $self->getStyleContent(\%styleProp);
84 $tagProp{id} = $self->{id};
85 my $legendHtml = '';
86 if (exists $self->{label}){
87 $legendHtml = $self->getHtmlTag("legend",
88 undef,
89 $self->escapeHtml($self->{label}));
90 }
91 return $self->getHtmlTag( "fieldset",
92 \%tagProp,
93 $legendHtml
94 .$self->SUPER::getHtml()) ;
95 }
96  
97  
98  
99 =head1 AUTHOR
100  
101 Jean-Christian Hassler, C<< <jhassler at free.fr> >>
102  
103 =head1 BUGS
104  
105 Please report any bugs or feature requests to
106 C<bug-gui-libhtml-fieldset at rt.cpan.org>, or through the web interface at
107 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-GUI-widget>.
108 I will be notified, and then you'll automatically be notified of progress on
109 your bug as I make changes.
110  
111 =head1 SUPPORT
112  
113 You can find documentation for this module with the perldoc command.
114  
115 perldoc HTML::GUI::widget
116  
117 You can also look for information at:
118  
119 =over 4
120  
121 =item * AnnoCPAN: Annotated CPAN documentation
122  
123 L<http://annocpan.org/dist/HTML-GUI-widget>
124  
125 =item * CPAN Ratings
126  
127 L<http://cpanratings.perl.org/d/HTML-GUI-widget>
128  
129 =item * RT: CPAN's request tracker
130  
131 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-GUI-widget>
132  
133 =item * Search CPAN
134  
135 L<http://search.cpan.org/dist/HTML-GUI-widget>
136  
137 =back
138  
139 =head1 ACKNOWLEDGEMENTS
140  
141 =head1 COPYRIGHT & LICENSE
142  
143 Copyright 2007 Jean-Christian Hassler, all rights reserved.
144  
145 This program is free software; you can redistribute it and/or modify it
146 under the same terms as Perl itself.
147  
148 =cut
149  
150 1; # End of HTML::GUI::fieldset
« container.pm ↑ Summary header.pm »