BxDolStudioFormsSearchFields.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. require_once(BX_DOL_DIR_STUDIO_INC . 'utils.inc.php');
  10. class BxDolStudioFormsSearchFields extends BxTemplStudioGrid
  11. {
  12. protected $sModule = '';
  13. protected $sForm = '';
  14. public function __construct ($aOptions, $oTemplate = false)
  15. {
  16. parent::__construct ($aOptions, $oTemplate);
  17. $this->oDb = new BxDolStudioFormsQuery();
  18. $sModule = bx_get('module');
  19. if(!empty($sModule)) {
  20. $this->sModule = bx_process_input($sModule);
  21. $this->_aQueryAppend['module'] = $this->sModule;
  22. }
  23. $sForm = bx_get('form');
  24. if(!empty($sForm)) {
  25. $this->sForm = bx_process_input($sForm);
  26. $this->_aQueryAppend['form'] = $this->sForm;
  27. }
  28. }
  29. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  30. {
  31. if(empty($this->sForm))
  32. return array();
  33. $this->_aOptions['source'] = $this->oDb->prepareAsString($this->_aOptions['source'], $this->sForm);
  34. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  35. }
  36. }
  37. /** @} */