ソースを参照

Ticket #2401 - Connection between Post and View blocks.

AntonLV 6 年 前
親
コミット
bc356c7177

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

@@ -1079,7 +1079,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             return '';
 
         $iProfileId = $this->getProfileId();
-        $sType = BX_TIMELINE_TYPE_OWNER_AND_CONNECTIONS;
+        $sType = BX_TIMELINE_TYPE_FEED;
         return $this->_getBlockPost($iProfileId, array(
             'type' => $sType,
             'form_display' => $this->_oConfig->getPostFormDisplay($sType)

+ 10 - 0
modules/boonex/timeline/js/post.js

@@ -315,6 +315,16 @@ BxTimelinePost.prototype._onGetPost = function(oData)
 
         $this.oView = $($this._getHtmlId('main', oData));
 
+        /*
+         * For backward compatibility.
+         * Current UPF: 'Post to Feed' and Timeline: 'Post to Feed' forms 
+         * should work with an old Account Feed ('Owner and Connections') block.
+         */
+        if(!$this.oView.length && oData['type'] == 'feed') {
+            oData['type'] = 'owner_and_connections';
+            $this.oView = $($this._getHtmlId('main', oData));
+        }
+
         var oLoadMore = $this.oView.find('.' + $this.sSP + '-load-more');
         if(!oLoadMore.is(':visible'))
             oLoadMore.show();