BxDolStudioFormsGroupsRoles.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 BxDolStudioFormsGroupsRoles extends BxTemplStudioGrid
  10. {
  11. protected $sModule;
  12. protected $sRolesDataList;
  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. $oModule = BxDolModule::getInstance($sModule);
  20. if ($oModule) {
  21. $sRolesDataList = isset($oModule->_oConfig->CNF['OBJECT_PRE_LIST_ROLES']) ? $oModule->_oConfig->CNF['OBJECT_PRE_LIST_ROLES'] : '';
  22. if ($sRolesDataList) {
  23. $this->sModule = bx_process_input($sModule);
  24. $this->sRolesDataList = $sRolesDataList;
  25. $this->_aQueryAppend['module'] = $this->sModule;
  26. }
  27. }
  28. }
  29. }
  30. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  31. {
  32. if($this->sRolesDataList != '') {
  33. $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `Key` = ?", $this->sRolesDataList);
  34. return parent::_getDataSql('', $sOrderField, $sOrderDir, $iStart, $iPerPage);
  35. }
  36. return false;
  37. }
  38. }
  39. /** @} */