1
0

searchExtended.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 . "design.inc.php");
  11. bx_import('BxDolLanguages');
  12. check_logged();
  13. $sObject = isset($_REQUEST['object']) ? bx_process_input($_REQUEST['object']) : '';
  14. $sAction = isset($_REQUEST['action']) && preg_match ('/^[A-Za-z_-]+$/', $_REQUEST['action']) ? bx_process_input($_REQUEST['action']) : '';
  15. if(!empty($sObject)) {
  16. $oSearch = BxDolSearchExtended::getObjectInstance($sObject);
  17. if(!$oSearch || !$sAction) {
  18. echoJson(array());
  19. exit;
  20. }
  21. $sMethod = 'action' . bx_gen_method_name($sAction);
  22. if(!method_exists($oSearch, $sMethod)) {
  23. echoJson(array());
  24. exit;
  25. }
  26. $oSearch->$sMethod();
  27. exit;
  28. }
  29. if(!empty($sAction)) {
  30. $sMethod = 'action' . bx_gen_method_name($sAction);
  31. if(!method_exists('BxDolSearchExtended', $sMethod)) {
  32. echoJson(array());
  33. exit;
  34. }
  35. BxDolSearchExtended::$sMethod();
  36. exit;
  37. }
  38. /** @} */