TurboForm/Element/Imagegalerie.pm untested

filter: Statementstmt 0.0% 0 / 51 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 84 CC 13 SCAR 48.8
CC
13
Cov
0%
render
182.0
init
2.0
get_dbix
2.0
CRAP 132.0
1 package HTML::TurboForm::Element::Imagegalerie;
2 use warnings;
3 use strict;
4 use base qw(HTML::TurboForm::Element);
5 __PACKAGE__->mk_accessors( qw/ del_link all_link max dir noimgs / );
6  
7 sub render{
8 my ($self, $options, $view)=@_;
9 if ($view) { $self->{view}=$view; }
10 my $result='';
11 my $disabled='';
12 my $class='form_imagegalerie';
13 my $request=$self->request;
14  
15 $self->label(' ') if ($self->label eq '');
16 $class=$self->{class} if exists($self->{class});
17 my $aha=$self->options;
18 my $name=$self->name;
19 my $nr_obj = scalar(@{ $self->{options} });
20  
21 $disabled=' disabled ' if ($options->{frozen} == 1);
22 my $dir='';
23 $dir = $self->dir if ($self->dir);
24 $result.='<div class="'.$class.'" id="'.$name.'">'."\n";
25 $result.='<table class="galerielist"><tr>';
26  
27 foreach (@{$self->{options}}){
28 my $col_fn = $self->dbid;
29 my $col_label = $self->dblabel;
30 my $fn ='';
31 $fn = $_->$col_fn if ($_->$col_fn);
32  
33 if (!$self->noimgs){
34 if ($self->all_link){
35 my $label = '';
36 $label = '<br /><span class="galerielabel">'.$_->$col_label.'</span>' if($self->dblabel);
37 $result.='<td><input class="del_btn" type="submit" name="'.$self->name.'_delete_'.$fn.'" value="Delete" />
38 <input class="del_btn" type="submit" name="'.$self->name.'_prev_'.$fn.'" value="<-" />
39 <input class="del_btn" type="submit" name="'.$self->name.'_next_'.$fn.'" value="->" /><br />
40 <img src="'.$dir.$fn.'" class="galerie_image" border="0"/>
41 '.$label.'
42 </td>'."\n";
43 }else{
44 $result.='<td><img src="'.$dir.$fn.'" border="0"/></td>'."\n";
45 }
46 }
47 if ($self->noimgs){ $result.='<td>'.$fn.'</td>'."\n";}
48 }
49  
50 $result.='</tr></table></div>';
51  
52 $result='' if ($nr_obj ==0);
53 $result= $self->vor($options).$result.$self->nach if ($self->check_param('norow')==0);
54 return $result;
55 }
56  
57 sub init{
58 my ($self)=@_;
59 my $name=$self->name;
60 }
61  
62 sub get_dbix{
63 my ($self)=@_;
64 return 0;
65 }
66  
67 1;
68  
69  
70 __END__