BxGroupsConfig.php 11 KB

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