From 9aaadfdc06efbfb31f70c32cdf6aacf2f8a136f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 10 Jul 2013 15:27:37 +0200 Subject: [PATCH] Doku, picker nach Presenter verschoben --- SL/Presenter/Part.pm | 44 +++++++++++++++++++++++++++++++++++++++++ SL/Template/Plugin/L.pm | 13 +----------- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index 99a6f14e9..25d682037 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -19,3 +19,47 @@ sub part_picker { } 1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Presenter::Part - Part lelated presenter stuff + +=head1 SYNOPSIS + +see L + +=head1 DESCRIPTION + +see L + +=head1 FUNCTIONS + +=over 4 + +=item C + +All-in-one picker widget for parts. The name will be both id and name of the +resulting hidden C input field. An additional dummy input will be generated +which is used to find parts. For a detailed description of it's behaviour, see +section C. + +C can be an id or C instance. + +If C contains C only parts of this type will be used for autocompletion. + + +=back + +=head1 BUGS + +None yet :) + +=head1 AUTHOR + +Sven Schöling Es.schoeling@linet-services.deE + +=cut diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 72cad2fa4..78efe642a 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -66,6 +66,7 @@ sub select_tag { return _call_presenter('select_tag', @_); } sub input_tag { return _call_presenter('input_tag', @_); } sub truncate { return _call_presenter('truncate', @_); } sub simple_format { return _call_presenter('simple_format', @_); } +sub part_picker { return _call_presenter('part_picker', @_); } sub _set_id_attribute { my ($attributes, $name) = @_; @@ -491,18 +492,6 @@ sub paginate_controls { return SL::Presenter->get->render('common/paginate', %template_params); } -sub part_picker { - my ($self, $name, $value, %params) = _hashify(3, @_); - my $name_e = _H($name); - - my $ret = $self->hidden_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => 'part_autocomplete') . - $self->hidden_tag("", delete $params{type}, id => $self->name_to_id("$name_e\_type")) . - $self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => $self->name_to_id("$name_e\_name"), %params) . - $self->hidden_tag("", delete $params{column}, id => $self->name_to_id("$name_e\_column")); - - $self->html_tag('span', $ret, class => 'part_picker'); -} - 1; __END__ -- 2.20.1