Revision 1edebcf0
Von Werner Hahn vor etwa 6 Jahren hinzugefügt
SL/Controller/TopQuickSearch.pm | ||
---|---|---|
70 | 70 |
namespace => 'TopQuickSearch', |
71 | 71 |
); |
72 | 72 |
|
73 |
my %enabled_names;
|
|
73 |
my @quick_search_modules;
|
|
74 | 74 |
if (my $prefs_val = $user_prefs->get('quick_search_modules')) { |
75 |
my @quick_search_modules = split ',', $prefs_val; |
|
76 |
|
|
77 |
%enabled_names = map { |
|
78 |
$_ => 1 |
|
79 |
} @quick_search_modules ; |
|
75 |
@quick_search_modules = split ',', $prefs_val; |
|
80 | 76 |
} else { |
81 |
%enabled_names = map { |
|
82 |
$_ => 1 |
|
83 |
} @{ $::instance_conf->get_quick_search_modules }; |
|
77 |
@quick_search_modules = @{ $::instance_conf->get_quick_search_modules }; |
|
84 | 78 |
} |
85 | 79 |
|
80 |
my %enabled_names = map { $_ => 1 } @quick_search_modules; |
|
81 |
|
|
86 | 82 |
grep { |
87 | 83 |
$enabled_names{$_->name} |
88 | 84 |
} $_[0]->available_modules |
SL/Form.pm | ||
---|---|---|
434 | 434 |
jquery jquery-ui jquery.cookie jquery.checkall jquery.download |
435 | 435 |
jquery/jquery.form jquery/fixes client_js |
436 | 436 |
jquery/jquery.tooltipster.min |
437 |
jquery.multiselect2side |
|
438 | 437 |
common part_selection |
439 | 438 |
), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); |
440 | 439 |
|
bin/mozilla/am.pl | ||
---|---|---|
656 | 656 |
} |
657 | 657 |
|
658 | 658 |
my $enabled_quick_search = [ SL::Controller::TopQuickSearch->new->available_modules ]; |
659 |
$form->{ENABLED_QUICK_SEARCHMODULES} = \@{$enabled_quick_search};
|
|
660 |
$form->{DEFAULT_QUICK_SEARCHMODULES} = \@quick_search_modules;
|
|
659 |
$form->{enabled_quick_searchmodules} = \@{$enabled_quick_search};
|
|
660 |
$form->{default_quick_searchmodules} = \@quick_search_modules;
|
|
661 | 661 |
|
662 | 662 |
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); |
663 | 663 |
$form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); |
664 | 664 |
$form->{todo_cfg} = { TODO->get_user_config('login' => $::myconfig{login}) }; |
665 | 665 |
|
666 |
$::request->{layout}->use_javascript("jquery.multiselect2side.js"); |
|
666 | 667 |
$form->{title} = $locale->text('Edit Preferences for #1', $::myconfig{login}); |
667 | 668 |
|
668 | 669 |
setup_am_config_action_bar(); |
... | ... | |
686 | 687 |
|
687 | 688 |
TODO->save_user_config('login' => $::myconfig{login}, %{ $form->{todo_cfg} || { } }); |
688 | 689 |
|
689 |
my $user_prefs = SL::Helper::UserPreferences->new( |
|
690 |
namespace => 'TopQuickSearch', |
|
691 |
); |
|
692 |
my $quick_search_modules = join ',', @{$form->{quick_search_modules}}; |
|
693 |
$user_prefs->store('quick_search_modules', $quick_search_modules); |
|
694 |
|
|
690 |
if ($form->{quick_search_modules}) { |
|
691 |
my $user_prefs = SL::Helper::UserPreferences->new( namespace => 'TopQuickSearch',); |
|
692 |
my $quick_search_modules = join ',', @{$form->{quick_search_modules}}; |
|
693 |
$user_prefs->store('quick_search_modules', $quick_search_modules); |
|
694 |
} |
|
695 | 695 |
if (AM->save_preferences($form)) { |
696 | 696 |
if ($::auth->can_change_password() |
697 | 697 |
&& defined $form->{new_password} |
templates/webpages/am/config.html | ||
---|---|---|
2 | 2 |
[%- USE LxERP %] |
3 | 3 |
[%- USE HTML %] |
4 | 4 |
[%- USE L %] |
5 |
[% USE Dumper %] |
|
5 |
|
|
6 | 6 |
<h1>[% title %]</h1> |
7 | 7 |
|
8 | 8 |
<form method="post" action="am.pl" name="Form" id="form"> |
... | ... | |
168 | 168 |
<td colspan=2> |
169 | 169 |
<div class="clearfix"> |
170 | 170 |
[% L.select_tag("quick_search_modules[]", |
171 |
ENABLED_QUICK_SEARCHMODULES,
|
|
171 |
enabled_quick_searchmodules,
|
|
172 | 172 |
value_key = "name", |
173 | 173 |
title_key = "description_config", |
174 | 174 |
id = "quick_searches", |
175 | 175 |
multiple = 1, |
176 | 176 |
with_empty = 1 |
177 |
size = ENABLED_QUICK_SEARCHMODULES.size, |
|
178 |
default = DEFAULT_QUICK_SEARCHMODULES) %] |
|
179 |
[% # L.multiselect2side("quick_searches", labelsx=LxERP.t8("All modules"), labeldx=LxERP.t8("Enabled modules")) %] |
|
177 |
size = enabled_quick_searchmodules.size, |
|
178 |
default = default_quick_searchmodules) %] |
|
180 | 179 |
</div> |
181 | 180 |
</td> |
182 | 181 |
</tr> |
Auch abrufbar als: Unified diff
TopQuickSearch: UserPreferences kleinere Syntaxverbesserungen