BxBaseModNotificationsTemplate.php 1.6 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 BaseNotifications Base classes for Notifications like modules
  7. * @ingroup DolphinModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralTemplate');
  12. class BxBaseModNotificationsTemplate extends BxBaseModGeneralTemplate
  13. {
  14. function __construct(&$oConfig, &$oDb)
  15. {
  16. parent::__construct($oConfig, $oDb);
  17. }
  18. public function getCssJs()
  19. {
  20. $this->addCss(array(
  21. 'view.css',
  22. 'view-media-tablet.css',
  23. 'view-media-desktop.css',
  24. ));
  25. $this->addJs(array(
  26. 'jquery.anim.js',
  27. 'main.js',
  28. 'view.js',
  29. ));
  30. }
  31. public function getJsCode($sType, $aParams = array(), $bWrap = true)
  32. {
  33. $oModule = $this->getModule();
  34. $sBaseUri = $this->_oConfig->getBaseUri();
  35. $sJsClass = $this->_oConfig->getJsClass($sType);
  36. $sJsObject = $this->_oConfig->getJsObject($sType);
  37. $aParams = array_merge(array(
  38. 'iOwnerId' => $oModule->_iOwnerId,
  39. 'sAnimationEffect' => $this->_oConfig->getAnimationEffect(),
  40. 'iAnimationSpeed' => $this->_oConfig->getAnimationSpeed(),
  41. 'aHtmlIds' => $this->_oConfig->getHtmlIds($sType)
  42. ), $aParams);
  43. $this->getCssJs();
  44. return parent::getJsCode($sType, $aParams, $bWrap);
  45. }
  46. protected function getModule()
  47. {
  48. $sName = $this->_oConfig->getName();
  49. return BxDolModule::getInstance($sName);
  50. }
  51. }
  52. /** @} */