BxDirConfig.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 Directory Directory
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxDirConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'edit-ad' => 'checkAllowedEdit',
  18. 'delete-ad' => 'checkAllowedDelete',
  19. );
  20. $this->CNF = array_merge($this->CNF, array (
  21. // module icon
  22. 'ICON' => 'folder-open col-green3',
  23. // database tables
  24. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
  25. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  26. 'TABLE_CATEGORIES' => $aModule['db_prefix'] . 'categories',
  27. 'TABLE_CATEGORIES_TYPES' => $aModule['db_prefix'] . 'categories_types',
  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' => 'ad-text',
  36. 'FIELD_CATEGORY' => 'category',
  37. 'FIELD_CATEGORY_VIEW' => 'category_view',
  38. 'FIELD_CATEGORY_SELECT' => 'category_select',
  39. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  40. 'FIELD_COVER' => 'covers',
  41. 'FIELD_PHOTO' => 'pictures',
  42. 'FIELD_VIDEO' => 'videos',
  43. 'FIELD_FILE' => 'files',
  44. 'FIELD_POLL' => '',
  45. 'FIELD_THUMB' => 'thumb',
  46. 'FIELD_ATTACHMENTS' => 'attachments',
  47. 'FIELD_VIEWS' => 'views',
  48. 'FIELD_COMMENTS' => 'comments',
  49. 'FIELD_STATUS' => 'status',
  50. 'FIELD_STATUS_ADMIN' => 'status_admin',
  51. 'FIELD_LOCATION_PREFIX' => 'location',
  52. 'FIELD_LABELS' => 'labels',
  53. 'FIELD_ANONYMOUS' => 'anonymous',
  54. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  55. // page URIs
  56. 'URI_VIEW_ENTRY' => 'view-ad',
  57. 'URI_AUTHOR_ENTRIES' => 'ads-author',
  58. 'URI_ENTRIES_BY_CONTEXT' => 'ads-context',
  59. 'URI_ADD_ENTRY' => 'create-ad',
  60. 'URI_EDIT_ENTRY' => 'edit-ad',
  61. 'URI_MANAGE_COMMON' => 'ads-manage',
  62. 'URL_HOME' => 'page.php?i=directory-home',
  63. 'URL_POPULAR' => 'page.php?i=ads-popular',
  64. 'URL_UPDATED' => 'page.php?i=ads-updated',
  65. 'URL_CATEGORIES' => 'page.php?i=ads-categories',
  66. 'URL_MANAGE_COMMON' => 'page.php?i=ads-manage',
  67. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=ads-administration',
  68. 'GET_PARAM_CATEGORY' => 'category',
  69. // some params
  70. 'PARAM_CHARS_SUMMARY' => 'bx_directory_summary_chars',
  71. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_directory_plain_summary_chars',
  72. 'PARAM_NUM_RSS' => 'bx_directory_rss_num',
  73. 'PARAM_SEARCHABLE_FIELDS' => 'bx_directory_searchable_fields',
  74. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_directory_per_page_browse_showcase',
  75. 'PARAM_CATEGORY_LEVEL_MAX' => 1,
  76. // objects
  77. 'OBJECT_STORAGE' => 'bx_directory_covers',
  78. 'OBJECT_STORAGE_FILES' => 'bx_directory_files',
  79. 'OBJECT_STORAGE_PHOTOS' => 'bx_directory_photos',
  80. 'OBJECT_STORAGE_VIDEOS' => 'bx_directory_videos',
  81. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_directory_preview',
  82. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_directory_gallery',
  83. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_directory_cover',
  84. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => 'bx_directory_preview_files',
  85. 'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => 'bx_directory_gallery_files',
  86. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_directory_preview_photos',
  87. 'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_directory_gallery_photos',
  88. 'OBJECT_VIDEOS_TRANSCODERS' => array(
  89. 'poster' => 'bx_directory_videos_poster',
  90. 'poster_preview' => 'bx_directory_videos_poster_preview',
  91. 'mp4' => 'bx_directory_videos_mp4',
  92. 'webm' => 'bx_directory_videos_webm'
  93. ),
  94. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
  95. 'OBJECT_REPORTS' => 'bx_directory',
  96. 'OBJECT_VIEWS' => 'bx_directory',
  97. 'OBJECT_VOTES' => 'bx_directory',
  98. 'OBJECT_REACTIONS' => 'bx_directory_reactions',
  99. 'OBJECT_SCORES' => 'bx_directory',
  100. 'OBJECT_FAVORITES' => 'bx_directory',
  101. 'OBJECT_FEATURED' => 'bx_directory',
  102. 'OBJECT_METATAGS' => 'bx_directory',
  103. 'OBJECT_COMMENTS' => 'bx_directory',
  104. 'OBJECT_CATEGORY' => '',
  105. 'OBJECT_PRIVACY_VIEW' => 'bx_directory_allow_view_to',
  106. 'OBJECT_FORM_CATEGORY' => 'bx_directory_category',
  107. 'OBJECT_FORM_CATEGORY_DISPLAY_ADD' => 'bx_directory_category_add',
  108. 'OBJECT_FORM_CATEGORY_DISPLAY_EDIT' => 'bx_directory_category_edit',
  109. 'OBJECT_FORM_CATEGORY_DISPLAY_DELETE' => 'bx_directory_category_delete',
  110. 'OBJECT_FORM_ENTRY' => 'bx_directory',
  111. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => '',
  112. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_directory_entry_add',
  113. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => '',
  114. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_directory_entry_delete',
  115. 'OBJECT_FORM_POLL' => 'bx_directory_poll',
  116. 'OBJECT_FORM_POLL_DISPLAY_ADD' => 'bx_directory_poll_add',
  117. 'OBJECT_MENU_ENTRY_ATTACHMENTS' => 'bx_directory_entry_attachments', // attachments menu in create/edit forms
  118. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_directory_view', // actions menu on view entry page
  119. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_directory_view_actions', // all actions menu on view entry page
  120. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_directory_my', // actions menu on my entries page
  121. 'OBJECT_MENU_SUBMENU' => 'bx_directory_submenu', // main module submenu
  122. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_directory_view_submenu', // view entry submenu
  123. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'directory-home', // first item in view entry submenu from main module submenu
  124. 'OBJECT_MENU_SNIPPET_META' => 'bx_directory_snippet_meta', // menu for snippet meta info
  125. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_directory_menu_manage_tools', //manage menu in content administration tools
  126. 'OBJECT_GRID_CATEGORIES' => 'bx_directory_categories',
  127. 'OBJECT_GRID_ADMINISTRATION' => 'bx_directory_administration',
  128. 'OBJECT_GRID_COMMON' => 'bx_directory_common',
  129. 'OBJECT_UPLOADERS' => array('bx_directory_simple', 'bx_directory_html5'),
  130. // menu items which visibility depends on custom visibility checking
  131. 'MENU_ITEM_TO_METHOD' => array (
  132. 'bx_directory_my' => array (
  133. 'create-ad' => 'checkAllowedAdd',
  134. ),
  135. 'bx_directory_view' => $aMenuItems2Methods,
  136. ),
  137. // some language keys
  138. 'T' => array (
  139. 'txt_sample_single' => '_bx_directory_txt_sample_single',
  140. 'txt_sample_single_with_article' => '_bx_directory_txt_sample_single_with_article',
  141. 'txt_sample_comment_single' => '_bx_directory_txt_sample_comment_single',
  142. 'txt_sample_vote_single' => '_bx_directory_txt_sample_vote_single',
  143. 'form_field_author' => '_bx_directory_form_entry_input_author',
  144. 'grid_action_err_delete' => '_bx_directory_grid_action_err_delete',
  145. 'grid_txt_account_manager' => '_bx_directory_grid_txt_account_manager',
  146. 'filter_item_active' => '_bx_directory_grid_filter_item_title_adm_active',
  147. 'filter_item_hidden' => '_bx_directory_grid_filter_item_title_adm_hidden',
  148. 'filter_item_select_one_filter1' => '_bx_directory_grid_filter_item_title_adm_select_one_filter1',
  149. 'menu_item_manage_my' => '_bx_directory_menu_item_title_manage_my',
  150. 'menu_item_manage_all' => '_bx_directory_menu_item_title_manage_all',
  151. 'txt_all_entries_by' => '_bx_directory_txt_all_entries_by',
  152. 'txt_all_entries_in' => '_bx_directory_txt_all_entries_in',
  153. 'txt_all_entries_by_author' => '_bx_directory_page_title_browse_by_author',
  154. 'txt_all_entries_by_context' => '_bx_directory_page_title_browse_by_context',
  155. 'txt_err_cannot_perform_action' => '_bx_directory_txt_err_cannot_perform_action',
  156. 'txt_poll_answer_vote_do_by' => '_bx_directory_txt_poll_answer_vote_do_by',
  157. 'txt_poll_answer_vote_counter' => '_bx_directory_txt_poll_answer_vote_counter',
  158. 'txt_poll_answer_vote_percent' => '_bx_directory_txt_poll_answer_vote_percent',
  159. 'txt_display_add' => '_bx_directory_txt_display_title_add',
  160. 'txt_display_edit' => '_bx_directory_txt_display_title_edit',
  161. 'txt_display_view' => '_bx_directory_txt_display_title_view',
  162. ),
  163. ));
  164. $this->_aJsClasses = array_merge($this->_aJsClasses, array(
  165. 'manage_tools' => 'BxDirManageTools',
  166. 'studio' => 'BxDirStudio',
  167. 'entry' => 'BxDirEntry'
  168. ));
  169. $this->_aJsObjects = array_merge($this->_aJsObjects, array(
  170. 'manage_tools' => 'oBxDirManageTools',
  171. 'studio' => 'oBxDirStudio',
  172. 'entry' => 'oBxDirEntry'
  173. ));
  174. $this->_aGridObjects = array(
  175. 'categories' => $this->CNF['OBJECT_GRID_CATEGORIES'],
  176. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  177. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  178. );
  179. $this->_bAttachmentsInTimeline = true;
  180. }
  181. }
  182. /** @} */