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 526 ahitrov next if ($prop->{hidden} == 1) || ($prop->{type} eq 'image') || ($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 % } elsif ($prop->{type} eq 'multimedia')
154 % {
155 % my $MULTI = $object->get_image( $prop->{attr} );
156
157 <& "/contenido/components/inputs/multimedia.msn",
158 rusname => $prop->{rusname},
159 prop => $prop, object=>$object,
160 attr => $prop->{attr},
161 MULTI => $MULTI,
162 options => $options,
163 &>
164 526 ahitrov % } elsif ($prop->{type} eq 'multimedia_new') {
165 3 ahitrov@rambler.ru % my $MULTI = $object->get_image( $prop->{attr} );
166
167 <& "/contenido/components/inputs/multimedia_new.msn",
168 rusname => $prop->{rusname},
169 prop => $prop, object=>$object,
170 attr => $prop->{attr},
171 MULTI => $MULTI,
172 options => $options,
173 &>
174 526 ahitrov % } elsif ($prop->{type} eq 'multimedia_multi') {
175 % my $FILES = $object->get_image( $prop->{attr} );
176 % if (ref($FILES) ne 'HASH') { next };
177 % my $MN = $FILES->{maxnumber}+0;
178 % for my $mn (1..$MN) {
179 % my $MULTI = $FILES->{'file_'.$mn};
180 <& "/contenido/components/inputs/multimedia_new.msn",
181 rusname => $prop->{rusname},
182 prop => $prop, object=>$object,
183 attr => $prop->{attr}.'_'.$mn,
184 MULTI => $MULTI,
185 options => $options,
186 &>
187
188 % }
189 % my $ME = exists $prop->{empty_slots} ? $prop->{empty_slots} : 3;
190 % $ME = ($ME + $FILES->{maxnumber}) >= 100 ? 0 : (100 - $FILES->{maxnumber} < $ME ? 100 - $FILES->{maxnumber} : $ME );
191 % for my $mn (1..$ME) {
192
193 <& "/contenido/components/inputs/multimedia_new.msn",
194 rusname => $prop->{rusname},
195 prop => $prop, object=>$object,
196 attr => $prop->{attr}.'_'.($MN+$mn),
197 MULTI => {},
198 options => $options,
199 &>
200
201 % }
202 % } elsif ($prop->{type} eq 'audio') {
203 3 ahitrov@rambler.ru % my $MULTI = $object->get_image( $prop->{attr} );
204
205 <& "/contenido/components/inputs/audio.msn",
206 rusname => $prop->{rusname},
207 prop => $prop, object=>$object,
208 attr => $prop->{attr},
209 MULTI => $MULTI,
210 options => $options,
211 &>
212 % }
213 % }
214
215 </table>
216 </td></tr></table>
217
218
219 </td></tr>
220 </table>
221
222 </td></tr></table>
223 </center>
224
225 <script>
226 <!--
227 function updateList(theFild,value,text) {
228 for (var i = 0; i < theFild.options.length; i++) {
229 if (theFild.options[i].value == value) {
230 return false;
231 }
232 }
233 var option_length = theFild.options.length++;
234 eval("theFild.options[option_length].value=value");
235 eval("theFild.options[option_length].text=text");
236
237 Save(); this.form.submit();
238
239 }
240 //-->
241 </script>
242
243 % unless ( $proto eq 'sections' && $object->id == 1 ) {
244 <div align="center"><input type="submit" value="���������" class="input_btn">
245 %# <input type="submit" value="��������� ��������� � <% $PROTOS->{$proto}->[3] %>" class="input_btn">
246
247 %#
248 %# ��� �� ��������� ��� ��������� �����?
249 %# onClick="javascript:updateList(parent.opener.links.links,'link_6_20_DefaultLink','test');"
250 %#
251
252
253 % if ($object->id > 0 && !$clone) {
254 <input name="delete" type="button" value="�������" onClick="javascript:window.location='confirm.html?id=<% $object->id() %>&action=<% $proto %>_deletion&class=<% $object->class() %>'" class="input_btn">\
255 % }
256 % if ( ref $filter_params eq 'HASH' ) {
257 % while ( my ($key, $value) = each %$filter_params ) {
258 % next if grep { $_->{attr} eq $key } $object->structure();
259 <input type="hidden" name="<% $key %>" value="<% $value %>">
260 % }
261 % }
262 <input type="hidden" name="control_charset" value="��������">
263 % if (( $proto eq 'documents' ) || ( $proto eq 'sections' )) {
264 <input type="submit" name="_save_and_leave" value="��������� � �����" class="input_btn">
265 % unless ( $clone ) {
266 <input type="submit" name="_save_and_again" value="��������� � ������� �����" class="input_btn">
267 % }
268 % }
269 </div>
270 % }
271 </form>
272
273 <%ARGS>
274
275 $proto => 'documents'
276 $object => undef
277 $clone => undef
278 $sect_id => 1
279 $filter_params => undef
280
281 </%ARGS>
282
283 <%ONCE>
284 my $PROTOS = {
285 'documents' => ['���������','document.html','���������','���������'],
286 'sections' => ['������','section.html','������','������'],
287 'links' => ['�����','link.html','�����','�����'],
288 'users' => ['������������','users.html','������������','������������'],
289 };
290 </%ONCE>
291
292 <%INIT>
293 return undef unless ref($object);
294
295 my $toopi = $project->$proto();
296 my $options = {};
297 if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{ $object->class }))) {
298 %{ $options } = %{ $toopi->{ $object->class } };
299 }
300 121 ahitrov my $is_multimedia = scalar( grep { $_->{type} =~ /(image|multimedia|audio)/ } $object->structure );
301 my $is_pickup = scalar( grep { $_->{type} =~ /(pickup)/ } $object->structure );
302
303 </%INIT>