roman.lesnikov@gmail.com 3 лет назад
Родитель
Сommit
90b525bcaf

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -210,7 +210,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $sTitle = _t('_bx_timeline_page_block_title_views_' . $aParams['view']);
 
         if (bx_is_api())
-            return $this->getViewBlock($aParams);
+            return [['id' => 1, 'type' => 'browse', 'data' => ['unit' => 'feed', 'data' => $this->getViewBlock($aParams)]]];
         
         return [
             'content' => $this->parseHtmlByName('block_views.html', [

+ 12 - 10
template/scripts/BxBasePage.php

@@ -419,17 +419,19 @@ class BxBasePage extends BxDolPage
         $aCells = $this->_oQuery->getPageBlocks();
         foreach ($aCells as $sKey => $aCell) {
             foreach ($aCell as $i => $aBlock) {                
-                if (!$this->_isVisibleBlock($aBlock))
+                if (!$this->_isVisibleBlock($aBlock)){
                     unset($aCells[$sKey][$i]);
-                
-                $this->processPageBlock($aCells[$sKey][$i], true);
-                $aBlock = $aCells[$sKey][$i];
-
-                $sFunc = '_getBlock' . ucfirst($aBlock['type']);
-                $aCells[$sKey][$i]['content'] = method_exists($this, $sFunc) ? $this->$sFunc($aBlock) : $aBlock['content'];
-                $aCells[$sKey][$i]['title'] = $this->getBlockTitle($aBlock);
-                foreach ($aFieldsUnset as $s)
-                    unset($aCells[$sKey][$i][$s]);
+                }
+                else{
+                    $this->processPageBlock($aCells[$sKey][$i], true);
+                    $aBlock = $aCells[$sKey][$i];
+
+                    $sFunc = '_getBlock' . ucfirst($aBlock['type']);
+                    $aCells[$sKey][$i]['content'] = method_exists($this, $sFunc) ? $this->$sFunc($aBlock) : $aBlock['content'];
+                    $aCells[$sKey][$i]['title'] = $this->getBlockTitle($aBlock);
+                    foreach ($aFieldsUnset as $s)
+                        unset($aCells[$sKey][$i][$s]);
+                }
             }
         }
         return $aCells;

+ 3 - 0
template/scripts/BxBaseServices.php

@@ -597,6 +597,9 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
      */
     public function serviceGetCreatePostForm($mixedContextId = false, $sDefault = '', $aCustom = array())
     {
+        if (bx_is_api())
+            return ;
+        
     	if(!isLogged() || ($mixedContextId !== false && !is_numeric($mixedContextId)))
             return '';