BxDolStudioNavigationImport.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup TridentStudio Trident Studio
  7. * @{
  8. */
  9. bx_import('BxTemplStudioGridNavigation');
  10. bx_import('BxDolStudioTemplate');
  11. bx_import('BxDolStudioNavigationQuery');
  12. class BxDolStudioNavigationImport extends BxTemplStudioGridNavigation
  13. {
  14. protected $sSet;
  15. public function __construct ($aOptions, $oTemplate = false)
  16. {
  17. parent::__construct ($aOptions, $oTemplate);
  18. $this->oDb = new BxDolStudioNavigationQuery();
  19. $sSet = bx_get('set');
  20. if(!empty($sSet))
  21. $this->sSet = bx_process_input($sSet);
  22. $this->_aQueryAppend['set'] = $this->sSet;
  23. }
  24. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  25. {
  26. $sSet = $sModule = '';
  27. if(strpos($sFilter, $this->sParamsDivider) !== false)
  28. list($sSet, $sModule, $sFilter) = explode($this->sParamsDivider, $sFilter);
  29. if($sSet != '')
  30. $this->_aOptions['source'] .= $this->oDb->prepare(" AND `set_name`=?", $sSet);
  31. if($sModule != '')
  32. $this->_aOptions['source'] .= $this->oDb->prepare(" AND `module`=?", $sModule);
  33. $this->_aOptions['source'] .= $this->oDb->prepare(" AND `set_name`<>?", $this->sSet);
  34. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  35. }
  36. }
  37. /** @} */