BxDolStudioFormsSearchFields.php 1.2 KB

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