1
0

BxBaseModGroupsConfig.php 1.9 KB

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