BxBaseMenuAccountDashboard.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. if(!parent::_isVisible($a))
  27. return false;
  28. switch ($a['name']) {
  29. case 'dashboard-subscriptions':
  30. $oPayments = BxDolPayments::getInstance();
  31. if(!$oPayments->isActive())
  32. return false;
  33. break;
  34. case 'dashboard-orders':
  35. $oPayments = BxDolPayments::getInstance();
  36. if(!$oPayments->isActive())
  37. return false;
  38. break;
  39. case 'dashboard-invoices':
  40. $oPayments = BxDolPayments::getInstance();
  41. if(!$oPayments->isActive())
  42. return false;
  43. break;
  44. }
  45. return true;
  46. }
  47. }
  48. /** @} */