BxFilesConfig.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 Files Files
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxFilesConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'download-file' => 'checkAllowedView',
  18. 'edit-file' => 'checkAllowedEdit',
  19. 'delete-file' => 'checkAllowedDelete',
  20. );
  21. $this->CNF = array (
  22. // module icon
  23. 'ICON' => 'far file col-red3',
  24. // database tables
  25. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'main',
  26. 'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
  27. 'TABLE_FILES' => $aModule['db_prefix'] . 'files',
  28. // database fields
  29. 'FIELD_ID' => 'id',
  30. 'FIELD_AUTHOR' => 'author',
  31. 'FIELD_ADDED' => 'added',
  32. 'FIELD_CHANGED' => 'changed',
  33. 'FIELD_FILE_ID' => 'file_id',
  34. 'FIELD_FOR_STORING_FILE_ID' => 'file_id',
  35. 'FIELD_TITLE' => 'title',
  36. 'FIELD_CATEGORY' => 'cat',
  37. 'FIELD_TEXT' => 'desc',
  38. 'FIELD_TEXT_ID' => 'file-desc',
  39. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  40. 'FIELD_PHOTO' => 'attachments',
  41. 'FIELD_VIEWS' => 'views',
  42. 'FIELD_COMMENTS' => 'comments',
  43. 'FIELD_STATUS' => 'status',
  44. 'FIELD_STATUS_ADMIN' => 'status_admin',
  45. 'FIELD_LOCATION' => 'location',
  46. 'FIELD_LOCATION_PREFIX' => 'location',
  47. 'FIELD_LABELS' => 'labels',
  48. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  49. // some params
  50. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_files_per_page_for_favorites_lists',
  51. // page URIs
  52. 'URI_VIEW_ENTRY' => 'view-file',
  53. 'URI_AUTHOR_ENTRIES' => 'files-author',
  54. 'URI_ENTRIES_BY_CONTEXT' => 'files-context',
  55. 'URI_ADD_ENTRY' => 'create-file',
  56. 'URI_EDIT_ENTRY' => 'edit-file',
  57. 'URI_MANAGE_COMMON' => 'files-manage',
  58. 'URI_FAVORITES_LIST' => 'files-favorites',
  59. 'URL_HOME' => 'page.php?i=files-home',
  60. 'URL_POPULAR' => 'page.php?i=files-popular',
  61. 'URL_TOP' => 'page.php?i=files-top',
  62. 'URL_UPDATED' => 'page.php?i=files-updated',
  63. 'URL_MANAGE_COMMON' => 'page.php?i=files-manage',
  64. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=files-administration',
  65. // some params
  66. 'PARAM_CHARS_SUMMARY' => 'bx_files_summary_chars',
  67. 'PARAM_CHARS_SUMMARY_PLAIN' => '',
  68. 'PARAM_NUM_RSS' => 'bx_files_rss_num',
  69. 'PARAM_SEARCHABLE_FIELDS' => 'bx_files_searchable_fields',
  70. // objects
  71. 'OBJECT_STORAGE' => 'bx_files_files',
  72. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_files_preview',
  73. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_files_gallery',
  74. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  75. 'OBJECT_REPORTS' => 'bx_files',
  76. 'OBJECT_VIEWS' => 'bx_files',
  77. 'OBJECT_VOTES' => 'bx_files',
  78. 'OBJECT_REACTIONS' => 'bx_files_reactions',
  79. 'OBJECT_SCORES' => 'bx_files',
  80. 'OBJECT_FAVORITES' => 'bx_files',
  81. 'OBJECT_FEATURED' => 'bx_files',
  82. 'OBJECT_METATAGS' => 'bx_files',
  83. 'OBJECT_COMMENTS' => 'bx_files',
  84. 'OBJECT_CATEGORY' => 'bx_files_cats',
  85. 'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
  86. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_files_allow_view_favorite_list',
  87. 'OBJECT_FORM_ENTRY' => 'bx_files',
  88. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
  89. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_files_entry_edit',
  90. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_files_entry_edit',
  91. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_files_entry_delete',
  92. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_files_view', // actions menu on view entry page
  93. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_files_view_actions', // all actions menu on view entry page
  94. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_files_my', // actions menu on my entries page
  95. 'OBJECT_MENU_SUBMENU' => 'bx_files_submenu', // main module submenu
  96. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_files_view_submenu', // view entry submenu
  97. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'files-home', // first item in view entry submenu from main module submenu
  98. 'OBJECT_MENU_SNIPPET_META' => 'bx_files_snippet_meta', // menu for snippet meta info
  99. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_files_menu_manage_tools', //manage menu in content administration tools
  100. 'OBJECT_GRID_ADMINISTRATION' => 'bx_files_administration',
  101. 'OBJECT_GRID_COMMON' => 'bx_files_common',
  102. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  103. // menu items which visibility depends on custom visibility checking
  104. 'MENU_ITEM_TO_METHOD' => array (
  105. 'bx_files_my' => array (
  106. 'create-file' => 'checkAllowedAdd',
  107. ),
  108. 'bx_files_view' => $aMenuItems2Methods,
  109. ),
  110. // some language keys
  111. 'T' => array (
  112. 'txt_sample_single' => '_bx_files_txt_sample_single',
  113. 'txt_sample_single_with_article' => '_bx_files_txt_sample_single_with_article',
  114. 'txt_sample_comment_single' => '_bx_files_txt_sample_comment_single',
  115. 'txt_sample_vote_single' => '_bx_files_txt_sample_vote_single',
  116. 'txt_sample_reaction_single' => '_bx_files_txt_sample_reaction_single',
  117. 'txt_sample_score_up_single' => '_bx_files_txt_sample_score_up_single',
  118. 'txt_sample_score_down_single' => '_bx_files_txt_sample_score_down_single',
  119. 'form_field_author' => '_bx_files_form_entry_input_author',
  120. 'form_entry_upload_single_for_update' => '_bx_files_form_entry_input_pictures_upload',
  121. 'grid_action_err_delete' => '_bx_files_grid_action_err_delete',
  122. 'grid_txt_account_manager' => '_bx_files_grid_txt_account_manager',
  123. 'filter_item_active' => '_bx_files_grid_filter_item_title_adm_active',
  124. 'filter_item_hidden' => '_bx_files_grid_filter_item_title_adm_hidden',
  125. 'filter_item_select_one_filter1' => '_bx_files_grid_filter_item_title_adm_select_one_filter1',
  126. 'menu_item_manage_my' => '_bx_files_menu_item_title_manage_my',
  127. 'menu_item_manage_all' => '_bx_files_menu_item_title_manage_all',
  128. 'txt_all_entries_by' => '_bx_files_txt_all_entries_by',
  129. 'txt_all_entries_in' => '_bx_files_txt_all_entries_in',
  130. 'txt_all_entries_by_author' => '_bx_files_page_title_browse_by_author',
  131. 'txt_all_entries_by_context' => '_bx_files_page_title_browse_by_context',
  132. ),
  133. );
  134. $this->_aJsClasses = array(
  135. 'manage_tools' => 'BxFilesManageTools'
  136. );
  137. $this->_aJsObjects = array(
  138. 'manage_tools' => 'oBxFilesManageTools'
  139. );
  140. $this->_aGridObjects = array(
  141. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  142. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  143. );
  144. }
  145. }
  146. /** @} */