17 $this->_oMain = $oMain;
18 $this->_oDb = $oMain->_oDb;
20 $this->_aMedia = array ();
22 $this->_aMedia[
'images'] = array (
23 'post' =>
'ready_images',
24 'upload_func' =>
'uploadPhotos',
29 'title_upload_post' =>
'images_titles',
30 'title_upload' =>
_t(
'_ch_groups_form_caption_file_title'),
31 'service_method' =>
'get_photo_array',
35 $this->_aMedia[
'videos'] = array (
36 'post' =>
'ready_videos',
37 'upload_func' =>
'uploadVideos',
42 'title_upload_post' =>
'videos_titles',
43 'title_upload' =>
_t(
'_ch_groups_form_caption_file_title'),
44 'service_method' =>
'get_video_array',
48 $this->_aMedia[
'sounds'] = array (
49 'post' =>
'ready_sounds',
50 'upload_func' =>
'uploadSounds',
55 'title_upload_post' =>
'sounds_titles',
56 'title_upload' =>
_t(
'_ch_groups_form_caption_file_title'),
57 'service_method' =>
'get_music_array',
61 $this->_aMedia[
'files'] = array (
62 'post' =>
'ready_files',
63 'upload_func' =>
'uploadFiles',
68 'title_upload_post' =>
'files_titles',
69 'title_upload' =>
_t(
'_ch_groups_form_caption_file_title'),
70 'service_method' =>
'get_file_array',
77 $aCountries = $oProfileFields->convertValues4Input(
'#!Country');
84 $aInputPrivacyCustom = array ();
85 $aInputPrivacyCustom[] = array (
'key' =>
'',
'value' =>
'----');
86 $aInputPrivacyCustom[] = array (
'key' =>
'f',
'value' =>
_t(
'_ch_groups_privacy_fans_only'));
87 $aInputPrivacyCustomPass = array (
89 'params' => array(
'/^([0-9f]+)$/'),
92 $aInputPrivacyCustom2 = array (
93 array(
'key' =>
'f',
'value' =>
_t(
'_ch_groups_privacy_fans')),
94 array(
'key' =>
'a',
'value' =>
_t(
'_ch_groups_privacy_admins_only'))
96 $aInputPrivacyCustom2Pass = array (
98 'params' => array(
'/^([fa]+)$/'),
101 $aInputPrivacyViewFans = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'view_fans');
102 $aInputPrivacyViewFans[
'values'] = array_merge($aInputPrivacyViewFans[
'values'], $aInputPrivacyCustom);
103 $aInputPrivacyViewFans[
'db'] = $aInputPrivacyCustomPass;
105 $aInputPrivacyComment = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'comment');
106 $aInputPrivacyComment[
'values'] = array_merge($aInputPrivacyComment[
'values'], $aInputPrivacyCustom);
107 $aInputPrivacyComment[
'db'] = $aInputPrivacyCustomPass;
109 $aInputPrivacyRate = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'rate');
110 $aInputPrivacyRate[
'values'] = array_merge($aInputPrivacyRate[
'values'], $aInputPrivacyCustom);
111 $aInputPrivacyRate[
'db'] = $aInputPrivacyCustomPass;
113 $aInputPrivacyForum = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'post_in_forum');
114 $aInputPrivacyForum[
'values'] = array_merge($aInputPrivacyForum[
'values'], $aInputPrivacyCustom);
115 $aInputPrivacyForum[
'db'] = $aInputPrivacyCustomPass;
117 $aInputPrivacyForumView = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'view_forum');
118 $aInputPrivacyForumView[
'values'] = array_merge($aInputPrivacyForumView[
'values'], $aInputPrivacyCustom);
119 $aInputPrivacyForumView[
'db'] = $aInputPrivacyCustomPass;
121 $aInputPrivacyUploadPhotos = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'upload_photos');
122 $aInputPrivacyUploadPhotos[
'values'] = $aInputPrivacyCustom2;
123 $aInputPrivacyUploadPhotos[
'db'] = $aInputPrivacyCustom2Pass;
125 $aInputPrivacyUploadVideos = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'upload_videos');
126 $aInputPrivacyUploadVideos[
'values'] = $aInputPrivacyCustom2;
127 $aInputPrivacyUploadVideos[
'db'] = $aInputPrivacyCustom2Pass;
129 $aInputPrivacyUploadSounds = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'upload_sounds');
130 $aInputPrivacyUploadSounds[
'values'] = $aInputPrivacyCustom2;
131 $aInputPrivacyUploadSounds[
'db'] = $aInputPrivacyCustom2Pass;
133 $aInputPrivacyUploadFiles = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'upload_files');
134 $aInputPrivacyUploadFiles[
'values'] = $aInputPrivacyCustom2;
135 $aInputPrivacyUploadFiles[
'db'] = $aInputPrivacyCustom2Pass;
137 $aCustomForm = array(
139 'form_attrs' => array(
140 'name' =>
'form_groups',
143 'enctype' =>
'multipart/form-data',
148 'table' =>
'ch_groups_main',
151 'uri_title' =>
'title',
152 'submit_name' =>
'submit_form',
158 'header_info' => array(
159 'type' =>
'block_header',
160 'caption' =>
_t(
'_ch_groups_form_header_info')
166 'caption' =>
_t(
'_ch_groups_form_caption_title'),
170 'params' => array(3,100),
171 'error' =>
_t (
'_ch_groups_form_err_title'),
178 'type' =>
'textarea',
180 'caption' =>
_t(
'_ch_groups_form_caption_desc'),
185 'params' => array(20,64000),
186 'error' =>
_t (
'_ch_groups_form_err_desc'),
195 'caption' =>
_t(
'_ch_groups_form_caption_country'),
196 'values' => $aCountries,
200 'params' => array(
'/([a-zA-Z]{2})/'),
206 'caption' =>
_t(
'_ch_groups_form_caption_city'),
215 'caption' =>
_t(
'_ch_groups_form_caption_zip'),
225 'caption' =>
_t(
'_Tags'),
226 'info' =>
_t(
'_sys_tags_note'),
230 'error' =>
_t (
'_ch_groups_form_err_tags'),
237 'categories' => $oCategories->getGroupChooser (
'ch_groups', (
int)
$iProfileId,
true),
241 'header_images' => array(
242 'type' =>
'block_header',
243 'caption' =>
_t(
'_ch_groups_form_header_images'),
244 'collapsable' =>
true,
245 'collapsed' =>
false,
249 'content' => $aCustomMediaTemplates[
'images'][
'thumb_choice'],
251 'caption' =>
_t(
'_ch_groups_form_caption_thumb_choice'),
252 'info' =>
_t(
'_ch_groups_form_info_thumb_choice'),
258 'images_choice' => array(
260 'content' => $aCustomMediaTemplates[
'images'][
'choice'],
261 'name' =>
'images_choice[]',
262 'caption' =>
_t(
'_ch_groups_form_caption_images_choice'),
263 'info' =>
_t(
'_ch_groups_form_info_images_choice'),
266 'images_upload' => array(
268 'content' => $aCustomMediaTemplates[
'images'][
'upload'],
269 'name' =>
'images_upload[]',
270 'caption' =>
_t(
'_ch_groups_form_caption_images_upload'),
271 'info' =>
_t(
'_ch_groups_form_info_images_upload'),
277 'header_videos' => array(
278 'type' =>
'block_header',
279 'caption' =>
_t(
'_ch_groups_form_header_videos'),
280 'collapsable' =>
true,
281 'collapsed' =>
false,
283 'videos_choice' => array(
285 'content' => $aCustomMediaTemplates[
'videos'][
'choice'],
286 'name' =>
'videos_choice[]',
287 'caption' =>
_t(
'_ch_groups_form_caption_videos_choice'),
288 'info' =>
_t(
'_ch_groups_form_info_videos_choice'),
291 'videos_upload' => array(
293 'content' => $aCustomMediaTemplates[
'videos'][
'upload'],
294 'name' =>
'videos_upload[]',
295 'caption' =>
_t(
'_ch_groups_form_caption_videos_upload'),
296 'info' =>
_t(
'_ch_groups_form_info_videos_upload'),
302 'header_sounds' => array(
303 'type' =>
'block_header',
304 'caption' =>
_t(
'_ch_groups_form_header_sounds'),
305 'collapsable' =>
true,
306 'collapsed' =>
false,
308 'sounds_choice' => array(
310 'content' => $aCustomMediaTemplates[
'sounds'][
'choice'],
311 'name' =>
'sounds_choice[]',
312 'caption' =>
_t(
'_ch_groups_form_caption_sounds_choice'),
313 'info' =>
_t(
'_ch_groups_form_info_sounds_choice'),
316 'sounds_upload' => array(
318 'content' => $aCustomMediaTemplates[
'sounds'][
'upload'],
319 'name' =>
'sounds_upload[]',
320 'caption' =>
_t(
'_ch_groups_form_caption_sounds_upload'),
321 'info' =>
_t(
'_ch_groups_form_info_sounds_upload'),
327 'header_files' => array(
328 'type' =>
'block_header',
329 'caption' =>
_t(
'_ch_groups_form_header_files'),
330 'collapsable' =>
true,
331 'collapsed' =>
false,
333 'files_choice' => array(
335 'content' => $aCustomMediaTemplates[
'files'][
'choice'],
336 'name' =>
'files_choice[]',
337 'caption' =>
_t(
'_ch_groups_form_caption_files_choice'),
338 'info' =>
_t(
'_ch_groups_form_info_files_choice'),
341 'files_upload' => array(
343 'content' => $aCustomMediaTemplates[
'files'][
'upload'],
344 'name' =>
'files_upload[]',
345 'caption' =>
_t(
'_ch_groups_form_caption_files_upload'),
346 'info' =>
_t(
'_ch_groups_form_info_files_upload'),
352 'header_privacy' => array(
353 'type' =>
'block_header',
354 'caption' =>
_t(
'_ch_groups_form_header_privacy'),
357 'allow_view_group_to' => $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'view_group'),
359 'allow_view_fans_to' => $aInputPrivacyViewFans,
361 'allow_comment_to' => $aInputPrivacyComment,
363 'allow_rate_to' => $aInputPrivacyRate,
365 'allow_post_in_forum_to' => $aInputPrivacyForum,
367 'allow_view_forum_to' => $aInputPrivacyForumView,
369 'allow_join_to' => $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'groups',
'join'),
371 'join_confirmation' => array (
373 'name' =>
'join_confirmation',
374 'caption' =>
_t(
'_ch_groups_form_caption_join_confirmation'),
375 'info' =>
_t(
'_ch_groups_form_info_join_confirmation'),
377 0 =>
_t(
'_ch_groups_form_join_confirmation_disabled'),
378 1 =>
_t(
'_ch_groups_form_join_confirmation_enabled'),
382 'error' =>
_t (
'_ch_groups_form_err_join_confirmation'),
389 'allow_upload_photos_to' => $aInputPrivacyUploadPhotos,
391 'allow_upload_videos_to' => $aInputPrivacyUploadVideos,
393 'allow_upload_sounds_to' => $aInputPrivacyUploadSounds,
395 'allow_upload_files_to' => $aInputPrivacyUploadFiles,
399 'name' =>
'submit_form',
400 'value' =>
_t(
'_Submit'),
406 if (!$aCustomForm[
'inputs'][
'images_choice'][
'content']) {
407 unset ($aCustomForm[
'inputs'][
'thumb']);
408 unset ($aCustomForm[
'inputs'][
'images_choice']);
411 if (!$aCustomForm[
'inputs'][
'videos_choice'][
'content'])
412 unset ($aCustomForm[
'inputs'][
'videos_choice']);
414 if (!$aCustomForm[
'inputs'][
'sounds_choice'][
'content'])
415 unset ($aCustomForm[
'inputs'][
'sounds_choice']);
417 if (!$aCustomForm[
'inputs'][
'files_choice'][
'content'])
418 unset ($aCustomForm[
'inputs'][
'files_choice']);
420 if (!isset($this->_aMedia[
'images'])) {
421 unset ($aCustomForm[
'inputs'][
'header_images']);
422 unset ($aCustomForm[
'inputs'][
'thumb']);
423 unset ($aCustomForm[
'inputs'][
'images_choice']);
424 unset ($aCustomForm[
'inputs'][
'images_upload']);
425 unset ($aCustomForm[
'inputs'][
'allow_upload_photos_to']);
428 if (!isset($this->_aMedia[
'videos'])) {
429 unset ($aCustomForm[
'inputs'][
'header_videos']);
430 unset ($aCustomForm[
'inputs'][
'videos_choice']);
431 unset ($aCustomForm[
'inputs'][
'videos_upload']);
432 unset ($aCustomForm[
'inputs'][
'allow_upload_videos_to']);
435 if (!isset($this->_aMedia[
'sounds'])) {
436 unset ($aCustomForm[
'inputs'][
'header_sounds']);
437 unset ($aCustomForm[
'inputs'][
'sounds_choice']);
438 unset ($aCustomForm[
'inputs'][
'sounds_upload']);
439 unset ($aCustomForm[
'inputs'][
'allow_upload_sounds_to']);
442 if (!isset($this->_aMedia[
'files'])) {
443 unset ($aCustomForm[
'inputs'][
'header_files']);
444 unset ($aCustomForm[
'inputs'][
'files_choice']);
445 unset ($aCustomForm[
'inputs'][
'files_upload']);
446 unset ($aCustomForm[
'inputs'][
'allow_upload_files_to']);
451 parent::__construct ($aCustomForm);