Revision 9aaadfdc
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Presenter/Part.pm | ||
---|---|---|
19 | 19 |
} |
20 | 20 |
|
21 | 21 |
1; |
22 |
|
|
23 |
__END__ |
|
24 |
|
|
25 |
=encoding utf-8 |
|
26 |
|
|
27 |
=head1 NAME |
|
28 |
|
|
29 |
SL::Presenter::Part - Part lelated presenter stuff |
|
30 |
|
|
31 |
=head1 SYNOPSIS |
|
32 |
|
|
33 |
see L<SL::Presenter> |
|
34 |
|
|
35 |
=head1 DESCRIPTION |
|
36 |
|
|
37 |
see L<SL::Presenter> |
|
38 |
|
|
39 |
=head1 FUNCTIONS |
|
40 |
|
|
41 |
=over 4 |
|
42 |
|
|
43 |
=item C<part_picker NAME, VALUE, PARAMS> |
|
44 |
|
|
45 |
All-in-one picker widget for parts. The name will be both id and name of the |
|
46 |
resulting hidden C<id> input field. An additional dummy input will be generated |
|
47 |
which is used to find parts. For a detailed description of it's behaviour, see |
|
48 |
section C<PART PICKER SPECIFICATION>. |
|
49 |
|
|
50 |
C<VALUE> can be an id or C<Rose::DB:Object> instance. |
|
51 |
|
|
52 |
If C<PARAMS> contains C<type> only parts of this type will be used for autocompletion. |
|
53 |
|
|
54 |
|
|
55 |
=back |
|
56 |
|
|
57 |
=head1 BUGS |
|
58 |
|
|
59 |
None yet :) |
|
60 |
|
|
61 |
=head1 AUTHOR |
|
62 |
|
|
63 |
Sven Schöling E<lt>s.schoeling@linet-services.deE<gt> |
|
64 |
|
|
65 |
=cut |
SL/Template/Plugin/L.pm | ||
---|---|---|
66 | 66 |
sub input_tag { return _call_presenter('input_tag', @_); } |
67 | 67 |
sub truncate { return _call_presenter('truncate', @_); } |
68 | 68 |
sub simple_format { return _call_presenter('simple_format', @_); } |
69 |
sub part_picker { return _call_presenter('part_picker', @_); } |
|
69 | 70 |
|
70 | 71 |
sub _set_id_attribute { |
71 | 72 |
my ($attributes, $name) = @_; |
... | ... | |
491 | 492 |
return SL::Presenter->get->render('common/paginate', %template_params); |
492 | 493 |
} |
493 | 494 |
|
494 |
sub part_picker { |
|
495 |
my ($self, $name, $value, %params) = _hashify(3, @_); |
|
496 |
my $name_e = _H($name); |
|
497 |
|
|
498 |
my $ret = $self->hidden_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => 'part_autocomplete') . |
|
499 |
$self->hidden_tag("", delete $params{type}, id => $self->name_to_id("$name_e\_type")) . |
|
500 |
$self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => $self->name_to_id("$name_e\_name"), %params) . |
|
501 |
$self->hidden_tag("", delete $params{column}, id => $self->name_to_id("$name_e\_column")); |
|
502 |
|
|
503 |
$self->html_tag('span', $ret, class => 'part_picker'); |
|
504 |
} |
|
505 |
|
|
506 | 495 |
1; |
507 | 496 |
|
508 | 497 |
__END__ |
Auch abrufbar als: Unified diff
Doku, picker nach Presenter verschoben