BxGroupsMenuView.php 1.3 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 Groups Groups
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * 'View group' menu.
  13. */
  14. class BxGroupsMenuView extends BxBaseModProfileMenuView
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_groups';
  19. parent::__construct($aObject, $oTemplate);
  20. if ($this->_oProfile && isLogged()) {
  21. $oConn = BxDolConnection::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_CONNECTIONS']);
  22. if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) {
  23. $this->addMarkers(array(
  24. 'title_add_fan' => _t('_bx_groups_menu_item_title_become_fan_sent'),
  25. 'title_remove_fan' => _t('_bx_groups_menu_item_title_leave_group_cancel_request'),
  26. ));
  27. } else {
  28. $this->addMarkers(array(
  29. 'title_add_fan' => _t('_bx_groups_menu_item_title_become_fan'),
  30. 'title_remove_fan' => _t('_bx_groups_menu_item_title_leave_group'),
  31. ));
  32. }
  33. }
  34. }
  35. }
  36. /** @} */