BxPersonsConfig.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. $aMenuItems2MethodsSubmenu = array (
  17. 'persons-profile-subscriptions' => 'checkAllowedSubscriptionsView'
  18. );
  19. $aMenuItems2MethodsActions = array (
  20. 'view-persons-profile' => 'checkAllowedView',
  21. 'edit-persons-profile' => 'checkAllowedEdit',
  22. 'edit-persons-cover' => 'checkAllowedChangeCover',
  23. 'delete-persons-profile' => 'checkAllowedDelete',
  24. 'profile-friend-add' => 'checkAllowedFriendAdd',
  25. 'profile-friend-remove' => 'checkAllowedFriendRemove',
  26. 'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
  27. 'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
  28. 'profile-actions-more' => 'checkAllowedViewMoreMenu',
  29. 'profile-set-acl-level' => 'checkAllowedSetMembership',
  30. 'convos-compose' => 'checkAllowedCompose',
  31. );
  32. $this->CNF = array (
  33. // module icon
  34. 'ICON' => 'user col-blue3',
  35. // database tables
  36. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
  37. 'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
  38. // database fields
  39. 'FIELD_ID' => 'id',
  40. 'FIELD_AUTHOR' => 'author',
  41. 'FIELD_ADDED' => 'added',
  42. 'FIELD_CHANGED' => 'changed',
  43. 'FIELD_NAME' => 'fullname',
  44. 'FIELD_TITLE' => 'fullname',
  45. 'FIELD_TEXT' => 'description',
  46. 'FIELD_PICTURE' => 'picture',
  47. 'FIELD_COVER' => 'cover',
  48. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  49. 'FIELDS_QUICK_SEARCH' => array('fullname'),
  50. 'FIELD_LOCATION_PREFIX' => 'location',
  51. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  52. // page URIs
  53. 'URI_VIEW_ENTRY' => 'view-persons-profile',
  54. 'URI_VIEW_FRIENDS' => 'persons-profile-friends',
  55. 'URI_VIEW_FAVORITES' => 'persons-profile-favorites',
  56. 'URI_EDIT_ENTRY' => 'edit-persons-profile',
  57. 'URI_EDIT_COVER' => 'edit-persons-cover',
  58. 'URI_MANAGE_COMMON' => 'persons-manage',
  59. 'URL_HOME' => 'page.php?i=persons-home',
  60. 'URL_CREATE' => 'page.php?i=create-persons-profile',
  61. 'URL_MANAGE_COMMON' => 'page.php?i=persons-manage',
  62. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=persons-administration',
  63. // some params
  64. 'PARAM_AUTOAPPROVAL' => 'bx_persons_autoapproval',
  65. 'PARAM_DEFAULT_ACL_LEVEL' => 'bx_persons_default_acl_level',
  66. 'PARAM_NUM_RSS' => 'bx_persons_num_rss',
  67. 'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_persons_num_connections_quick',
  68. 'PARAM_SEARCHABLE_FIELDS' => 'bx_persons_searchable_fields',
  69. 'PARAM_PUBLIC_SBSN' => 'bx_persons_public_subscriptions',
  70. 'PARAM_PUBLIC_SBSD' => 'bx_persons_public_subscribed_me',
  71. 'PARAM_REDIRECT_AADD' => 'bx_persons_redirect_aadd',
  72. 'PARAM_REDIRECT_AADD_CUSTOM_URL' => 'bx_persons_redirect_aadd_custom_url',
  73. // objects
  74. 'OBJECT_STORAGE' => 'bx_persons_pictures',
  75. 'OBJECT_STORAGE_COVER' => 'bx_persons_pictures',
  76. 'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_persons_thumb',
  77. 'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_persons_icon',
  78. 'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_persons_avatar',
  79. 'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_persons_picture',
  80. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_persons_cover',
  81. 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_persons_cover_thumb',
  82. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_persons_gallery',
  83. 'OBJECT_VIEWS' => 'bx_persons',
  84. 'OBJECT_FAVORITES' => 'bx_persons',
  85. 'OBJECT_FEATURED' => 'bx_persons',
  86. 'OBJECT_COMMENTS' => 'bx_persons',
  87. 'OBJECT_REPORTS' => 'bx_persons',
  88. 'OBJECT_METATAGS' => 'bx_persons',
  89. 'OBJECT_FORM_ENTRY' => 'bx_person',
  90. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_person_view',
  91. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_person_view_full', // for "info" tab on view profile page
  92. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_person_add',
  93. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_person_edit',
  94. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_person_edit_cover',
  95. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_person_delete',
  96. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_persons_view_actions', // actions menu on view entry page
  97. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_persons_view_actions_more', // actions menu on view entry page for "more" popup
  98. 'OBJECT_MENU_SUBMENU' => 'bx_persons_submenu', // main module submenu
  99. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_persons_view_submenu', // view entry submenu
  100. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_COVER' => 'bx_persons_view_submenu_cover', // view entry submenu displayed in cover
  101. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'persons-home', // first item in view entry submenu from main module submenu
  102. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_persons_menu_manage_tools', //manage menu in content administration tools
  103. 'OBJECT_PAGE_VIEW_ENTRY' => 'bx_persons_view_profile',
  104. 'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_persons_view_profile_closed',
  105. 'OBJECT_PRIVACY_VIEW' => 'bx_persons_allow_view_to',
  106. 'OBJECT_GRID_ADMINISTRATION' => 'bx_persons_administration',
  107. 'OBJECT_GRID_COMMON' => 'bx_persons_common',
  108. 'OBJECT_UPLOADERS_COVER' => array('bx_persons_cover_crop'),
  109. 'OBJECT_UPLOADERS_PICTURE' => array('bx_persons_picture_crop'),
  110. 'EMAIL_FRIEND_REQUEST' => 'bx_persons_friend_request',
  111. 'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
  112. 'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
  113. 'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
  114. // menu items which visibility depends on custom visibility checking
  115. 'MENU_ITEM_TO_METHOD' => array (
  116. 'bx_persons_view_submenu' => $aMenuItems2MethodsSubmenu,
  117. 'bx_persons_view_actions' => $aMenuItems2MethodsActions,
  118. 'bx_persons_view_actions_more' => $aMenuItems2MethodsActions,
  119. ),
  120. // informer messages
  121. 'INFORMERS' => array (
  122. 'status' => array (
  123. 'name' => 'bx-persons-status-not-active',
  124. 'map' => array (
  125. BX_PROFILE_STATUS_PENDING => '_bx_persons_txt_account_pending',
  126. BX_PROFILE_STATUS_SUSPENDED => '_bx_persons_txt_account_suspended',
  127. ),
  128. ),
  129. ),
  130. // some language keys
  131. 'T' => array (
  132. 'txt_sample_single' => '_bx_persons_txt_sample_single',
  133. 'txt_sample_comment_single' => '_bx_persons_txt_sample_comment_single',
  134. 'txt_N_fans' => '_bx_persons_txt_N_friends',
  135. 'menu_item_title_befriend_sent' => '_bx_persons_menu_item_title_befriend_sent',
  136. 'menu_item_title_unfriend_cancel_request' => '_bx_persons_menu_item_title_unfriend_cancel_request',
  137. 'menu_item_title_befriend_confirm' => '_bx_persons_menu_item_title_befriend_confirm',
  138. 'menu_item_title_unfriend_reject_request' => '_bx_persons_menu_item_title_unfriend_reject_request',
  139. 'menu_item_title_befriend' => '_bx_persons_menu_item_title_befriend',
  140. 'menu_item_title_unfriend' => '_bx_persons_menu_item_title_unfriend',
  141. 'grid_action_err_delete' => '_bx_persons_grid_action_err_delete',
  142. 'grid_txt_account_manager' => '_bx_persons_grid_txt_account_manager',
  143. 'filter_item_active' => '_bx_persons_grid_filter_item_title_adm_active',
  144. 'filter_item_pending' => '_bx_persons_grid_filter_item_title_adm_pending',
  145. 'filter_item_suspended' => '_bx_persons_grid_filter_item_title_adm_suspended',
  146. 'filter_item_select_one_filter1' => '_bx_persons_grid_filter_item_title_adm_select_one_filter1',
  147. 'menu_item_manage_my' => '_bx_persons_menu_item_title_manage_my',
  148. 'menu_item_manage_all' => '_bx_persons_menu_item_title_manage_all',
  149. 'txt_browse_favorites' => '_bx_persons_page_title_browse_favorites',
  150. 'option_redirect_aadd_profile' => '_bx_persons_option_redirect_aadd_profile',
  151. 'option_redirect_aadd_last' => '_bx_persons_option_redirect_aadd_last',
  152. 'option_redirect_aadd_custom' => '_bx_persons_option_redirect_aadd_custom'
  153. ),
  154. );
  155. $this->_aJsClasses = array(
  156. 'manage_tools' => 'BxPersonsManageTools'
  157. );
  158. $this->_aJsObjects = array(
  159. 'manage_tools' => 'oBxPersonsManageTools'
  160. );
  161. $this->_aGridObjects = array(
  162. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  163. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  164. );
  165. }
  166. }
  167. /** @} */