Revision 3 (by ahitrov@rambler.ru, 2010/03/24 15:19:32) The CORE
<& "/contenido/components/header.msn", title => '�������������� ��������' &>

<br>
<table border="0" style="font-size:85%;" width="80%">
<tr>
<td width="10"></td>
<td>
<div style="font-size:130%;">�������������� ��������</div>
������� ������������ �� ���� ����� ����������� ����� �� ������, ��������� � �������������� ���������� ������� ������� � ��������� ������������ ������������� ����������. ����� ������� ���������� ������������ �����, ��������, ����������������, ������������, ���������������� � �.�.
<p>������ ������������ ����� ������ � ��������� ����� ��������. ��� � �������������� ����������� ������.
</td>
</tr>

<tr><td height="20"></td></tr>

<tr><td></td><td> 
<& "/contenido/components/exists_tabs.msn" &>
</td></tr>

<tr><td></td><td>
<& "/contenido/components/new_tab_form.msn" &>
</td></tr>

<tr><td></td><td>
<& "/contenido/components/tab_form.msn", tab=>$tab &>
</td></tr>

</table>

</body>
</html>

<%ARGS>

	$save => undef

	$id	=> undef
	$name	=> undef
	$level	=> 3
	$sections => undef
	$lefts	=> undef

</%ARGS>
<%INIT>

	use vars qw($keeper $request);

	my $toopi = $project->tabs();
	my $tab = {};
	if ($id && (length($id) > 0) && (exists($toopi->{$id})) )
	{
		$tab = $toopi->{$id};
	} elsif ($id && (length($id) > 0) )
	{
		$tab->{id} = $id;
	};

	if ( $save && $id && (length($id) > 0))
	{
		$request->{local_codepage} = 'KOI8';
		$request->{local_codepage} = 'WIN' if Convert::Cyrillic::cstocs('WIN', 'KOI8', $ARGS{control_charset}) eq '��������';
		$request->{local_codepage} = 'UTF8' if Convert::Cyrillic::cstocs('UTF8', 'KOI8', $ARGS{control_charset}) eq '��������';
		warn "Contenido Debug: ����� ��� �������������� �������� ������� ������ � ��������� ".$request->{local_codepage}."\n"		if ($state->debug());

		$tab->{id} = $id;
		$tab->{name} = $m->comp('/contenido/components/filter.msn', str => $name);
		$tab->{level} = $level;
		$tab->{sections} = (ref($sections) ? $sections : [$sections]);
		$tab->{lefts} = (ref($lefts) ? $lefts : [$lefts]);
		$toopi->{$id} = $tab;

		$project->tabs($toopi);
		$project->store($keeper);

		$m->redirect('tabs.html');
	}

</%INIT>