BxEventsConfig.php 15 KB

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