Line # Revision Author
1 3 ahitrov@rambler.ru <!-- ����� ��� �������������� ������� -->
2 <a name="top"></a>
3 285 ahitrov <form enctype="multipart/form-data" action="<% $PROTOS->{$proto}->[1] %>" method="POST" name="form" onSubmit="return Save(this)">
4 3 ahitrov@rambler.ru <table border="0" width="100%" cellspacing="0" cellpadding="6">
5 <tr>
6 <td style="font-size:110%;">
7 <b><% (ref($object) && $object->id() ) ? '��������������' : '��������' %> <% $PROTOS->{$proto}->[0] %> ���� "<% $object->class_name() %>"</b>
8 </td>
9 <td align="right">
10 % unless ( $proto eq 'sections' && $object->id == 1 ) {
11 <input type="submit" value="���������" class="input_btn">
12 % if (( $proto eq 'documents' ) || ( $proto eq 'sections' )) {
13 <input type="submit" name="_save_and_leave" value="��������� � �����" class="input_btn">
14 <input type="submit" name="_save_and_again" value="��������� � ������� �����" class="input_btn">
15 % }
16 % }
17 </td>
18 </tr>
19 </table>
20
21 % if ( $m->comp_exists ('/contenido/components/object_context_menu.msn') ) {
22 <div style="text-align:right;"><& '/contenido/components/object_context_menu.msn', object => $object &></div>
23 % }
24
25 <center>
26 <table width="100%" cellpadding="0" cellspacing="0" border="0">
27 <tr>
28 <td bgcolor="#999999">
29 <table width="100%" cellpadding="0" cellspacing="1" border="0">
30 <tr><td valign="top" width="80%" bgcolor="#ffffff">
31 <center>
32 <table width="98%" cellpadding="1" cellspacing="0" border="0">
33
34 <%perl>
35
36 my @properties = $object->structure();
37
38 for (0..$#properties)
39 {
40
41 my $prop = $properties[$_];
42 527 ahitrov next if ($prop->{hidden} == 1) || ($prop->{type} eq 'external') || ($prop->{type} =~ /^array/i) || ($prop->{type} =~ /^image/) || ($prop->{type} eq 'multimedia') || ($prop->{type} eq 'multimedia_new') || ($prop->{type} eq 'multimedia_multi') || ($prop->{type} eq 'audio');
43 3 ahitrov@rambler.ru
44 </%perl>
45 <tr><td height="8"></td></tr>
46 <tr><td nowrap>
47 <table cellpadding="0" cellspacing="0" border="0">
48 <tr>
49 % if( ( $prop->{type} eq 'flag' ) || ($prop->{type} eq 'checkbox') )
50 % {
51 <td><& "/contenido/components/inputs/checkbox.msn", prop => $prop, object=>$object, options=>$options, name => $prop->{attr}, check => $object->{$prop->{attr}}, id => $object->id() &></td>
52 % }
53 <td nowrap><b><% $prop->{rusname} %></b>&nbsp;/</td>
54 <td align="right" nowrap><font color="#888888" size="-1">&nbsp;name="<% $prop->{attr} %>"</font></td>
55 % if( $prop->{readonly} )
56 % {
57 <td align="right" nowrap>&nbsp;/&nbsp;<font color="#CC0000" size="-1">�������� ������ ��������</font></td>
58 % }
59 </tr>
60 </table>
61 </td></tr>
62 % if ($prop->{type} eq 'parent')
63 % {
64 <tr><td><& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options=>$options, name => $prop->{attr}, check => ($object->{$prop->{attr} } || $prop->{default} || $sect_id ), id => $object->id() &></td></tr>
65 % }
66 % elsif( ( $prop->{type} ne 'flag' ) && ($prop->{type} ne 'checkbox') )
67 % {
68 <tr><td><& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options => $options, name => $prop->{attr}, check => $object->{$prop->{attr}}, id => ($object->id() || 0) &></td></tr>
69 % }
70 % }
71 <tr>
72 <td><br>
73
74 % for (0..$#properties)
75 % {
76 % my $prop = $properties[$_];
77 % next if ($prop->{hidden} != 1);
78 % next if ($prop->{attr} eq 'id' && $clone);
79 <input type="hidden" name="<% $prop->{attr} %>" value="<% html_escape($object->{ $prop->{attr} }) %>">
80 % }
81 <input type="hidden" name="sect_id" value="<% $sect_id %>">
82 %#���� ������ � ��������� ������� ��� ��� ����� ���� ��� ���������� ��� hidden
83 % unless (grep {$_->{attr} eq 'class'} @properties) {
84 <input type="hidden" name="class" value="<% html_escape($object->{class}) %>">
85 % }
86 % if ( $clone ) {
87 <input type="hidden" name="clone" value="<% $object->id %>">
88 % }
89 <input type="hidden" name="save" value="1">
90
91 </td>
92 </tr>
93 </table>
94 </center>
95
96 </td>
97 <td valign="top" bgcolor="#efefef">
98 <div style="width:270px"><spacer type="block" width="270"></div>
99 <div><iframe name="DocFinder" id="DocFinder" src="/contenido/find_document.html" frameborder="0"
100 marginheight="0" marginwidth="0" width="100%" height="0"></iframe></div>
101 <table cellpadding="5" cellspacing="0" border="0"><tr><td>
102 121 ahitrov <p><b style="font-size:15px;"><nobr>�����������-�������</nobr> �&nbsp;<% $PROTOS->{$proto}->[2] %></b></p>
103 3 ahitrov@rambler.ru
104 % for (0..$#properties)
105 % {
106 % my $prop = $properties[$_];
107 %
108 % if ($prop->{type} eq 'image')
109 % {
110 % my $IMAGE = $object->get_image( $prop->{attr} );
111 % if (ref($IMAGE) ne 'HASH') { next };
112 <& "/contenido/components/inputs/image.msn",
113 IMAGE => $IMAGE,
114 rusname => $prop->{rusname},
115 prop => $prop, object=>$object,
116 attr => $prop->{attr},
117 options => $options,
118 &>
119
120 % } elsif ($prop->{type} eq 'images')
121 % {
122 % my $IMAGES = $object->get_image( $prop->{attr} );
123 % if (ref($IMAGES) ne 'HASH') { next };
124 % my $MN = $IMAGES->{maxnumber}+0;
125 % for my $mn (1..$MN)
126 % {
127 % my $IMAGE = $IMAGES->{'image_'.$mn};
128
129 <& "/contenido/components/inputs/image.msn",
130 rusname => $prop->{rusname},
131 prop => $prop, object=>$object,
132 attr => $prop->{attr}.'_'.$mn,
133 IMAGE => $IMAGE,
134 options => $options,
135 &>
136
137 % }
138 64 ahitrov@rambler.ru % my $ME = exists $prop->{empty_slots} ? $prop->{empty_slots} : 5;
139 % $ME = ($ME + $IMAGES->{maxnumber}) >= 100 ? 0 : (100 - $IMAGES->{maxnumber} < $ME ? 100 - $IMAGES->{maxnumber} : $ME );
140 % for my $mn (1..$ME)
141 3 ahitrov@rambler.ru % {
142
143
144 <& "/contenido/components/inputs/image.msn",
145 IMAGE => {},
146 rusname => $prop->{rusname},
147 prop => $prop, object=>$object,
148 attr => $prop->{attr}.'_'.($MN+$mn),
149 options => $options,
150 &>
151
152 % }
153 527 ahitrov % } elsif ($prop->{type} eq 'multimedia') {
154 3 ahitrov@rambler.ru % my $MULTI = $object->get_image( $prop->{attr} );
155
156 <& "/contenido/components/inputs/multimedia.msn",
157 rusname => $prop->{rusname},
158 prop => $prop, object=>$object,
159 attr => $prop->{attr},
160 MULTI => $MULTI,
161 options => $options,
162 &>
163 526 ahitrov % } elsif ($prop->{type} eq 'multimedia_new') {
164 3 ahitrov@rambler.ru % my $MULTI = $object->get_image( $prop->{attr} );
165
166 <& "/contenido/components/inputs/multimedia_new.msn",
167 rusname => $prop->{rusname},
168 prop => $prop, object=>$object,
169 attr => $prop->{attr},
170 MULTI => $MULTI,
171 options => $options,
172 &>
173 526 ahitrov % } elsif ($prop->{type} eq 'multimedia_multi') {
174 % my $FILES = $object->get_image( $prop->{attr} );
175 % if (ref($FILES) ne 'HASH') { next };
176 % my $MN = $FILES->{maxnumber}+0;
177 % for my $mn (1..$MN) {
178 % my $MULTI = $FILES->{'file_'.$mn};
179 <& "/contenido/components/inputs/multimedia_new.msn",
180 rusname => $prop->{rusname},
181 prop => $prop, object=>$object,
182 attr => $prop->{attr}.'_'.$mn,
183 MULTI => $MULTI,
184 options => $options,
185 &>
186
187 % }
188 % my $ME = exists $prop->{empty_slots} ? $prop->{empty_slots} : 3;
189 % $ME = ($ME + $FILES->{maxnumber}) >= 100 ? 0 : (100 - $FILES->{maxnumber} < $ME ? 100 - $FILES->{maxnumber} : $ME );
190 % for my $mn (1..$ME) {
191
192 <& "/contenido/components/inputs/multimedia_new.msn",
193 rusname => $prop->{rusname},
194 prop => $prop, object=>$object,
195 attr => $prop->{attr}.'_'.($MN+$mn),
196 MULTI => {},
197 options => $options,
198 &>
199
200 % }
201 % } elsif ($prop->{type} eq 'audio') {
202 3 ahitrov@rambler.ru % my $MULTI = $object->get_image( $prop->{attr} );
203
204 <& "/contenido/components/inputs/audio.msn",
205 rusname => $prop->{rusname},
206 prop => $prop, object=>$object,
207 attr => $prop->{attr},
208 MULTI => $MULTI,
209 options => $options,
210 &>
211 % }
212 % }
213
214 </table>
215 </td></tr></table>
216
217
218 </td></tr>
219 </table>
220
221 </td></tr></table>
222 </center>
223
224 <script>
225 <!--
226 function updateList(theFild,value,text) {
227 for (var i = 0; i < theFild.options.length; i++) {
228 if (theFild.options[i].value == value) {
229 return false;
230 }
231 }
232 var option_length = theFild.options.length++;
233 eval("theFild.options[option_length].value=value");
234 eval("theFild.options[option_length].text=text");
235
236 Save(); this.form.submit();
237
238 }
239 //-->
240 </script>
241
242 % unless ( $proto eq 'sections' && $object->id == 1 ) {
243 <div align="center"><input type="submit" value="���������" class="input_btn">
244 %# <input type="submit" value="��������� ��������� � <% $PROTOS->{$proto}->[3] %>" class="input_btn">
245
246 %#
247 %# ��� �� ��������� ��� ��������� �����?
248 %# onClick="javascript:updateList(parent.opener.links.links,'link_6_20_DefaultLink','test');"
249 %#
250
251
252 % if ($object->id > 0 && !$clone) {
253 <input name="delete" type="button" value="�������" onClick="javascript:window.location='confirm.html?id=<% $object->id() %>&action=<% $proto %>_deletion&class=<% $object->class() %>'" class="input_btn">\
254 % }
255 % if ( ref $filter_params eq 'HASH' ) {
256 % while ( my ($key, $value) = each %$filter_params ) {
257 % next if grep { $_->{attr} eq $key } $object->structure();
258 <input type="hidden" name="<% $key %>" value="<% $value %>">
259 % }
260 % }
261 <input type="hidden" name="control_charset" value="��������">
262 % if (( $proto eq 'documents' ) || ( $proto eq 'sections' )) {
263 <input type="submit" name="_save_and_leave" value="��������� � �����" class="input_btn">
264 % unless ( $clone ) {
265 <input type="submit" name="_save_and_again" value="��������� � ������� �����" class="input_btn">
266 % }
267 % }
268 </div>
269 % }
270 </form>
271
272 <%ARGS>
273
274 $proto => 'documents'
275 $object => undef
276 $clone => undef
277 $sect_id => 1
278 $filter_params => undef
279
280 </%ARGS>
281
282 <%ONCE>
283 my $PROTOS = {
284 'documents' => ['���������','document.html','���������','���������'],
285 'sections' => ['������','section.html','������','������'],
286 'links' => ['�����','link.html','�����','�����'],
287 'users' => ['������������','users.html','������������','������������'],
288 };
289 </%ONCE>
290
291 <%INIT>
292 return undef unless ref($object);
293
294 my $toopi = $project->$proto();
295 my $options = {};
296 if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{ $object->class }))) {
297 %{ $options } = %{ $toopi->{ $object->class } };
298 }
299 121 ahitrov my $is_multimedia = scalar( grep { $_->{type} =~ /(image|multimedia|audio)/ } $object->structure );
300 my $is_pickup = scalar( grep { $_->{type} =~ /(pickup)/ } $object->structure );
301
302 </%INIT>