BxVideosConfig.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 Videos Videos
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxVideosConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'edit-video' => 'checkAllowedEdit',
  18. 'delete-video' => 'checkAllowedDelete',
  19. );
  20. $this->CNF = array (
  21. // module icon
  22. 'ICON' => 'film col-gray',
  23. // database tables
  24. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
  25. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  26. // database fields
  27. 'FIELD_ID' => 'id',
  28. 'FIELD_AUTHOR' => 'author',
  29. 'FIELD_ADDED' => 'added',
  30. 'FIELD_CHANGED' => 'changed',
  31. 'FIELD_TITLE' => 'title',
  32. 'FIELD_TEXT' => 'text',
  33. 'FIELD_TEXT_ID' => 'video-text',
  34. 'FIELD_CATEGORY' => 'cat',
  35. 'FIELD_DURATION' => 'duration',
  36. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  37. 'FIELD_PHOTO' => 'pictures',
  38. 'FIELD_THUMB' => 'thumb',
  39. 'FIELD_POSTER' => '', //'poster',
  40. 'FIELD_VIDEOS' => 'videos',
  41. 'FIELD_VIDEO' => 'video',
  42. 'FIELD_VIEWS' => 'views',
  43. 'FIELD_COMMENTS' => 'comments',
  44. 'FIELD_STATUS' => 'status',
  45. 'FIELD_STATUS_ADMIN' => 'status_admin',
  46. 'FIELD_LABELS' => 'labels',
  47. 'FIELD_LOCATION_PREFIX' => 'location',
  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. // page URIs
  50. 'URI_VIEW_ENTRY' => 'view-video',
  51. 'URI_AUTHOR_ENTRIES' => 'videos-author',
  52. 'URI_ENTRIES_BY_CONTEXT' => 'videos-context',
  53. 'URI_ADD_ENTRY' => 'create-video',
  54. 'URI_EDIT_ENTRY' => 'edit-video',
  55. 'URI_MANAGE_COMMON' => 'videos-manage',
  56. 'URL_HOME' => 'page.php?i=videos-home',
  57. 'URL_POPULAR' => 'page.php?i=videos-popular',
  58. 'URL_UPDATED' => 'page.php?i=videos-updated',
  59. 'URL_MANAGE_COMMON' => 'page.php?i=videos-manage',
  60. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=videos-administration',
  61. // some params
  62. 'PARAM_CHARS_SUMMARY' => 'bx_videos_summary_chars',
  63. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_videos_plain_summary_chars',
  64. 'PARAM_NUM_RSS' => 'bx_videos_rss_num',
  65. 'PARAM_SEARCHABLE_FIELDS' => 'bx_videos_searchable_fields',
  66. // objects
  67. 'OBJECT_STORAGE' => 'bx_videos_photos',
  68. 'OBJECT_STORAGE_VIDEOS' => 'bx_videos_videos',
  69. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_videos_preview',
  70. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_videos_gallery',
  71. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_videos_cover',
  72. 'OBJECT_IMAGES_TRANSCODER_POSTER' => 'bx_videos_poster',
  73. 'OBJECT_VIDEOS_TRANSCODERS' => array(
  74. 'poster' => 'bx_videos_video_poster_cover',
  75. 'poster_preview' => 'bx_videos_video_poster_preview',
  76. 'poster_gallery' => 'bx_videos_video_poster_gallery',
  77. 'mp4' => 'bx_videos_video_mp4',
  78. 'webm' => 'bx_videos_video_webm'
  79. ),
  80. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
  81. 'OBJECT_REPORTS' => 'bx_videos',
  82. 'OBJECT_VIEWS' => 'bx_videos',
  83. 'OBJECT_VOTES' => 'bx_videos',
  84. 'OBJECT_VOTES_STARS' => 'bx_videos_stars',
  85. 'OBJECT_SCORES' => 'bx_videos',
  86. 'OBJECT_FAVORITES' => 'bx_videos',
  87. 'OBJECT_FEATURED' => 'bx_videos',
  88. 'OBJECT_METATAGS' => 'bx_videos',
  89. 'OBJECT_COMMENTS' => 'bx_videos',
  90. 'OBJECT_CATEGORY' => 'bx_videos_cats',
  91. 'OBJECT_PRIVACY_VIEW' => 'bx_videos_allow_view_to',
  92. 'OBJECT_FORM_ENTRY' => 'bx_videos',
  93. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_videos_entry_view',
  94. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_videos_entry_add',
  95. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_videos_entry_edit',
  96. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_videos_entry_delete',
  97. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_videos_view', // actions menu on view entry page
  98. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_videos_view_actions', // all actions menu on view entry page
  99. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_videos_my', // actions menu on my entries page
  100. 'OBJECT_MENU_SUBMENU' => 'bx_videos_submenu', // main module submenu
  101. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_videos_view_submenu', // view entry submenu
  102. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'videos-home', // first item in view entry submenu from main module submenu
  103. 'OBJECT_MENU_SNIPPET_META' => 'bx_videos_snippet_meta', // menu for snippet meta info
  104. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_videos_menu_manage_tools', //manage menu in content administration tools
  105. 'OBJECT_GRID_ADMINISTRATION' => 'bx_videos_administration',
  106. 'OBJECT_GRID_COMMON' => 'bx_videos_common',
  107. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  108. // menu items which visibility depends on custom visibility checking
  109. 'MENU_ITEM_TO_METHOD' => array (
  110. 'bx_videos_my' => array (
  111. 'create-video' => 'checkAllowedAdd',
  112. ),
  113. 'bx_videos_view' => $aMenuItems2Methods,
  114. ),
  115. // some language keys
  116. 'T' => array (
  117. 'txt_sample_single' => '_bx_videos_txt_sample_single',
  118. 'txt_sample_single_with_article' => '_bx_videos_txt_sample_single_with_article',
  119. 'txt_sample_comment_single' => '_bx_videos_txt_sample_comment_single',
  120. 'txt_sample_vote_single' => '_bx_videos_txt_sample_vote_single',
  121. 'form_field_author' => '_bx_videos_form_entry_input_author',
  122. 'grid_action_err_delete' => '_bx_videos_grid_action_err_delete',
  123. 'grid_txt_account_manager' => '_bx_videos_grid_txt_account_manager',
  124. 'filter_item_active' => '_bx_videos_grid_filter_item_title_adm_active',
  125. 'filter_item_hidden' => '_bx_videos_grid_filter_item_title_adm_hidden',
  126. 'filter_item_select_one_filter1' => '_bx_videos_grid_filter_item_title_adm_select_one_filter1',
  127. 'menu_item_manage_my' => '_bx_videos_menu_item_title_manage_my',
  128. 'menu_item_manage_all' => '_bx_videos_menu_item_title_manage_all',
  129. 'txt_all_entries_by' => '_bx_videos_txt_all_entries_by',
  130. 'txt_all_entries_in' => '_bx_videos_txt_all_entries_in',
  131. 'txt_all_entries_by_author' => '_bx_videos_page_title_browse_by_author',
  132. 'txt_pict_use_as_thumb' => '_bx_videos_form_entry_input_picture_use_as_thumb',
  133. 'txt_all_entries_by_context' => '_bx_videos_page_title_browse_by_context',
  134. 'txt_pict_use_as_poster' => '_bx_videos_form_entry_input_picture_use_as_poster',
  135. ),
  136. );
  137. $this->_aJsClasses = array(
  138. 'manage_tools' => 'BxVideosManageTools'
  139. );
  140. $this->_aJsObjects = array(
  141. 'manage_tools' => 'oBxVideosManageTools'
  142. );
  143. $this->_aGridObjects = array(
  144. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  145. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION']
  146. );
  147. }
  148. }
  149. /** @} */