BxTasksConfig.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. * @defgroup Tasks Tasks
  6. * @ingroup UnaModules
  7. *
  8. * @{
  9. */
  10. bx_import('BxDolInformer');
  11. class BxTasksConfig extends BxBaseModTextConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $aMenuItems2Methods = array (
  17. 'approve' => 'checkAllowedApprove',
  18. 'edit-task' => 'checkAllowedEdit',
  19. 'delete-task' => 'checkAllowedDelete',
  20. );
  21. $this->CNF = array_merge($this->CNF, array (
  22. // module icon
  23. 'ICON' => 'tasks col-red3',
  24. // database tables
  25. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'tasks',
  26. 'TABLE_LISTS' => $aModule['db_prefix'] . 'lists',
  27. 'TABLE_POLLS' => '',
  28. 'TABLE_ENTRIES_FULLTEXT' => 'title_text',
  29. // database fields
  30. 'FIELD_ID' => 'id',
  31. 'FIELD_AUTHOR' => 'author',
  32. 'FIELD_ADDED' => 'added',
  33. 'FIELD_CHANGED' => 'changed',
  34. 'FIELD_PUBLISHED' => 'published',
  35. 'FIELD_TITLE' => 'title',
  36. 'FIELD_TEXT' => 'text',
  37. 'FIELD_TEXT_ID' => 'post-text',
  38. 'FIELD_CATEGORY' => 'cat',
  39. 'FIELD_MULTICAT' => 'multicat',
  40. 'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
  41. 'FIELD_CF' => 'cf',
  42. 'FIELD_COVER' => 'covers',
  43. 'FIELD_PHOTO' => 'pictures',
  44. 'FIELD_VIDEO' => 'videos',
  45. 'FIELD_FILE' => 'files',
  46. 'FIELD_THUMB' => 'thumb',
  47. 'FIELD_ATTACHMENTS' => 'attachments',
  48. 'FIELD_VIEWS' => 'views',
  49. 'FIELD_COMMENTS' => 'comments',
  50. 'FIELD_STATUS' => 'status',
  51. 'FIELD_STATUS_ADMIN' => 'status_admin',
  52. 'FIELD_LABELS' => 'labels',
  53. 'FIELD_TASKLIST' => 'tasks_list',
  54. 'FIELD_DUEDATE' => 'due_date',
  55. 'FIELD_EXPIRED' => 'expired',
  56. 'FIELD_COMPLETED' => 'completed',
  57. 'FIELD_ANONYMOUS' => 'anonymous',
  58. 'FIELD_ALLOW_COMMENTS' => 'allow_comments',
  59. 'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
  60. 'FIELDS_DELAYED_PROCESSING' => 'videos', // can be array of fields or comma separated string of field names
  61. // some params
  62. 'PARAM_MULTICAT_ENABLED' => true,
  63. 'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_tasks_auto_activation_for_categories',
  64. 'PARAM_POLL_ENABLED' => false,
  65. // page URIs
  66. 'URI_VIEW_ENTRY' => 'view-task',
  67. 'URI_ENTRIES_BY_CONTEXT' => 'tasks-context',
  68. 'URI_ADD_ENTRY' => 'create-task',
  69. 'URI_EDIT_ENTRY' => 'edit-task',
  70. 'URI_MANAGE_COMMON' => 'tasks-manage',
  71. 'URL_HOME' => 'page.php?i=tasks-home',
  72. 'URL_POPULAR' => 'page.php?i=tasks-popular',
  73. 'URL_TOP' => 'page.php?i=tasks-top',
  74. 'URL_UPDATED' => 'page.php?i=tasks-updated',
  75. 'URL_MANAGE_COMMON' => 'page.php?i=tasks-manage',
  76. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=tasks-administration',
  77. // some params
  78. 'PARAM_AUTO_APPROVE' => 'bx_tasks_enable_auto_approve',
  79. 'PARAM_CHARS_SUMMARY' => 'bx_tasks_summary_chars',
  80. 'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_tasks_plain_summary_chars',
  81. 'PARAM_NUM_RSS' => 'bx_tasks_rss_num',
  82. 'PARAM_SEARCHABLE_FIELDS' => 'bx_tasks_searchable_fields',
  83. 'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_tasks_per_page_browse_showcase',
  84. // objects
  85. 'OBJECT_STORAGE' => 'bx_tasks_covers',
  86. 'OBJECT_STORAGE_FILES' => 'bx_tasks_files',
  87. 'OBJECT_STORAGE_PHOTOS' => 'bx_tasks_photos',
  88. 'OBJECT_STORAGE_VIDEOS' => 'bx_tasks_videos',
  89. 'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_tasks_preview',
  90. 'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_tasks_gallery',
  91. 'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_tasks_cover',
  92. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => 'bx_tasks_preview_files',
  93. 'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => 'bx_tasks_gallery_files',
  94. 'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_tasks_preview_photos',
  95. 'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_tasks_gallery_photos',
  96. 'OBJECT_VIDEOS_TRANSCODERS' => array(
  97. 'poster' => 'bx_tasks_videos_poster',
  98. 'poster_preview' => 'bx_tasks_videos_poster_preview',
  99. 'mp4' => 'bx_tasks_videos_mp4',
  100. 'mp4_hd' => 'bx_tasks_videos_mp4_hd'
  101. ),
  102. 'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
  103. 'OBJECT_REPORTS' => 'bx_tasks',
  104. 'OBJECT_VIEWS' => 'bx_tasks',
  105. 'OBJECT_VOTES' => 'bx_tasks',
  106. 'OBJECT_REACTIONS' => 'bx_tasks_reactions',
  107. 'OBJECT_SCORES' => 'bx_tasks',
  108. 'OBJECT_FAVORITES' => 'bx_tasks',
  109. 'OBJECT_FEATURED' => 'bx_tasks',
  110. 'OBJECT_COMMENTS' => 'bx_tasks',
  111. 'OBJECT_NOTES' => 'bx_tasks_notes',
  112. 'OBJECT_CATEGORY' => 'bx_tasks_cats',
  113. 'OBJECT_CONNECTION' => 'bx_tasks_assignments',
  114. 'OBJECT_PRIVACY_VIEW' => 'bx_tasks_allow_view_to',
  115. 'OBJECT_FORM_ENTRY' => 'bx_tasks',
  116. 'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_tasks_entry_view',
  117. 'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_tasks_entry_add',
  118. 'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_tasks_entry_edit',
  119. 'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_tasks_entry_delete',
  120. 'OBJECT_FORM_LIST_ENTRY' => 'bx_tasks_list',
  121. 'OBJECT_FORM_LIST_ENTRY_DISPLAY_ADD' => 'bx_tasks_list_entry_add',
  122. 'OBJECT_FORM_LIST_ENTRY_DISPLAY_EDIT' => 'bx_tasks_list_entry_edit',
  123. 'OBJECT_MENU_ENTRY_ATTACHMENTS' => 'bx_tasks_entry_attachments', // attachments menu in create/edit forms
  124. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_tasks_view', // actions menu on view entry page
  125. 'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_tasks_view_actions', // all actions menu on view entry page
  126. 'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_tasks_my', // actions menu on my entries page
  127. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_tasks_view_submenu', // view entry submenu
  128. 'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'tasks-home', // first item in view entry submenu from main module submenu
  129. 'OBJECT_MENU_SNIPPET_META' => 'bx_tasks_snippet_meta', // menu for snippet meta info
  130. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_tasks_menu_manage_tools', //manage menu in content administration tools
  131. 'OBJECT_GRID_ADMINISTRATION' => 'bx_tasks_administration',
  132. 'OBJECT_GRID_COMMON' => 'bx_tasks_common',
  133. 'OBJECT_GRID_CATEGORIES' => 'bx_tasks_categories',
  134. 'OBJECT_UPLOADERS' => array('bx_tasks_simple', 'bx_tasks_html5'),
  135. 'OBJECT_CONTENT_INFO' => 'bx_tasks',
  136. 'OBJECT_CMTS_CONTENT_INFO' => 'bx_tasks_cmts',
  137. 'BADGES_AVALIABLE' => true,
  138. 'COOKIE_SETTING_KEY' => 'bx_tasks_filters',
  139. // menu items which visibility depends on custom visibility checking
  140. 'MENU_ITEM_TO_METHOD' => array (
  141. 'bx_tasks_my' => array (
  142. 'create-task' => 'checkAllowedAdd',
  143. ),
  144. 'bx_tasks_view' => $aMenuItems2Methods,
  145. ),
  146. // informer messages
  147. 'INFORMERS' => array (
  148. 'approving' => array (
  149. 'name' => 'bx-tasks-approving',
  150. 'map' => array (
  151. 'pending' => array('msg' => '_bx_tasks_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
  152. 'hidden' => array('msg' => '_bx_tasks_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
  153. ),
  154. ),
  155. 'processing' => array (
  156. 'name' => 'bx-tasks-processing',
  157. 'map' => array (
  158. 'awaiting' => array('msg' => '_bx_tasks_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
  159. 'failed' => array('msg' => '_bx_tasks_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
  160. ),
  161. ),
  162. 'scheduled' => array (
  163. 'name' => 'bx-tasks-scheduled',
  164. 'map' => array (
  165. 'awaiting' => array('msg' => '_bx_tasks_txt_scheduled_awaiting', 'type' => BX_INFORMER_ALERT),
  166. ),
  167. ),
  168. ),
  169. // some language keys
  170. 'T' => array (
  171. 'txt_sample_single' => '_bx_tasks_txt_sample_single',
  172. 'txt_sample_single_with_article' => '_bx_tasks_txt_sample_single_with_article',
  173. 'txt_sample_comment_single' => '_bx_tasks_txt_sample_comment_single',
  174. 'txt_sample_vote_single' => '_bx_tasks_txt_sample_vote_single',
  175. 'txt_sample_reaction_single' => '_bx_tasks_txt_sample_reaction_single',
  176. 'txt_sample_score_up_single' => '_bx_tasks_txt_sample_score_up_single',
  177. 'txt_sample_score_down_single' => '_bx_tasks_txt_sample_score_down_single',
  178. 'form_field_author' => '_bx_tasks_form_entry_input_author',
  179. 'grid_action_err_delete' => '_bx_tasks_grid_action_err_delete',
  180. 'grid_txt_account_manager' => '_bx_tasks_grid_txt_account_manager',
  181. 'filter_item_active' => '_bx_tasks_grid_filter_item_title_adm_active',
  182. 'filter_item_hidden' => '_bx_tasks_grid_filter_item_title_adm_hidden',
  183. 'filter_item_select_one_filter1' => '_bx_tasks_grid_filter_item_title_adm_select_one_filter1',
  184. 'filter_item_select_one_filter2' => '_bx_tasks_grid_filter_item_title_adm_select_one_filter2',
  185. 'menu_item_manage_my' => '_bx_tasks_menu_item_title_manage_my',
  186. 'menu_item_manage_all' => '_bx_tasks_menu_item_title_manage_all',
  187. 'txt_all_entries_by' => '_bx_tasks_txt_all_entries_by',
  188. 'txt_all_entries_in' => '_bx_tasks_txt_all_entries_in',
  189. 'txt_all_entries_by_author' => '_bx_tasks_page_title_browse_by_author',
  190. 'txt_all_entries_by_context' => '_bx_tasks_page_title_browse_by_context',
  191. 'txt_err_cannot_perform_action' => '_bx_tasks_txt_err_cannot_perform_action',
  192. ),
  193. ));
  194. $this->_aJsClasses = array_merge($this->_aJsClasses, array(
  195. 'manage_tools' => 'BxTasksManageTools',
  196. 'categories' => 'BxDolCategories',
  197. 'tasks' => 'BxTasksView'
  198. ));
  199. $this->_aJsObjects = array_merge($this->_aJsObjects, array(
  200. 'manage_tools' => 'oBxTasksManageTools',
  201. 'categories' => 'oBxDolCategories',
  202. 'tasks' => 'oBxTasksView'
  203. ));
  204. $this->_aGridObjects = array(
  205. 'common' => $this->CNF['OBJECT_GRID_COMMON'],
  206. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  207. );
  208. $this->_bAttachmentsInTimeline = true;
  209. }
  210. }
  211. /** @} */