BxBaseLiveUpdates.php 1.0 KB

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