BxPostsConfig.php 5.6 KB

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