1
0

BxBaseMenuAccountNotifications.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 TridentCore Trident Core
  7. * @{
  8. */
  9. /**
  10. * Menu representation.
  11. * @see BxDolMenu
  12. */
  13. class BxBaseMenuAccountNotifications extends BxTemplMenu
  14. {
  15. public function __construct ($aObject, $oTemplate)
  16. {
  17. parent::__construct ($aObject, $oTemplate);
  18. }
  19. /**
  20. * Check if menu items is visible with extended checking for friends notifications
  21. * @param $a menu item array
  22. * @return boolean
  23. */
  24. protected function _isVisible ($a)
  25. {
  26. // default visible settings
  27. if (!BxDolAcl::getInstance()->isMemberLevelInSet($a['visible_for_levels']))
  28. return false;
  29. // show only friends for currently active profile for friend request notification
  30. if ('notifications-friend-requests' == $a['name'] || 'profile-stats-friend-requests' == $a['name']) {
  31. $oProfile = BxDolProfile::getInstance();
  32. $aInfo = $oProfile->getInfo();
  33. if ($a['module'] != $aInfo['type'])
  34. return false;
  35. }
  36. return true;
  37. }
  38. }
  39. /** @} */