BxForumConfig.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 Forum Forum
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxForumConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'subscribe-discussion' => 'checkAllowedSubscribe',
  18. 'unsubscribe-discussion' => 'checkAllowedUnsubscribe',
  19. 'stick-discussion' => 'checkAllowedStickAnyEntry',
  20. 'unstick-discussion' => 'checkAllowedUnstickAnyEntry',
  21. 'lock-discussion' => 'checkAllowedLockAnyEntry',
  22. 'unlock-discussion' => 'checkAllowedUnlockAnyEntry',
  23. 'hide-discussion' => 'checkAllowedHideAnyEntry',
  24. 'unhide-discussion' => 'checkAllowedUnhideAnyEntry',
  25. 'edit-discussion' => 'checkAllowedEdit',
  26. 'delete-discussion' => 'checkAllowedDelete'
  27. );
  28. $this->CNF = array (
  29. // module icon
  30. 'ICON' => 'far comments col-blue2',
  31. // database tables
  32. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'discussions',
  33. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  34. // database fields
  35. 'FIELD_ID' => 'id',
  36. 'FIELD_AUTHOR' => 'author',
  37. 'FIELD_ADDED' => 'added',
  38. 'FIELD_CHANGED' => 'changed',
  39. 'FIELD_TITLE' => 'title',
  40. 'FIELD_TEXT' => 'text',
  41. 'FIELD_TEXT_ID' => 'discussion-text',
  42. 'FIELD_TEXT_COMMENTS' => 'text_comments',
  43. 'FIELD_CATEGORY' => 'cat',
  44. 'FIELD_LR_AUTHOR' => 'lr_profile_id',
  45. 'FIELD_LR_ADDED' => 'lr_timestamp',
  46. 'FIELD_LR_COMMENT_ID' => 'lr_comment_id',
  47. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  48. 'FIELD_PHOTO' => 'attachments',
  49. 'FIELD_THUMB' => 'thumb',
  50. 'FIELD_VIEWS' => 'views',
  51. 'FIELD_VOTES' => 'votes',
  52. 'FIELD_COMMENTS' => 'comments',
  53. 'FIELD_STICK' => 'stick',
  54. 'FIELD_LOCK' => 'lock',
  55. 'FIELD_STATUS' => 'status',
  56. 'FIELD_STATUS_ADMIN' => 'status_admin',
  57. 'FIELD_LABELS' => 'labels',
  58. 'FIELD_ANONYMOUS' => 'anonymous',
  59. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  60. // page URIs
  61. 'URI_VIEW_ENTRY' => 'view-discussion',
  62. 'URI_AUTHOR_ENTRIES' => 'discussions-author',
  63. 'URI_ENTRIES_BY_CONTEXT' => 'discussions-context',
  64. 'URI_CATEGORY_ENTRIES' => 'discussions-category',
  65. 'URI_KEYWORD_ENTRIES' => 'discussions-keyword',
  66. 'URI_ADD_ENTRY' => 'create-discussion',
  67. 'URI_EDIT_ENTRY' => 'edit-discussion',
  68. 'URI_MANAGE_COMMON' => 'discussions-manage',
  69. 'URL_HOME' => 'page.php?i=discussions-home',
  70. 'URL_UPDATED' => 'page.php?i=discussions-updated',
  71. 'URL_NEW' => 'page.php?i=discussions-new',
  72. 'URL_TOP' => 'page.php?i=discussions-top',
  73. 'URL_POPULAR' => 'page.php?i=discussions-popular',
  74. 'URL_MANAGE_COMMON' => 'page.php?i=discussions-manage',
  75. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=discussions-administration',
  76. // some params
  77. 'PARAM_CHARS_SUMMARY' => 'bx_forum_summary_chars',
  78. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_forum_plain_summary_chars',
  79. 'PARAM_NUM_RSS' => 'bx_forum_rss_num',
  80. 'PARAM_SEARCHABLE_FIELDS' => 'bx_forum_searchable_fields',
  81. 'PARAM_AUTOSUBSCRIBE_CREATED' => 'bx_forum_autosubscribe_created',
  82. 'PARAM_AUTOSUBSCRIBE_REPLIED' => 'bx_forum_autosubscribe_replied',
  83. // objects
  84. 'OBJECT_GRID' => 'bx_forum',
  85. 'OBJECT_GRID_FAVORITE' => 'bx_forum_favorite',
  86. 'OBJECT_GRID_FEATURE' => 'bx_forum_feature',
  87. 'OBJECT_GRID_ADMINISTRATION' => 'bx_forum_administration',
  88. 'OBJECT_GRID_COMMON' => 'bx_forum_common',
  89. 'OBJECT_GRID_CATEGORIES' => 'bx_forum_categories',
  90. 'OBJECT_STORAGE' => 'bx_forum_files',
  91. 'OBJECT_STORAGE_CMTS' => 'bx_forum_files_cmts',
  92. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_forum_preview',
  93. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS' => 'bx_forum_preview_cmts',
  94. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_forum_gallery',
  95. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_forum_cover',
  96. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  97. 'OBJECT_REPORTS' => 'bx_forum',
  98. 'OBJECT_VIEWS' => 'bx_forum',
  99. 'OBJECT_VOTES' => 'bx_forum',
  100. 'OBJECT_SCORES' => 'bx_forum',
  101. 'OBJECT_FAVORITES' => 'bx_forum',
  102. 'OBJECT_FEATURED' => 'bx_forum',
  103. 'OBJECT_CATEGORY' => 'bx_forum_cats',
  104. 'OBJECT_COMMENTS' => 'bx_forum',
  105. 'OBJECT_METATAGS' => 'bx_forum',
  106. 'OBJECT_PRIVACY_VIEW' => 'bx_forum_allow_view_to',
  107. 'OBJECT_FORM_ENTRY' => 'bx_forum',
  108. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_forum_entry_view',
  109. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_forum_entry_add',
  110. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_forum_entry_edit',
  111. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_forum_entry_delete',
  112. 'OBJECT_FORM_SEARCH' => 'bx_forum_search',
  113. 'OBJECT_FORM_SEARCH_DISPLAY_FULL' => 'bx_forum_search_full',
  114. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_forum_view', // actions menu on view entry page
  115. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_forum_view_more', // more actions menu on view entry page
  116. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_forum_view_actions', // all actions menu on view entry page
  117. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_forum_my', // actions menu on my entries page
  118. 'OBJECT_MENU_SNIPPET_META_MAIN' => 'bx_forum_snippet_meta_main', // menu for 'main' snippet meta info
  119. 'OBJECT_MENU_SNIPPET_META_COUNTERS' => 'bx_forum_snippet_meta_counters', // menu for 'counters' snippet meta info
  120. 'OBJECT_MENU_SNIPPET_META_REPLY' => 'bx_forum_snippet_meta_reply', // menu for 'reply' snippet meta info
  121. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_forum_menu_manage_tools', //manage menu in content administration tools
  122. 'OBJECT_MENU_SUBMENU' => 'bx_forum_submenu', // main module submenu
  123. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
  124. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'forum', // first item in view entry submenu from main module submenu
  125. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  126. 'OBJECT_CONNECTION_SUBSCRIBERS' => 'bx_forum_subscribers',
  127. // menu items which visibility depends on custom visibility checking
  128. 'MENU_ITEM_TO_METHOD' => array (
  129. 'bx_forum_view' => $aMenuItems2Methods,
  130. 'bx_forum_view_more' => $aMenuItems2Methods,
  131. ),
  132. // some language keys
  133. 'T' => array (
  134. 'txt_sample_single' => '_bx_forum_txt_sample_single',
  135. 'txt_sample_single_with_article' => '_bx_forum_txt_sample_single_with_article',
  136. 'txt_sample_comment_single' => '_bx_forum_txt_sample_comment_single',
  137. 'txt_sample_vote_single' => '_bx_forum_txt_sample_vote_single',
  138. 'form_field_author' => '_bx_forum_form_entry_input_author',
  139. 'grid_action_err_delete' => '_bx_forum_grid_action_err_delete',
  140. 'grid_txt_account_manager' => '_bx_forum_grid_txt_account_manager',
  141. 'filter_item_active' => '_bx_forum_grid_filter_item_title_adm_active',
  142. 'filter_item_hidden' => '_bx_forum_grid_filter_item_title_adm_hidden',
  143. 'filter_item_select_one_filter1' => '_bx_forum_grid_filter_item_title_adm_select_one_filter1',
  144. 'menu_item_manage_my' => '_bx_forum_menu_item_title_manage_my',
  145. 'menu_item_manage_all' => '_bx_forum_menu_item_title_manage_all',
  146. 'txt_all_entries_in' => '_bx_forum_txt_all_entries_in',
  147. 'txt_all_entries_by_author' => '_bx_forum_page_title_browse_by_author',
  148. 'txt_all_entries_by_context' => '_bx_forum_page_title_browse_by_context',
  149. 'txt_pict_use_as_thumb' => '_bx_forum_form_entry_input_picture_use_as_thumb'
  150. ),
  151. );
  152. $this->_aJsClasses = array(
  153. 'main' => 'BxForumMain',
  154. 'entry' => 'BxForumEntry',
  155. 'manage_tools' => 'BxForumManageTools',
  156. 'studio' => 'BxForumStudio'
  157. );
  158. $this->_aJsObjects = array(
  159. 'main' => 'oBxForumMain',
  160. 'entry' => 'oBxForumEntry',
  161. 'manage_tools' => 'oBxForumManageTools',
  162. 'studio' => 'oBxForumStudio'
  163. );
  164. $this->_aGridObjects = array(
  165. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  166. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  167. );
  168. }
  169. }
  170. /** @} */