BxForumConfig.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. 'resolve-discussion' => 'checkAllowedResolveAnyEntry',
  22. 'unresolve-discussion' => 'checkAllowedUnresolveAnyEntry',
  23. 'lock-discussion' => 'checkAllowedLockAnyEntry',
  24. 'unlock-discussion' => 'checkAllowedUnlockAnyEntry',
  25. 'hide-discussion' => 'checkAllowedHideAnyEntry',
  26. 'unhide-discussion' => 'checkAllowedUnhideAnyEntry',
  27. 'approve' => 'checkAllowedApprove',
  28. 'edit-discussion' => 'checkAllowedEdit',
  29. 'delete-discussion' => 'checkAllowedDelete'
  30. );
  31. $this->CNF = array_merge($this->CNF, array (
  32. // module icon
  33. 'ICON' => 'far comments',
  34. // database tables
  35. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'discussions',
  36. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  37. // database fields
  38. 'FIELD_ID' => 'id',
  39. 'FIELD_AUTHOR' => 'author',
  40. 'FIELD_ADDED' => 'added',
  41. 'FIELD_CHANGED' => 'changed',
  42. 'FIELD_TITLE' => 'title',
  43. 'FIELD_TEXT' => 'text',
  44. 'FIELD_TEXT_ID' => 'discussion-text',
  45. 'FIELD_TEXT_COMMENTS' => 'text_comments',
  46. 'FIELD_CATEGORY' => 'cat',
  47. 'FIELD_MULTICAT' => 'multicat',
  48. 'FIELD_LR_AUTHOR' => 'lr_profile_id',
  49. 'FIELD_LR_ADDED' => 'lr_timestamp',
  50. 'FIELD_LR_COMMENT_ID' => 'lr_comment_id',
  51. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  52. 'FIELD_CF' => 'cf',
  53. 'FIELD_COVER' => 'covers',
  54. 'FIELD_PHOTO' => 'pictures',
  55. 'FIELD_VIDEO' => 'videos',
  56. 'FIELD_FILE' => 'files',
  57. 'FIELD_POLL' => 'polls',
  58. 'FIELD_THUMB' => 'thumb',
  59. 'FIELD_THUMB_POSITION' => 'thumb_data',
  60. 'FIELD_ATTACHMENTS' => 'attachments',
  61. 'FIELD_LINK' => 'link',
  62. 'FIELD_VIEWS' => 'views',
  63. 'FIELD_VOTES' => 'votes',
  64. 'FIELD_COMMENTS' => 'comments',
  65. 'FIELD_SCORE' => 'score',
  66. 'FIELD_STICK' => 'stick',
  67. 'FIELD_LOCK' => 'lock',
  68. 'FIELD_RESOLVE' => 'resolved',
  69. 'FIELD_RESOLVABLE' => 'resolvable',
  70. 'FIELD_STATUS' => 'status',
  71. 'FIELD_STATUS_ADMIN' => 'status_admin',
  72. 'FIELD_LABELS' => 'labels',
  73. 'FIELD_ANONYMOUS' => 'anonymous',
  74. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  75. // some params
  76. 'PARAM_MULTICAT_ENABLED' => true,
  77. 'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_forum_auto_activation_for_categories',
  78. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_forum_per_page_for_favorites_lists',
  79. // page URIs
  80. 'URI_VIEW_ENTRY' => 'view-discussion',
  81. 'URI_AUTHOR_ENTRIES' => 'discussions-author',
  82. 'URI_ENTRIES_BY_CONTEXT' => 'discussions-context',
  83. 'URI_CATEGORY_ENTRIES' => 'discussions-category',
  84. 'URI_KEYWORD_ENTRIES' => 'discussions-keyword',
  85. 'URI_ADD_ENTRY' => 'create-discussion',
  86. 'URI_EDIT_ENTRY' => 'edit-discussion',
  87. 'URI_MANAGE_COMMON' => 'discussions-manage',
  88. 'URI_FAVORITES_LIST' => 'discussions-favorites',
  89. 'URL_HOME' => 'page.php?i=discussions-home',
  90. 'URL_UPDATED' => 'page.php?i=discussions-updated',
  91. 'URL_NEW' => 'page.php?i=discussions-new',
  92. 'URL_TOP' => 'page.php?i=discussions-top',
  93. 'URL_POPULAR' => 'page.php?i=discussions-popular',
  94. 'URL_PARTAKEN' => 'page.php?i=discussions-partaken',
  95. 'URL_MANAGE_COMMON' => 'page.php?i=discussions-manage',
  96. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=discussions-administration',
  97. // some params
  98. 'PARAM_AUTO_APPROVE' => 'bx_forum_enable_auto_approve',
  99. 'PARAM_CHARS_SUMMARY' => 'bx_forum_summary_chars',
  100. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_forum_plain_summary_chars',
  101. 'PARAM_NUM_RSS' => 'bx_forum_rss_num',
  102. 'PARAM_SEARCHABLE_FIELDS' => 'bx_forum_searchable_fields',
  103. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_forum_per_page_browse_showcase',
  104. 'PARAM_AUTOSUBSCRIBE_CREATED' => 'bx_forum_autosubscribe_created',
  105. 'PARAM_AUTOSUBSCRIBE_REPLIED' => 'bx_forum_autosubscribe_replied',
  106. 'PARAM_LINKS_ENABLED' => true,
  107. // objects
  108. 'OBJECT_GRID' => 'bx_forum',
  109. 'OBJECT_GRID_FAVORITE' => 'bx_forum_favorite',
  110. 'OBJECT_GRID_FEATURE' => 'bx_forum_feature',
  111. 'OBJECT_GRID_ADMINISTRATION' => 'bx_forum_administration',
  112. 'OBJECT_GRID' => 'bx_forum',
  113. 'OBJECT_GRID_COMMON' => 'bx_forum_common',
  114. 'OBJECT_GRID_CATEGORIES' => 'bx_forum_categories',
  115. 'OBJECT_STORAGE' => 'bx_forum_covers',
  116. 'OBJECT_STORAGE_FILES' => 'bx_forum_files',
  117. 'OBJECT_STORAGE_PHOTOS' => 'bx_forum_photos',
  118. 'OBJECT_STORAGE_VIDEOS' => 'bx_forum_videos',
  119. 'OBJECT_STORAGE_CMTS' => 'bx_forum_files_cmts', // for comments
  120. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_forum_preview',
  121. 'OBJECT_IMAGES_TRANSCODER_MINIATURE' => 'bx_forum_miniature',
  122. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_forum_gallery',
  123. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_forum_cover',
  124. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => 'bx_forum_preview_files',
  125. 'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => 'bx_forum_gallery_files',
  126. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_forum_preview_photos',
  127. 'OBJECT_IMAGES_TRANSCODER_MINIATURE_PHOTOS' => 'bx_forum_miniature_photos',
  128. 'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_forum_gallery_photos',
  129. 'OBJECT_IMAGES_TRANSCODER_VIEW_PHOTOS' => 'bx_forum_view_photos',
  130. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS' => 'bx_forum_preview_cmts', // for comments
  131. 'OBJECT_VIDEOS_TRANSCODERS' => array(
  132. 'poster' => 'bx_forum_videos_poster',
  133. 'poster_preview' => 'bx_forum_videos_poster_preview',
  134. 'mp4' => 'bx_forum_videos_mp4',
  135. 'mp4_hd' => 'bx_forum_videos_mp4_hd'
  136. ),
  137. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
  138. 'OBJECT_REPORTS' => 'bx_forum',
  139. 'OBJECT_VIEWS' => 'bx_forum',
  140. 'OBJECT_VOTES' => 'bx_forum',
  141. 'OBJECT_REACTIONS' => 'bx_forum_reactions',
  142. 'OBJECT_SCORES' => 'bx_forum',
  143. 'OBJECT_FAVORITES' => 'bx_forum',
  144. 'OBJECT_FEATURED' => 'bx_forum',
  145. 'OBJECT_CATEGORY' => 'bx_forum_cats',
  146. 'OBJECT_COMMENTS' => 'bx_forum',
  147. 'OBJECT_NOTES' => 'bx_forum_notes',
  148. 'OBJECT_METATAGS' => 'bx_forum',
  149. 'OBJECT_PRIVACY_VIEW' => 'bx_forum_allow_view_to',
  150. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_forum_allow_view_favorite_list',
  151. 'OBJECT_FORM_ENTRY' => 'bx_forum',
  152. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_forum_entry_view',
  153. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_forum_entry_add',
  154. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_forum_entry_edit',
  155. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_forum_entry_delete',
  156. 'OBJECT_FORM_POLL' => 'bx_forum_poll',
  157. 'OBJECT_FORM_POLL_DISPLAY_ADD' => 'bx_forum_poll_add',
  158. 'OBJECT_FORM_SEARCH' => 'bx_forum_search',
  159. 'OBJECT_FORM_SEARCH_DISPLAY_FULL' => 'bx_forum_search_full',
  160. 'OBJECT_MENU_ENTRY_ATTACHMENTS' => 'bx_forum_entry_attachments', // attachments menu in create/edit forms
  161. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_forum_view', // actions menu on view entry page
  162. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_forum_view_more', // more actions menu on view entry page
  163. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_forum_view_actions', // all actions menu on view entry page
  164. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_forum_my', // actions menu on my entries page
  165. 'OBJECT_MENU_SNIPPET_META' => 'bx_forum_snippet_meta_main', // menu for 'main' snippet meta info
  166. 'OBJECT_MENU_SNIPPET_META_MAIN' => 'bx_forum_snippet_meta_main', // menu for 'main' snippet meta info
  167. 'OBJECT_MENU_SNIPPET_META_COUNTERS' => 'bx_forum_snippet_meta_counters', // menu for 'counters' snippet meta info
  168. 'OBJECT_MENU_SNIPPET_META_REPLY' => 'bx_forum_snippet_meta_reply', // menu for 'reply' snippet meta info
  169. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_forum_menu_manage_tools', //manage menu in content administration tools
  170. 'OBJECT_MENU_SUBMENU' => 'bx_forum_submenu', // main module submenu
  171. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
  172. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'forum', // first item in view entry submenu from main module submenu
  173. 'OBJECT_UPLOADERS' => array('sys_html5'),
  174. 'OBJECT_CONNECTION_SUBSCRIBERS' => 'bx_forum_subscribers',
  175. 'BADGES_AVALIABLE' => true,
  176. // menu items which visibility depends on custom visibility checking
  177. 'MENU_ITEM_TO_METHOD' => array (
  178. 'bx_forum_view' => $aMenuItems2Methods,
  179. 'bx_forum_view_more' => $aMenuItems2Methods,
  180. ),
  181. // informer messages
  182. 'INFORMERS' => array (
  183. 'approving' => array (
  184. 'name' => 'bx-forum-approving',
  185. 'map' => array (
  186. 'pending' => array('msg' => '_bx_forum_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
  187. 'hidden' => array('msg' => '_bx_forum_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
  188. ),
  189. ),
  190. ),
  191. // some language keys
  192. 'T' => array (
  193. 'txt_sample_single' => '_bx_forum_txt_sample_single',
  194. 'txt_sample_single_with_article' => '_bx_forum_txt_sample_single_with_article',
  195. 'txt_sample_comment_single' => '_bx_forum_txt_sample_comment_single',
  196. 'txt_sample_vote_single' => '_bx_forum_txt_sample_vote_single',
  197. 'txt_sample_reaction_single' => '_bx_forum_txt_sample_reaction_single',
  198. 'txt_sample_score_up_single' => '_bx_forum_txt_sample_score_up_single',
  199. 'txt_sample_score_down_single' => '_bx_forum_txt_sample_score_down_single',
  200. 'form_field_author' => '_bx_forum_form_entry_input_author',
  201. 'form_field_covers_uploader_simple' => '_bx_forum_form_entry_input_covers_uploader_simple_title',
  202. 'form_field_covers_uploader_html5' => '_bx_forum_form_entry_input_covers_uploader_html5_title',
  203. 'grid_action_err_delete' => '_bx_forum_grid_action_err_delete',
  204. 'grid_txt_account_manager' => '_bx_forum_grid_txt_account_manager',
  205. 'filter_item_active' => '_bx_forum_grid_filter_item_title_adm_active',
  206. 'filter_item_hidden' => '_bx_forum_grid_filter_item_title_adm_hidden',
  207. 'filter_item_pending' => '_bx_forum_grid_filter_item_title_adm_pending',
  208. 'filter_item_select_one_filter1' => '_bx_forum_grid_filter_item_title_adm_select_one_filter1',
  209. 'filter_item_select_one_filter2' => '_bx_forum_grid_filter_item_title_adm_select_one_filter2',
  210. 'menu_item_manage_my' => '_bx_forum_menu_item_title_manage_my',
  211. 'menu_item_manage_all' => '_bx_forum_menu_item_title_manage_all',
  212. 'txt_all_entries_in' => '_bx_forum_txt_all_entries_in',
  213. 'txt_all_entries_by_author' => '_bx_forum_page_title_browse_by_author',
  214. 'txt_all_entries_by_context' => '_bx_forum_page_title_browse_by_context',
  215. 'txt_pict_use_as_thumb' => '_bx_forum_form_entry_input_picture_use_as_thumb',
  216. 'txt_poll_form_answers_add' => '_bx_forum_form_poll_input_answers_add',
  217. 'txt_poll_menu_view_answers' => '_bx_forum_txt_poll_view_answers',
  218. 'txt_poll_menu_view_results' => '_bx_forum_txt_poll_view_results',
  219. 'txt_poll_menu_view_' => '_bx_forum_txt_poll_view_',
  220. 'txt_poll_answer_vote_do_by' => '_bx_forum_txt_poll_answer_vote_do_by',
  221. 'txt_poll_answer_vote_counter' => '_bx_forum_txt_poll_answer_vote_counter',
  222. 'txt_poll_answer_vote_percent' => '_bx_forum_txt_poll_answer_vote_percent'
  223. ),
  224. ));
  225. $this->_aPrefixes = array(
  226. 'style' => 'bx-forum',
  227. );
  228. $this->_aJsClasses = array_merge($this->_aJsClasses, array(
  229. 'main' => 'BxForumMain',
  230. 'entry' => 'BxForumEntry',
  231. 'manage_tools' => 'BxForumManageTools',
  232. 'studio' => 'BxForumStudio',
  233. 'categories' => 'BxDolCategories'
  234. ));
  235. $this->_aJsObjects = array_merge($this->_aJsObjects, array(
  236. 'main' => 'oBxForumMain',
  237. 'entry' => 'oBxForumEntry',
  238. 'manage_tools' => 'oBxForumManageTools',
  239. 'studio' => 'oBxForumStudio',
  240. 'categories' => 'oBxDolCategories'
  241. ));
  242. $this->_aGridObjects = array(
  243. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  244. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  245. 'main' => $this->CNF['OBJECT_GRID'],
  246. );
  247. $this->_bAttachmentsInTimeline = true;
  248. }
  249. }
  250. /** @} */