BxSpacesVoteStars.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 Spaces Spaces
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxSpacesVoteStars extends BxTemplVoteStars
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. public function __construct($sSystem, $iId, $iInit = 1)
  16. {
  17. $this->_sModule = 'bx_spaces';
  18. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  19. parent::__construct($sSystem, $iId, $iInit);
  20. }
  21. public function isAllowedVote($isPerformAction = false)
  22. {
  23. $CNF = &$this->_oModule->_oConfig->CNF;
  24. if($this->getObjectAuthorId() == $this->_getAuthorId())
  25. return false;
  26. if($this->_oModule->_oConfig->isPaidJoin() && !$this->_oModule->isFan($this->_iId))
  27. return false;
  28. return parent::isAllowedVote($isPerformAction);
  29. }
  30. protected function _getCounterLabel($iCount, $aParams = [])
  31. {
  32. return _t('_bx_spaces_txt_vote_starts_counter', $iCount);
  33. }
  34. }
  35. /** @} */