Revision 3 (by ahitrov@rambler.ru, 2010/03/24 15:19:32) The CORE
<%args>

	$name => undef
	$SETS => undef

</%args>
<%init>

	return 	undef	if (! ref($SETS));
	return 	undef	if (! $name);

	my $FIELDS = {};
	for my $element (%{ $SETS })
	{
		if ($element =~ /^${name}_(\d+)\.selectrusname$/)
		{
			$FIELDS->{$name.'_'.$1} = {}		if (! exists($FIELDS->{$name.'_'.$1}));
			$FIELDS->{$name.'_'.$1}->{rusname} = $m->comp('/contenido/components/filter.msn', str => $SETS->{$element} );
		} elsif ($element =~ /^${name}_(\d+)\.selectdata$/)
		{
			my $lvalues = $m->comp('/contenido/components/filter.msn', str => $SETS->{$element});
			$FIELDS->{$name.'_'.$1} = {}		if (! exists($FIELDS->{$name.'_'.$1}));
			my @values = split(/[\n\r]+/, $lvalues);

			$FIELDS->{$name.'_'.$1}->{values} = \@values;
		}
	}
	{
		local $Data::Dumper::Indent = 0;
		return Data::Dumper::Dumper($FIELDS);
	}

</%init>