BxBaseMenuAccountPopup.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 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. $oProfile = BxDolProfile::getInstance();
  23. if(!$oProfile)
  24. return $aVars;
  25. $aVars['bx_repeat:menu_items'] = array(true);
  26. $aVars['active_profile'] = $oProfile->getUnit();
  27. $aVars['menu_notifications'] = BxDolMenu::getObjectInstance('sys_account_notifications')->getCode();
  28. $aVars['bx_if:multiple_profiles_mode'] = array(
  29. 'condition' => BxDolAccount::isAllowedCreateMultiple($oProfile->id()),
  30. 'content' => array(
  31. 'url_switch_profile' => BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher')
  32. ),
  33. );
  34. $a = BxDolService::call('system', 'account_profile_switcher', array(), 'TemplServiceProfiles');
  35. $aVars['profile_switcher'] = $a['content'];
  36. return $aVars;
  37. }
  38. }
  39. /** @} */