|
|
@@ -32,34 +32,22 @@ class BxBaseModGroupsMenuViewActions extends BxBaseModProfileMenuViewActions
|
|
|
if(isset($CNF['OBJECT_CONNECTIONS']) && ($oConn = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS'])) !== false) {
|
|
|
$iProfileId = bx_get_logged_profile_id();
|
|
|
$iGroupProfileId = $this->_oProfile->id();
|
|
|
- $sOnclickAddFan = "bx_conn_action(this, 'bx_events_fans', 'add', '" . $iGroupProfileId . "')";
|
|
|
|
|
|
- $aMarkers = [];
|
|
|
- if($oConn->isConnectedNotMutual($iProfileId, $iGroupProfileId)) {
|
|
|
- if(isset($CNF['T']['menu_item_title_become_fan_sent'], $CNF['T']['menu_item_title_leave_group_cancel_request']))
|
|
|
- $aMarkers = [
|
|
|
- 'title_add_fan' => _t($CNF['T']['menu_item_title_become_fan_sent']),
|
|
|
- 'onclick_add_fan' => $sOnclickAddFan,
|
|
|
- 'title_remove_fan' => _t($CNF['T']['menu_item_title_leave_group_cancel_request']),
|
|
|
- ];
|
|
|
- }
|
|
|
- else {
|
|
|
- if($oConn->hasQuestionnaire($iGroupProfileId))
|
|
|
- $sOnclickAddFan = $this->_oModule->_oConfig->getJsObject('entry') . ".connAction(this, 'bx_events_fans', 'add', '" . $iGroupProfileId . "')";
|
|
|
-
|
|
|
- if(isset($CNF['T']['menu_item_title_become_fan'], $CNF['T']['menu_item_title_leave_group']))
|
|
|
- $aMarkers = [
|
|
|
- 'title_add_fan' => _t($CNF['T']['menu_item_title_become_fan']),
|
|
|
- 'onclick_add_fan' => $sOnclickAddFan,
|
|
|
- 'title_remove_fan' => _t($CNF['T']['menu_item_title_leave_group']),
|
|
|
- ];
|
|
|
- }
|
|
|
- $this->addMarkers($aMarkers);
|
|
|
+ $aTitles = $this->_oModule->getMenuItemTitleByConnection($CNF['OBJECT_CONNECTIONS'], '', $iGroupProfileId, $iProfileId);
|
|
|
+ $aMarkers = [
|
|
|
+ 'title_add_fan' => $aTitles['add'],
|
|
|
+ 'onclick_add_fan' => "bx_conn_action(this, 'bx_events_fans', 'add', '" . $iGroupProfileId . "')",
|
|
|
+ 'title_remove_fan' => $aTitles['remove'],
|
|
|
+ ];
|
|
|
+ if(!$oConn->isConnectedNotMutual($iProfileId, $iGroupProfileId) && $oConn->hasQuestionnaire($iGroupProfileId))
|
|
|
+ $aMarkers['onclick_add_fan'] = $this->_oModule->_oConfig->getJsObject('entry') . ".connAction(this, 'bx_events_fans', 'add', '" . $iGroupProfileId . "')";
|
|
|
|
|
|
if ($this->_oModule->isFan($this->_aContentInfo[$CNF['FIELD_ID']])) {
|
|
|
$a = $oConn->getConnectedInitiators($iGroupProfileId);
|
|
|
- $this->addMarkers(array('recipients' => implode(',', $a)));
|
|
|
+ $aMarkers['recipients'] = implode(',', $a);
|
|
|
}
|
|
|
+
|
|
|
+ $this->addMarkers($aMarkers);
|
|
|
}
|
|
|
}
|
|
|
}
|