BxDecorousModule.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 Decorous Decorous template
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. bx_import ('BxBaseModTemplateModule');
  12. class BxDecorousModule extends BxBaseModTemplateModule
  13. {
  14. function __construct(&$aModule)
  15. {
  16. parent::__construct($aModule);
  17. }
  18. public function serviceGetActions($aWidget)
  19. {
  20. $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
  21. $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_decorous', _t('_bx_decorous_stg_cpt_type')), BX_INFORMER_ALERT);
  22. return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
  23. }
  24. function serviceIncludeCssJs($sType)
  25. {
  26. $sResult = '';
  27. if(BxDolTemplate::getInstance()->getCode() != $this->_oConfig->getUri())
  28. return $sResult;
  29. switch($sType) {
  30. case 'head':
  31. $sCss = trim(getParam($this->_oConfig->getName() . '_styles_custom'));
  32. if(!empty($sCss))
  33. $sResult .= $this->_oTemplate->_wrapInTagCssCode($sCss);
  34. $sResult .= $this->_oTemplate->addJs([
  35. 'custom.js'
  36. ], true);
  37. break;
  38. case 'footer':
  39. $sResult .= $this->_oTemplate->addJs([
  40. 'modules/base/template/js/|sidebar.js'
  41. ], true);
  42. break;
  43. }
  44. return $sResult;
  45. }
  46. }
  47. /** @} */