BxPostsConfig.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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_TITLE' => 'title',
  32. 'FIELD_TEXT' => 'text',
  33. 'FIELD_TEXT_ID' => 'post-text',
  34. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  35. 'FIELD_PHOTO' => 'pictures',
  36. 'FIELD_THUMB' => 'thumb',
  37. 'FIELD_COMMENTS' => 'comments',
  38. 'FIELD_STATUS' => 'status',
  39. 'FIELD_STATUS_ADMIN' => 'status_admin',
  40. 'FIELD_LOCATION_PREFIX' => 'location',
  41. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  42. // page URIs
  43. 'URI_VIEW_ENTRY' => 'view-post',
  44. 'URI_AUTHOR_ENTRIES' => 'posts-author',
  45. 'URI_ADD_ENTRY' => 'create-post',
  46. 'URI_EDIT_ENTRY' => 'edit-post',
  47. 'URI_MANAGE_COMMON' => 'posts-manage',
  48. 'URL_HOME' => 'page.php?i=posts-home',
  49. 'URL_POPULAR' => 'page.php?i=posts-popular',
  50. 'URL_UPDATED' => 'page.php?i=posts-updated',
  51. 'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
  52. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
  53. // some params
  54. 'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
  55. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
  56. 'PARAM_NUM_RSS' => 'bx_posts_rss_num',
  57. 'PARAM_SEARCHABLE_FIELDS' => 'bx_posts_searchable_fields',
  58. // objects
  59. 'OBJECT_STORAGE' => 'bx_posts_files',
  60. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
  61. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_posts_gallery',
  62. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_posts_cover',
  63. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  64. 'OBJECT_REPORTS' => 'bx_posts',
  65. 'OBJECT_VIEWS' => 'bx_posts',
  66. 'OBJECT_VOTES' => 'bx_posts',
  67. 'OBJECT_FAVORITES' => 'bx_posts',
  68. 'OBJECT_FEATURED' => 'bx_posts',
  69. 'OBJECT_METATAGS' => 'bx_posts',
  70. 'OBJECT_COMMENTS' => 'bx_posts',
  71. 'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
  72. 'OBJECT_FORM_ENTRY' => 'bx_posts',
  73. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_posts_entry_view',
  74. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
  75. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
  76. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
  77. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
  78. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
  79. 'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
  80. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
  81. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
  82. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
  83. 'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
  84. 'OBJECT_GRID_COMMON' => 'bx_posts_common',
  85. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  86. // menu items which visibility depends on custom visibility checking
  87. 'MENU_ITEM_TO_METHOD' => array (
  88. 'bx_posts_my' => array (
  89. 'create-post' => 'checkAllowedAdd',
  90. ),
  91. 'bx_posts_view' => $aMenuItems2Methods,
  92. ),
  93. // some language keys
  94. 'T' => array (
  95. 'txt_sample_single' => '_bx_posts_txt_sample_single',
  96. 'txt_sample_single_with_article' => '_bx_posts_txt_sample_single_with_article',
  97. 'txt_sample_comment_single' => '_bx_posts_txt_sample_comment_single',
  98. 'txt_sample_vote_single' => '_bx_posts_txt_sample_vote_single',
  99. 'form_field_author' => '_bx_posts_form_entry_input_author',
  100. 'grid_action_err_delete' => '_bx_posts_grid_action_err_delete',
  101. 'grid_txt_account_manager' => '_bx_posts_grid_txt_account_manager',
  102. 'filter_item_active' => '_bx_posts_grid_filter_item_title_adm_active',
  103. 'filter_item_hidden' => '_bx_posts_grid_filter_item_title_adm_hidden',
  104. 'filter_item_select_one_filter1' => '_bx_posts_grid_filter_item_title_adm_select_one_filter1',
  105. 'menu_item_manage_my' => '_bx_posts_menu_item_title_manage_my',
  106. 'menu_item_manage_all' => '_bx_posts_menu_item_title_manage_all',
  107. 'txt_all_entries_by' => '_bx_posts_txt_all_entries_by',
  108. 'txt_all_entries_by_author' => '_bx_posts_page_title_browse_by_author',
  109. 'txt_pict_use_as_thumb' => '_bx_posts_form_entry_input_picture_use_as_thumb'
  110. ),
  111. );
  112. $this->_aJsClasses = array(
  113. 'manage_tools' => 'BxPostsManageTools'
  114. );
  115. $this->_aJsObjects = array(
  116. 'manage_tools' => 'oBxPostsManageTools'
  117. );
  118. $this->_aGridObjects = array(
  119. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  120. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  121. );
  122. }
  123. }
  124. /** @} */