BxPostsConfig.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 Posts Posts
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxPostsConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'edit-post' => 'checkAllowedEdit',
  18. 'delete-post' => 'checkAllowedDelete',
  19. );
  20. $this->CNF = array (
  21. // module icon
  22. 'ICON' => 'file-text col-red3',
  23. // database tables
  24. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
  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_PUBLISHED' => 'published',
  32. 'FIELD_TITLE' => 'title',
  33. 'FIELD_TEXT' => 'text',
  34. 'FIELD_TEXT_ID' => 'post-text',
  35. 'FIELD_CATEGORY' => 'cat',
  36. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  37. 'FIELD_PHOTO' => 'pictures',
  38. 'FIELD_THUMB' => 'thumb',
  39. 'FIELD_VIEWS' => 'views',
  40. 'FIELD_COMMENTS' => 'comments',
  41. 'FIELD_STATUS' => 'status',
  42. 'FIELD_STATUS_ADMIN' => 'status_admin',
  43. 'FIELD_LOCATION_PREFIX' => 'location',
  44. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  45. // page URIs
  46. 'URI_VIEW_ENTRY' => 'view-post',
  47. 'URI_AUTHOR_ENTRIES' => 'posts-author',
  48. 'URI_ENTRIES_BY_CONTEXT' => 'posts-context',
  49. 'URI_ADD_ENTRY' => 'create-post',
  50. 'URI_EDIT_ENTRY' => 'edit-post',
  51. 'URI_MANAGE_COMMON' => 'posts-manage',
  52. 'URL_HOME' => 'page.php?i=posts-home',
  53. 'URL_POPULAR' => 'page.php?i=posts-popular',
  54. 'URL_UPDATED' => 'page.php?i=posts-updated',
  55. 'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
  56. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
  57. // some params
  58. 'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
  59. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
  60. 'PARAM_NUM_RSS' => 'bx_posts_rss_num',
  61. 'PARAM_SEARCHABLE_FIELDS' => 'bx_posts_searchable_fields',
  62. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_posts_per_page_browse_showcase',
  63. // objects
  64. 'OBJECT_STORAGE' => 'bx_posts_files',
  65. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
  66. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_posts_gallery',
  67. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_posts_cover',
  68. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  69. 'OBJECT_REPORTS' => 'bx_posts',
  70. 'OBJECT_VIEWS' => 'bx_posts',
  71. 'OBJECT_VOTES' => 'bx_posts',
  72. 'OBJECT_SCORES' => 'bx_posts',
  73. 'OBJECT_FAVORITES' => 'bx_posts',
  74. 'OBJECT_FEATURED' => 'bx_posts',
  75. 'OBJECT_METATAGS' => 'bx_posts',
  76. 'OBJECT_COMMENTS' => 'bx_posts',
  77. 'OBJECT_CATEGORY' => 'bx_posts_cats',
  78. 'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
  79. 'OBJECT_FORM_ENTRY' => 'bx_posts',
  80. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_posts_entry_view',
  81. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
  82. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
  83. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
  84. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
  85. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
  86. 'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
  87. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
  88. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
  89. 'OBJECT_MENU_SNIPPET_META' => 'bx_posts_snippet_meta', // menu for snippet meta info
  90. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
  91. 'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
  92. 'OBJECT_GRID_COMMON' => 'bx_posts_common',
  93. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  94. // menu items which visibility depends on custom visibility checking
  95. 'MENU_ITEM_TO_METHOD' => array (
  96. 'bx_posts_my' => array (
  97. 'create-post' => 'checkAllowedAdd',
  98. ),
  99. 'bx_posts_view' => $aMenuItems2Methods,
  100. ),
  101. // some language keys
  102. 'T' => array (
  103. 'txt_sample_single' => '_bx_posts_txt_sample_single',
  104. 'txt_sample_single_with_article' => '_bx_posts_txt_sample_single_with_article',
  105. 'txt_sample_comment_single' => '_bx_posts_txt_sample_comment_single',
  106. 'txt_sample_vote_single' => '_bx_posts_txt_sample_vote_single',
  107. 'form_field_author' => '_bx_posts_form_entry_input_author',
  108. 'grid_action_err_delete' => '_bx_posts_grid_action_err_delete',
  109. 'grid_txt_account_manager' => '_bx_posts_grid_txt_account_manager',
  110. 'filter_item_active' => '_bx_posts_grid_filter_item_title_adm_active',
  111. 'filter_item_hidden' => '_bx_posts_grid_filter_item_title_adm_hidden',
  112. 'filter_item_select_one_filter1' => '_bx_posts_grid_filter_item_title_adm_select_one_filter1',
  113. 'menu_item_manage_my' => '_bx_posts_menu_item_title_manage_my',
  114. 'menu_item_manage_all' => '_bx_posts_menu_item_title_manage_all',
  115. 'txt_all_entries_by' => '_bx_posts_txt_all_entries_by',
  116. 'txt_all_entries_in' => '_bx_posts_txt_all_entries_in',
  117. 'txt_all_entries_by_author' => '_bx_posts_page_title_browse_by_author',
  118. 'txt_all_entries_by_context' => '_bx_posts_page_title_browse_by_context',
  119. 'txt_pict_use_as_thumb' => '_bx_posts_form_entry_input_picture_use_as_thumb'
  120. ),
  121. );
  122. $this->_aJsClasses = array(
  123. 'manage_tools' => 'BxPostsManageTools'
  124. );
  125. $this->_aJsObjects = array(
  126. 'manage_tools' => 'oBxPostsManageTools'
  127. );
  128. $this->_aGridObjects = array(
  129. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  130. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  131. );
  132. }
  133. }
  134. /** @} */