Просмотр исходного кода

Ticket #4558 - Build-in API support: Connnections lists.

AntonLV 2 лет назад
Родитель
Сommit
47586f8af4

+ 6 - 0
modules/base/groups/classes/BxBaseModGroupsMenuViewMeta.php

@@ -35,8 +35,14 @@ class BxBaseModGroupsMenuViewMeta extends BxBaseModProfileMenuViewMeta
         if($this->_bIsApi) {
             $aCounter = $oConnection->getCounterAPI($iContentProfileId, false, ['caption' => $aItem['title']], BX_CONNECTIONS_CONTENT_TYPE_INITIATORS);
 
+            $sUrl = $this->_oContentProfile->getUrl();
+            if(!empty($CNF['URI_VIEW_MEMBERS']))
+                $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEMBERS'] . '&profile_id=' . $iContentProfileId));
+
             return $this->_getMenuItemAPI($aItem, ['display' => 'button'], [
                 'title' => $aCounter['countf'],
+                'link' => bx_api_get_relative_url($sUrl),
+                'list' => $oConnection->getConnectedListAPI($iContentProfileId, false, BX_CONNECTIONS_CONTENT_TYPE_INITIATORS)
             ]);
         }
 

+ 12 - 0
modules/base/profile/classes/BxBaseModProfileMenuViewMeta.php

@@ -119,8 +119,14 @@ class BxBaseModProfileMenuViewMeta extends BxTemplMenuUnitMeta
         if($this->_bIsApi) {
             $aCounter = $oConnection->getCounterAPI($iContentProfileId, true, ['caption' => $aItem['title']], BX_CONNECTIONS_CONTENT_TYPE_INITIATORS);
 
+            $sUrl = $this->_oContentProfile->getUrl();
+            if(!empty($CNF['URI_VIEW_FRIENDS']))
+                $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_FRIENDS'] . '&profile_id=' . $iContentProfileId));
+
             return $this->_getMenuItemAPI($aItem, ['display' => 'button'], [
                 'title' => $aCounter['countf'],
+                'link' => bx_api_get_relative_url($sUrl),
+                'list' => $oConnection->getConnectedListAPI($iContentProfileId, true, BX_CONNECTIONS_CONTENT_TYPE_CONTENT)
             ]);
         }
 
@@ -144,8 +150,14 @@ class BxBaseModProfileMenuViewMeta extends BxTemplMenuUnitMeta
         if($this->_bIsApi) {
             $aCounter = $oConnection->getCounterAPI($iContentProfileId, false, ['caption' => $aItem['title']], BX_CONNECTIONS_CONTENT_TYPE_INITIATORS);
 
+            $sUrl = $this->_oContentProfile->getUrl();
+            if(!empty($CNF['URI_VIEW_SUBSCRIPTIONS']))
+                $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_SUBSCRIPTIONS'] . '&profile_id=' . $iContentProfileId));
+
             return $this->_getMenuItemAPI($aItem, ['display' => 'button'], [
                 'title' => $aCounter['countf'],
+                'link' => bx_api_get_relative_url($sUrl),
+                'list' => $oConnection->getConnectedListAPI($iContentProfileId, false, BX_CONNECTIONS_CONTENT_TYPE_INITIATORS)
             ]);
         }
 

+ 1 - 0
modules/boonex/events/classes/BxEventsConfig.php

@@ -79,6 +79,7 @@ class BxEventsConfig extends BxBaseModGroupsConfig
 
             // page URIs
             'URI_VIEW_ENTRY' => 'view-event-profile',
+            'URI_VIEW_MEMBERS' => 'event-fans',
             'URI_EDIT_ENTRY' => 'edit-event-profile',
             'URI_ENTRIES_BY_CONTEXT' => 'events-context',
             'URI_JOIN_ENTRY' => 'join-event-profile',

+ 1 - 0
modules/boonex/groups/classes/BxGroupsConfig.php

@@ -68,6 +68,7 @@ class BxGroupsConfig extends BxBaseModGroupsConfig
 
             // page URIs
             'URI_VIEW_ENTRY' => 'view-group-profile',
+            'URI_VIEW_MEMBERS' => 'group-fans',
             'URI_EDIT_ENTRY' => 'edit-group-profile',
             'URI_JOIN_ENTRY' => 'join-group-profile',
             'URI_JOINED_ENTRIES' => 'joined-groups',

+ 3 - 3
modules/boonex/groups/install/config.php

@@ -18,12 +18,12 @@ $aConfig = array(
     'name' => 'bx_groups',
     'title' => 'Groups',
     'note' => 'Basic group profiles functionality.',
-    'version' => '13.0.11.DEV',
-    'vendor' => 'BoonEx',
+    'version' => '14.0.0.DEV',
+    'vendor' => 'UNA INC',
     'help_url' => 'http://feed.una.io/?section={module_name}',
 
     'compatible_with' => array(
-        '13.0.x'
+        '14.0.x'
     ),
 
     /**