BxGroupsConfig.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 Groups Groups
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxGroupsConfig extends BxBaseModProfileConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'view-group-profile' => 'checkAllowedView',
  18. 'edit-group-profile' => 'checkAllowedEdit',
  19. 'edit-group-cover' => 'checkAllowedChangeCover',
  20. 'invite-to-group' => 'checkAllowedInvite',
  21. 'delete-group-profile' => 'checkAllowedDelete',
  22. 'profile-fan-add' => 'checkAllowedFanAdd',
  23. 'profile-fan-remove' => 'checkAllowedFanRemove',
  24. 'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
  25. 'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
  26. 'profile-actions-more' => 'checkAllowedViewMoreMenu',
  27. 'convos-compose' => 'checkAllowedCompose',
  28. );
  29. $this->CNF = array (
  30. // module icon
  31. 'ICON' => 'users col-red2',
  32. // database tables
  33. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
  34. 'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
  35. 'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
  36. 'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
  37. // database fields
  38. 'FIELD_ID' => 'id',
  39. 'FIELD_AUTHOR' => 'author',
  40. 'FIELD_ADDED' => 'added',
  41. 'FIELD_CHANGED' => 'changed',
  42. 'FIELD_NAME' => 'group_name',
  43. 'FIELD_TITLE' => 'group_name',
  44. 'FIELD_TEXT' => 'group_desc',
  45. 'FIELD_PICTURE' => 'picture',
  46. 'FIELD_COVER' => 'cover',
  47. 'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
  48. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  49. 'FIELD_ALLOW_POST_TO' => 'allow_post_to',
  50. 'FIELD_VIEWS' => 'views',
  51. 'FIELD_COMMENTS' => 'comments',
  52. 'FIELDS_QUICK_SEARCH' => array('group_name'),
  53. 'FIELD_LOCATION' => 'location',
  54. 'FIELD_LOCATION_PREFIX' => 'location',
  55. 'FIELD_LABELS' => 'labels',
  56. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  57. // page URIs
  58. 'URI_VIEW_ENTRY' => 'view-group-profile',
  59. 'URI_EDIT_ENTRY' => 'edit-group-profile',
  60. 'URI_INVITE_TO_ENTRY' => 'invite-to-group',
  61. 'URI_EDIT_COVER' => 'edit-group-cover',
  62. 'URI_JOINED_ENTRIES' => 'joined-groups',
  63. 'URI_MANAGE_COMMON' => 'groups-manage',
  64. 'URL_HOME' => 'page.php?i=groups-home',
  65. 'URL_ENTRY_FANS' => 'page.php?i=group-fans',
  66. 'URL_MANAGE_COMMON' => 'page.php?i=groups-manage',
  67. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=groups-administration',
  68. 'PARAM_NUM_RSS' => 'bx_groups_num_rss',
  69. 'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_groups_num_connections_quick',
  70. 'PARAM_SEARCHABLE_FIELDS' => 'bx_groups_searchable_fields',
  71. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_groups_per_page_browse_showcase',
  72. 'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_groups_per_page_browse_recommended',
  73. // objects
  74. 'OBJECT_STORAGE' => 'bx_groups_pics',
  75. 'OBJECT_STORAGE_COVER' => 'bx_groups_pics',
  76. 'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_groups_thumb',
  77. 'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_groups_icon',
  78. 'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_groups_avatar',
  79. 'OBJECT_IMAGES_TRANSCODER_AVATAR_BIG' => 'bx_groups_avatar_big',
  80. 'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_groups_picture',
  81. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_groups_cover',
  82. 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_groups_cover_thumb',
  83. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_groups_gallery',
  84. 'OBJECT_VIEWS' => 'bx_groups',
  85. 'OBJECT_VOTES' => 'bx_groups',
  86. 'OBJECT_SCORES' => 'bx_groups',
  87. 'OBJECT_FAVORITES' => 'bx_groups',
  88. 'OBJECT_FEATURED' => 'bx_groups',
  89. 'OBJECT_COMMENTS' => 'bx_groups',
  90. 'OBJECT_REPORTS' => 'bx_groups',
  91. 'OBJECT_METATAGS' => 'bx_groups',
  92. 'OBJECT_FORM_ENTRY' => 'bx_group',
  93. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_group_view',
  94. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_group_view_full', // for "info" tab on view group page
  95. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_group_add',
  96. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_group_edit',
  97. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_group_edit_cover',
  98. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_group_delete',
  99. 'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_group_invite',
  100. 'OBJECT_FORM_ENTRY_DISPLAY_JOIN' => 'bx_group_join',
  101. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_groups_view_actions', // actions menu on view entry page
  102. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_groups_view_actions_more', // actions menu on view entry page for "more" popup
  103. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_groups_view_actions_all', // all actions menu on view entry page
  104. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_groups_my', // actions menu on profile entries page
  105. 'OBJECT_MENU_SUBMENU' => 'bx_groups_submenu', // main module submenu
  106. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_groups_view_submenu', // view entry submenu
  107. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_COVER' => 'bx_groups_view_submenu_cover', // view entry submenu displayed in cover
  108. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'groups-home', // first item in view entry submenu from main module submenu
  109. 'OBJECT_MENU_SNIPPET_META' => 'bx_groups_snippet_meta', // menu for snippet meta info
  110. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_groups_menu_manage_tools', //manage menu in content administration tools
  111. 'OBJECT_PAGE_VIEW_ENTRY' => 'bx_groups_view_profile',
  112. 'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_groups_view_profile_closed',
  113. 'OBJECT_PRIVACY_VIEW' => 'bx_groups_allow_view_to',
  114. 'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_groups_allow_view_notification_to',
  115. 'OBJECT_PRIVACY_POST' => 'bx_groups_allow_post_to',
  116. 'OBJECT_GRID_ADMINISTRATION' => 'bx_groups_administration',
  117. 'OBJECT_GRID_COMMON' => 'bx_groups_common',
  118. 'OBJECT_GRID_CONNECTIONS' => 'bx_groups_fans',
  119. 'OBJECT_GRID_INVITES' => 'bx_groups_invites',
  120. 'OBJECT_CONNECTIONS' => 'bx_groups_fans',
  121. 'OBJECT_UPLOADERS_COVER' => array('bx_groups_cover_crop'),
  122. 'OBJECT_UPLOADERS_PICTURE' => array('bx_groups_picture_crop'),
  123. 'BADGES_AVALIABLE' => true,
  124. 'INVITES_KEYS_LIFETIME' => 86400,
  125. 'EMAIL_INVITATION' => 'bx_groups_invitation',
  126. 'EMAIL_JOIN_REQUEST' => 'bx_groups_join_request',
  127. 'EMAIL_JOIN_CONFIRM' => 'bx_groups_join_confirm',
  128. 'EMAIL_FAN_BECOME_ADMIN' => 'bx_groups_fan_become_admin',
  129. 'EMAIL_ADMIN_BECOME_FAN' => 'bx_groups_admin_become_fan',
  130. 'EMAIL_FAN_REMOVE' => 'bx_groups_fan_remove',
  131. 'EMAIL_JOIN_REJECT' => 'bx_groups_join_reject',
  132. 'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_group_view_submenu',
  133. 'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_group_snippet_meta',
  134. 'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_group_view_actions',
  135. 'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_group_view_entry',
  136. // menu items which visibility depends on custom visibility checking
  137. 'MENU_ITEM_TO_METHOD' => array (
  138. 'bx_groups_view_actions' => $aMenuItems2Methods,
  139. 'bx_groups_view_actions_more' => $aMenuItems2Methods,
  140. 'bx_groups_view_actions_all' => $aMenuItems2Methods,
  141. ),
  142. // informer messages
  143. 'INFORMERS' => array (
  144. 'status' => array (
  145. 'name' => 'bx-groups-status-not-active',
  146. 'map' => array (
  147. BX_PROFILE_STATUS_PENDING => '_bx_groups_txt_account_pending',
  148. BX_PROFILE_STATUS_SUSPENDED => '_bx_groups_txt_account_suspended',
  149. ),
  150. ),
  151. ),
  152. // some language keys
  153. 'T' => array (
  154. 'txt_sample_single' => '_bx_groups_txt_sample_single',
  155. 'txt_sample_single_with_article' => '_bx_groups_txt_sample_single_with_article',
  156. 'txt_sample_comment_single' => '_bx_groups_txt_sample_comment_single',
  157. 'txt_sample_vote_single' => '_bx_groups_txt_sample_vote_single',
  158. 'txt_sample_score_up_single' => '_bx_groups_txt_sample_score_up_single',
  159. 'txt_sample_score_down_single' => '_bx_groups_txt_sample_score_down_single',
  160. 'txt_private_group' => '_bx_groups_txt_private_group',
  161. 'txt_N_fans' => '_bx_groups_txt_N_fans',
  162. 'txt_ntfs_join_request' => '_bx_groups_txt_ntfs_join_request',
  163. 'txt_ntfs_fan_added' => '_bx_groups_txt_ntfs_fan_added',
  164. 'txt_ntfs_timeline_post_common' => '_bx_groups_txt_ntfs_timeline_post_common',
  165. 'form_field_author' => '_bx_groups_form_entry_input_author',
  166. 'menu_item_title_befriend_sent' => '_bx_groups_menu_item_title_befriend_sent',
  167. 'menu_item_title_unfriend_cancel_request' => '_bx_groups_menu_item_title_unfriend_cancel_request',
  168. 'menu_item_title_befriend_confirm' => '_bx_groups_menu_item_title_befriend_confirm',
  169. 'menu_item_title_unfriend_reject_request' => '_bx_groups_menu_item_title_unfriend_reject_request',
  170. 'menu_item_title_befriend' => '_bx_groups_menu_item_title_befriend',
  171. 'menu_item_title_unfriend' => '_bx_groups_menu_item_title_unfriend',
  172. 'grid_action_err_delete' => '_bx_groups_grid_action_err_delete',
  173. 'grid_txt_account_manager' => '_bx_groups_grid_txt_account_manager',
  174. 'filter_item_active' => '_bx_groups_grid_filter_item_title_adm_active',
  175. 'filter_item_pending' => '_bx_groups_grid_filter_item_title_adm_pending',
  176. 'filter_item_suspended' => '_bx_groups_grid_filter_item_title_adm_suspended',
  177. 'filter_item_select_one_filter1' => '_bx_groups_grid_filter_item_title_adm_select_one_filter1',
  178. 'menu_item_manage_my' => '_bx_groups_menu_item_title_manage_my',
  179. 'menu_item_manage_all' => '_bx_groups_menu_item_title_manage_all',
  180. 'menu_item_title_become_fan_sent' => '_bx_groups_menu_item_title_become_fan_sent',
  181. 'menu_item_title_leave_group_cancel_request' => '_bx_groups_menu_item_title_leave_group_cancel_request',
  182. 'menu_item_title_become_fan' => '_bx_groups_menu_item_title_become_fan',
  183. 'menu_item_title_leave_group' => '_bx_groups_menu_item_title_leave_group',
  184. 'txt_all_entries_by_author' => '_bx_groups_page_title_browse_by_author'
  185. ),
  186. );
  187. $this->_aJsClasses = array(
  188. 'manage_tools' => 'BxGroupsManageTools'
  189. );
  190. $this->_aJsObjects = array(
  191. 'manage_tools' => 'oBxGroupsManageTools'
  192. );
  193. $this->_aGridObjects = array(
  194. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  195. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  196. );
  197. }
  198. }
  199. /** @} */