BxBaseLiveUpdates.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 TridentCore Trident Core
  7. * @{
  8. */
  9. bx_import('BxDolLiveUpdates');
  10. /**
  11. * @see BxDolLiveUpdates
  12. */
  13. class BxBaseLiveUpdates extends BxDolLiveUpdates
  14. {
  15. public function __construct()
  16. {
  17. parent::__construct();
  18. }
  19. public function init($aParams = array())
  20. {
  21. $aParams = array_merge(array(
  22. 'sActionsUrl' => BX_DOL_URL_ROOT . 'live_updates.php',
  23. 'sObjName' => $this->_sJsObject,
  24. 'iInterval' => $this->_iInterval,
  25. 'aSystemsActive' => $this->_aSystemsActive,
  26. 'bServerRequesting' => !empty($this->_aSystems)
  27. ), $aParams);
  28. $sContent = "var " . $this->_sJsObject . " = new " . $this->_sJsClass . "(" . json_encode($aParams) . ");";
  29. bx_import('BxDolTemplate');
  30. $oTemplate = BxDolTemplate::getInstance();
  31. $oTemplate->addJs(array('BxDolLiveUpdates.js'));
  32. return $oTemplate->_wrapInTagJsCode($sContent);
  33. }
  34. }
  35. /** @} */