BxBaseStudioGridNavigation.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 TridentView Trident Studio Representation classes
  7. * @ingroup TridentStudio
  8. * @{
  9. */
  10. class BxBaseStudioGridNavigation extends BxTemplStudioGrid
  11. {
  12. function __construct($aOptions, $oTemplate = false)
  13. {
  14. parent::__construct($aOptions, $oTemplate);
  15. }
  16. public function getModulesSelectAll($sGetItemsMethod, $bShowCustom = true, $bShowSystem = true)
  17. {
  18. if(empty($sGetItemsMethod))
  19. return '';
  20. $oForm = new BxTemplStudioFormView(array());
  21. $aInputModules = array(
  22. 'type' => 'select',
  23. 'name' => 'module',
  24. 'attrs' => array(
  25. 'id' => 'bx-grid-module-' . $this->_sObject,
  26. 'onChange' => 'javascript:' . $this->getJsObject() . '.onChangeFilter()'
  27. ),
  28. 'value' => '',
  29. 'values' => $this->getModules($bShowCustom, $bShowSystem)
  30. );
  31. $aCounter = array();
  32. $this->oDb->$sGetItemsMethod(array('type' => 'counter_by_modules'), $aCounter, false);
  33. foreach($aInputModules['values'] as $sKey => $sValue)
  34. $aInputModules['values'][$sKey] = $aInputModules['values'][$sKey] . " (" . (isset($aCounter[$sKey]) ? $aCounter[$sKey] : "0") . ")";
  35. $aInputModules['values'] = array_merge(array('' => _t('_adm_nav_txt_all_modules')), $aInputModules['values']);
  36. return $oForm->genRow($aInputModules);
  37. }
  38. public function getSearchInput()
  39. {
  40. $oForm = new BxTemplStudioFormView(array());
  41. $aInputSearch = array(
  42. 'type' => 'text',
  43. 'name' => 'keyword',
  44. 'attrs' => array(
  45. 'id' => 'bx-grid-search-' . $this->_sObject,
  46. 'onKeyup' => 'javascript:$(this).off(\'keyup\'); ' . $this->getJsObject() . '.onChangeFilter()'
  47. )
  48. );
  49. return $oForm->genRow($aInputSearch);
  50. }
  51. }
  52. /** @} */