BxInvTemplate.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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('BxDolModuleTemplate');
  12. class BxInvTemplate extends BxDolModuleTemplate
  13. {
  14. function __construct(&$oConfig, &$oDb)
  15. {
  16. parent::__construct($oConfig, $oDb);
  17. }
  18. public function getBlockInvite($iAccountId, $iProfileId)
  19. {
  20. $iInvites = $this->_oConfig->getCountPerUser();
  21. $iInvited = $this->_oDb->getInvites(array('type' => 'count_by_account', 'value' => $iAccountId));
  22. bx_import('BxDolPermalinks');
  23. $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_INVITE']);
  24. $this->addCss(array('main.css'));
  25. return $this->parseHtmlByName('block_invite.html', array(
  26. 'style_prefix' => $this->_oConfig->getPrefix('style'),
  27. 'text' => _t('_bx_invites_txt_invite_block_text', $iInvites - $iInvited),
  28. 'url' => $sUrl
  29. ));
  30. }
  31. public function getBlockRequest()
  32. {
  33. bx_import('BxDolPermalinks');
  34. $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_REQUEST']);
  35. $this->addCss(array('main.css'));
  36. return $this->parseHtmlByName('block_request.html', array(
  37. 'style_prefix' => $this->_oConfig->getPrefix('style'),
  38. 'text' => _t('_bx_invites_txt_request_block_text'),
  39. 'url' => $sUrl
  40. ));
  41. }
  42. }
  43. /** @} */