BxBaseLiveUpdates.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 DolphinCore Dolphin 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. 'bServerRequesting' => !empty($this->_aSystems)
  26. ), $aParams);
  27. $sContent = "var " . $this->_sJsObject . " = new " . $this->_sJsClass . "(" . json_encode($aParams) . ");";
  28. bx_import('BxDolTemplate');
  29. $oTemplate = BxDolTemplate::getInstance();
  30. $oTemplate->addJs(array('BxDolLiveUpdates.js'));
  31. return $oTemplate->_wrapInTagJsCode($sContent);
  32. }
  33. }
  34. /** @} */