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

Ticket #757 - Related changes in Timeline and integrated modules.

AntonLV 9 лет назад
Родитель
Сommit
37492721e0

+ 5 - 5
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -590,7 +590,7 @@ class BxBaseModGeneralModule extends BxDolModule
     /**
      * Entry post for Timeline module
      */
-    public function serviceGetTimelinePost($aEvent)
+    public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
     {
         $aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
         if(empty($aContentInfo) || !is_array($aContentInfo))
@@ -654,7 +654,7 @@ class BxBaseModGeneralModule extends BxDolModule
         	'sample_wo_article' => $CNF['T']['txt_sample_single'],
     	    'sample_action' => isset($CNF['T']['txt_sample_single_action']) ? $CNF['T']['txt_sample_single_action'] : '',
             'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
-            'content' => $this->_getContentForTimelinePost($aEvent, $aContentInfo), //a string to display or array to parse default template before displaying.
+            'content' => $this->_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams), //a string to display or array to parse default template before displaying.
             'date' => $aContentInfo[$CNF['FIELD_ADDED']],
             'views' => $aViews,
             'votes' => $aVotes,
@@ -988,14 +988,14 @@ class BxBaseModGeneralModule extends BxDolModule
         exit;
     }
 
-    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
     {
     	$CNF = &$this->_oConfig->CNF;
 
     	$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
 
     	//--- Image(s)
-        $aImages = $this->_getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl);
+        $aImages = $this->_getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
 
     	return array(
     		'sample' => isset($CNF['T']['txt_sample_single_with_article']) ? $CNF['T']['txt_sample_single_with_article'] : $CNF['T']['txt_sample_single'],
@@ -1009,7 +1009,7 @@ class BxBaseModGeneralModule extends BxDolModule
 		);
     }
 
-    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     {
         $CNF = &$this->_oConfig->CNF;
 

+ 3 - 3
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -347,9 +347,9 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
     /**
      * Entry post for Timeline module
      */
-    public function serviceGetTimelinePost($aEvent)
+    public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
     {
-        $a = parent::serviceGetTimelinePost($aEvent);
+        $a = parent::serviceGetTimelinePost($aEvent, $aBrowseParams);
 
         $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aEvent['object_id'], $this->getName());
 
@@ -502,7 +502,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         return $oGroupProfile && ($oConnection = BxDolConnection::getObjectInstance($this->_oConfig->CNF['OBJECT_CONNECTIONS'])) && $oConnection->isConnected($iProfileId ? $iProfileId : bx_get_logged_profile_id(), $oGroupProfile->id(), true);
     }
 
-    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     {
         $CNF = &$this->_oConfig->CNF;
 

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -346,7 +346,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         return $aParams;
     }
 
-    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     {
         $CNF = &$this->_oConfig->CNF;
 

+ 2 - 2
modules/boonex/events/classes/BxEventsModule.php

@@ -117,9 +117,9 @@ class BxEventsModule extends BxBaseModGroupsModule
      * @param $aEvent timeline event array from Timeline module
      * @return array in special format which is needed specifically for Timeline module to display the data.
      */
-    public function serviceGetTimelinePost($aEvent)
+    public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
     {
-        $a = parent::serviceGetTimelinePost($aEvent);
+        $a = parent::serviceGetTimelinePost($aEvent, $aBrowseParams);
 
         if (!($aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id'])))
             return $a;

+ 3 - 3
modules/boonex/files/classes/BxFilesModule.php

@@ -179,9 +179,9 @@ class BxFilesModule extends BxBaseModTextModule
         }
     }
 
-    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
     {
-        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo);
+        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
 
         $aFile = $this->getContentFile($aContentInfo);
         if (!$aFile['is_image']) {
@@ -200,7 +200,7 @@ class BxFilesModule extends BxBaseModTextModule
         return $aResult;
     }
 
-    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     {
         $aFile = $this->getContentFile($aContentInfo);
         if (!$aFile)

+ 2 - 2
modules/boonex/snipcart/classes/BxSnipcartModule.php

@@ -102,9 +102,9 @@ class BxSnipcartModule extends BxBaseModTextModule
         );
     }
 
-    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
     {
-        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo);
+        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
         $aResult['raw'] = $this->_oTemplate->getBuyButton($aContentInfo);
 
         return $aResult;

+ 2 - 2
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -266,7 +266,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         $sPrefix = $this->getPrefix('common_post');
         return strpos($sType, $sPrefix) === false && !empty($sAction);
     }
-    public function getSystemData(&$aEvent)
+    public function getSystemData(&$aEvent, $aBrowseParams = array())
     {
 		$sHandler = $aEvent['type'] . '_' . $aEvent['action'];
         if(!$this->isHandler($sHandler))
@@ -276,7 +276,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         if(empty($aHandler['module_name']) || empty($aHandler['module_class']) || empty($aHandler['module_method']))
         	return false; 
 
-		return BxDolService::call($aHandler['module_name'], $aHandler['module_method'], array($aEvent), $aHandler['module_class']);
+		return BxDolService::call($aHandler['module_name'], $aHandler['module_method'], array($aEvent, $aBrowseParams), $aHandler['module_class']);
     }
     public function getSystemDataByDescriptor($sType, $sAction, $iObjectId)
     {

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

@@ -167,7 +167,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 return '';
         }
 
-        $aResult = $this->getData($aEvent);
+        $aResult = $this->getData($aEvent, $aBrowseParams);
         if($aResult === false)
             return '';
 
@@ -649,9 +649,9 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         ));
     }
 
-    public function getData(&$aEvent)
+    public function getData(&$aEvent, $aBrowseParams = array())
     {
-        $aResult = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $this->_getSystemData($aEvent) : $this->_getCommonData($aEvent);
+        $aResult = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $this->_getSystemData($aEvent, $aBrowseParams) : $this->_getCommonData($aEvent, $aBrowseParams);
         if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
             return false;
 
@@ -1083,9 +1083,9 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         );
     }
 
-    protected function _getSystemData(&$aEvent)
+    protected function _getSystemData(&$aEvent, $aBrowseParams = array())
     {
-        $mixedResult = $this->_oConfig->getSystemData($aEvent);
+        $mixedResult = $this->_oConfig->getSystemData($aEvent, $aBrowseParams);
 		if($mixedResult !== false)
 			return $mixedResult;
 
@@ -1096,7 +1096,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 		return $this->$sMethod($aEvent);
     }
 
-    protected function _getCommonData(&$aEvent)
+    protected function _getCommonData(&$aEvent, $aBrowseParams = array())
     {
         $CNF = $this->_oConfig->CNF;
 
@@ -1185,10 +1185,10 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
                 if(!$this->_oConfig->isSystem($aContent['type'] , $aContent['action'])) {
                     $aReposted = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $aContent['object_id']));
-                    $aReposted = $this->_getCommonData($aReposted);
+                    $aReposted = $this->_getCommonData($aReposted, $aBrowseParams);
                 } 
                 else
-                	$aReposted = $this->_getSystemData($aContent);
+                	$aReposted = $this->_getSystemData($aContent, $aBrowseParams);
 
 				if(empty($aReposted) || !is_array($aReposted))
 					return array();