BxBaseModGroupsConfig.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 isset($this->CNF['PARAM_PAID_JOIN_ENABLED']) && $this->CNF['PARAM_PAID_JOIN_ENABLED'] === true;
  50. }
  51. public function getPriceName($sName)
  52. {
  53. return uriGenerate($sName, $this->CNF['TABLE_PRICES'], $this->CNF['FIELD_PRICE_NAME']);
  54. }
  55. }
  56. /** @} */