BxStrmConfig.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 Stream Stream
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxStrmConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'approve' => 'checkAllowedApprove',
  18. 'edit-stream' => 'checkAllowedEdit',
  19. 'delete-stream' => 'checkAllowedDelete',
  20. );
  21. $this->CNF = array_merge($this->CNF, array (
  22. // module icon
  23. 'ICON' => 'rss col-red3',
  24. // database tables
  25. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'streams',
  26. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  27. 'TABLE_POLLS' => '',
  28. // database fields
  29. 'FIELD_ID' => 'id',
  30. 'FIELD_AUTHOR' => 'author',
  31. 'FIELD_ADDED' => 'added',
  32. 'FIELD_CHANGED' => 'changed',
  33. 'FIELD_PUBLISHED' => 'published',
  34. 'FIELD_TITLE' => 'title',
  35. 'FIELD_TEXT' => 'text',
  36. 'FIELD_TEXT_ID' => 'stream-text',
  37. 'FIELD_CATEGORY' => 'cat',
  38. 'FIELD_MULTICAT' => 'multicat',
  39. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  40. 'FIELD_COVER' => 'covers',
  41. 'FIELD_PHOTO' => 'pictures',
  42. 'FIELD_VIDEO' => 'videos',
  43. 'FIELD_SOUND' => 'sounds',
  44. 'FIELD_FILE' => 'files',
  45. 'FIELD_POLL' => 'polls',
  46. 'FIELD_THUMB' => 'thumb',
  47. 'FIELD_ATTACHMENTS' => 'attachments',
  48. 'FIELD_VIEWS' => 'views',
  49. 'FIELD_COMMENTS' => 'comments',
  50. 'FIELD_STATUS' => 'status',
  51. 'FIELD_STATUS_ADMIN' => 'status_admin',
  52. 'FIELD_LOCATION' => 'location',
  53. 'FIELD_LOCATION_PREFIX' => 'location',
  54. 'FIELD_LABELS' => 'labels',
  55. 'FIELD_ANONYMOUS' => 'anonymous',
  56. 'FIELD_ALLOW_COMMENTS' => 'allow_comments',
  57. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  58. 'FIELD_KEY' => 'key',
  59. 'PARAM_POLL_ENABLED' => false,
  60. // page URIs
  61. 'URI_VIEW_ENTRY' => 'view-stream',
  62. 'URI_AUTHOR_ENTRIES' => '',
  63. 'URI_ENTRIES_BY_CONTEXT' => '',
  64. 'URI_ADD_ENTRY' => 'create-stream',
  65. 'URI_EDIT_ENTRY' => 'edit-stream',
  66. 'URI_MANAGE_COMMON' => 'streams-manage',
  67. 'URI_FAVORITES_LIST' => '',
  68. 'URL_HOME' => '',
  69. 'URL_POPULAR' => '',
  70. 'URL_TOP' => '',
  71. 'URL_UPDATED' => '',
  72. 'URL_MANAGE_COMMON' => 'page.php?i=streams-manage',
  73. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=streams-administration',
  74. // some params
  75. 'PARAM_AUTO_APPROVE' => 'bx_stream_enable_auto_approve',
  76. 'PARAM_CHARS_SUMMARY' => 'bx_stream_summary_chars',
  77. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_stream_plain_summary_chars',
  78. 'PARAM_NUM_RSS' => 'bx_stream_rss_num',
  79. 'PARAM_SEARCHABLE_FIELDS' => 'bx_stream_searchable_fields',
  80. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_stream_per_page_browse_showcase',
  81. 'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_stream_per_page_for_favorites_lists',
  82. 'PARAM_MULTICAT_ENABLED' => true,
  83. 'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_stream_auto_activation_for_categories',
  84. // objects
  85. 'OBJECT_STORAGE' => 'bx_stream_covers',
  86. 'OBJECT_STORAGE_FILES' => '',
  87. 'OBJECT_STORAGE_PHOTOS' => '',
  88. 'OBJECT_STORAGE_VIDEOS' => '',
  89. 'OBJECT_STORAGE_SOUNDS' => '',
  90. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_stream_preview',
  91. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_stream_gallery',
  92. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_stream_cover',
  93. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => '',
  94. 'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => '',
  95. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => '',
  96. 'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => '',
  97. 'OBJECT_SOUNDS_TRANSCODER' => '',
  98. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  99. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '',
  100. 'OBJECT_REPORTS' => 'bx_stream',
  101. 'OBJECT_VIEWS' => 'bx_stream',
  102. 'OBJECT_VOTES' => 'bx_stream',
  103. 'OBJECT_REACTIONS' => 'bx_stream_reactions',
  104. 'OBJECT_SCORES' => 'bx_stream',
  105. 'OBJECT_FEATURED' => 'bx_stream',
  106. 'OBJECT_METATAGS' => 'bx_stream',
  107. 'OBJECT_COMMENTS' => 'bx_stream',
  108. 'OBJECT_NOTES' => 'bx_stream_notes',
  109. 'OBJECT_CATEGORY' => 'bx_stream_cats',
  110. 'OBJECT_PRIVACY_VIEW' => 'bx_stream_allow_view_to',
  111. 'OBJECT_PRIVACY_LIST_VIEW' => 'bx_stream_allow_view_favorite_list',
  112. 'OBJECT_FORM_ENTRY' => 'bx_stream',
  113. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_stream_entry_view',
  114. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_stream_entry_add',
  115. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_stream_entry_edit',
  116. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_stream_entry_delete',
  117. 'OBJECT_FORM_POLL' => '',
  118. 'OBJECT_FORM_POLL_DISPLAY_ADD' => '',
  119. 'OBJECT_MENU_ENTRY_ATTACHMENTS' => '', // attachments menu in create/edit forms
  120. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_stream_view', // actions menu on view entry page
  121. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_stream_view_actions', // all actions menu on view entry page
  122. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_stream_my', // actions menu on my entries page
  123. 'OBJECT_MENU_SUBMENU' => '', // main module submenu
  124. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
  125. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => '', // first item in view entry submenu from main module submenu
  126. 'OBJECT_MENU_SNIPPET_META' => 'bx_stream_snippet_meta', // menu for snippet meta info
  127. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_stream_menu_manage_tools', //manage menu in content administration tools
  128. 'OBJECT_GRID_ADMINISTRATION' => 'bx_stream_administration',
  129. 'OBJECT_GRID_COMMON' => 'bx_stream_common',
  130. 'OBJECT_GRID_CATEGORIES' => 'bx_stream_categories',
  131. 'OBJECT_UPLOADERS' => array('bx_stream_simple', 'bx_stream_html5'),
  132. 'OBJECT_CONTENT_INFO' => 'bx_stream',
  133. 'OBJECT_CMTS_CONTENT_INFO' => 'bx_stream_cmts',
  134. 'BADGES_AVALIABLE' => true,
  135. // menu items which visibility depends on custom visibility checking
  136. 'MENU_ITEM_TO_METHOD' => array (
  137. 'bx_stream_my' => array (
  138. 'create-stream' => 'checkAllowedAdd',
  139. ),
  140. 'bx_stream_view' => $aMenuItems2Methods,
  141. ),
  142. // informer messages
  143. 'INFORMERS' => array (
  144. 'approving' => array (
  145. 'name' => 'bx-stream-approving',
  146. 'map' => array (
  147. 'pending' => array('msg' => '_bx_stream_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
  148. 'hidden' => array('msg' => '_bx_stream_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
  149. ),
  150. ),
  151. 'processing' => array (
  152. 'name' => 'bx-stream-processing',
  153. 'map' => array (
  154. 'awaiting' => array('msg' => '_bx_stream_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
  155. 'failed' => array('msg' => '_bx_stream_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
  156. ),
  157. ),
  158. 'scheduled' => array (
  159. 'name' => 'bx-stream-scheduled',
  160. 'map' => array (
  161. 'awaiting' => array('msg' => '_bx_stream_txt_scheduled_awaiting', 'type' => BX_INFORMER_ALERT),
  162. ),
  163. ),
  164. ),
  165. // some language keys
  166. 'T' => array (
  167. 'txt_sample_single' => '_bx_stream_txt_sample_single',
  168. 'txt_sample_single_with_article' => '_bx_stream_txt_sample_single_with_article',
  169. 'txt_sample_comment_single' => '_bx_stream_txt_sample_comment_single',
  170. 'txt_sample_vote_single' => '_bx_stream_txt_sample_vote_single',
  171. 'txt_sample_reaction_single' => '_bx_stream_txt_sample_reaction_single',
  172. 'txt_sample_score_up_single' => '_bx_stream_txt_sample_score_up_single',
  173. 'txt_sample_score_down_single' => '_bx_stream_txt_sample_score_down_single',
  174. 'form_field_author' => '_bx_stream_form_entry_input_author',
  175. 'grid_action_err_delete' => '_bx_stream_grid_action_err_delete',
  176. 'grid_txt_account_manager' => '_bx_stream_grid_txt_account_manager',
  177. 'filter_item_active' => '_bx_stream_grid_filter_item_title_adm_active',
  178. 'filter_item_hidden' => '_bx_stream_grid_filter_item_title_adm_hidden',
  179. 'filter_item_pending' => '_bx_stream_grid_filter_item_title_adm_pending',
  180. 'filter_item_select_one_filter1' => '_bx_stream_grid_filter_item_title_adm_select_one_filter1',
  181. 'menu_item_manage_my' => '_bx_stream_menu_item_title_manage_my',
  182. 'menu_item_manage_all' => '_bx_stream_menu_item_title_manage_all',
  183. 'txt_all_entries_by' => '_bx_stream_txt_all_entries_by',
  184. 'txt_all_entries_in' => '_bx_stream_txt_all_entries_in',
  185. 'txt_all_entries_by_author' => '_bx_stream_page_title_browse_by_author',
  186. 'txt_all_entries_by_context' => '_bx_stream_page_title_browse_by_context',
  187. 'txt_err_cannot_perform_action' => '_bx_stream_txt_err_cannot_perform_action',
  188. 'txt_poll_form_answers_add' => '_bx_stream_form_poll_input_answers_add',
  189. 'txt_poll_menu_view_answers' => '_bx_stream_txt_poll_view_answers',
  190. 'txt_poll_menu_view_results' => '_bx_stream_txt_poll_view_results',
  191. 'txt_poll_menu_view_' => '_bx_stream_txt_poll_view_',
  192. 'txt_poll_answer_vote_do_by' => '_bx_stream_txt_poll_answer_vote_do_by',
  193. 'txt_poll_answer_vote_counter' => '_bx_stream_txt_poll_answer_vote_counter',
  194. 'txt_poll_answer_vote_percent' => '_bx_stream_txt_poll_answer_vote_percent'
  195. ),
  196. ));
  197. $this->_aJsClasses = array_merge($this->_aJsClasses, array(
  198. 'manage_tools' => 'BxStrmManageTools',
  199. 'categories' => 'BxDolCategories'
  200. ));
  201. $this->_aJsObjects = array_merge($this->_aJsObjects, array(
  202. 'manage_tools' => 'oBxStrmManageTools',
  203. 'categories' => 'oBxDolCategories'
  204. ));
  205. $this->_aGridObjects = array(
  206. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  207. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  208. );
  209. $this->_bAttachmentsInTimeline = true;
  210. }
  211. }
  212. /** @} */