BxMarkerIoTemplate.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 Marker.io Marker.io
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxMarkerIoTemplate extends BxDolModuleTemplate
  12. {
  13. function __construct(&$oConfig, &$oDb)
  14. {
  15. parent::__construct($oConfig, $oDb);
  16. }
  17. public function getIncludeCode()
  18. {
  19. $CNF = &$this->_oConfig->CNF;
  20. $sCode = $this->_oDb->getParam($CNF['PARAM_CODE']);
  21. if(empty($sCode))
  22. return '';
  23. $aTmplVarsShowForLogged = array();
  24. if(isLogged()) {
  25. $oProfile = BxDolProfile::getInstance();
  26. $aTmplVarsShowForLogged = array(
  27. 'email' => $oProfile->getAccountObject()->getEmail(),
  28. 'name' => $oProfile->getDisplayName(),
  29. 'profile_url' => $oProfile->getUrl(),
  30. 'template' => $this->getCode(),
  31. );
  32. }
  33. return $this->parseHtmlByName('code.html', array(
  34. 'code' => $sCode,
  35. 'bx_if:show_for_logged' => array(
  36. 'condition' => !empty($aTmplVarsShowForLogged),
  37. 'content' => $aTmplVarsShowForLogged
  38. )
  39. ));
  40. }
  41. }
  42. /** @} */