1 |
8 |
ahitrov@rambler.ru |
<%ARGS> |
2 |
|
|
|
3 |
|
|
$s => undef |
4 |
|
|
$id => undef |
5 |
|
|
$move => undef |
6 |
|
|
$p => 1 |
7 |
|
|
$use_section => undef |
8 |
|
|
$class => undef |
9 |
|
|
|
10 |
|
|
</%ARGS> |
11 |
|
|
<%INIT> |
12 |
|
|
|
13 |
|
|
my $sect; |
14 |
|
|
if ($s && ($s !~ /\D/) && ($s > 0)) { |
15 |
|
|
$sect = $keeper->get_section_by_id($s); |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
my %filter_params; |
19 |
|
|
$filter_params{use_section} = $ARGS{use_section} if $ARGS{use_section}; |
20 |
|
|
$filter_params{class} = $ARGS{class} if $ARGS{class}; |
21 |
|
|
$filter_params{alpha} = $ARGS{alpha} if $ARGS{alpha}; |
22 |
|
|
$filter_params{alpha_search} = $ARGS{alpha_search} if $ARGS{alpha_search}; |
23 |
|
|
$filter_params{search_by} = $ARGS{search_by} if $ARGS{search_by}; |
24 |
|
|
$filter_params{search} = $ARGS{search} if $ARGS{search}; |
25 |
|
|
$filter_params{p} = $ARGS{p} if $ARGS{p} && $ARGS{p} > 1; |
26 |
|
|
my $return_params = join ('&', map { $_.'='.$filter_params{$_} } keys %filter_params ); |
27 |
|
|
|
28 |
284 |
ahitrov |
# Перемещение... |
29 |
8 |
ahitrov@rambler.ru |
if ($move && $id && ($id !~ /\D/) && ($id > 0)) { |
30 |
|
|
$sect->dmove($id, $move); |
31 |
|
|
my @params; |
32 |
|
|
push @params, 'id='.$s if $s; |
33 |
|
|
push @params, 'p='.$p if $p > 1; |
34 |
|
|
push @params, 'class='.$class if $class; |
35 |
|
|
push @params, 'use_section='.$use_section if $use_section; |
36 |
|
|
$m->redirect($s ? "sections.html?id=".$s.( $return_params ? '&'.$return_params : '' ) : 'index.html'); |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
</%INIT> |