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

Ticket #4148 - Build-in API support: Use avatar with max size in cover block.

AntonLV 3 лет назад
Родитель
Сommit
560d6983d6
2 измененных файлов с 7 добавлено и 5 удалено
  1. 1 1
      inc/classes/BxDolProfile.php
  2. 6 4
      template/scripts/BxBasePage.php

+ 1 - 1
inc/classes/BxDolProfile.php

@@ -146,7 +146,7 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
             'display_type' =>  $sDisplayType,
             'display_name' => $oProfile->getDisplayName(),
             'url' => bx_api_get_relative_url($oProfile->getUrl()),
-            'url_avatar' => $oProfile->getAvatar(),
+            'url_avatar' => $oProfile->{isset($aParams['get_avatar']) && method_exists($oProfile, $aParams['get_avatar']) ? $aParams['get_avatar'] : 'getAvatar'}(),
             'module' => $oProfile->getModule(),
         ];
         

+ 6 - 4
template/scripts/BxBasePage.php

@@ -418,12 +418,14 @@ class BxBasePage extends BxDolPage
         ];
         
         
-        if (BxDolCover::getInstance($this)->isCover() && isset($this->_aProfileInfo)){
-            
+        if (BxDolCover::getInstance($this)->isCover() && isset($this->_aProfileInfo)) {
             $oModule = BxDolModule::getInstance($this->getModule());
-            
+
             $a['cover_block'] = [
-                'profile' => BxDolProfile::getInstance()->getData($this->_aProfileInfo['id'], ['with_info' => true]),
+                'profile' => BxDolProfile::getInstance()->getData($this->_aProfileInfo['id'], [
+                    'get_avatar' => 'getAvatarBig',
+                    'with_info' => true
+                ]),
                 'actions_menu' => '',
                 'meta_menu' => '',
                 'cover' => $oModule->serviceGetCover($this->_aProfileInfo['content_id'])