BxTemplMenuAccountNotifications.php 1.4 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 UnaTemplate UNA Template Classes
  7. * @{
  8. */
  9. /**
  10. * @see BxDolMenu
  11. */
  12. class BxTemplMenuAccountNotifications extends BxBaseMenuAccountNotifications
  13. {
  14. public function __construct ($aObject, $oTemplate = false)
  15. {
  16. parent::__construct ($aObject, $oTemplate);
  17. }
  18. protected function _getMenuItem ($a)
  19. {
  20. $a = parent::_getMenuItem ($a);
  21. if($a === false)
  22. return $a;
  23. $a['class_add_a'] = '';
  24. switch ($a['name']) {
  25. case 'add-content':
  26. if(isset($a['bx_if:onclick']['content']['onclick']))
  27. $a['bx_if:onclick']['content']['onclick'] = str_replace(['bx_menu_slide_inline', 'bx-menu-toolbar-item-add-content'], ['oBxArtificerUtils.getAddContentMenu', 'bx-menu-toolbar-item-account'], $a['bx_if:onclick']['content']['onclick']);
  28. break;
  29. case 'notifications-notifications':
  30. if(isset($a['bx_if:onclick']['content']['onclick']))
  31. $a['bx_if:onclick']['content']['onclick'] = str_replace(['bx_menu_slide', 'this'], ['oBxArtificerUtils.getNotificationsMenu', '$(\'#bx-menu-toolbar-item-account a\').get(0)'], $a['bx_if:onclick']['content']['onclick']);
  32. break;
  33. }
  34. return $a;
  35. }
  36. }
  37. /** @} */