BxRemindersConfig.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Reminders Reminders
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxRemindersConfig extends BxBaseModGeneralConfig
  12. {
  13. protected $_oDb;
  14. /**
  15. * Is needed to send system notifications from.
  16. */
  17. protected $_iSystemProfileId;
  18. function __construct($aModule)
  19. {
  20. parent::__construct($aModule);
  21. $this->CNF = array (
  22. // module icon
  23. 'ICON' => 'bell col-red3',
  24. // database tables
  25. 'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
  26. 'TABLE_TYPES' => $aModule['db_prefix'] . 'types',
  27. // database fields
  28. 'FIELD_ID' => 'id',
  29. 'FIELD_AUTHOR' => 'author',
  30. 'FIELD_ADDED' => 'added',
  31. 'FIELD_CHANGED' => 'changed',
  32. 'FIELD_TITLE' => 'title',
  33. 'FIELD_TEXT' => 'text',
  34. 'FIELD_LINK' => 'link',
  35. // page URIs
  36. 'URI_VIEW_ENTRY' => '',
  37. // options
  38. 'PARAM_DELETE_AFTER' => 'bx_reminders_delete_after',
  39. 'PARAM_DELETE_SYSTEM_PROFILE_ID' => 'bx_reminders_system_profile_id',
  40. 'PARAM_DAYS_DELIMITER' => ',',
  41. // objects
  42. 'OBJECT_CONNECTIONS_FRD' => 'sys_profiles_friends',
  43. 'OBJECT_CONNECTIONS_SBN' => 'sys_profiles_subscriptions',
  44. // some language keys
  45. 'T' => array (
  46. 'txt_sample_single' => '_bx_reminders_txt_sample_single',
  47. 'txt_sample_single_with_article' => '_bx_reminders_txt_sample_single_with_article',
  48. )
  49. );
  50. $this->_aJsClasses = array(
  51. 'main' => 'BxRemindersMain',
  52. );
  53. $this->_aJsObjects = array(
  54. 'main' => 'oBxRemindersMain',
  55. );
  56. $sPrefix = str_replace('_', '-', $this->_sName);
  57. $this->_aHtmlIds = array(
  58. 'main' => $sPrefix . '-main',
  59. );
  60. }
  61. public function init(&$oDb)
  62. {
  63. $this->_oDb = &$oDb;
  64. $this->_iSystemProfileId = (int)getParam($this->CNF['PARAM_DELETE_SYSTEM_PROFILE_ID']);
  65. if(empty($this->_iSystemProfileId))
  66. $this->_iSystemProfileId = (int)getParam('sys_profile_bot');
  67. }
  68. public function getHtmlIds($sKey = '')
  69. {
  70. if(empty($sKey))
  71. return $this->_aHtmlIds;
  72. return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
  73. }
  74. public function getSystemProfileId()
  75. {
  76. return $this->_iSystemProfileId;
  77. }
  78. }
  79. /** @} */