| lib/Jifty/Plugin/Media/Widget.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 9 | 9 | 100.0 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 3 | 3 | 100.0 |
| pod | n/a | ||
| total | 12 | 12 | 100.0 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 2388 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 31 | ||||||
| 2 | 1 | 1 | 4 | use warnings; | |||
| 1 | 2 | ||||||
| 1 | 30 | ||||||
| 3 | |||||||
| 4 | package Jifty::Plugin::Media::Widget; | ||||||
| 5 | 1 | 1 | 4 | use base qw/Jifty::Web::Form::Field/; | |||
| 1 | 1 | ||||||
| 1 | 583 | ||||||
| 6 | |||||||
| 7 | =head1 NAME | ||||||
| 8 | |||||||
| 9 | Jifty::Plugin::Media::Widget - widget for managing files in Jifty | ||||||
| 10 | |||||||
| 11 | =head2 render_widget | ||||||
| 12 | |||||||
| 13 | html widget | ||||||
| 14 | |||||||
| 15 | =cut | ||||||
| 16 | |||||||
| 17 | sub render_widget { | ||||||
| 18 | my $self = shift; | ||||||
| 19 | my $field; | ||||||
| 20 | |||||||
| 21 | my $element_id = "@{[ $self->element_id ]}"; | ||||||
| 22 | $element_id=~s/://g; | ||||||
| 23 | |||||||
| 24 | my $current_value = $self->current_value || ''; | ||||||
| 25 | |||||||
| 26 | $field .= qq! !; |
||||||
| 27 | $field .= qq! | ||||||
| 28 | $field .= qq! name="@{[ $self->input_name ]}"!; | ||||||
| 29 | $field .= qq! type="text" value="$current_value" />!; | ||||||
| 30 | my $folder = 'f'.$element_id; | ||||||
| 31 | $field .= qq! !; | ||||||
| 32 | |||||||
| 33 | $field .= <<"EOF"; | ||||||
| 34 | |||||||
| 47 | EOF | ||||||
| 48 | |||||||
| 49 | Jifty->web->out($field); | ||||||
| 50 | ''; | ||||||
| 51 | }; | ||||||
| 52 | |||||||
| 53 | =head1 AUTHOR | ||||||
| 54 | |||||||
| 55 | Yves Agostini, |
||||||
| 56 | |||||||
| 57 | =head1 LICENSE | ||||||
| 58 | |||||||
| 59 | Copyright 2010, Yves Agostini. | ||||||
| 60 | |||||||
| 61 | This program is free software and may be modified and distributed under the same terms as Perl itself. | ||||||
| 62 | |||||||
| 63 | =cut | ||||||
| 64 | |||||||
| 65 | |||||||
| 66 | 1; | ||||||
| 67 |