Line # Revision Author
1 3 ahitrov@rambler.ru <%args>
2
3 $name => undef
4 $SETS => undef
5
6 </%args>
7 <%init>
8
9 return undef if (! ref($SETS));
10 return undef if (! $name);
11
12 my $FIELDS = {};
13 for my $element (%{ $SETS })
14 {
15 if ($element =~ /^${name}_(\d+)\.selectrusname$/)
16 {
17 $FIELDS->{$name.'_'.$1} = {} if (! exists($FIELDS->{$name.'_'.$1}));
18 $FIELDS->{$name.'_'.$1}->{rusname} = $m->comp('/contenido/components/filter.msn', str => $SETS->{$element} );
19 } elsif ($element =~ /^${name}_(\d+)\.selectdata$/)
20 {
21 my $lvalues = $m->comp('/contenido/components/filter.msn', str => $SETS->{$element});
22 $FIELDS->{$name.'_'.$1} = {} if (! exists($FIELDS->{$name.'_'.$1}));
23 my @values = split(/[\n\r]+/, $lvalues);
24
25 $FIELDS->{$name.'_'.$1}->{values} = \@values;
26 }
27 }
28 {
29 local $Data::Dumper::Indent = 0;
30 return Data::Dumper::Dumper($FIELDS);
31 }
32
33 </%init>