BxEventsConfig.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Events Events
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxEventsConfig extends BxBaseModGroupsConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
  17. 'view-event-profile' => 'checkAllowedView',
  18. 'edit-event-profile' => 'checkAllowedEdit',
  19. 'edit-event-cover' => 'checkAllowedChangeCover',
  20. 'invite-to-event' => 'checkAllowedInvite',
  21. 'delete-event-profile' => 'checkAllowedDelete'
  22. ));
  23. $this->CNF = array (
  24. // module icon
  25. 'ICON' => 'calendar col-red2',
  26. // database tables
  27. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
  28. 'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
  29. 'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
  30. 'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
  31. 'TABLE_PRICES' => $aModule['db_prefix'] . 'prices',
  32. // database fields
  33. 'FIELD_ID' => 'id',
  34. 'FIELD_AUTHOR' => 'author',
  35. 'FIELD_ADDED' => 'added',
  36. 'FIELD_CHANGED' => 'changed',
  37. 'FIELD_PUBLISHED' => 'published',
  38. 'FIELD_NAME' => 'event_name',
  39. 'FIELD_TITLE' => 'event_name',
  40. 'FIELD_TEXT' => 'event_desc',
  41. 'FIELD_CATEGORY' => 'event_cat',
  42. 'FIELD_PICTURE' => 'picture',
  43. 'FIELD_COVER' => 'cover',
  44. 'FIELD_DATE_START' => 'date_start',
  45. 'FIELD_DATE_END' => 'date_end',
  46. 'FIELD_TIMEZONE' => 'timezone',
  47. 'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
  48. 'FIELD_REMINDER' => 'reminder',
  49. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  50. 'FIELD_ALLOW_POST_TO' => 'allow_post_to',
  51. 'FIELD_CF' => 'cf',
  52. 'FIELD_VIEWS' => 'views',
  53. 'FIELD_VOTES' => 'votes',
  54. 'FIELD_COMMENTS' => 'comments',
  55. 'FIELD_STATUS' => 'status',
  56. 'FIELDS_QUICK_SEARCH' => array('event_name'),
  57. 'FIELD_LOCATION' => 'location',
  58. 'FIELD_LOCATION_PREFIX' => 'location',
  59. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  60. 'FIELD_LABELS' => 'labels',
  61. 'FIELD_PRICE_ROLE_ID' => 'role_id',
  62. 'FIELD_PRICE_NAME' => 'name',
  63. // page URIs
  64. 'URI_VIEW_ENTRY' => 'view-event-profile',
  65. 'URI_EDIT_ENTRY' => 'edit-event-profile',
  66. 'URI_ENTRIES_BY_CONTEXT' => 'events-context',
  67. 'URI_EDIT_COVER' => 'edit-event-cover',
  68. 'URI_JOIN_ENTRY' => 'join-event-profile',
  69. 'URI_JOINED_ENTRIES' => 'joined-events',
  70. 'URI_MANAGE_COMMON' => 'events-manage',
  71. 'URI_FAVORITES_LIST' => 'events-favorites',
  72. 'URL_HOME' => 'page.php?i=events-home',
  73. 'URL_ENTRY_FANS' => 'page.php?i=event-fans',
  74. 'URL_MANAGE_COMMON' => 'page.php?i=events-manage',
  75. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=events-administration',
  76. 'PARAM_CHARS_SUMMARY' => 'bx_events_summary_chars',
  77. 'PARAM_NUM_RSS' => 'bx_events_num_rss',
  78. 'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_events_num_connections_quick',
  79. 'PARAM_SEARCHABLE_FIELDS' => 'bx_events_searchable_fields',
  80. 'PARAM_PUBLIC_SBSD' => 'bx_events_public_subscribed_me',
  81. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_events_per_page_browse_showcase',
  82. 'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_events_per_page_browse_recommended',
  83. 'PARAM_MMODE' => 'bx_events_members_mode',
  84. 'PARAM_PAID_JOIN_ENABLED' => true,
  85. 'PARAM_RECURRING_RESERVE' => 3, // 3 days for recurring payment to be registered
  86. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_events_per_page_for_favorites_lists',
  87. 'PARAM_USE_IN' => 'bx_events_internal_notifications',
  88. // objects
  89. 'OBJECT_STORAGE' => 'bx_events_pics',
  90. 'OBJECT_STORAGE_COVER' => 'bx_events_pics',
  91. 'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_events_thumb',
  92. 'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_events_icon',
  93. 'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_events_avatar',
  94. 'OBJECT_IMAGES_TRANSCODER_AVATAR_BIG' => 'bx_events_avatar_big',
  95. 'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_events_picture',
  96. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_events_cover',
  97. 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_events_cover_thumb',
  98. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_events_gallery',
  99. 'OBJECT_VIEWS' => 'bx_events',
  100. 'OBJECT_VOTES' => 'bx_events',
  101. 'OBJECT_SCORES' => 'bx_events',
  102. 'OBJECT_FAVORITES' => 'bx_events',
  103. 'OBJECT_FEATURED' => 'bx_events',
  104. 'OBJECT_COMMENTS' => 'bx_events',
  105. 'OBJECT_NOTES' => 'bx_events_notes',
  106. 'OBJECT_REPORTS' => 'bx_events',
  107. 'OBJECT_METATAGS' => 'bx_events',
  108. 'OBJECT_CATEGORY' => 'bx_events_cats',
  109. 'OBJECT_FORM_ENTRY' => 'bx_event',
  110. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_event_view',
  111. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_event_view_full', // for "info" tab on view group page
  112. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_event_add',
  113. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_event_edit',
  114. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_event_edit_cover',
  115. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_event_delete',
  116. 'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_event_invite',
  117. 'OBJECT_FORM_PRICE' => 'bx_events_price',
  118. 'OBJECT_FORM_PRICE_DISPLAY_ADD' => 'bx_events_price_add',
  119. 'OBJECT_FORM_PRICE_DISPLAY_EDIT' => 'bx_events_price_edit',
  120. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_events_view_actions', // actions menu on view entry page
  121. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_events_view_actions_more', // actions menu on view entry page for "more" popup
  122. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_events_view_actions_all', // all actions menu on view entry page
  123. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_events_my', // actions menu on profile entries page
  124. 'OBJECT_MENU_SUBMENU' => 'bx_events_submenu', // main module submenu
  125. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_events_view_submenu', // view entry submenu
  126. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'events-home', // first item in view entry submenu from main module submenu
  127. 'OBJECT_MENU_VIEW_ENTRY_META' => 'bx_events_view_meta', // meta menu on view entry page
  128. 'OBJECT_MENU_SNIPPET_META' => 'bx_events_snippet_meta', // menu for snippet meta info
  129. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_events_menu_manage_tools', //manage menu in content administration tools
  130. 'OBJECT_PAGE_VIEW_ENTRY' => 'bx_events_view_profile',
  131. 'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_events_view_profile_closed',
  132. 'OBJECT_PRIVACY_VIEW' => 'bx_events_allow_view_to',
  133. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_events_allow_view_favorite_list',
  134. 'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_events_allow_view_notification_to',
  135. 'OBJECT_PRIVACY_POST' => 'bx_events_allow_post_to',
  136. 'OBJECT_GRID_ADMINISTRATION' => 'bx_events_administration',
  137. 'OBJECT_GRID_COMMON' => 'bx_events_common',
  138. 'OBJECT_GRID_CONNECTIONS' => 'bx_events_fans',
  139. 'OBJECT_GRID_INVITES' => 'bx_events_invites',
  140. 'OBJECT_GRID_PRICES_MANAGE' => 'bx_events_prices_manage',
  141. 'OBJECT_GRID_PRICES_VIEW' => 'bx_events_prices_view',
  142. 'OBJECT_CONNECTIONS' => 'bx_events_fans',
  143. 'OBJECT_UPLOADERS_COVER' => array('bx_events_cover_crop'),
  144. 'OBJECT_UPLOADERS_PICTURE' => array('bx_events_picture_crop'),
  145. 'OBJECT_PRE_LIST_ROLES' => 'bx_events_roles',
  146. 'OBJECT_PRE_LIST_PERIOD_UNITS' => 'bx_events_period_units',
  147. 'BADGES_AVALIABLE' => true,
  148. 'INVITES_KEYS_LIFETIME' => 86400,
  149. 'ENABLE_FOR_CONTEXT_IN_MODULES' => array('bx_groups', 'bx_spaces'),
  150. 'EMAIL_INVITATION' => 'bx_events_invitation',
  151. 'EMAIL_JOIN_REQUEST' => 'bx_events_join_request',
  152. 'EMAIL_JOIN_CONFIRM' => 'bx_events_join_confirm',
  153. 'EMAIL_FAN_BECOME_ADMIN' => 'bx_events_fan_become_admin',
  154. 'EMAIL_ADMIN_BECOME_FAN' => 'bx_events_admin_become_fan',
  155. 'EMAIL_FAN_REMOVE' => 'bx_events_fan_remove',
  156. 'EMAIL_FAN_SET_ROLE' => 'bx_events_set_role',
  157. 'EMAIL_JOIN_REJECT' => 'bx_events_join_reject',
  158. 'EMAIL_REMINDER' => 'bx_events_reminder',
  159. 'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_group_view_submenu',
  160. 'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_group_snippet_meta',
  161. 'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_group_view_actions',
  162. 'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_group_view_entry',
  163. // menu items which visibility depends on custom visibility checking
  164. 'MENU_ITEM_TO_METHOD' => array (
  165. 'bx_events_view_actions' => $this->_aMenuItems2MethodsActions,
  166. 'bx_events_view_actions_more' => $this->_aMenuItems2MethodsActions,
  167. 'bx_events_view_actions_all' => $this->_aMenuItems2MethodsActions,
  168. ),
  169. // informer messages
  170. 'INFORMERS' => array (
  171. 'status' => array (
  172. 'name' => 'bx-events-status-not-active',
  173. 'map' => array (
  174. BX_PROFILE_STATUS_PENDING => '_bx_events_txt_account_pending',
  175. BX_PROFILE_STATUS_SUSPENDED => '_bx_events_txt_account_suspended',
  176. ),
  177. ),
  178. 'scheduled' => array (
  179. 'name' => 'bx-events-scheduled',
  180. 'map' => array (
  181. 'awaiting' => array('msg' => '_bx_events_txt_scheduled_awaiting', 'type' => BX_INFORMER_ALERT),
  182. ),
  183. ),
  184. ),
  185. // some language keys
  186. 'T' => array (
  187. 'txt_sample_single' => '_bx_events_txt_sample_single',
  188. 'txt_sample_single_with_article' => '_bx_events_txt_sample_single_with_article',
  189. 'txt_sample_comment_single' => '_bx_events_txt_sample_comment_single',
  190. 'txt_sample_vote_single' => '_bx_events_txt_sample_vote_single',
  191. 'txt_sample_score_up_single' => '_bx_events_txt_sample_score_up_single',
  192. 'txt_sample_score_down_single' => '_bx_events_txt_sample_score_down_single',
  193. 'txt_private_group' => '_bx_events_txt_private_group',
  194. 'txt_N_fans' => '_bx_events_txt_N_fans',
  195. 'txt_ntfs_join_invitation' => '_bx_events_txt_ntfs_join_invitation',
  196. 'txt_ntfs_join_request' => '_bx_events_txt_ntfs_join_request',
  197. 'txt_ntfs_fan_added' => '_bx_events_txt_ntfs_fan_added',
  198. 'txt_ntfs_timeline_post_common' => '_bx_events_txt_ntfs_timeline_post_common',
  199. 'option_members_mode_multi_roles' => '_bx_events_option_members_mode_multi_roles',
  200. 'txt_all_entries_in' => '_bx_events_txt_all_entries_in',
  201. 'form_field_author' => '_bx_events_form_profile_input_author',
  202. 'menu_item_title_befriend_sent' => '_bx_events_menu_item_title_befriend_sent',
  203. 'menu_item_title_unfriend_cancel_request' => '_bx_events_menu_item_title_unfriend_cancel_request',
  204. 'menu_item_title_befriend_confirm' => '_bx_events_menu_item_title_befriend_confirm',
  205. 'menu_item_title_unfriend_reject_request' => '_bx_events_menu_item_title_unfriend_reject_request',
  206. 'menu_item_title_befriend' => '_bx_events_menu_item_title_befriend',
  207. 'menu_item_title_unfriend' => '_bx_events_menu_item_title_unfriend',
  208. 'menu_item_title_subscribe' => '_bx_events_menu_item_title_subscribe',
  209. 'menu_item_title_unsubscribe' => '_bx_events_menu_item_title_unsubscribe',
  210. 'grid_action_err_delete' => '_bx_events_grid_action_err_delete',
  211. 'grid_txt_account_manager' => '_bx_events_grid_txt_account_manager',
  212. 'filter_item_active' => '_bx_events_grid_filter_item_title_adm_active',
  213. 'filter_item_pending' => '_bx_events_grid_filter_item_title_adm_pending',
  214. 'filter_item_suspended' => '_bx_events_grid_filter_item_title_adm_suspended',
  215. 'filter_item_select_one_filter1' => '_bx_events_grid_filter_item_title_adm_select_one_filter1',
  216. 'filter_item_select_one_filter2' => '_bx_events_grid_filter_item_title_adm_select_one_filter2',
  217. 'menu_item_manage_my' => '_bx_events_menu_item_title_manage_my',
  218. 'menu_item_manage_all' => '_bx_events_menu_item_title_manage_all',
  219. 'menu_item_title_become_fan_sent' => '_bx_events_menu_item_title_become_fan_sent',
  220. 'menu_item_title_leave_group_cancel_request' => '_bx_events_menu_item_title_leave_group_cancel_request',
  221. 'menu_item_title_become_fan' => '_bx_events_menu_item_title_become_fan',
  222. 'menu_item_title_leave_group' => '_bx_events_menu_item_title_leave_group',
  223. 'menu_item_title_become_fan_sent' => '_bx_events_menu_item_title_become_fan_sent',
  224. 'menu_item_title_become_fan' => '_bx_events_menu_item_title_become_fan',
  225. 'txt_all_entries_by_author' => '_bx_events_page_title_browse_by_author',
  226. 'txt_all_entries_by_context' => '_bx_events_page_title_browse_by_context',
  227. 'txt_invitation_popup_title' => '_bx_events_txt_invite_popup_title',
  228. 'txt_invitation_popup_text' => '_bx_events_txt_invite_popup_text',
  229. 'txt_invitation_popup_accept_button' => '_bx_events_txt_invite_popup_button_accept',
  230. 'txt_invitation_popup_decline_button' => '_bx_events_txt_invite_popup_button_decline',
  231. 'txt_invitation_popup_error_invitation_absent' => '_bx_events_txt_invite_popup_error_invitation_absent',
  232. 'txt_invitation_popup_error_wrong_user' => '_bx_events_txt_invite_popup_error_invitation_wrong_user',
  233. 'txt_n_unit' => '_bx_events_txt_n_unit',
  234. 'txt_buy_title' => '_bx_events_grid_action_title_buy_title',
  235. 'txt_cart_item_title' => '_bx_events_txt_cart_item_title',
  236. 'txt_subscribe_title' => '_bx_events_grid_action_title_subscribe_title',
  237. 'popup_title_price_add' => '_bx_events_popup_title_price_add',
  238. 'popup_title_price_edit' => '_bx_events_popup_title_price_edit',
  239. 'msg_performed' => '_bx_events_msg_performed',
  240. 'err_period_unit' => '_bx_events_form_price_input_err_period_unit',
  241. 'err_price_duplicate' => '_bx_events_err_price_duplicate',
  242. 'err_cannot_perform' => '_bx_events_err_cannot_perform',
  243. ),
  244. );
  245. $this->_aJsClasses = array(
  246. 'main' => 'BxEventsMain',
  247. 'entry' => 'BxEventsEntry',
  248. 'manage_tools' => 'BxEventsManageTools',
  249. 'invite_popup' => 'BxEventsInvitePopup',
  250. 'prices' => 'BxEventsPrices'
  251. );
  252. $this->_aJsObjects = array(
  253. 'main' => 'oBxEventsMain',
  254. 'entry' => 'oBxEventsEntry',
  255. 'manage_tools' => 'oBxEventsManageTools',
  256. 'invite_popup' => 'oBxEventsInvitePopup',
  257. 'prices' => 'oBxEventsPrices'
  258. );
  259. $this->_aGridObjects = array(
  260. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  261. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION']
  262. );
  263. }
  264. }
  265. /** @} */