# Listenlaenge festlegen
$c->stash->{'list_length'} = $c->session->{'list_length'} || $c->config->{'default_list_length'} || 20;
-
+
+ # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
+ $c->stash->{'books_in_other_list'} = $c->session->{'books_in_other_list'} || $c->config->{'default_count_books_in_other_list'} || 10;
1;
=item I<list_length>: die aktuelle Listenlaenge
+=item I<books_in_other_list>: Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
+
=back
=cut
delete $c->session->{'book_list_page'} if exists $c->session->{'book_list_page'};
}
+ # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste festlegen
+ $length = $c->request->params->{'books_in_other_list'};
+ if ( $length and to_int( $length ) ) {
+ $length = to_int( $length );
+ $length = 2 if $length < 2;
+ $length = 100 if $length > 100;
+ $c->session->{'books_in_other_list'} = $length;
+ $c->stash->{'books_in_other_list'} = $length;
+ }
+
save_user_prefs($c) if $c->user_exists();
}
my $prefs = {};
+ # allgemeine Listenlänge
$prefs->{'list_length'} = $c->stash->{'list_length'};
+
+ # Sortierkriterien der Buchliste
$prefs->{'book_order_criteria'} = $c->session->{'book_order_criteria'} if $c->session->{'book_order_criteria'};
+ # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
+ $prefs->{'books_in_other_list'} = $c->stash->{'books_in_other_list'};
+
my $dump = Dump($prefs);
$c->model('Schema::UserAdd')->search( { 'user_id' => $user_id } )->update( { 'prefs' => $dump } ) ;
return unless $prefs;
if ( $prefs->{'list_length'} ) {
+
+ # Seite der Buchliste
delete $c->session->{'book_list_page'} if exists $c->session->{'book_list_page'};
- $c->stash->{'list_length'} = $prefs->{'list_length'};
- $c->session->{'list_length'} = $prefs->{'list_length'};
+
+ # allgemeine Listenlänge
+ if ( $prefs->{'list_length'} ) {
+ $c->stash->{'list_length'} = $prefs->{'list_length'};
+ $c->session->{'list_length'} = $prefs->{'list_length'};
+ }
+
+ # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
+ if ( $prefs->{'books_in_other_list'} ) {
+ $c->stash->{'books_in_other_list'} = $prefs->{'books_in_other_list'};
+ $c->session->{'books_in_other_list'} = $prefs->{'books_in_other_list'};
+ }
+
}
+ # Sortierkriterien der Buchliste
$c->session->{'book_order_criteria'} = $prefs->{'book_order_criteria'} if $prefs->{'book_order_criteria'};
return 1;