BxNtfsStudioPage.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 Notifications Notifications
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. define('BX_DOL_STUDIO_MOD_TYPE_ETEMPLATES', 'etemplates_text');
  12. class BxNtfsStudioPage extends BxBaseModNotificationsStudioPage
  13. {
  14. public function __construct($sModule, $mixedPageName, $sPage = "")
  15. {
  16. $this->_sModule = 'bx_notifications';
  17. parent::__construct($sModule, $mixedPageName, $sPage);
  18. $this->aMenuItems = array_merge($this->aMenuItems, array(
  19. BX_BASE_MOD_NTFS_DTYPE_SITE => array('name' => BX_BASE_MOD_NTFS_DTYPE_SITE, 'icon' => 'globe', 'title' => '_bx_ntfs_lmi_cpt_site'),
  20. BX_BASE_MOD_NTFS_DTYPE_EMAIL => array('name' => BX_BASE_MOD_NTFS_DTYPE_EMAIL, 'icon' => 'envelope', 'title' => '_bx_ntfs_lmi_cpt_email'),
  21. BX_BASE_MOD_NTFS_DTYPE_PUSH => array('name' => BX_BASE_MOD_NTFS_DTYPE_PUSH, 'icon' => 'bullhorn', 'title' => '_bx_ntfs_lmi_cpt_push'),
  22. BX_DOL_STUDIO_MOD_TYPE_ETEMPLATES => array('name' => BX_DOL_STUDIO_MOD_TYPE_ETEMPLATES, 'icon' => 'file-word', 'title' => '_bx_ntfs_lmi_cpt_etemplates_text'),
  23. ));
  24. }
  25. protected function getSite()
  26. {
  27. return $this->_getDeliveryType(BX_BASE_MOD_NTFS_DTYPE_SITE);
  28. }
  29. protected function getEmail()
  30. {
  31. return $this->_getDeliveryType(BX_BASE_MOD_NTFS_DTYPE_EMAIL);
  32. }
  33. protected function getPush()
  34. {
  35. return $this->_getDeliveryType(BX_BASE_MOD_NTFS_DTYPE_PUSH);
  36. }
  37. protected function getEtemplatesText()
  38. {
  39. $oGrid = BxDolGrid::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_GRID_ETEMPLATES'], BxDolStudioTemplate::getInstance());
  40. if(!$oGrid)
  41. return '';
  42. $this->_oModule->_oTemplate->addStudioJs(['main.js']);
  43. return $oGrid->getCode();
  44. }
  45. protected function _getDeliveryType($sDeliveryType)
  46. {
  47. return $this->_oModule->getBlockSettings($sDeliveryType, array(
  48. 'grid' => $this->_oModule->_oConfig->CNF['OBJECT_GRID_SETTINGS_ADMINISTRATION'],
  49. 'template' => BxDolStudioTemplate::getInstance()
  50. ));
  51. }
  52. }
  53. /** @} */