AntonLV 7 лет назад
Родитель
Сommit
cad929ecf7

+ 5 - 0
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -1036,6 +1036,11 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         return CHECK_ACTION_RESULT_ALLOWED;
     }
 
+    public function serviceSetViewProfileCover($oPage, $aProfileInfo)
+    {
+        $this->_oTemplate->setCover($oPage,$aProfileInfo);
+    }
+
     /**
      * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.
      */

+ 8 - 0
modules/base/text/classes/BxBaseModTextPageAuthor.php

@@ -31,6 +31,14 @@ class BxBaseModTextPageAuthor extends BxTemplPage
         if (!$this->_aProfileInfo || !$this->_oProfile)
             return;
 
+        //set cover
+        $sProfileModule = $this->_oProfile->getModule();
+        if(BxDolRequest::serviceExists($sProfileModule, 'set_view_profile_cover')) {
+            $aProfileInfoFull = BxDolService::call($sProfileModule, 'get_all', array(array('type' => 'id', 'id' => $this->_oProfile->getContentId())));
+
+            BxDolService::call($sProfileModule, 'set_view_profile_cover', array($this, $aProfileInfoFull));
+        }
+
         // select view profile submenu
         $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
         if ($oMenuSubmenu) {