BxBaseMenuAccountDashboard.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. /**
  10. * Menu representation.
  11. * @see BxDolMenu
  12. */
  13. class BxBaseMenuAccountDashboard 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. switch ($a['name']) {
  30. case 'dashboard-subscriptions':
  31. $oPayments = BxDolPayments::getInstance();
  32. if(!$oPayments->isActive())
  33. return false;
  34. break;
  35. case 'dashboard-orders':
  36. $oPayments = BxDolPayments::getInstance();
  37. if(!$oPayments->isActive())
  38. return false;
  39. break;
  40. }
  41. return true;
  42. }
  43. }
  44. /** @} */