BxVideosConfig.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. bx_import('BxDolInformer');
  12. class BxVideosConfig extends BxBaseModTextConfig
  13. {
  14. function __construct($aModule)
  15. {
  16. parent::__construct($aModule);
  17. $aMenuItems2Methods = array (
  18. 'approve' => 'checkAllowedApprove',
  19. 'edit-video' => 'checkAllowedEdit',
  20. 'delete-video' => 'checkAllowedDelete',
  21. );
  22. $this->CNF = array (
  23. // module icon
  24. 'ICON' => 'film',
  25. // database tables
  26. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
  27. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  28. // database fields
  29. 'FIELD_ID' => 'id',
  30. 'FIELD_AUTHOR' => 'author',
  31. 'FIELD_ADDED' => 'added',
  32. 'FIELD_CHANGED' => 'changed',
  33. 'FIELD_TITLE' => 'title',
  34. 'FIELD_TEXT' => 'text',
  35. 'FIELD_TEXT_ID' => 'video-text',
  36. 'FIELD_CATEGORY' => 'cat',
  37. 'FIELD_MULTICAT' => 'multicat',
  38. 'FIELD_DURATION' => 'duration',
  39. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  40. 'FIELD_CF' => 'cf',
  41. 'FIELD_PHOTO' => 'pictures',
  42. 'FIELD_THUMB' => 'thumb',
  43. 'FIELD_POSTER' => '', //'poster',
  44. 'FIELD_VIDEOS' => 'videos',
  45. 'FIELD_VIDEO' => 'video',
  46. 'FIELD_VIEWS' => 'views',
  47. 'FIELD_COMMENTS' => 'comments',
  48. 'FIELD_STATUS' => 'status',
  49. 'FIELD_STATUS_ADMIN' => 'status_admin',
  50. 'FIELD_LABELS' => 'labels',
  51. 'FIELD_LOCATION' => 'location',
  52. 'FIELD_LOCATION_PREFIX' => 'location',
  53. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  54. 'FIELDS_DELAYED_PROCESSING' => 'videos', // can be array of fields or comma separated string of field names
  55. // page URIs
  56. 'URI_VIEW_ENTRY' => 'view-video',
  57. 'URI_AUTHOR_ENTRIES' => 'videos-author',
  58. 'URI_ENTRIES_BY_CONTEXT' => 'videos-context',
  59. 'URI_ADD_ENTRY' => 'create-video',
  60. 'URI_EDIT_ENTRY' => 'edit-video',
  61. 'URI_MANAGE_COMMON' => 'videos-manage',
  62. 'URI_FAVORITES_LIST' => 'videos-favorites',
  63. 'URL_HOME' => 'page.php?i=videos-home',
  64. 'URL_POPULAR' => 'page.php?i=videos-popular',
  65. 'URL_TOP' => 'page.php?i=videos-top',
  66. 'URL_UPDATED' => 'page.php?i=videos-updated',
  67. 'URL_MANAGE_COMMON' => 'page.php?i=videos-manage',
  68. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=videos-administration',
  69. // some params
  70. 'PARAM_AUTO_APPROVE' => 'bx_videos_enable_auto_approve',
  71. 'PARAM_CHARS_SUMMARY' => 'bx_videos_summary_chars',
  72. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_videos_plain_summary_chars',
  73. 'PARAM_NUM_RSS' => 'bx_videos_rss_num',
  74. 'PARAM_SEARCHABLE_FIELDS' => 'bx_videos_searchable_fields',
  75. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_videos_per_page_browse_showcase',
  76. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_videos_per_page_for_favorites_lists',
  77. 'PARAM_MULTICAT_ENABLED' => true,
  78. 'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_videos_auto_activation_for_categories',
  79. // objects
  80. 'OBJECT_STORAGE' => 'bx_videos_photos',
  81. 'OBJECT_STORAGE_VIDEOS' => 'bx_videos_videos',
  82. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_videos_preview',
  83. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_videos_gallery',
  84. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_videos_cover',
  85. 'OBJECT_IMAGES_TRANSCODER_POSTER' => 'bx_videos_poster',
  86. 'OBJECT_VIDEOS_TRANSCODERS' => array(
  87. 'poster' => 'bx_videos_video_poster_cover',
  88. 'poster_preview' => 'bx_videos_video_poster_preview',
  89. 'poster_gallery' => 'bx_videos_video_poster_gallery',
  90. 'mp4' => 'bx_videos_video_mp4',
  91. 'mp4_hd' => 'bx_videos_video_mp4_hd'
  92. ),
  93. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
  94. 'OBJECT_REPORTS' => 'bx_videos',
  95. 'OBJECT_VIEWS' => 'bx_videos',
  96. 'OBJECT_VOTES' => 'bx_videos',
  97. 'OBJECT_VOTES_STARS' => 'bx_videos_stars',
  98. 'OBJECT_REACTIONS' => 'bx_videos_reactions',
  99. 'OBJECT_SCORES' => 'bx_videos',
  100. 'OBJECT_FAVORITES' => 'bx_videos',
  101. 'OBJECT_FEATURED' => 'bx_videos',
  102. 'OBJECT_METATAGS' => 'bx_videos',
  103. 'OBJECT_COMMENTS' => 'bx_videos',
  104. 'OBJECT_NOTES' => 'bx_videos_notes',
  105. 'OBJECT_CATEGORY' => 'bx_videos_cats',
  106. 'OBJECT_PRIVACY_VIEW' => 'bx_videos_allow_view_to',
  107. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_videos_allow_view_favorite_list',
  108. 'OBJECT_FORM_ENTRY' => 'bx_videos',
  109. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_videos_entry_view',
  110. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_videos_entry_add',
  111. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_videos_entry_edit',
  112. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_videos_entry_delete',
  113. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_videos_view', // actions menu on view entry page
  114. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_videos_view_actions', // all actions menu on view entry page
  115. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_videos_my', // actions menu on my entries page
  116. 'OBJECT_MENU_SUBMENU' => 'bx_videos_submenu', // main module submenu
  117. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_videos_view_submenu', // view entry submenu
  118. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'videos-home', // first item in view entry submenu from main module submenu
  119. 'OBJECT_MENU_SNIPPET_META' => 'bx_videos_snippet_meta', // menu for snippet meta info
  120. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_videos_menu_manage_tools', //manage menu in content administration tools
  121. 'OBJECT_GRID_ADMINISTRATION' => 'bx_videos_administration',
  122. 'OBJECT_GRID_COMMON' => 'bx_videos_common',
  123. 'OBJECT_UPLOADERS' => array('sys_html5'),
  124. 'BADGES_AVALIABLE' => true,
  125. // menu items which visibility depends on custom visibility checking
  126. 'MENU_ITEM_TO_METHOD' => array (
  127. 'bx_videos_my' => array (
  128. 'create-video' => 'checkAllowedAdd',
  129. ),
  130. 'bx_videos_view' => $aMenuItems2Methods,
  131. ),
  132. // informer messages
  133. 'INFORMERS' => array (
  134. 'approving' => array (
  135. 'name' => 'bx-videos-approving',
  136. 'map' => array (
  137. 'pending' => array('msg' => '_bx_videos_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
  138. 'hidden' => array('msg' => '_bx_videos_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
  139. ),
  140. ),
  141. 'processing' => array (
  142. 'name' => 'bx-videos-processing',
  143. 'map' => array (
  144. 'awaiting' => array('msg' => '_bx_videos_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
  145. 'failed' => array('msg' => '_bx_videos_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
  146. ),
  147. ),
  148. ),
  149. // some language keys
  150. 'T' => array (
  151. 'txt_sample_single' => '_bx_videos_txt_sample_single',
  152. 'txt_sample_single_with_article' => '_bx_videos_txt_sample_single_with_article',
  153. 'txt_sample_comment_single' => '_bx_videos_txt_sample_comment_single',
  154. 'txt_sample_vote_single' => '_bx_videos_txt_sample_vote_single',
  155. 'txt_sample_reaction_single' => '_bx_videos_txt_sample_reaction_single',
  156. 'txt_sample_score_up_single' => '_bx_videos_txt_sample_score_up_single',
  157. 'txt_sample_score_down_single' => '_bx_videos_txt_sample_score_down_single',
  158. 'form_field_author' => '_bx_videos_form_entry_input_author',
  159. 'grid_action_err_delete' => '_bx_videos_grid_action_err_delete',
  160. 'grid_txt_account_manager' => '_bx_videos_grid_txt_account_manager',
  161. 'filter_item_active' => '_bx_videos_grid_filter_item_title_adm_active',
  162. 'filter_item_hidden' => '_bx_videos_grid_filter_item_title_adm_hidden',
  163. 'filter_item_pending' => '_bx_videos_grid_filter_item_title_adm_pending',
  164. 'filter_item_select_one_filter1' => '_bx_videos_grid_filter_item_title_adm_select_one_filter1',
  165. 'filter_item_select_one_filter2' => '_bx_videos_grid_filter_item_title_adm_select_one_filter2',
  166. 'menu_item_manage_my' => '_bx_videos_menu_item_title_manage_my',
  167. 'menu_item_manage_all' => '_bx_videos_menu_item_title_manage_all',
  168. 'txt_all_entries_by' => '_bx_videos_txt_all_entries_by',
  169. 'txt_all_entries_in' => '_bx_videos_txt_all_entries_in',
  170. 'txt_all_entries_by_author' => '_bx_videos_page_title_browse_by_author',
  171. 'txt_pict_use_as_thumb' => '_bx_videos_form_entry_input_picture_use_as_thumb',
  172. 'txt_all_entries_by_context' => '_bx_videos_page_title_browse_by_context',
  173. 'txt_pict_use_as_poster' => '_bx_videos_form_entry_input_picture_use_as_poster',
  174. ),
  175. 'OEMBED_PROVIDERS_IMPORT_URL' => 'https://oembed.com/providers.json',
  176. );
  177. $this->_aJsClasses = array(
  178. 'manage_tools' => 'BxVideosManageTools',
  179. 'categories' => 'BxDolCategories',
  180. 'embeds' => 'BxVideosEmbeds',
  181. );
  182. $this->_aJsObjects = array(
  183. 'manage_tools' => 'oBxVideosManageTools',
  184. 'categories' => 'oBxDolCategories',
  185. 'embeds' => 'oBxVideosEmbeds',
  186. );
  187. $this->_aGridObjects = array(
  188. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  189. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION']
  190. );
  191. }
  192. }
  193. /** @} */