BxInvConfig.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Invites Invites
  7. * @ingroup DolphinModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralConfig');
  12. class BxInvConfig extends BxBaseModGeneralConfig
  13. {
  14. protected $_oDb;
  15. protected $_iCountPerUser;
  16. protected $_sKeyCode;
  17. protected $_iKeyLifetime;
  18. protected $_bRequestInvite;
  19. protected $_sRequestsEmail;
  20. /**
  21. * Constructor
  22. */
  23. public function __construct($aModule)
  24. {
  25. parent::__construct($aModule);
  26. $this->CNF = array (
  27. 'URL_INVITE' => 'page.php?i=invites-invite',
  28. 'URL_REQUEST' => 'page.php?i=invites-request',
  29. );
  30. $this->_aObjects = array(
  31. 'alert' => $this->_sName,
  32. 'grid_requests' => $this->_sName . '_requests',
  33. 'form_invite' => $this->_sName . '_invite',
  34. 'form_request' => $this->_sName . '_request',
  35. 'form_display_invite_send' => $this->_sName . '_invite_send',
  36. 'form_display_request_send' => $this->_sName . '_request_send',
  37. );
  38. $this->_aPrefixes = array(
  39. 'style' => 'bx-inv',
  40. 'option' => 'bx_invites_',
  41. );
  42. $this->_iCountPerUser = 0;
  43. $this->_sKeyCode = 'icode';
  44. $this->_iKeyLifetime = 86400;
  45. $this->_bRequestInvite = false;
  46. $this->_sRequestsEmail = '';
  47. }
  48. public function init(&$oDb)
  49. {
  50. $this->_oDb = &$oDb;
  51. $sOptionPrefix = $this->getPrefix('option');
  52. $this->_iCountPerUser = (int)getParam($sOptionPrefix . 'count_per_user');
  53. $this->_iKeyLifetime = 86400 * (int)getParam($sOptionPrefix . 'key_lifetime');
  54. $this->_bRequestInvite = getParam($sOptionPrefix . 'enable_request_invite') == 'on';
  55. $this->_sRequestsEmail = getParam($sOptionPrefix . 'requests_email');
  56. }
  57. public function getCountPerUser()
  58. {
  59. return $this->_iCountPerUser;
  60. }
  61. public function getKeyCode()
  62. {
  63. return $this->_sKeyCode;
  64. }
  65. public function getKeyLifetime()
  66. {
  67. return $this->_iKeyLifetime;
  68. }
  69. public function isRequestInvite()
  70. {
  71. return $this->_bRequestInvite;
  72. }
  73. public function getRequestsEmail()
  74. {
  75. return $this->_sRequestsEmail;
  76. }
  77. }
  78. /** @} */