BxPostsConfig.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup Posts Posts
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModTextConfig');
  12. class BxPostsConfig extends BxBaseModTextConfig
  13. {
  14. function __construct($aModule)
  15. {
  16. parent::__construct($aModule);
  17. $this->CNF = array (
  18. // database tables
  19. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
  20. // database fields
  21. 'FIELD_ID' => 'id',
  22. 'FIELD_AUTHOR' => 'author',
  23. 'FIELD_ADDED' => 'added',
  24. 'FIELD_CHANGED' => 'changed',
  25. 'FIELD_TITLE' => 'title',
  26. 'FIELD_TEXT' => 'text',
  27. 'FIELD_TEXT_ID' => 'post-text',
  28. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  29. 'FIELD_PHOTO' => 'pictures',
  30. 'FIELD_THUMB' => 'thumb',
  31. 'FIELD_COMMENTS' => 'comments',
  32. 'FIELD_LOCATION_PREFIX' => 'location',
  33. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  34. // page URIs
  35. 'URI_VIEW_ENTRY' => 'view-post',
  36. 'URI_AUTHOR_ENTRIES' => 'posts-author',
  37. 'URI_ADD_ENTRY' => 'create-post',
  38. 'URI_EDIT_ENTRY' => 'edit-post',
  39. 'URI_MANAGE_COMMON' => 'posts-manage',
  40. 'URL_HOME' => 'page.php?i=posts-home',
  41. 'URL_POPULAR' => 'page.php?i=posts-popular',
  42. 'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
  43. 'URL_MANAGE_MODERATION' => 'page.php?i=posts-moderation',
  44. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
  45. // some params
  46. 'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
  47. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
  48. 'PARAM_NUM_RSS' => 'bx_posts_rss_num',
  49. // objects
  50. 'OBJECT_STORAGE' => 'bx_posts_files',
  51. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
  52. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_posts_gallery',
  53. 'OBJECT_VIDEOS_TRANSCODERS' => array(),
  54. 'OBJECT_VIEWS' => 'bx_posts',
  55. 'OBJECT_VOTES' => 'bx_posts',
  56. 'OBJECT_METATAGS' => 'bx_posts',
  57. 'OBJECT_COMMENTS' => 'bx_posts',
  58. 'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
  59. 'OBJECT_FORM_ENTRY' => 'bx_posts',
  60. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_posts_entry_view',
  61. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
  62. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
  63. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
  64. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
  65. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
  66. 'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
  67. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
  68. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
  69. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
  70. 'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
  71. 'OBJECT_GRID_MODERATION' => 'bx_posts_moderation',
  72. 'OBJECT_GRID_COMMON' => 'bx_posts_common',
  73. 'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
  74. // menu items which visibility depends on custom visibility checking
  75. 'MENU_ITEM_TO_METHOD' => array (
  76. 'bx_posts_my' => array (
  77. 'create-post' => 'checkAllowedAdd',
  78. ),
  79. 'bx_posts_view' => array (
  80. 'edit-post' => 'checkAllowedEdit',
  81. 'delete-post' => 'checkAllowedDelete',
  82. ),
  83. ),
  84. // some language keys
  85. 'T' => array (
  86. 'txt_sample_single' => '_bx_posts_txt_sample_single',
  87. 'txt_sample_comment_single' => '_bx_posts_txt_sample_comment_single',
  88. 'grid_action_err_delete' => '_bx_posts_grid_action_err_delete',
  89. 'filter_item_active' => '_bx_posts_grid_filter_item_title_adm_active',
  90. 'filter_item_hidden' => '_bx_posts_grid_filter_item_title_adm_hidden',
  91. 'filter_item_select_one_filter1' => '_bx_posts_grid_filter_item_title_adm_select_one_filter1',
  92. 'menu_item_manage_my' => '_bx_posts_menu_item_title_manage_my',
  93. 'menu_item_manage_all' => '_bx_posts_menu_item_title_manage_all',
  94. ),
  95. );
  96. $this->_aJsClass = array(
  97. 'manage_tools' => 'BxPostsManageTools'
  98. );
  99. $this->_aJsObjects = array(
  100. 'manage_tools' => 'oBxPostsManageTools'
  101. );
  102. $this->_aGridObjects = array(
  103. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  104. 'moderation' => $this->CNF['OBJECT_GRID_MODERATION'],
  105. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  106. );
  107. }
  108. }
  109. /** @} */