BxDolStudioNavigationImport.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 DolphinStudio Dolphin Studio
  7. * @{
  8. */
  9. bx_import('BxTemplStudioGridNavigation');
  10. bx_import('BxDolStudioTemplate');
  11. bx_import('BxDolStudioNavigationQuery');
  12. class BxDolStudioNavigationImport extends BxTemplStudioGridNavigation {
  13. protected $sSet;
  14. public function __construct ($aOptions, $oTemplate = false) {
  15. parent::__construct ($aOptions, $oTemplate);
  16. $this->oDb = new BxDolStudioNavigationQuery();
  17. $sSet = bx_get('set');
  18. if(!empty($sSet))
  19. $this->sSet = bx_process_input($sSet);
  20. $this->_aQueryAppend['set'] = $this->sSet;
  21. }
  22. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage) {
  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->prepare(" AND `set_name`=?", $sSet);
  28. if($sModule != '')
  29. $this->_aOptions['source'] .= $this->oDb->prepare(" AND `module`=?", $sModule);
  30. $this->_aOptions['source'] .= $this->oDb->prepare(" AND `set_name`<>?", $this->sSet);
  31. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  32. }
  33. }
  34. /** @} */