BxPersonsConfig.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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 Persons Persons
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxPersonsConfig extends BxBaseModProfileConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
  17. 'persons-profile-friends' => 'checkAllowedFriendsView',
  18. 'persons-profile-relations' => 'checkAllowedRelationsView',
  19. 'persons-profile-subscriptions' => 'checkAllowedSubscriptionsView'
  20. ));
  21. $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
  22. 'view-persons-profile' => 'checkAllowedView',
  23. 'edit-persons-profile' => 'checkAllowedEdit',
  24. 'edit-persons-cover' => 'checkAllowedChangeCover',
  25. 'edit-persons-badge' => 'checkAllowedChangeBadge',
  26. 'delete-persons-profile' => 'checkAllowedDelete',
  27. ));
  28. $this->CNF = array (
  29. // module icon
  30. 'ICON' => 'user',
  31. // database tables
  32. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
  33. 'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
  34. // database fields
  35. 'FIELD_ID' => 'id',
  36. 'FIELD_AUTHOR' => 'author',
  37. 'FIELD_ADDED' => 'added',
  38. 'FIELD_CHANGED' => 'changed',
  39. 'FIELD_NAME' => 'fullname',
  40. 'FIELD_LAST_NAME' => 'last_name',
  41. 'FIELD_TITLE' => 'fullname',
  42. 'FIELD_TEXT' => 'description',
  43. 'FIELD_PICTURE' => 'picture',
  44. 'FIELD_COVER' => 'cover',
  45. 'FIELD_COVER_POSITION' => 'cover_data',
  46. 'FIELD_BADGE' => 'badge',
  47. 'FIELD_BADGE_LINK' => 'badge_link',
  48. 'FIELD_BADGE_LINK_SELECT' => 'badge_link_select',
  49. 'FIELD_BADGE_LINK_CUSTOM' => 'badge_link_custom',
  50. 'FIELD_BIRTHDAY' => 'birthday',
  51. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  52. 'FIELD_ALLOW_POST_TO' => 'allow_post_to',
  53. 'FIELD_ALLOW_CONTACT_TO' => 'allow_contact_to',
  54. 'FIELD_VIEWS' => 'views',
  55. 'FIELD_VOTES' => 'votes',
  56. 'FIELD_REACTIONS' => 'rvotes',
  57. 'FIELD_SCORE' => 'score',
  58. 'FIELD_SCORE_UP' => 'sc_up',
  59. 'FIELD_SCORE_DOWN' => 'sc_down',
  60. 'FIELD_COMMENTS' => 'comments',
  61. 'FIELDS_QUICK_SEARCH' => array('fullname', 'last_name'),
  62. 'FIELD_LOCATION' => 'location',
  63. 'FIELD_LOCATION_PREFIX' => 'location',
  64. 'FIELD_LABELS' => 'labels',
  65. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  66. // page URIs
  67. 'URI_VIEW_ENTRY' => 'view-persons-profile',
  68. 'URI_VIEW_FRIENDS' => 'persons-profile-friends',
  69. 'URI_VIEW_FRIEND_REQUESTS' => 'persons-friend-requests',
  70. 'URI_VIEW_RELATIONS' => 'persons-profile-relations',
  71. 'URI_VIEW_FAVORITES' => 'persons-profile-favorites',
  72. 'URI_ADD_ENTRY' => 'create-persons-profile',
  73. 'URI_EDIT_ENTRY' => 'edit-persons-profile',
  74. 'URI_MANAGE_COMMON' => 'persons-manage',
  75. 'URI_VIEW_SUBSCRIPTIONS' => 'persons-profile-subscriptions',
  76. 'URL_HOME' => 'page.php?i=persons-home',
  77. 'URL_CREATE' => 'page.php?i=create-persons-profile',
  78. 'URL_MANAGE_COMMON' => 'page.php?i=persons-manage',
  79. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=persons-administration',
  80. // some params
  81. 'ALLOW_AS_CONTEXT' => defined('BX_PERSONS_AS_CONTEXT'),
  82. 'PARAM_AUTOAPPROVAL' => 'bx_persons_autoapproval',
  83. 'PARAM_ENABLE_ACTIVATION_LETTER' => 'bx_persons_enable_profile_activation_letter',
  84. 'PARAM_DEFAULT_ACL_LEVEL' => 'bx_persons_default_acl_level',
  85. 'PARAM_NUM_RSS' => 'bx_persons_num_rss',
  86. 'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_persons_num_connections_quick',
  87. 'PARAM_SEARCHABLE_FIELDS' => 'bx_persons_searchable_fields',
  88. 'PARAM_FRIENDS' => 'bx_persons_friends',
  89. 'PARAM_PUBLIC_SBSN' => 'bx_persons_public_subscriptions',
  90. 'PARAM_PUBLIC_SBSD' => 'bx_persons_public_subscribed_me',
  91. 'PARAM_REDIRECT_AADD' => 'bx_persons_redirect_aadd',
  92. 'PARAM_REDIRECT_AADD_CUSTOM_URL' => 'bx_persons_redirect_aadd_custom_url',
  93. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_persons_per_page_browse_showcase',
  94. 'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_persons_per_page_browse_recommended',
  95. // objects
  96. 'OBJECT_STORAGE' => 'bx_persons_pictures',
  97. 'OBJECT_STORAGE_COVER' => 'bx_persons_pictures',
  98. 'OBJECT_STORAGE_BADGE' => 'bx_persons_pictures',
  99. 'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_persons_thumb',
  100. 'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_persons_icon',
  101. 'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_persons_avatar',
  102. 'OBJECT_IMAGES_TRANSCODER_AVATAR_BIG' => 'bx_persons_avatar_big',
  103. 'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_persons_picture',
  104. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_persons_cover',
  105. 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_persons_cover_thumb',
  106. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_persons_gallery',
  107. 'OBJECT_IMAGES_TRANSCODER_BADGE' => 'bx_persons_badge',
  108. 'OBJECT_VIEWS' => 'bx_persons',
  109. 'OBJECT_VOTES' => 'bx_persons',
  110. 'OBJECT_REACTIONS' => 'bx_persons_reactions',
  111. 'OBJECT_SCORES' => 'bx_persons',
  112. 'OBJECT_FAVORITES' => 'bx_persons',
  113. 'OBJECT_FEATURED' => 'bx_persons',
  114. 'OBJECT_COMMENTS' => 'bx_persons',
  115. 'OBJECT_NOTES' => 'bx_persons_notes',
  116. 'OBJECT_REPORTS' => 'bx_persons',
  117. 'OBJECT_METATAGS' => 'bx_persons',
  118. 'OBJECT_FORM_ENTRY' => 'bx_person',
  119. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_person_view',
  120. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_person_view_full', // for "info" tab on view profile page
  121. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_person_add',
  122. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_person_edit',
  123. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_person_edit_cover',
  124. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_BADGE' => 'bx_person_edit_badge',
  125. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_person_delete',
  126. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_persons_view_actions', // actions menu on view entry page
  127. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_persons_view_actions_more', // actions menu on view entry page for "more" popup
  128. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_persons_view_actions_all', // all actions menu on view entry page
  129. 'OBJECT_MENU_SUBMENU' => 'bx_persons_submenu', // main module submenu
  130. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_persons_view_submenu', // view entry submenu
  131. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'persons-home', // first item in view entry submenu from main module submenu
  132. 'OBJECT_MENU_MANAGE_VIEW_ENTRY' => '',
  133. 'OBJECT_MENU_VIEW_ENTRY_META' => 'bx_persons_view_meta', // meta menu on view entry page
  134. 'OBJECT_MENU_SNIPPET_META' => 'bx_persons_snippet_meta', // menu for snippet meta info
  135. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_persons_menu_manage_tools', //manage menu in content administration tools
  136. 'OBJECT_PAGE_VIEW_ENTRY' => 'bx_persons_view_profile',
  137. 'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_persons_view_profile_closed',
  138. 'OBJECT_PAGE_JOINED_ENTRY' => 'bx_persons_join_profile',
  139. 'OBJECT_PRIVACY_VIEW' => 'bx_persons_allow_view_to',
  140. 'OBJECT_PRIVACY_POST' => 'bx_persons_allow_post_to',
  141. 'OBJECT_PRIVACY_CONTACT' => 'bx_persons_allow_contact_to',
  142. 'OBJECT_GRID_ADMINISTRATION' => 'bx_persons_administration',
  143. 'OBJECT_GRID_COMMON' => 'bx_persons_common',
  144. 'OBJECT_UPLOADERS_COVER' => array('bx_persons_cover_crop'),
  145. 'OBJECT_UPLOADERS_PICTURE' => array('bx_persons_picture_crop'),
  146. 'OBJECT_UPLOADERS_BADGE' => array('bx_persons_badge_crop'),
  147. 'BADGES_AVALIABLE' => true,
  148. 'EMAIL_FRIEND_REQUEST' => 'bx_persons_friend_request',
  149. 'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
  150. 'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_profile_snippet_meta',
  151. 'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
  152. 'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
  153. // menu items which visibility depends on custom visibility checking
  154. 'MENU_ITEM_TO_METHOD' => array (
  155. 'bx_persons_view_submenu' => $this->_aMenuItems2MethodsSubmenu,
  156. 'bx_persons_view_actions' => $this->_aMenuItems2MethodsActions,
  157. 'bx_persons_view_actions_more' => $this->_aMenuItems2MethodsActions,
  158. 'bx_persons_view_actions_all' => $this->_aMenuItems2MethodsActions,
  159. ),
  160. // informer messages
  161. 'INFORMERS' => array (
  162. 'status' => array (
  163. 'name' => 'bx-persons-status-not-active',
  164. 'map' => array (
  165. BX_PROFILE_STATUS_PENDING => '_bx_persons_txt_account_pending',
  166. BX_PROFILE_STATUS_SUSPENDED => '_bx_persons_txt_account_suspended',
  167. ),
  168. ),
  169. 'status_moderation' => array (
  170. 'name' => 'bx-persons-status-not-active-moderation',
  171. 'map' => array (
  172. BX_PROFILE_STATUS_PENDING => '_bx_persons_txt_account_pending_moderation',
  173. BX_PROFILE_STATUS_SUSPENDED => '_bx_persons_txt_account_suspended_moderation',
  174. ),
  175. ),
  176. ),
  177. // some language keys
  178. 'T' => array (
  179. 'txt_sample_single' => '_bx_persons_txt_sample_single',
  180. 'txt_sample_comment_single' => '_bx_persons_txt_sample_comment_single',
  181. 'txt_sample_vote_single' => '_bx_persons_txt_sample_vote_single',
  182. 'txt_sample_score_up_single' => '_bx_persons_txt_sample_score_up_single',
  183. 'txt_sample_score_down_single' => '_bx_persons_txt_sample_score_down_single',
  184. 'txt_sample_pp_single' => '_bx_persons_txt_sample_pp_single',
  185. 'txt_sample_pp_single_with_article' => '_bx_persons_txt_sample_pp_single_with_article',
  186. 'txt_sample_pc_single' => '_bx_persons_txt_sample_pc_single',
  187. 'txt_sample_pc_single_with_article' => '_bx_persons_txt_sample_pc_single_with_article',
  188. 'txt_sample_pi_action' => '_bx_persons_txt_sample_pi_action',
  189. 'txt_sample_pi_action_user' => '_bx_persons_txt_sample_pi_action_user',
  190. 'txt_N_fans' => '_bx_persons_txt_N_friends',
  191. 'txt_ntfs_timeline_post_common' => '_bx_persons_txt_ntfs_timeline_post_common',
  192. 'form_field_picture' => '_bx_persons_form_profile_input_picture_search',
  193. 'form_field_online' => '_bx_persons_form_profile_input_online_search',
  194. 'menu_item_title_befriend_sent' => '_bx_persons_menu_item_title_befriend_sent',
  195. 'menu_item_title_unfriend_cancel_request' => '_bx_persons_menu_item_title_unfriend_cancel_request',
  196. 'menu_item_title_befriend_confirm' => '_bx_persons_menu_item_title_befriend_confirm',
  197. 'menu_item_title_unfriend_reject_request' => '_bx_persons_menu_item_title_unfriend_reject_request',
  198. 'menu_item_title_befriend' => '_bx_persons_menu_item_title_befriend',
  199. 'menu_item_title_unfriend' => '_bx_persons_menu_item_title_unfriend',
  200. 'grid_action_err_delete' => '_bx_persons_grid_action_err_delete',
  201. 'grid_txt_account_manager' => '_bx_persons_grid_txt_account_manager',
  202. 'filter_item_active' => '_bx_persons_grid_filter_item_title_adm_active',
  203. 'filter_item_pending' => '_bx_persons_grid_filter_item_title_adm_pending',
  204. 'filter_item_suspended' => '_bx_persons_grid_filter_item_title_adm_suspended',
  205. 'filter_item_unconfirmed' => '_bx_persons_grid_filter_item_title_adm_unconfirmed',
  206. 'filter_item_select_one_filter1' => '_bx_persons_grid_filter_item_title_adm_select_one_filter1',
  207. 'filter_item_select_one_filter2' => '_bx_persons_grid_filter_item_title_adm_select_one_filter2',
  208. 'menu_item_manage_my' => '_bx_persons_menu_item_title_manage_my',
  209. 'menu_item_manage_all' => '_bx_persons_menu_item_title_manage_all',
  210. 'txt_browse_favorites' => '_bx_persons_page_title_browse_favorites',
  211. 'option_redirect_aadd_profile' => '_bx_persons_option_redirect_aadd_profile',
  212. 'option_redirect_aadd_last' => '_bx_persons_option_redirect_aadd_last',
  213. 'option_redirect_aadd_custom' => '_bx_persons_option_redirect_aadd_custom',
  214. 'option_redirect_aadd_homepage' => '_bx_persons_option_redirect_aadd_homepage',
  215. 'option_activation_on' => '_bx_persons_option_activation_on',
  216. 'option_activation_off' => '_bx_persons_option_activation_off',
  217. 'option_activation_add' => '_bx_persons_option_activation_add',
  218. 'option_activation_edit' => '_bx_persons_option_activation_edit'
  219. ),
  220. );
  221. $this->_aJsClasses = array(
  222. 'manage_tools' => 'BxPersonsManageTools'
  223. );
  224. $this->_aJsObjects = array(
  225. 'manage_tools' => 'oBxPersonsManageTools'
  226. );
  227. $this->_aGridObjects = array(
  228. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  229. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  230. );
  231. }
  232. }
  233. /** @} */