Revision 04854ac2
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Template/Plugin/L.pm | ||
---|---|---|
377 | 377 |
: $self->input_tag($name, $value, %attributes); |
378 | 378 |
} |
379 | 379 |
|
380 |
sub multiselect2side { |
|
381 |
my ($self, $id, @slurp) = @_; |
|
382 |
my %params = _hashify(@slurp); |
|
383 |
|
|
384 |
$params{labelsx} = "\"" . _J($params{labelsx} || $::locale->text('Available')) . "\""; |
|
385 |
$params{labeldx} = "\"" . _J($params{labeldx} || $::locale->text('Selected')) . "\""; |
|
386 |
$params{moveOptions} = 'false'; |
|
387 |
|
|
388 |
my $vars = join(', ', map { "${_}: " . $params{$_} } keys %params); |
|
389 |
my $code = <<EOCODE; |
|
390 |
<script type="text/javascript"> |
|
391 |
\$().ready(function() { |
|
392 |
\$('#${id}').multiselect2side({ ${vars} }); |
|
393 |
}); |
|
394 |
</script> |
|
395 |
EOCODE |
|
396 |
|
|
397 |
return $code; |
|
398 |
} |
|
399 |
|
|
380 | 400 |
1; |
381 | 401 |
|
382 | 402 |
__END__ |
... | ... | |
545 | 565 |
You can force input by setting rows to 1, and you can force textarea by setting |
546 | 566 |
rows to anything >1. |
547 | 567 |
|
568 |
=item C<multiselect2side $id, %params> |
|
569 |
|
|
570 |
Creates a JavaScript snippet calling the jQuery function |
|
571 |
C<multiselect2side> on the select control with the ID C<$id>. The |
|
572 |
select itself is not created. C<%params> can contain the following |
|
573 |
entries: |
|
574 |
|
|
575 |
=over 2 |
|
576 |
|
|
577 |
=item C<labelsx> |
|
578 |
|
|
579 |
The label of the list of available options. Defaults to the |
|
580 |
translation of 'Available'. |
|
581 |
|
|
582 |
=item C<labeldx> |
|
583 |
|
|
584 |
The label of the list of selected options. Defaults to the |
|
585 |
translation of 'Selected'. |
|
586 |
|
|
587 |
=back |
|
588 |
|
|
548 | 589 |
=back |
549 | 590 |
|
550 | 591 |
=head2 CONVERSION FUNCTIONS |
Auch abrufbar als: Unified diff
Layout-Helfer für multiselect2side