BxDolAITool.php 748 B

12345678910111213141516171819202122232425262728293031
  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 UnaCore UNA Core
  7. * @{
  8. */
  9. use NeuronAI\Tools\Tool;
  10. class BxDolAITool extends Tool
  11. {
  12. function getContentModules()
  13. {
  14. $a = bx_srv('system', 'modules_list', [true, true], 'TemplServiceContent');
  15. return implode(', ', $a);
  16. }
  17. function convertArrayToKeyValue($data) {
  18. $result = [];
  19. foreach ($data as $item) {
  20. if (isset($item['name']) && isset($item['value'])) {
  21. $result[$item['name']] = $item['value'];
  22. }
  23. }
  24. return $result;
  25. }
  26. }