BxDolStudioNavigationImport.php 1.4 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 BxDolStudioNavigationImport extends BxTemplStudioGridNavigation
  10. {
  11. protected $sSet;
  12. public function __construct ($aOptions, $oTemplate = false)
  13. {
  14. parent::__construct ($aOptions, $oTemplate);
  15. $this->oDb = new BxDolStudioNavigationQuery();
  16. $sSet = bx_get('set');
  17. if(!empty($sSet))
  18. $this->sSet = bx_process_input($sSet);
  19. $this->_aQueryAppend['set'] = $this->sSet;
  20. }
  21. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  22. {
  23. $sSet = $sModule = '';
  24. if(strpos($sFilter, $this->sParamsDivider) !== false)
  25. list($sSet, $sModule, $sFilter) = explode($this->sParamsDivider, $sFilter);
  26. if($sSet != '')
  27. $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `set_name`=?", $sSet);
  28. if($sModule != '')
  29. $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `module`=?", $sModule);
  30. $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `set_name`<>?", $this->sSet);
  31. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  32. }
  33. }
  34. /** @} */