BxBaseMenuToolbar.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 DolphinCore Dolphin Core
  7. * @{
  8. */
  9. bx_import('BxTemplMenu');
  10. /**
  11. * Menu representation.
  12. * @see BxDolMenu
  13. */
  14. class BxBaseMenuToolbar extends BxTemplMenu
  15. {
  16. public function __construct ($aObject, $oTemplate)
  17. {
  18. parent::__construct ($aObject, $oTemplate);
  19. }
  20. protected function _getMenuItems () {
  21. $a = parent::_getMenuItems ();
  22. if (!isLogged())
  23. return $a;
  24. foreach ($a as $k => $r) {
  25. if ('account' != $r['name'])
  26. continue;
  27. bx_import('BxDolProfile');
  28. $oProfile = BxDolProfile::getInstance(bx_get_logged_profile_id ());
  29. $sUrlIcon = $oProfile->getThumb();
  30. if (!$sUrlIcon)
  31. break;
  32. $a[$k]['bx_if:image'] = array (
  33. 'condition' => true,
  34. 'content' => array('icon_url' => $sUrlIcon),
  35. );
  36. $a[$k]['bx_if:icon']['condition'] = false;
  37. }
  38. return $a;
  39. }
  40. }
  41. /** @} */