BxDolStudioOptionsApi.php 968 B

1234567891011121314151617181920212223242526272829303132333435
  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 UnaStudio UNA Studio
  7. * @{
  8. */
  9. class BxDolStudioOptionsApi extends BxTemplStudioOptions
  10. {
  11. public function __construct($sType = '', $mixedCategory = '', $sMix = '')
  12. {
  13. parent::__construct($sType, $mixedCategory, $sMix);
  14. $this->sBaseUrl = BX_DOL_URL_STUDIO . bx_append_url_params('api.php', ['page' => 'api_config']);
  15. }
  16. public function saveChanges(&$oForm)
  17. {
  18. $sResult = parent::saveChanges($oForm);
  19. if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnabled())
  20. $oSockets->sendEvent('sys_api', 0, 'config_changed', true);
  21. $sAppUrl = getParam('sys_api_url_root_email');
  22. if ($sAppUrl != ''){
  23. bx_file_get_contents($sAppUrl . '_upd_conf');
  24. }
  25. return $sResult;
  26. }
  27. }
  28. /** @} */