BxDolStudioFormsFields.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 BxDolStudioFormsFields extends BxTemplStudioGrid
  10. {
  11. protected $sModule = '';
  12. protected $sObject = '';
  13. protected $sDisplay = '';
  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. $sObject = bx_get('object');
  24. if(!empty($sObject)) {
  25. $this->sObject = bx_process_input($sObject);
  26. $this->_aQueryAppend['object'] = $this->sObject;
  27. }
  28. $sDisplay = bx_get('display');
  29. if(!empty($sDisplay)) {
  30. $this->sDisplay = bx_process_input($sDisplay);
  31. $this->_aQueryAppend['display'] = $this->sDisplay;
  32. }
  33. }
  34. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  35. {
  36. if(empty($this->sObject) || empty($this->sDisplay))
  37. return array();
  38. $this->oDb->checkInputsInDisplays($this->sObject, $this->sDisplay);
  39. $this->_aOptions['source'] = $this->oDb->prepareAsString($this->_aOptions['source'], $this->sObject, $this->sDisplay);
  40. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  41. }
  42. }
  43. /** @} */