17 $this->_oMain = $oMain;
18 $this->_oDb = $oMain->_oDb;
20 $this->_aMedia = array ();
23 $this->_aMedia[
'images'] = array (
24 'post' =>
'ready_images',
25 'upload_func' =>
'uploadPhotos',
28 'thumb' =>
'PrimPhoto',
30 'title_upload_post' =>
'images_titles',
31 'title_upload' =>
_t(
'_ch_events_form_caption_file_title'),
32 'service_method' =>
'get_photo_array',
36 $this->_aMedia[
'videos'] = array (
37 'post' =>
'ready_videos',
38 'upload_func' =>
'uploadVideos',
43 'title_upload_post' =>
'videos_titles',
44 'title_upload' =>
_t(
'_ch_events_form_caption_file_title'),
45 'service_method' =>
'get_video_array',
49 $this->_aMedia[
'sounds'] = array (
50 'post' =>
'ready_sounds',
51 'upload_func' =>
'uploadSounds',
56 'title_upload_post' =>
'sounds_titles',
57 'title_upload' =>
_t(
'_ch_events_form_caption_file_title'),
58 'service_method' =>
'get_music_array',
62 $this->_aMedia[
'files'] = array (
63 'post' =>
'ready_files',
64 'upload_func' =>
'uploadFiles',
69 'title_upload_post' =>
'files_titles',
70 'title_upload' =>
_t(
'_ch_events_form_caption_file_title'),
71 'service_method' =>
'get_file_array',
76 $oCategories->getTagObjectConfig ();
79 $aCountries = $oProfileFields->convertValues4Input(
'#!Country');
86 $aInputPrivacyCustom = array ();
87 $aInputPrivacyCustom[] = array (
'key' =>
'',
'value' =>
'----');
88 $aInputPrivacyCustom[] = array (
'key' =>
'p',
'value' =>
_t(
'_ch_events_privacy_participants_only'));
89 $aInputPrivacyCustomPass = array (
91 'params' => array(
'/^([0-9p]+)$/'),
94 $aInputPrivacyCustom2 = array (
95 array(
'key' =>
'p',
'value' =>
_t(
'_ch_events_privacy_participants')),
96 array(
'key' =>
'a',
'value' =>
_t(
'_ch_events_privacy_admins_only'))
98 $aInputPrivacyCustom2Pass = array (
100 'params' => array(
'/^([pa]+)$/'),
103 $aInputPrivacyViewParticipants =
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'view_participants');
104 $aInputPrivacyViewParticipants[
'values'] = array_merge($aInputPrivacyViewParticipants[
'values'], $aInputPrivacyCustom);
106 $aInputPrivacyComment =
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'comment');
107 $aInputPrivacyComment[
'values'] = array_merge($aInputPrivacyComment[
'values'], $aInputPrivacyCustom);
108 $aInputPrivacyComment[
'db'] = $aInputPrivacyCustomPass;
110 $aInputPrivacyRate =
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'rate');
111 $aInputPrivacyRate[
'values'] = array_merge($aInputPrivacyRate[
'values'], $aInputPrivacyCustom);
112 $aInputPrivacyRate[
'db'] = $aInputPrivacyCustomPass;
114 $aInputPrivacyForum =
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'post_in_forum');
115 $aInputPrivacyForum[
'values'] = array_merge($aInputPrivacyForum[
'values'], $aInputPrivacyCustom);
116 $aInputPrivacyForum[
'db'] = $aInputPrivacyCustomPass;
118 $aInputPrivacyForumView =
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'view_forum');
119 $aInputPrivacyForumView[
'values'] = array_merge($aInputPrivacyForumView[
'values'], $aInputPrivacyCustom);
120 $aInputPrivacyForumView[
'db'] = $aInputPrivacyCustomPass;
122 $aInputPrivacyUploadPhotos = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'upload_photos');
123 $aInputPrivacyUploadPhotos[
'values'] = $aInputPrivacyCustom2;
124 $aInputPrivacyUploadPhotos[
'db'] = $aInputPrivacyCustom2Pass;
126 $aInputPrivacyUploadVideos = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'upload_videos');
127 $aInputPrivacyUploadVideos[
'values'] = $aInputPrivacyCustom2;
128 $aInputPrivacyUploadVideos[
'db'] = $aInputPrivacyCustom2Pass;
130 $aInputPrivacyUploadSounds = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'upload_sounds');
131 $aInputPrivacyUploadSounds[
'values'] = $aInputPrivacyCustom2;
132 $aInputPrivacyUploadSounds[
'db'] = $aInputPrivacyCustom2Pass;
134 $aInputPrivacyUploadFiles = $this->_oMain->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'upload_files');
135 $aInputPrivacyUploadFiles[
'values'] = $aInputPrivacyCustom2;
136 $aInputPrivacyUploadFiles[
'db'] = $aInputPrivacyCustom2Pass;
138 $aCustomForm = array(
140 'form_attrs' => array(
141 'name' =>
'form_events',
144 'enctype' =>
'multipart/form-data',
149 'table' =>
'ch_events_main',
152 'uri_title' =>
'Title',
153 'submit_name' =>
'submit_form',
159 'header_info' => array(
160 'type' =>
'block_header',
161 'caption' =>
_t(
'_ch_events_form_header_info')
167 'caption' =>
_t(
'_ch_events_caption_title'),
171 'params' => array(3,100),
172 'error' =>
_t (
'_ch_events_err_title'),
178 'Description' => array(
179 'type' =>
'textarea',
180 'name' =>
'Description',
181 'caption' =>
_t(
'_ch_events_caption_desc'),
186 'params' => array(20,64000),
187 'error' =>
_t (
'_ch_events_err_desc'),
196 'caption' =>
_t(
'_ch_events_caption_country'),
197 'values' => $aCountries,
201 'params' => array(
'/^[a-zA-Z]{2}$/'),
202 'error' =>
_t (
'_ch_events_err_country'),
206 'params' => array(
'/([a-zA-Z]{2})/'),
212 'caption' =>
_t(
'_ch_events_caption_city'),
216 'params' => array(3,50),
217 'error' =>
_t (
'_ch_events_err_city'),
226 'caption' =>
_t(
'_ch_events_caption_place'),
230 'error' =>
_t (
'_ch_events_err_place'),
236 'EventStart' => array(
237 'type' =>
'datetime',
238 'name' =>
'EventStart',
239 'caption' =>
_t(
'_ch_events_caption_event_start'),
242 'func' =>
'DateTime',
243 'error' =>
_t (
'_ch_events_err_event_start'),
246 'pass' =>
'DateTimeUTC',
248 'display' =>
'filterDateUTC',
251 'type' =>
'datetime',
252 'name' =>
'EventEnd',
253 'caption' =>
_t(
'_ch_events_caption_event_end'),
256 'func' =>
'DateTime',
257 'error' =>
_t (
'_ch_events_err_event_end'),
260 'pass' =>
'DateTimeUTC',
262 'display' =>
'filterDateUTC',
267 'caption' =>
_t(
'_Tags'),
268 'info' =>
_t(
'_sys_tags_note'),
272 'error' =>
_t (
'_ch_events_err_tags'),
279 'Categories' => $oCategories->getGroupChooser (
'ch_events', (
int)
$iProfileId,
true),
283 'header_images' => array(
284 'type' =>
'block_header',
285 'caption' =>
_t(
'_ch_events_form_header_images'),
286 'collapsable' =>
true,
287 'collapsed' =>
false,
289 'PrimPhoto' => array(
291 'content' => $aCustomMediaTemplates[
'images'][
'thumb_choice'],
292 'name' =>
'PrimPhoto',
293 'caption' =>
_t(
'_ch_events_form_caption_thumb_choice'),
294 'info' =>
_t(
'_ch_events_form_info_thumb_choice'),
300 'images_choice' => array(
302 'content' => $aCustomMediaTemplates[
'images'][
'choice'],
303 'name' =>
'images_choice[]',
304 'caption' =>
_t(
'_ch_events_form_caption_images_choice'),
305 'info' =>
_t(
'_ch_events_form_info_images_choice'),
308 'images_upload' => array(
310 'content' => $aCustomMediaTemplates[
'images'][
'upload'],
311 'name' =>
'images_upload[]',
312 'caption' =>
_t(
'_ch_events_form_caption_images_upload'),
313 'info' =>
_t(
'_ch_events_form_info_images_upload'),
319 'header_videos' => array(
320 'type' =>
'block_header',
321 'caption' =>
_t(
'_ch_events_form_header_videos'),
322 'collapsable' =>
true,
323 'collapsed' =>
false,
325 'videos_choice' => array(
327 'content' => $aCustomMediaTemplates[
'videos'][
'choice'],
328 'name' =>
'videos_choice[]',
329 'caption' =>
_t(
'_ch_events_form_caption_videos_choice'),
330 'info' =>
_t(
'_ch_events_form_info_videos_choice'),
333 'videos_upload' => array(
335 'content' => $aCustomMediaTemplates[
'videos'][
'upload'],
336 'name' =>
'videos_upload[]',
337 'caption' =>
_t(
'_ch_events_form_caption_videos_upload'),
338 'info' =>
_t(
'_ch_events_form_info_videos_upload'),
344 'header_sounds' => array(
345 'type' =>
'block_header',
346 'caption' =>
_t(
'_ch_events_form_header_sounds'),
347 'collapsable' =>
true,
348 'collapsed' =>
false,
350 'sounds_choice' => array(
352 'content' => $aCustomMediaTemplates[
'sounds'][
'choice'],
353 'name' =>
'sounds_choice[]',
354 'caption' =>
_t(
'_ch_events_form_caption_sounds_choice'),
355 'info' =>
_t(
'_ch_events_form_info_sounds_choice'),
358 'sounds_upload' => array(
360 'content' => $aCustomMediaTemplates[
'sounds'][
'upload'],
361 'name' =>
'sounds_upload[]',
362 'caption' =>
_t(
'_ch_events_form_caption_sounds_upload'),
363 'info' =>
_t(
'_ch_events_form_info_sounds_upload'),
369 'header_files' => array(
370 'type' =>
'block_header',
371 'caption' =>
_t(
'_ch_events_form_header_files'),
372 'collapsable' =>
true,
373 'collapsed' =>
false,
375 'files_choice' => array(
377 'content' => $aCustomMediaTemplates[
'files'][
'choice'],
378 'name' =>
'files_choice[]',
379 'caption' =>
_t(
'_ch_events_form_caption_files_choice'),
380 'info' =>
_t(
'_ch_events_form_info_files_choice'),
383 'files_upload' => array(
385 'content' => $aCustomMediaTemplates[
'files'][
'upload'],
386 'name' =>
'files_upload[]',
387 'caption' =>
_t(
'_ch_events_form_caption_files_upload'),
388 'info' =>
_t(
'_ch_events_form_info_files_upload'),
394 'header_privacy' => array(
395 'type' =>
'block_header',
396 'caption' =>
_t(
'_ch_events_form_header_privacy'),
399 'allow_view_event_to' =>
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'view_event'),
401 'allow_view_participants_to' => $aInputPrivacyViewParticipants,
403 'allow_comment_to' => $aInputPrivacyComment,
405 'allow_rate_to' => $aInputPrivacyRate,
407 'allow_post_in_forum_to' => $aInputPrivacyForum,
409 'allow_view_forum_to' => $aInputPrivacyForumView,
411 'allow_join_to' =>
$GLOBALS[
'oChEventsModule']->_oPrivacy->getGroupChooser(
$iProfileId,
'events',
'join'),
413 'JoinConfirmation' => array (
415 'name' =>
'JoinConfirmation',
416 'caption' =>
_t(
'_ch_events_form_caption_join_confirmation'),
417 'info' =>
_t(
'_ch_events_form_info_join_confirmation'),
419 0 =>
_t(
'_ch_events_form_join_confirmation_disabled'),
420 1 =>
_t(
'_ch_events_form_join_confirmation_enabled'),
424 'error' =>
_t (
'_ch_events_form_err_join_confirmation'),
431 'allow_upload_photos_to' => $aInputPrivacyUploadPhotos,
433 'allow_upload_videos_to' => $aInputPrivacyUploadVideos,
435 'allow_upload_sounds_to' => $aInputPrivacyUploadSounds,
437 'allow_upload_files_to' => $aInputPrivacyUploadFiles,
441 if (!$aCustomForm[
'inputs'][
'images_choice'][
'content']) {
442 unset ($aCustomForm[
'inputs'][
'PrimPhoto']);
443 unset ($aCustomForm[
'inputs'][
'images_choice']);
446 if (!$aCustomForm[
'inputs'][
'videos_choice'][
'content'])
447 unset ($aCustomForm[
'inputs'][
'videos_choice']);
449 if (!$aCustomForm[
'inputs'][
'sounds_choice'][
'content'])
450 unset ($aCustomForm[
'inputs'][
'sounds_choice']);
452 if (!$aCustomForm[
'inputs'][
'files_choice'][
'content'])
453 unset ($aCustomForm[
'inputs'][
'files_choice']);
455 if (!isset($this->_aMedia[
'images'])) {
456 unset ($aCustomForm[
'inputs'][
'header_images']);
457 unset ($aCustomForm[
'inputs'][
'PrimPhoto']);
458 unset ($aCustomForm[
'inputs'][
'images_choice']);
459 unset ($aCustomForm[
'inputs'][
'images_upload']);
460 unset ($aCustomForm[
'inputs'][
'allow_upload_photos_to']);
463 if (!isset($this->_aMedia[
'videos'])) {
464 unset ($aCustomForm[
'inputs'][
'header_videos']);
465 unset ($aCustomForm[
'inputs'][
'videos_choice']);
466 unset ($aCustomForm[
'inputs'][
'videos_upload']);
467 unset ($aCustomForm[
'inputs'][
'allow_upload_videos_to']);
470 if (!isset($this->_aMedia[
'sounds'])) {
471 unset ($aCustomForm[
'inputs'][
'header_sounds']);
472 unset ($aCustomForm[
'inputs'][
'sounds_choice']);
473 unset ($aCustomForm[
'inputs'][
'sounds_upload']);
474 unset ($aCustomForm[
'inputs'][
'allow_upload_sounds_to']);
477 if (!isset($this->_aMedia[
'files'])) {
478 unset ($aCustomForm[
'inputs'][
'header_files']);
479 unset ($aCustomForm[
'inputs'][
'files_choice']);
480 unset ($aCustomForm[
'inputs'][
'files_upload']);
481 unset ($aCustomForm[
'inputs'][
'allow_upload_files_to']);
486 unset ($aCustomForm[
'inputs'][
'allow_post_in_forum_to']);
488 $aFormInputsAdminPart = array ();
491 require_once(CH_DIRECTORY_PATH_INC .
'membership_levels.inc.php');
494 $aMemberships = array(
'' =>
_t(
'_ch_events_membership_filter_none')) + $aMemberships;
495 $aFormInputsAdminPart = array (
496 'EventMembershipFilter' => array(
498 'name' =>
'EventMembershipFilter',
499 'caption' =>
_t(
'_ch_events_caption_membership_filter'),
500 'info' =>
_t(
'_ch_events_info_membership_filter'),
501 'values' => $aMemberships,
505 'params' => array(
'/^[0-9a-zA-Z]*$/'),
506 'error' =>
_t (
'_ch_events_err_membership_filter'),
510 'params' => array(
'/([0-9a-zA-Z]*)/'),
517 $aFormInputsSubmit = array (
520 'name' =>
'submit_form',
521 'value' =>
_t(
'_Submit'),
525 $aCustomForm[
'inputs'] = array_merge($aCustomForm[
'inputs'], $aFormInputsAdminPart, $aFormInputsSubmit);
529 parent::__construct ($aCustomForm);