BxPersonsConfig.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup Persons Persons
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxPersonsConfig extends BxBaseModProfileConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'view-persons-profile' => 'checkAllowedView',
  18. 'edit-persons-profile' => 'checkAllowedEdit',
  19. 'edit-persons-cover' => 'checkAllowedChangeCover',
  20. 'delete-persons-profile' => 'checkAllowedDelete',
  21. 'profile-friend-add' => 'checkAllowedFriendAdd',
  22. 'profile-friend-remove' => 'checkAllowedFriendRemove',
  23. 'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
  24. 'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
  25. 'profile-actions-more' => 'checkAllowedViewMoreMenu',
  26. 'profile-set-acl-level' => 'checkAllowedSetMembership',
  27. );
  28. $this->CNF = array (
  29. // module icon
  30. 'ICON' => 'user col-blue3',
  31. // database tables
  32. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
  33. // database fields
  34. 'FIELD_ID' => 'id',
  35. 'FIELD_AUTHOR' => 'author',
  36. 'FIELD_ADDED' => 'added',
  37. 'FIELD_CHANGED' => 'changed',
  38. 'FIELD_NAME' => 'fullname',
  39. 'FIELD_PICTURE' => 'picture',
  40. 'FIELD_PICTURE_PREVIEW' => 'picture_preview',
  41. 'FIELD_COVER' => 'cover',
  42. 'FIELD_COVER_PREVIEW' => 'cover_preview',
  43. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  44. 'FIELDS_QUICK_SEARCH' => array('fullname'),
  45. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  46. // page URIs
  47. 'URI_VIEW_ENTRY' => 'view-persons-profile',
  48. 'URI_EDIT_ENTRY' => 'edit-persons-profile',
  49. 'URI_EDIT_COVER' => 'edit-persons-cover',
  50. 'URI_MANAGE_COMMON' => 'persons-manage',
  51. 'URL_HOME' => 'page.php?i=persons-home',
  52. 'URL_MANAGE_COMMON' => 'page.php?i=persons-manage',
  53. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=persons-administration',
  54. // some params
  55. 'PARAM_AUTOAPPROVAL' => 'bx_persons_autoapproval',
  56. 'PARAM_DEFAULT_ACL_LEVEL' => 'bx_persons_default_acl_level',
  57. 'PARAM_NUM_RSS' => 'bx_persons_num_rss',
  58. 'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_persons_num_connections_quick',
  59. // objects
  60. 'OBJECT_STORAGE' => 'bx_persons_pictures',
  61. 'OBJECT_STORAGE_COVER' => 'bx_persons_pictures',
  62. 'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_persons_thumb',
  63. 'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_persons_icon',
  64. 'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_persons_avatar',
  65. 'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_persons_picture',
  66. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_persons_cover',
  67. 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_persons_cover_thumb',
  68. 'OBJECT_VIEWS' => 'bx_persons',
  69. 'OBJECT_METATAGS' => 'bx_persons',
  70. 'OBJECT_FORM_ENTRY' => 'bx_person',
  71. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_person_view',
  72. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_person_add',
  73. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_person_edit',
  74. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_person_edit_cover',
  75. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_person_delete',
  76. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_persons_view_actions', // actions menu on view entry page
  77. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_persons_view_actions_more', // actions menu on view entry page for "more" popup
  78. 'OBJECT_MENU_SUBMENU' => 'bx_persons_submenu', // main module submenu
  79. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_persons_view_submenu', // view entry submenu
  80. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_COVER' => 'bx_persons_view_submenu_cover', // view entry submenu displayed in cover
  81. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'persons-home', // first item in view entry submenu from main module submenu
  82. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_persons_menu_manage_tools', //manage menu in content administration tools
  83. 'OBJECT_PAGE_VIEW_ENTRY' => 'bx_persons_view_profile',
  84. 'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_persons_view_profile_closed',
  85. 'OBJECT_PRIVACY_VIEW' => 'bx_persons_allow_view_to',
  86. 'OBJECT_GRID_ADMINISTRATION' => 'bx_persons_administration',
  87. 'OBJECT_GRID_COMMON' => 'bx_persons_common',
  88. 'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
  89. 'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
  90. 'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
  91. // menu items which visibility depends on custom visibility checking
  92. 'MENU_ITEM_TO_METHOD' => array (
  93. 'bx_persons_view_actions' => $aMenuItems2Methods,
  94. 'bx_persons_view_actions_more' => $aMenuItems2Methods,
  95. ),
  96. // informer messages
  97. 'INFORMERS' => array (
  98. 'status' => array (
  99. 'name' => 'bx-persons-status-not-active',
  100. 'map' => array (
  101. BX_PROFILE_STATUS_PENDING => '_bx_persons_txt_account_pending',
  102. BX_PROFILE_STATUS_SUSPENDED => '_bx_persons_txt_account_suspended',
  103. ),
  104. ),
  105. ),
  106. // some language keys
  107. 'T' => array (
  108. 'txt_sample_single' => '_bx_persons_txt_sample_single',
  109. 'menu_item_title_befriend_sent' => '_bx_persons_menu_item_title_befriend_sent',
  110. 'menu_item_title_unfriend_cancel_request' => '_bx_persons_menu_item_title_unfriend_cancel_request',
  111. 'menu_item_title_befriend_confirm' => '_bx_persons_menu_item_title_befriend_confirm',
  112. 'menu_item_title_unfriend_reject_request' => '_bx_persons_menu_item_title_unfriend_reject_request',
  113. 'menu_item_title_befriend' => '_bx_persons_menu_item_title_befriend',
  114. 'menu_item_title_unfriend' => '_bx_persons_menu_item_title_unfriend',
  115. 'grid_action_err_delete' => '_bx_persons_grid_action_err_delete',
  116. 'grid_txt_account_manager' => '_bx_persons_grid_txt_account_manager',
  117. 'filter_item_active' => '_bx_persons_grid_filter_item_title_adm_active',
  118. 'filter_item_pending' => '_bx_persons_grid_filter_item_title_adm_pending',
  119. 'filter_item_suspended' => '_bx_persons_grid_filter_item_title_adm_suspended',
  120. 'filter_item_select_one_filter1' => '_bx_persons_grid_filter_item_title_adm_select_one_filter1',
  121. 'menu_item_manage_my' => '_bx_persons_menu_item_title_manage_my',
  122. 'menu_item_manage_all' => '_bx_persons_menu_item_title_manage_all',
  123. ),
  124. );
  125. $this->_aJsClasses = array(
  126. 'manage_tools' => 'BxPersonsManageTools'
  127. );
  128. $this->_aJsObjects = array(
  129. 'manage_tools' => 'oBxPersonsManageTools'
  130. );
  131. $this->_aGridObjects = array(
  132. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  133. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  134. );
  135. }
  136. }
  137. /** @} */