Wizard/Elem/Select/HTML.pm

filter: Statementstmt 28.1% 9 / 32 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 23.4% 11 / 47 CC 7 SCAR 37.8
CC
7
Cov
21%
Display
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 43.8
« Wizard/Examples/ISDN/Settings.pm ↑ Summary HTML/EP/Wizard.pm »
1 # -*- perl -*-
2 #
3 # Wizard - A Perl package for implementing system administration
4 # applications in the style of Windows wizards.
5 #
6 #
7 # This module is
8 #
9 # Copyright (C) 1999 Jochen Wiedmann
10 # Am Eisteich 9
11 # 72555 Metzingen
12 # Germany
13 #
14 # Email: joe@ispsoft.de
15 # Phone: +49 7123 14887
16 #
17 # and Amarendran R. Subramanian
18 # Grundstr. 32
19 # 72810 Gomaringen
20 # Germany
21 #
22 # Email: amar@ispsoft.de
23 # Phone: +49 7072 920696
24 #
25 # All Rights Reserved.
26 #
27 # You may distribute under the terms of either the GNU General Public
28 # License or the Artistic License, as specified in the Perl README file.
29 #
30 # $Id$
31 #
32  
33 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 ▶use Wizard::Elem::HTML ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37  
38 package Wizard::Elem::Select::HTML;
39  
40 1 @Wizard::Elem::Select::HTML::ISA = qw(Wizard::Elem::HTML);
41 1 $Wizard::Elem::Select::HTML::VERSION = '0.01';
42  
43  
44 0 ▶sub Display {
Subroutine Display: not called CC=7 SCAR=40.3
Pod undocumented
45 0 my($self, $wiz, $form, $state) = @_;
46 0 $self->SUPER::Display($wiz, $form, $state);
47  
48 0 ▶ my $hurl = $form->HelpUrl() || 'gethelp.ep';
Condition0%0/2
$form->HelpUrl || 'gethelp.ep'
l!l
00
MC/DC0%0/1
$form->HelpUrl || 'gethelp.ep'
$form->HelpUrl
Truth table0%0/2
A
A= $form->HelpUrl
Aresult
11
00
49 0 my $mod = ref($state); $mod =~ s/\::/\//g; $mod .= '.pm';
50 0 my $item = "item_" . $self->{'name'}; $item =~ s/\-/\_/g;
51 0 $hurl .= "?module=" . CGI->escape($mod) . "#" . CGI->escape($item);
52  
53 0 my $options = $self->{'options'};
54 0 my $name = $self->{'name'};
55 0 my $value = $self->{'value'};
56  
57 0 ▶ $options = '' unless defined($options);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $options 0 0 0
58 0 ▶ $options = '' unless @$options;
Branch: 1 branch
BranchTrueFalseTotal
unless @$options 0 0 0
59 my $str = '<tr><td>'
60 0 . HTML::Entities::encode_entities($self->{'descr'})
61 . '</td>';
62 0 ▶ unless (ref($options) eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $options eq "ARRAY") 0 0 0
63 0 my $astr = $str . '<td>' . $options
64 . '<input type=hidden name="' . $name . '" value="'
65 . HTML::Entities::encode_entities($options) . '"></td></tr>';
66 0 return $form->AddHTML($astr);
67 }
68 0 $str .= '<td><SELECT NAME="' . $name . '">' . "\n";
69 0 foreach my $opt (@$options) {
70 0 ▶ $str .= '<option' . (($opt eq $value) ? ' SELECTED ' : '') . '>'
Branch: 1 branch
BranchTrueFalseTotal
$opt eq $value ? : 0 0 0
71 . HTML::Entities::encode_entities($opt) . "\n";
72 }
73 0 $str .= '</SELECT></td><td><a href="' . $hurl . '">Help</a></td></tr>';
74 0 $form->AddHTML($str);
75 }
76  
77  
78 1 1;
79  
« Wizard/Examples/ISDN/Settings.pm ↑ Summary HTML/EP/Wizard.pm »