1 |
616 |
ahitrov |
<%args> |
2 |
|
|
|
3 |
|
|
$sect_id => undef |
4 |
|
|
$size => undef |
5 |
|
|
|
6 |
|
|
</%args> |
7 |
|
|
<%init> |
8 |
|
|
|
9 |
|
|
my $redirect = $r->header_in('Referer'); |
10 |
|
|
$redirect =~ s/\?(.+)$//; |
11 |
|
|
if ( $1 ) { |
12 |
|
|
my $params = join '&', grep { $_ !~ /^p=\d+/ } split /\&/, $1; |
13 |
|
|
$redirect .= '?'.$params; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
my $section; |
17 |
|
|
if ( $sect_id && $sect_id =~ /^\d+$/ ) { |
18 |
|
|
$section = $keeper->get_section_by_id( $sect_id ); |
19 |
|
|
} |
20 |
|
|
if ( ref $section && !$section->_sorted && $size && $size =~ /^\d+$/ ) { |
21 |
|
|
$section->_page_size( $size ); |
22 |
|
|
$section->store; |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
$m->redirect( $redirect ); |
26 |
|
|
|
27 |
|
|
</%init> |