BxBaseModGroupsConfig.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 Groups Groups
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModGroupsConfig extends BxBaseModProfileConfig
  12. {
  13. protected $_aHtmlIds;
  14. protected $_aCurrency;
  15. function __construct($aModule)
  16. {
  17. parent::__construct($aModule);
  18. $this->_aMenuItems2MethodsActions = array (
  19. 'join-group-profile' => 'checkAllowedFanAdd',
  20. 'profile-fan-add' => 'checkAllowedFanAdd',
  21. 'profile-fan-remove' => 'checkAllowedFanRemove',
  22. 'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
  23. 'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
  24. 'profile-actions-more' => 'checkAllowedViewMoreMenu',
  25. 'convos-compose' => 'checkAllowedCompose',
  26. );
  27. $sHtmlPrefix = str_replace('_', '-', $this->_sName);
  28. $this->_aHtmlIds = array(
  29. 'popup_price' => $sHtmlPrefix . '-popup-price'
  30. );
  31. $oPayments = BxDolPayments::getInstance();
  32. $this->_aCurrency = array(
  33. 'code' => $oPayments->getOption('default_currency_code'),
  34. 'sign' => $oPayments->getOption('default_currency_sign')
  35. );
  36. }
  37. public function getHtmlIds($sKey = '')
  38. {
  39. if(empty($sKey))
  40. return $this->_aHtmlIds;
  41. return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
  42. }
  43. public function getCurrency()
  44. {
  45. return $this->_aCurrency;
  46. }
  47. public function isPaidJoin()
  48. {
  49. return !empty($this->CNF['PARAM_PER_PAID_JOIN']) && getParam($this->CNF['PARAM_PER_PAID_JOIN']) == 'on';
  50. }
  51. }
  52. /** @} */