1 |
3 |
ahitrov@rambler.ru |
<& "/contenido/components/header.msn", title => '��������� '.$PROTOS->{$proto}->[0] &> |
2 |
|
|
|
3 |
|
|
<br> |
4 |
|
|
<table border="0" style="font-size:85%;" width="80%"> |
5 |
|
|
<tr> |
6 |
|
|
<td width="10"></td> |
7 |
|
|
<td> |
8 |
|
|
<div style="font-size:130%;">��������� <% $PROTOS->{$proto}->[0] %></div> |
9 |
|
|
<br> |
10 |
|
|
���� ��������� ��� ����, ������� �� ������ ��������� � ������ <% $PROTOS->{$proto}->[1] %> "<% $class %>". |
11 |
|
|
��������� ������������� ���� � ������� ������ [���������].<br><br> |
12 |
|
|
|
13 |
|
|
��� �������������� �������� �������� ��������� ��������� ������� - ���� ������ �������� � ���� ���� ������� ��� ������. |
14 |
|
|
������ ������ �������� ��������������� ����� ������ - ��������� ������� � ������� ������� ��� ����������. |
15 |
|
|
</td> |
16 |
|
|
</tr> |
17 |
|
|
|
18 |
|
|
<tr><td height="20"></td></tr> |
19 |
|
|
|
20 |
|
|
% if (($class) && (ref($object))) |
21 |
|
|
% { |
22 |
|
|
|
23 |
|
|
<tr><td></td> |
24 |
|
|
<td> |
25 |
|
|
<div style="font-size:130%;">��������� <% $PROTOS->{$proto}->[1] %> "<% $object->class_name %>" (<% $class %>)</div> |
26 |
|
|
<% $object->class_description() %> |
27 |
|
|
</td> |
28 |
|
|
</tr> |
29 |
|
|
|
30 |
|
|
<form action="./tuning.html" method="post"> |
31 |
|
|
<input type="hidden" name="control_charset" value="��������"> |
32 |
|
|
<input type="hidden" name="proto" value="<% $proto %>"> |
33 |
|
|
<input type="hidden" name="class" value="<% $class %>"> |
34 |
|
|
|
35 |
|
|
<tr><td height="20"></td></tr> |
36 |
|
|
<tr> |
37 |
|
|
<td></td><td> |
38 |
|
|
<& "/contenido/components/selects.msn", object=>$object, options=>$options &> |
39 |
|
|
</td> |
40 |
|
|
</tr> |
41 |
|
|
|
42 |
|
|
% if ($proto eq 'links') { |
43 |
|
|
<tr><td height="20"></td></tr> |
44 |
|
|
<tr> |
45 |
|
|
<td></td><td> |
46 |
|
|
<& "/contenido/components/link_source_id.msn", object=>$object, options=>$options &> |
47 |
|
|
</td> |
48 |
|
|
</tr> |
49 |
|
|
% } |
50 |
|
|
|
51 |
|
|
<tr><td height="20"></td></tr> |
52 |
|
|
<tr> |
53 |
|
|
<td></td><td> |
54 |
|
|
<& "/contenido/components/obj_lists.msn", object=>$object, options=>$options &> |
55 |
|
|
</td> |
56 |
|
|
</tr> |
57 |
|
|
|
58 |
|
|
<tr><td></td><td> |
59 |
|
|
<input type="submit" value="��������� ���������" style="font-size:13pt;font-weight:bold; height:40px;margin-bottom: 5px; background-color:#930300;color:#FFFFFF;"> |
60 |
|
|
<input type="hidden" name="save" value="1"> |
61 |
|
|
</td></tr> |
62 |
|
|
</form> |
63 |
|
|
|
64 |
|
|
% } |
65 |
|
|
|
66 |
|
|
</table> |
67 |
|
|
</body> |
68 |
|
|
</html> |
69 |
|
|
<%ARGS> |
70 |
|
|
|
71 |
|
|
$proto => undef |
72 |
|
|
$class => undef |
73 |
|
|
$save => undef |
74 |
|
|
|
75 |
|
|
</%ARGS> |
76 |
|
|
<%INIT> |
77 |
|
|
|
78 |
|
|
use vars qw($keeper $request); |
79 |
|
|
|
80 |
|
|
my $PROTOS = { |
81 |
|
|
'documents' => ['����������','���������'], |
82 |
|
|
'sections' => ['������','������'], |
83 |
|
|
'links' => ['������','�����'], |
84 |
|
|
'users' => ['�������������','������������'], |
85 |
|
|
'locals' => ['��������� �������', '���������� ������'], |
86 |
|
|
}; |
87 |
|
|
if (! exists($PROTOS->{$proto})) |
88 |
|
|
{ |
89 |
|
|
$proto = 'documents'; |
90 |
|
|
} |
91 |
|
|
|
92 |
|
|
# �������� ������������ ������... |
93 |
|
|
my @correct_classes = @{ $state->{'available_'.$proto} }; |
94 |
|
|
if (! (grep { $_ eq $class } @correct_classes)) |
95 |
|
|
{ |
96 |
|
|
# ����� �����, �� �� �� ���������� |
97 |
|
|
$class = undef; |
98 |
|
|
} |
99 |
|
|
my $options; |
100 |
|
|
my $object; |
101 |
|
|
|
102 |
|
|
|
103 |
|
|
# ���������� ���������!!! |
104 |
|
|
if (($save == 1) && ($class)) |
105 |
|
|
{ |
106 |
|
|
my $toopi = $project->$proto(); |
107 |
|
|
if ((ref($toopi) eq 'HASH') && (exists($toopi->{$class})) ) |
108 |
|
|
{ |
109 |
|
|
$options = $toopi->{ $class }; |
110 |
|
|
} else { |
111 |
|
|
$options = {}; |
112 |
|
|
} |
113 |
|
|
|
114 |
|
|
$request->{local_codepage} = 'KOI8'; |
115 |
|
|
$request->{local_codepage} = 'WIN' if Convert::Cyrillic::cstocs('WIN', 'KOI8', $ARGS{control_charset}) eq '��������'; |
116 |
|
|
$request->{local_codepage} = 'UTF8' if Convert::Cyrillic::cstocs('UTF8', 'KOI8', $ARGS{control_charset}) eq '��������'; |
117 |
|
|
warn "Contenido Debug: ����� ��� �������������� �������� ������� ������ � ��������� ".$request->{local_codepage}."\n" if ($state->debug()); |
118 |
|
|
|
119 |
|
|
foreach my $attr (keys(%ARGS)) |
120 |
|
|
{ |
121 |
|
|
if ($attr =~ /^(.+)\.selectdata$/) |
122 |
|
|
{ |
123 |
|
|
my $local_select = $1; |
124 |
|
|
my @local_values = split(/\n/, $m->comp('/contenido/components/filter.msn', str => $ARGS{$attr} )); |
125 |
|
|
$options->{$local_select} = \@local_values; |
126 |
|
|
} |
127 |
|
|
} |
128 |
|
|
|
129 |
|
|
foreach my $attr (keys(%ARGS)) |
130 |
|
|
{ |
131 |
|
|
if ($attr =~ /^(.+)\.obj_list_root$/) |
132 |
|
|
{ |
133 |
|
|
my $local_obj_list = $1; |
134 |
|
|
my $local_value = $ARGS{$attr}; |
135 |
|
|
$options->{$local_obj_list}->[0] = $local_value; |
136 |
|
|
} |
137 |
|
|
elsif ($attr =~ /^(.+)\.obj_list_classes$/) |
138 |
|
|
{ |
139 |
|
|
my $local_obj_list = $1; |
140 |
|
|
my @local_values = (); |
141 |
|
|
if (ref($ARGS{$attr}) eq 'ARRAY') |
142 |
|
|
{ |
143 |
|
|
@local_values = @{ $ARGS{$attr} }; |
144 |
|
|
} else { |
145 |
|
|
@local_values = ( $ARGS{$attr} ); |
146 |
|
|
} |
147 |
|
|
$options->{ $local_obj_list }->[1] = join(',',@local_values); |
148 |
|
|
} |
149 |
|
|
} |
150 |
|
|
$toopi->{ $class } = $options; |
151 |
|
|
$project->$proto($toopi); |
152 |
|
|
$project->store($keeper); |
153 |
|
|
} |
154 |
|
|
|
155 |
|
|
|
156 |
|
|
if ($class) |
157 |
|
|
{ |
158 |
|
|
$object = new $class ($keeper); |
159 |
|
|
my $toopi = $project->$proto(); |
160 |
|
|
if ((ref($toopi) eq 'HASH') && (exists($toopi->{$class})) ) |
161 |
|
|
{ |
162 |
|
|
$options = $toopi->{ $class }; |
163 |
|
|
} else { |
164 |
|
|
$options = {}; |
165 |
|
|
} |
166 |
|
|
} |
167 |
|
|
|
168 |
|
|
</%INIT> |