BxGlsrConfig.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 Glossary Glossary
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxGlsrConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'approve' => 'checkAllowedApprove',
  18. 'edit-glossary' => 'checkAllowedEdit',
  19. 'delete-glossary' => 'checkAllowedDelete',
  20. );
  21. $this->CNF = array (
  22. // module icon
  23. 'ICON' => 'fa-book',
  24. // database tables
  25. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'terms',
  26. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  27. // database fields
  28. 'FIELD_ID' => 'id',
  29. 'FIELD_AUTHOR' => 'author',
  30. 'FIELD_ADDED' => 'added',
  31. 'FIELD_CHANGED' => 'changed',
  32. 'FIELD_TITLE' => 'title',
  33. 'FIELD_TEXT' => 'text',
  34. 'FIELD_TEXT_ID' => 'glossary-text',
  35. 'FIELD_CATEGORY' => 'cat',
  36. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  37. 'FIELD_CF' => 'cf',
  38. 'FIELD_PHOTO' => 'pictures',
  39. 'FIELD_THUMB' => 'thumb',
  40. 'FIELD_VIEWS' => 'views',
  41. 'FIELD_COMMENTS' => 'comments',
  42. 'FIELD_STATUS' => 'status',
  43. 'FIELD_STATUS_ADMIN' => 'status_admin',
  44. 'FIELD_LABELS' => 'labels',
  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-glossary',
  48. 'URI_AUTHOR_ENTRIES' => 'glossary-author',
  49. 'URI_ENTRIES_BY_CONTEXT' => 'glossary-context',
  50. 'URI_ADD_ENTRY' => 'create-glossary',
  51. 'URI_EDIT_ENTRY' => 'edit-glossary',
  52. 'URI_MANAGE_COMMON' => 'glossary-manage',
  53. 'URI_FAVORITES_LIST' => 'glossary-favorites',
  54. 'URL_HOME' => 'page.php?i=glossary-home',
  55. 'URL_POPULAR' => 'page.php?i=glossary-popular',
  56. 'URL_TOP' => 'page.php?i=glossary-top',
  57. 'URL_UPDATED' => 'page.php?i=glossary-updated',
  58. 'URL_MANAGE_COMMON' => 'page.php?i=glossary-manage',
  59. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=glossary-administration',
  60. // some params
  61. 'PARAM_AUTO_APPROVE' => 'bx_glossary_enable_auto_approve',
  62. 'PARAM_CHARS_SUMMARY' => 'bx_glossary_summary_chars',
  63. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_glossary_plain_summary_chars',
  64. 'PARAM_NUM_RSS' => 'bx_glossary_rss_num',
  65. 'PARAM_SEARCHABLE_FIELDS' => 'bx_glossary_searchable_fields',
  66. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_glossary_per_page_browse_showcase',
  67. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_glossary_per_page_for_favorites_lists',
  68. // objects
  69. 'OBJECT_STORAGE' => 'bx_glossary_files',
  70. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_glossary_preview',
  71. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_glossary_gallery',
  72. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_glossary_cover',
  73. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  74. 'OBJECT_REPORTS' => 'bx_glossary',
  75. 'OBJECT_VIEWS' => 'bx_glossary',
  76. 'OBJECT_VOTES' => 'bx_glossary',
  77. 'OBJECT_REACTIONS' => 'bx_glossary_reactions',
  78. 'OBJECT_SCORES' => 'bx_glossary',
  79. 'OBJECT_FAVORITES' => 'bx_glossary',
  80. 'OBJECT_FEATURED' => 'bx_glossary',
  81. 'OBJECT_METATAGS' => 'bx_glossary',
  82. 'OBJECT_COMMENTS' => 'bx_glossary',
  83. 'OBJECT_NOTES' => 'bx_glossary_notes',
  84. 'OBJECT_CATEGORY' => 'bx_glossary_cats',
  85. 'OBJECT_PRIVACY_VIEW' => 'bx_glossary_allow_view_to',
  86. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_glossary_allow_view_favorite_list',
  87. 'OBJECT_FORM_ENTRY' => 'bx_glossary',
  88. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_glossary_entry_view',
  89. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_glossary_entry_add',
  90. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_glossary_entry_edit',
  91. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_glossary_entry_delete',
  92. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_glossary_view', // actions menu on view entry page
  93. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_glossary_view_actions', // all actions menu on view entry page
  94. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_glossary_my', // actions menu on my entries page
  95. 'OBJECT_MENU_SUBMENU' => 'bx_glossary_submenu', // main module submenu
  96. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_glossary_view_submenu', // view entry submenu
  97. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'glossary-home', // first item in view entry submenu from main module submenu
  98. 'OBJECT_MENU_SNIPPET_META' => 'bx_glossary_snippet_meta', // menu for snippet meta info
  99. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_glossary_menu_manage_tools', //manage menu in content administration tools
  100. 'OBJECT_GRID_ADMINISTRATION' => 'bx_glossary_administration',
  101. 'OBJECT_GRID_COMMON' => 'bx_glossary_common',
  102. 'OBJECT_UPLOADERS' => array('sys_html5'),
  103. // menu items which visibility depends on custom visibility checking
  104. 'MENU_ITEM_TO_METHOD' => array (
  105. 'bx_glossary_my' => array (
  106. 'create-glossary' => 'checkAllowedAdd',
  107. ),
  108. 'bx_glossary_view' => $aMenuItems2Methods,
  109. ),
  110. // informer messages
  111. 'INFORMERS' => array (
  112. 'approving' => array (
  113. 'name' => 'bx-glossary-approving',
  114. 'map' => array (
  115. 'pending' => array('msg' => '_bx_glossary_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
  116. 'hidden' => array('msg' => '_bx_glossary_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
  117. ),
  118. ),
  119. ),
  120. // some language keys
  121. 'T' => array (
  122. 'txt_sample_single' => '_bx_glossary_txt_sample_single',
  123. 'txt_sample_single_with_article' => '_bx_glossary_txt_sample_single_with_article',
  124. 'txt_sample_comment_single' => '_bx_glossary_txt_sample_comment_single',
  125. 'txt_sample_vote_single' => '_bx_glossary_txt_sample_vote_single',
  126. 'txt_sample_reaction_single' => '_bx_glossary_txt_sample_reaction_single',
  127. 'txt_sample_score_up_single' => '_bx_glossary_txt_sample_score_up_single',
  128. 'txt_sample_score_down_single' => '_bx_glossary_txt_sample_score_down_single',
  129. 'form_field_author' => '_bx_glossary_form_entry_input_author',
  130. 'grid_action_err_delete' => '_bx_glossary_grid_action_err_delete',
  131. 'grid_txt_account_manager' => '_bx_glossary_grid_txt_account_manager',
  132. 'filter_item_active' => '_bx_glossary_grid_filter_item_title_adm_active',
  133. 'filter_item_hidden' => '_bx_glossary_grid_filter_item_title_adm_hidden',
  134. 'filter_item_pending' => '_bx_glossary_grid_filter_item_title_adm_pending',
  135. 'filter_item_select_one_filter1' => '_bx_glossary_grid_filter_item_title_adm_select_one_filter1',
  136. 'filter_item_select_one_filter2' => '_bx_glossary_grid_filter_item_title_adm_select_one_filter2',
  137. 'menu_item_manage_my' => '_bx_glossary_menu_item_title_manage_my',
  138. 'menu_item_manage_all' => '_bx_glossary_menu_item_title_manage_all',
  139. 'txt_all_entries_by' => '_bx_glossary_txt_all_entries_by',
  140. 'txt_all_entries_in' => '_bx_glossary_txt_all_entries_in',
  141. 'txt_all_entries_by_author' => '_bx_glossary_page_title_browse_by_author',
  142. 'txt_all_entries_by_context' => '_bx_glossary_page_title_browse_by_context',
  143. 'txt_pict_use_as_thumb' => '_bx_glossary_form_entry_input_picture_use_as_thumb'
  144. ),
  145. );
  146. $this->_aJsClasses = array(
  147. 'manage_tools' => 'BxGlsrManageTools'
  148. );
  149. $this->_aJsObjects = array(
  150. 'manage_tools' => 'oBxGlsrManageTools'
  151. );
  152. $this->_aGridObjects = array(
  153. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  154. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  155. );
  156. }
  157. }
  158. /** @} */