BxBaseMenuAccountPopup.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 BxBaseMenuAccountPopup extends BxTemplMenu
  14. {
  15. public function __construct ($aObject, $oTemplate)
  16. {
  17. parent::__construct ($aObject, $oTemplate);
  18. }
  19. protected function _getTemplateVars ()
  20. {
  21. $aVars = parent::_getTemplateVars ();
  22. $aVars['bx_repeat:menu_items'] = array(true);
  23. $aVars['profile_display_name'] = BxDolProfile::getInstance()->getDisplayName();
  24. $aVars['url_switch_profile'] = BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher');
  25. $aVars['menu_account'] = BxDolMenu::getObjectInstance('sys_account')->getCode();
  26. $aVars['menu_notifications'] = BxDolMenu::getObjectInstance('sys_account_notifications')->getCode();
  27. $aVars['bx_if:multiple_profiles_mode'] = array(
  28. 'condition' => 1 != (int)getParam('sys_account_limit_profiles_number'),
  29. 'content' => array(),
  30. );
  31. $a = BxDolService::call('system', 'account_profile_switcher', array(), 'TemplServiceProfiles');
  32. $aVars['profile_switcher'] = $a['content'];
  33. return $aVars;
  34. }
  35. }
  36. /** @} */