BxAdsFormCategory.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 Ads Ads
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Create/Edit category form
  13. */
  14. class BxAdsFormCategory extends BxTemplStudioFormView
  15. {
  16. protected $_sModule;
  17. protected $_oModule;
  18. public function __construct($aInfo, $oTemplate = false)
  19. {
  20. $this->_sModule = 'bx_ads';
  21. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  22. parent::__construct($aInfo, $oTemplate);
  23. $CNF = &$this->_oModule->_oConfig->CNF;
  24. if(isset($this->aInputs['parent_id'])) {
  25. $this->aInputs['parent_id']['values'] = array();
  26. }
  27. if(isset($this->aInputs['type'])) {
  28. $this->aInputs['type']['values'] = array();
  29. $aTypes = $this->_oModule->_oDb->getCategoryTypes(array('type' => 'all'));
  30. foreach($aTypes as $aType)
  31. $this->aInputs['type']['values'][] = array('key' => $aType['id'], 'value' => _t($aType['title']));
  32. }
  33. }
  34. }
  35. /** @} */