BxBaseLiveUpdates.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. if(!$this->_iProfileId)
  21. return '';
  22. $aParams = array_merge(array(
  23. 'sActionsUrl' => BX_DOL_URL_ROOT . 'live_updates.php',
  24. 'sObjName' => $this->_sJsObject,
  25. 'iInterval' => $this->_iInterval,
  26. 'aSystemsActive' => $this->_aSystemsActive,
  27. 'bServerRequesting' => !empty($this->_aSystems)
  28. ), $aParams);
  29. $sContent = "var " . $this->_sJsObject . " = new " . $this->_sJsClass . "(" . json_encode($aParams) . ");";
  30. $oTemplate = BxDolTemplate::getInstance();
  31. $oTemplate->addJs(array('BxDolLiveUpdates.js'));
  32. return $oTemplate->_wrapInTagJsCode($sContent);
  33. }
  34. }
  35. /** @} */