agents.php 977 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. require_once('./inc/header.inc.php');
  10. require_once(BX_DIRECTORY_PATH_INC . "utils.inc.php");
  11. bx_import('BxDolLanguages');
  12. /**
  13. * Work with Providers
  14. */
  15. if(($iProviderId = bx_get('p')) !== false) {
  16. $iProviderId = bx_process_input($iProviderId, BX_DATA_INT);
  17. if(!$iProviderId)
  18. exit;
  19. $oProvider = BxDolAIProvider::getObjectInstance($iProviderId);
  20. if(!$oProvider)
  21. exit;
  22. if(($sAction = bx_get('a')) !== false) {
  23. $sAction = 'processAction' . bx_gen_method_name(bx_process_input($sAction));
  24. if(method_exists($oProvider, $sAction))
  25. $oProvider->$sAction();
  26. }
  27. else {
  28. $mixedResponce = $oProvider->call('products/7433953116300.json', ['fields' => 'id,title,handle,body_html,tags,variants'], 'get');
  29. print_r($mixedResponce);
  30. }
  31. }
  32. /** @} */