Jelajahi Sumber

#24 - Timeline - Share feature.

AntonLV 13 tahun lalu
induk
melakukan
c84503a84d

+ 1 - 0
modules/boonex/notes/classes/BxNotesModule.php

@@ -244,6 +244,7 @@ class BxNotesModule extends BxDolModule {
     		'owner_id' => $aContentInfo[BxNotesConfig::$FIELD_AUTHOR],
     		'content_type' => !empty($sImage) ? 'photo' : 'text', //how to parse content, 'text' by default.
     		'content' => array(
+    			'sample' => _t('_bx_notes_txt_sample_single'),
     			'url' => $sUrl,
     			'title' => $aContentInfo[BxNotesConfig::$FIELD_TITLE],
     			'text' => $aContentInfo[BxNotesConfig::$FIELD_TEXT],

+ 1 - 0
modules/boonex/notes/install/langs/en.xml

@@ -106,5 +106,6 @@
 	<string name="_bx_notes_txt_error_note_is_not_defined"><![CDATA[Note isn't defined]]></string>
     <string name="_bx_notes_txt_status_pending"><![CDATA[This note is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_notes_txt_read_more"><![CDATA[Read More]]></string>
+    <string name="_bx_notes_txt_sample_single"><![CDATA[note]]></string>
 
 </resources>

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

@@ -287,9 +287,19 @@ class BxTimelineConfig extends BxDolModuleConfig
     	return $this->_iPrivacyViewDefault;
     }
 
-    public function getTimelineVisibilityThreshold()
+    /**
+     * Ancillary functions
+     */
+    public function getItemViewUrl(&$aEvent)
+    {
+    	bx_import('BxDolPermalinks');
+		return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=timeline-item&id=' . $aEvent['id']);
+    }
+
+	public function isSystem($sType, $sAction)
     {
-    	return $this->_iTimelineVisibilityThreshold;
+    	$sPrefix = $this->getPrefix('common_post');
+    	return strpos($sType, $sPrefix) === false && !empty($sAction);
     }
 }
 

+ 25 - 18
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -184,6 +184,12 @@ class BxTimelineDb extends BxDolModuleDb
             	$sMethod = 'getRow';
                 $sWhereClause = $this->prepare("AND `{$this->_sTable}`.`id`=? ", $aParams['value']);
                 $sLimitClause = "LIMIT 1";
+                break;
+
+			case 'descriptor':
+            	$sMethod = 'getRow';
+                $sWhereClause = $this->prepare("AND `{$this->_sTable}`.`type`=? AND `{$this->_sTable}`.`action`=? AND `{$this->_sTable}`.`object_id`=? ", $aParams['type'], $aParams['action'], $aParams['object_id']);
+                $sLimitClause = "LIMIT 1";
                 break;
 
 			case 'last':
@@ -255,11 +261,12 @@ class BxTimelineDb extends BxDolModuleDb
         $sSql = "SELECT
                 `{$this->_sTable}`.`id` AS `id`,
                 `{$this->_sTable}`.`owner_id` AS `owner_id`,
-                `{$this->_sTable}`.`object_id` AS `object_id`,
                 `{$this->_sTable}`.`type` AS `type`,
                 `{$this->_sTable}`.`action` AS `action`,
+                `{$this->_sTable}`.`object_id` AS `object_id`,
                 `{$this->_sTable}`.`content` AS `content`,
                 `{$this->_sTable}`.`comments` AS `comments`,
+                `{$this->_sTable}`.`shares` AS `shares`,
                 `{$this->_sTable}`.`date` AS `date`,
                 YEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `year`,
                 DAYOFYEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `day_date`,
@@ -284,12 +291,25 @@ class BxTimelineDb extends BxDolModuleDb
 
 		$iNowYear = date('Y', time());
 		return (int)$aEvent['year'] < $iNowYear ? (int)$aEvent['year'] : 0;
-        /*
-		//TODO: Remove if old timeline slider is not used
-        return $aEvent['day_date'] == $aEvent['day_now'] ? (int)floor($aEvent['ago_days']) : (int)ceil($aEvent['ago_days']);
-        */
     }
 
+    public function updateSharesCounter($sType, $sActions, $iObjectId, $iIncrement = 1)
+    {
+    	if($this->_oConfig->isSystem($sType, $sActions))
+			$aParams = array('browse' => 'descriptor', 'type' => $sType, 'action' => $sActions, 'object_id' => $iObjectId);
+		else 
+			$aParams = array('browse' => 'id', 'value' => $iObjectId);
+
+		$aEvent = $this->getEvents($aParams);
+		if(!empty($aEvent) && is_array($aEvent) && ($iIncrement > 0 || (int)$aEvent['shares'] > 0)) {
+			$this->updateEvent(array('shares' => (int)$aEvent['shares'] + $iIncrement), array('id' => $aEvent['id']));
+
+			return (int)$aEvent['id'];
+		}
+
+		return 0;
+    }
+    
 	public function savePhoto($iEventId, $iPhId, $sPhTitle, $sPhText)
 	{
 		$sQuery = $this->prepare("INSERT INTO `" . $this->_sPrefix . "photos2events` SET `event_id`=?, `photo_id`=?, `title`=?, `text`=?", $iEventId, $iPhId, $sPhTitle, $sPhText);
@@ -417,19 +437,6 @@ class BxTimelineDb extends BxDolModuleDb
         $sSql = "SELECT COUNT(`cmt_id`) FROM `" . $this->_sPrefix . "comments` WHERE `cmt_object_id`='" . $iId . "' AND `cmt_parent_id`='0' LIMIT 1";
         return (int)$this->getOne($sSql);
     }
-
-    //--- Shared Media Functions ---//
-    function getSharedCategory($sType, $iId)
-    {
-        $aType2Db = array(
-            'sharedPhoto' => array('table' =>'bx_shared_photo_files', 'id' => 'medID'),
-            'sharedMusic' => array('table' => 'RayMp3Files', 'id' => 'ID'),
-            'sharedVideo' => array('table' => 'RayVideoFiles', 'id' => 'ID')
-        );
-
-        $sSql = "SELECT `Categories` FROM `" . $aType2Db[$sType]['table'] . "` WHERE `" . $aType2Db[$sType]['id'] . "`='" . $iId . "' LIMIT 1";
-        return $this->getOne($sSql);
-    }
 }
 
 /** @} */ 

+ 30 - 2
modules/boonex/timeline/classes/BxTimelineMenuItem.php

@@ -34,12 +34,40 @@ class BxTimelineMenuItem extends BxTemplMenu {
     		return;
 
     	$this->_aEvent = $aEvent;
-    	
+
     	$sCommentsSystem = '';
-    	if(isset($aEvent['comments']) && is_array($aEvent['comments']) && isset($aEvent['comments']['system']))
+    	$iCommentsCount = 0;
+    	if(isset($aEvent['comments']) && is_array($aEvent['comments']) && isset($aEvent['comments']['system'])) {
     		$sCommentsSystem = $aEvent['comments']['system'];
+    		$iCommentsCount = (int)$aEvent['comments']['count'];
+    	}
+
+		$sCommonPrefix = $this->_oModule->_oConfig->getPrefix('common_post');
+
+		$iOwnerId = $this->_oModule->getUserId(); //--- in whose timeline the content will be shared
+		$sType = $aEvent['type'];
+		$sAction = $aEvent['action'];
+
+		if($this->_oModule->_oConfig->isSystem($sType, $sAction))
+			$iObjectId = $aEvent['object_id'];
+		else {
+			$iObjectId = $aEvent['id'];
+
+			if(str_replace($sCommonPrefix, '', $sType) == BX_TIMELINE_PARSE_TYPE_SHARE) {
+				$sType = $aEvent['content']['type'];
+				$sAction = $aEvent['content']['action'];
+				$iObjectId = $aEvent['content']['object_id'];
+			}
+		}
 
     	$this->addMarkers(array(
+    		//--- For Share Button
+    		'share_onclick' => $this->_oModule->serviceGetShareOnclick($iOwnerId, $sType, $sAction, $iObjectId),
+			//--- For Share Button
+
+			'counter_shares' => (int)$aEvent['shares'] > 0 ? ' (' . $aEvent['shares'] . ')' : '', 
+    		'counter_comments' => $iCommentsCount > 0 ? ' (' . $iCommentsCount . ')' : '',
+
 			'content_id' => $aEvent['id'],
 			'comments_system' => $sCommentsSystem
 		));    	

+ 103 - 49
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -25,11 +25,10 @@ define('BX_TIMELINE_FILTER_ALL', 'all');
 define('BX_TIMELINE_FILTER_OWNER', 'owner');
 define('BX_TIMELINE_FILTER_OTHER', 'other');
 
-define('BX_TIMELINE_DIVIDER_ID', ',');
-
 define('BX_TIMELINE_PARSE_TYPE_TEXT', 'text');
 define('BX_TIMELINE_PARSE_TYPE_LINK', 'link');
 define('BX_TIMELINE_PARSE_TYPE_PHOTO', 'photo');
+define('BX_TIMELINE_PARSE_TYPE_SHARE', 'share');
 define('BX_TIMELINE_PARSE_TYPE_DEFAULT', BX_TIMELINE_PARSE_TYPE_TEXT);
 
 
@@ -88,30 +87,47 @@ class BxTimelineModule extends BxDolModule
             return;
         }
 
-        $iPostId = bx_process_input(bx_get('post_id'), BX_DATA_INT);
-        if(!$this->_oDb->deleteEvent(array('id' => $iPostId))) {
+        $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iId));
+
+        if(!$this->_oDb->deleteEvent(array('id' => $iId))) {
         	$this->_echoResultJson(array('code' => 2));
             return;
         }
 
-        $aPhotos = $this->_oDb->getPhotos($iPostId);
-		if(is_array($aPhotos) && !empty($aPhotos)) {
-			bx_import('BxDolStorage');
-			$oStorage = BxDolStorage::getObjectInstance($this->_oConfig->getObject('storage'));
+        $this->onDelete($aEvent);
 
-			foreach($aPhotos as $aPhoto)
-				$oStorage->deleteFile($aPhoto['id']);
+        $this->_echoResultJson(array('code' => 0, 'id' => $iId));
+    }
 
-			$this->_oDb->deletePhotos($iPostId);
-		}
+	public function actionShare()
+    {
+    	$iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
+    	$aContent = array(
+    		'type' => bx_process_input(bx_get('type'), BX_DATA_TEXT),
+    		'action' => bx_process_input(bx_get('action'), BX_DATA_TEXT),
+    		'object_id' => bx_process_input(bx_get('object_id'), BX_DATA_INT),	
+    	);
+
+		$iId = $this->_oDb->insertEvent(array(
+            'owner_id' => $iOwnerId,
+            'type' => $this->_oConfig->getPrefix('common_post') . 'share',
+            'action' => '',
+        	'object_id' => $this->getUserId(),
+        	'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault(),
+            'content' => serialize($aContent),
+			'title' => '',
+			'description' => ''
+        ));
 
-		//--- Event -> Delete for Alerts Engine ---//
-        bx_import('BxDolAlerts');
-        $oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'delete', $iPostId, $this->getUserId());
-        $oAlert->alert();
-        //--- Event -> Delete for Alerts Engine ---//
+        if(!empty($iId)) {
+        	$this->onShare($iId);
 
-        $this->_echoResultJson(array('code' => 0, 'id' => $iPostId));
+        	$this->_echoResultJson(array('msg' => _t('_bx_timeline_txt_msg_success_share')));
+        	return;
+        }
+
+		$this->_echoResultJson(array('msg' => _t('_bx_timeline_txt_err_cannot_share')));
     }
 
     function actionGetPost()
@@ -119,10 +135,10 @@ class BxTimelineModule extends BxDolModule
         $this->_oConfig->setJsMode(true);
         $this->_iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
 
-        $iEvent = bx_process_input(bx_get('post_id'), BX_DATA_INT);
+        $iEvent = bx_process_input(bx_get('id'), BX_DATA_INT);
         $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iEvent));
 
-        $this->_echoResultJson(array('item' => $this->_oTemplate->getCommon($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId))));
+        $this->_echoResultJson(array('item' => $this->_oTemplate->getPost($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId))));
     }
 
 	function actionGetPosts()
@@ -149,14 +165,6 @@ class BxTimelineModule extends BxDolModule
     	$this->_echoResultJson($aResult);
     }
 
-	public function actionGetTimeline()
-    {
-        $aParams = $this->_prepareParamsGet();
-        $sTimeline = $this->_oTemplate->getTimeline($aParams);
-
-        $this->_echoResultJson(array('timeline' => $sTimeline));
-    }
-
     public function actionGetComments()
     {
     	$this->_iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
@@ -296,6 +304,15 @@ class BxTimelineModule extends BxDolModule
     	return array('content' => $this->_oTemplate->getViewItemBlock($iItemId));
     }
 
+	public function serviceGetShareOnclick($iOwnerId, $sType, $sAction, $iObjectId)
+    {
+    	$sJsObject = $this->_oConfig->getJsObject('view');
+    	$sFormat = "%s.shareItem(this, %d, '%s', '%s', %d);";
+
+    	$iOwnerId = !empty($iOwnerId) ? (int)$iOwnerId : $this->getUserId(); //--- in whose timeline the content will be shared
+    	return sprintf($sFormat, $sJsObject, $iOwnerId, $sType, $sAction, (int)$iObjectId);
+    }
+
     /*
      * COMMON METHODS 
      */
@@ -319,17 +336,16 @@ class BxTimelineModule extends BxDolModule
         	$sContent = serialize(array('text' => $sContent));
         	BxDolForm::setSubmittedValue('content', $sContent, $oForm->aFormAttrs['method']);
 
-        	bx_import('BxDolPrivacy');
         	$iId = $oForm->insert(array(
         		'object_id' => $iUserId,
-        		'object_privacy_view' => BX_DOL_PG_ALL,
+        		'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault(),
 				'title' => bx_process_input($sUserName . ' ' . _t('_bx_timeline_txt_wrote')),
 				'description' => $sDescription,
         		'date' => time()
 			));
 
-			if($iId != 0) {
-				$this->onPost($iId, $iUserId);
+			if(!empty($iId)) {
+				$this->onPost($iId);
 
                 return array('id' => $iId);
 			}
@@ -372,17 +388,16 @@ class BxTimelineModule extends BxDolModule
 			));
 	        BxDolForm::setSubmittedValue('content', $sContent, $oForm->aFormAttrs['method']);
 
-        	bx_import('BxDolPrivacy');
         	$iId = $oForm->insert(array(
         		'object_id' => $iUserId,
-        		'object_privacy_view' => BX_DOL_PG_ALL,
+        		'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault(),
 				'title' => bx_process_input($sUserName . ' ' . _t('_bx_timeline_txt_shared_link')),
 				'description' => bx_process_input($sUrl . ' - ' . $sTitle),
         		'date' => time()
 			));
 
-			if($iId != 0) {
-				$this->onPost($iId, $iUserId);
+			if(!empty($iId)) {
+				$this->onPost($iId);
 
                 return array('id' => $iId);
 			}
@@ -456,16 +471,15 @@ class BxTimelineModule extends BxDolModule
         	$aPhIds = $oForm->getCleanValue('content');
         	BxDolForm::setSubmittedValue('content', serialize(array()), $oForm->aFormAttrs['method']);
 
-        	bx_import('BxDolPrivacy');
         	$iId = $oForm->insert(array(
         		'object_id' => $iUserId,
-        		'object_privacy_view' => BX_DOL_PG_ALL,
+        		'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault(),
 				'title' => bx_process_input($sUserName . ' ' . _t('_bx_timeline_txt_added_photo')),
 				'description' => '',
         		'date' => time()
 			));
 
-			if($iId != 0) {
+			if(!empty($iId)) {
 				$iPhIds = count($aPhIds);
 				if($iPhIds > 0) {
 					$aPhTitles = $oForm->getCleanValue('file_title');
@@ -479,7 +493,7 @@ class BxTimelineModule extends BxDolModule
 							$oStorage->afterUploadCleanup($aPhIds[$i], $iUserId);
 				}
 
-				$this->onPost($iId, $iUserId);
+				$this->onPost($iId);
 
                 return array('id' => $iId);
 			}
@@ -553,7 +567,7 @@ class BxTimelineModule extends BxDolModule
 
 	public function isAllowedComment($aEvent, $bPerform = false)
     {
-    	$mixedComments = $this->getCommentsData($aEvent);
+    	$mixedComments = $this->getCommentsData($aEvent['comments']);
     	if($mixedComments === false)
     		return false;
 
@@ -567,30 +581,70 @@ class BxTimelineModule extends BxDolModule
         return $oCmts->isPostReplyAllowed($bPerform);
     }
 
-	public function onPost($iId, $iUserId)
+	public function onPost($iId)
     {
+    	$aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iId));
+    	
+    	if($this->_oConfig->isSystem($aEvent['type'], $aEvent['action'])) {
+    		$sPostType = 'system';
+    		$iSenderId = $aEvent['owner_id'];
+    	}
+    	else {
+    		$sPostType = 'common';
+    		$iSenderId = $aEvent['object_id'];
+    	}
+
     	//--- Event -> Post for Alerts Engine ---//
 		bx_import('BxDolAlerts');
-        $oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'post', $iId, $iUserId);
+        $oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'post_' . $sPostType, $iId, $iSenderId);
         $oAlert->alert();
         //--- Event -> Post for Alerts Engine ---//
     }
 
-    public function onUpdate($iOwnerId)
+	public function onShare($iId)
     {
+    	$aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iId));
+
+		$aContent = unserialize($aEvent['content']);
+    	$iSharedId = $this->_oDb->updateSharesCounter($aContent['type'], $aContent['action'], $aContent['object_id']);
+
 		//--- Timeline -> Update for Alerts Engine ---//
 		bx_import('BxDolAlerts');
-		$oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'update', $iOwnerId);
+		$oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'share', $iSharedId, $aEvent['object_id']);
 		$oAlert->alert();
 		//--- Timeline -> Update for Alerts Engine ---//
     }
 
-    public function getCommentsData(&$aEvent)
+    public function onDelete($aEvent)
     {
-    	if(empty($aEvent['comments']) || !is_array($aEvent['comments']))
-    		return false; 
+		$aPhotos = $this->_oDb->getPhotos($aEvent['id']);
+		if(is_array($aPhotos) && !empty($aPhotos)) {
+			bx_import('BxDolStorage');
+			$oStorage = BxDolStorage::getObjectInstance($this->_oConfig->getObject('storage'));
+
+			foreach($aPhotos as $aPhoto)
+				$oStorage->deleteFile($aPhoto['id']);
 
-    	$aComments = $aEvent['comments'];
+			$this->_oDb->deletePhotos($aEvent['id']);
+		}
+
+		if($aEvent['type'] == $this->_oConfig->getPrefix('common_post') . BX_TIMELINE_PARSE_TYPE_SHARE) {
+			$aContent = unserialize($aEvent['content']);
+			$this->_oDb->updateSharesCounter($aContent['type'], $aContent['action'], $aContent['object_id'], -1);
+		}
+		
+		
+		//--- Event -> Delete for Alerts Engine ---//
+        bx_import('BxDolAlerts');
+        $oAlert = new BxDolAlerts($this->_oConfig->getSystemName('alert'), 'delete', $aEvent['id'], $this->getUserId());
+        $oAlert->alert();
+        //--- Event -> Delete for Alerts Engine ---//
+    }
+
+    public function getCommentsData(&$aComments)
+    {
+    	if(empty($aComments) || !is_array($aComments))
+    		return false; 
 
 		$sSystem = isset($aComments['system']) ? $aComments['system'] : '';
 	    $iObjectId = isset($aComments['object_id']) ? (int)$aComments['object_id'] : 0;

+ 3 - 3
modules/boonex/timeline/classes/BxTimelineResponse.php

@@ -62,7 +62,7 @@ class BxTimelineResponse extends BxDolAlertsResponse
 		        ));
 
 		        if(!empty($iId))
-		        	$this->_oModule->onUpdate($oAlert->iSender);
+		        	$this->_oModule->onPost($iId);
 
 		        $this->_oModule->_oDb->updateSimilarObject($iId, $oAlert);		
 		        break;
@@ -88,7 +88,7 @@ class BxTimelineResponse extends BxDolAlertsResponse
 
 		$iId = $this->_oModule->_oDb->insertEvent(array(
             'owner_id' => $this->_oModule->_iOwnerId,
-            'type' => $this->_oModule->_oConfig->getCommonPostPrefix() . $sMedia,
+            'type' => $this->_oModule->_oConfig->getPrefix('common_post') . $sMedia,
             'action' => '',
 			'object_id' => $this->_oModule->_getUserId(),
 			'object_privacy_view' => $this->_getPrivacyView($oAlert->aExtras),
@@ -101,7 +101,7 @@ class BxTimelineResponse extends BxDolAlertsResponse
         ));
 
         if(!empty($iId))
-			$this->_oModule->onUpdate($this->_oModule->_iOwnerId);
+			$this->_oModule->onPost($iId);
 
 		echo $this->_oModule->_oTemplate->_wrapInTagJsCode("parent." . $this->_oModule->_sJsPostObject . "._getPost(null, " . $iId . ");");
     }

+ 175 - 127
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -82,10 +82,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	$this->getCssJs();
     	return $this->parseHtmlByName('view.html', array(
     		'style_prefix' => $this->_oConfig->getPrefix('style'),
-    		/*
-		    //TODO: Remove if old timeline slider is not used
-            'timeline' => $this->getTimeline($aParams),
-            */
     		'back' => $sBack,
             'content' => $sContent,
     		'load_more' =>  $sLoadMore,
@@ -126,9 +122,27 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	));
     }
 
-    public function getPost(&$aEvent, $aParams = array())
+    public function getPost(&$aEvent, $aBrowseParams = array())
     {
-    	return !empty($aEvent['action']) ? $this->getSystem($aEvent, $aParams) : $this->getCommon($aEvent, $aParams);
+        $aResult = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $this->_getSystemData($aEvent) : $this->_getCommonData($aEvent);
+		if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
+			return '';
+
+		if((empty($aEvent['title']) && !empty($aResult['title'])) || (empty($aEvent['description']) && !empty($aResult['description'])))
+        	$this->_oDb->updateEvent(array(
+            	'title' => bx_process_input($aResult['title'], BX_TAGS_STRIP),
+                'description' => bx_process_input($aResult['description'], BX_TAGS_STRIP)
+			), array('id' => $aEvent['id']));
+
+		if(is_string($aResult['content']))
+			return $aResult['content'];
+
+		$aEvent['object_owner_id'] = $aResult['owner_id'];
+		$aEvent['content'] = $aResult['content'];
+		$aEvent['comments'] = $aResult['comments'];
+
+		$sType = !empty($aResult['content_type']) ? $aResult['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
+        return $this->_getPost($sType, $aEvent, $aBrowseParams);
     }
 
 	public function getPosts($aParams)
@@ -190,25 +204,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         ));
     }
 
-	public function getTimeline($aParams)
-    {
-    	$iTimeline = $aParams['timeline'];
-
-        $iMaxDuration = $this->_oDb->getMaxDuration($aParams);
-        if($iMaxDuration <= $this->_oConfig->getTimelineVisibilityThreshold())
-			return '';
-
-        if(empty($iTimeline))
-            $iTimeline = $iMaxDuration;
-
-        return $this->parseHtmlByName('timeline.html', array(
-        	'style_prefix' => $this->_oConfig->getPrefix('style'),
-        	'js_object' => $this->_oConfig->getJsObject('view'),
-			'min' => 0,
-			'max' => $iMaxDuration,
-        	'value' => $iTimeline
-        ));
-    }
 	public function getBack($iYearSel)
 	{
 		if($iYearSel == 0)
@@ -291,86 +286,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         ));
     }
 
-	function getSystem(&$aEvent, $aBrowseParams = array())
-    {
-        $aResult = $this->_getSystemData($aEvent);
-		if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
-			return '';
-
-		if((empty($aEvent['title']) && !empty($aResult['title'])) || (empty($aEvent['description']) && !empty($aResult['description'])))
-        	$this->_oDb->updateEvent(array(
-            	'title' => bx_process_input($aResult['title'], BX_TAGS_STRIP),
-                'description' => bx_process_input($aResult['description'], BX_TAGS_STRIP)
-			), array('id' => $aEvent['id']));
-
-		if(is_string($aResult['content']))
-			return $aResult['content'];
-
-		$aEvent['object_owner_id'] = $aResult['owner_id'];
-		$aEvent['content'] = $aResult['content'];
-		$aEvent['comments'] = $aResult['comments'];
-
-		$sType = !empty($aResult['content_type']) ? $aResult['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
-        return $this->_getPost($sType, $aEvent, $aBrowseParams);
-    }
-
-    public function getCommon(&$aEvent, $aBrowseParams = array())
-    {
-    	$sPrefix = $this->_oConfig->getPrefix('common_post');
-        if(strpos($aEvent['type'], $sPrefix) !== 0)
-            return '';
-
-		$oModule = $this->getModule();
-
-		$sType = str_replace($sPrefix, '', $aEvent['type']);
-		$aEvent['object_owner_id'] = $aEvent['object_id'];
-
-		switch($sType) {
-			case BX_TIMELINE_PARSE_TYPE_TEXT:
-			case BX_TIMELINE_PARSE_TYPE_LINK:
-				if(!empty($aEvent['content']))
-					$aEvent['content'] = unserialize($aEvent['content']);
-				break;
-
-			case BX_TIMELINE_PARSE_TYPE_PHOTO:
-				$aPhotos = $this->_oDb->getPhotos($aEvent['id']);
-				if(!is_array($aPhotos) || empty($aPhotos))
-					break;
-
-	        	$aEvent['content'] = array(
-	        		'title' => '', 
-	        		'text' => ''
-	        	);
-
-	        	$aFirst = current($aPhotos);
-	        	if($aFirst !== false) {
-	        		$aEvent['content']['title'] = isset($aFirst['title']) ? $aFirst['title'] : '';
-	        		$aEvent['content']['text'] = isset($aFirst['text']) ? $aFirst['text'] : '';
-	        	}
-
-				bx_import('BxDolImageTranscoder');
-	        	$oTranscoder = BxDolImageTranscoder::getObjectInstance($this->_oConfig->getObject('transcoder_preview'));
-
-				foreach($aPhotos as $aPhoto)
-					$aEvent['content']['images'][] = array(
-						'src' => $oTranscoder->getImageUrl($aPhoto['id']),
-						'title' => isset($aPhoto['title']) ? $aPhoto['title'] : '' 
-					); 
-
-				break;
-		}
-
-		$sSystem = $this->_oConfig->getSystemName('comment');
-        if($oModule->getCmtsObject($sSystem, $aEvent['id']) !== false)
-        	$aEvent['comments'] = array(
-        		'system' => $sSystem,
-        		'object_id' => $aEvent['id'],
-				'count' => $aEvent['comments']
-			);
-
-		return $this->_getPost($sType, $aEvent, $aBrowseParams);
-    }
-
 	protected function _getPost($sType, $aEvent, $aBrowseParams = array())
     {
 		$oModule = $this->getModule();
@@ -387,9 +302,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         if(isset($aBrowseParams['type']) && $aBrowseParams['type'] == BX_TIMELINE_TYPE_CONNECTIONS)
         	$aTmplVarsTimelineOwner = $this->_getTmplVarsTimelineOwner($aEvent);
 
-		bx_import('BxDolPermalinks');
-		$sViewUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=timeline-item&id=' . $aEvent['id']);
-
         $aTmplVars = array (
         	'style_prefix' => $sStylePrefix,
         	'js_object' => $sJsObject,
@@ -414,29 +326,51 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         		'condition' => !empty($aTmplVarsTimelineOwner),
         		'content' => $aTmplVarsTimelineOwner
         	),
-        	'item_view_url' => $sViewUrl,
+        	'item_view_url' => $this->_oConfig->getItemViewUrl($aEvent),
         	'item_date' => bx_time_js($aEvent['date']),
+/*
+			//Comments and Shares counters
+
+        	'bx_if:show_counter_comments' => array(
+        		'condition' => (int)$aEvent['comments']['count'] > 0,
+        		'content' => array(
+        			'style_prefix' => $sStylePrefix,
+        			'counter' => $aEvent['comments']['count']
+        		)
+        	),
+        	'bx_if:show_counter_shares' => array(
+        		'condition' => (int)$aEvent['shares'] > 0,
+        		'content' => array(
+        			'style_prefix' => $sStylePrefix,
+        			'counter' => $aEvent['shares']
+        		)
+        	),
+*/
+        	'content' => $this->_getContent($sType, $aEvent['content'], $aBrowseParams),
 			'bx_if:show_menu_item_actions' => array(
 				'condition' => !empty($aTmplVarsMenuItemActions),
         		'content' => $aTmplVarsMenuItemActions
 			),
-			'comments' => $this->_getComments($aEvent, $aBrowseParams)
+			'comments' => isset($aBrowseParams['type']) && $aBrowseParams['type'] == 'view_item' ? $this->_getComments($aEvent['comments']) : ''
         );
 
-        $sMethod = '_getTmplVarsContent' . ucfirst($sType);
-        if(method_exists($this, $sMethod)) {
-        	$aTmplVarsContent = $this->$sMethod($aEvent['content']);
-        	if(is_array($aTmplVarsContent))
-        		$aTmplVars = array_merge($aTmplVars, $aTmplVarsContent);
-        }
+        return $this->parseHtmlByName('item.html', $aTmplVars);
+    }
 
-        return $this->parseHtmlByName($sType . '.html', $aTmplVars);
+    protected function _getContent($sType, $aContent)
+    {
+    	$sMethod = '_getTmplVarsContent' . ucfirst($sType);
+        if(!method_exists($this, $sMethod)) 
+        	return '';
+
+       	$aTmplVars = $this->$sMethod($aContent);
+       	return $this->parseHtmlByName($sType . '.html', $aTmplVars);
     }
 
-	protected function _getComments($aEvent, $aBrowseParams)
+	protected function _getComments($aComments)
     {
-    	$mixedComments = $this->getModule()->getCommentsData($aEvent);
-    	if($mixedComments === false || !isset($aBrowseParams['type']) || $aBrowseParams['type'] != 'view_item')
+    	$mixedComments = $this->getModule()->getCommentsData($aComments);
+    	if($mixedComments === false) 
     		return '';
 
     	list($sSystem, $iObjectId, $iCount) = $mixedComments;
@@ -529,6 +463,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 		$sTextMore = $this->_prepareTextForOutput($sTextMore);
 
 		return array(
+			'style_prefix' => $sStylePrefix,
 			'bx_if:show_images' => array(
 				'condition' => false,
             	'content' => array()
@@ -604,13 +539,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 				'image' => $sImage
 			);
 		}
-			/*
-				$aTmplVarsImages[] = array(
-					'style_prefix' => $sStylePrefix,
-					'src' => $aImage['src'],
-					'title' => isset($aImage['title']) && !empty($aImage['title']) ? $aImage['title'] : $sTitleDefault
-				);
-			*/
 
     	return array_merge($aTmplVarsContent, array(
     		'bx_if:show_images' => array(
@@ -622,6 +550,47 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	));
     }
 
+	protected function _getTmplVarsContentShare($aContent)
+    {
+    	$sStylePrefix = $this->_oConfig->getPrefix('style');
+    	$sCommonPrefix = $this->_oConfig->getPrefix('common_post');
+		$sJsObject = $this->_oConfig->getJsObject('view');
+
+		$sOwnerLink = $this->parseHtmlByName('bx_a.html', array(
+			'href' => $aContent['owner_url'],
+			'title' => '',
+			'bx_repeat:attrs' => array(),
+			'content' => $aContent['owner_name']
+		));
+
+		$sSampleLink = empty($aContent['url']) ? $aContent['sample'] : $this->parseHtmlByName('bx_a.html', array(
+			'href' => $aContent['url'],
+			'title' => '',
+			'bx_repeat:attrs' => array(),
+			'content' => $aContent['sample']
+		));
+
+		$sTitle = _t('_bx_timeline_txt_shared', $sOwnerLink, $sSampleLink);
+		$sText = $this->_getContent($aContent['parse_type'], $aContent);
+
+		return array(
+        	'bx_if:show_title' => array(
+		    	'condition' => !empty($sTitle),
+            	'content' => array(
+					'style_prefix' => $sStylePrefix,
+					'title' => $sTitle,
+				)
+			),
+			'bx_if:show_content' => array(
+				'condition' => !empty($sText),
+		        'content' => array(
+		        	'style_prefix' => $sStylePrefix,
+		        	'content' => $sText,
+		        )
+			)
+		);
+    }
+
     protected function _getSystemData(&$aEvent)
     {
     	$sHandler = $aEvent['type'] . '_' . $aEvent['action'];
@@ -646,6 +615,85 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         return $mixedResult;
     }
 
+    protected function _getCommonData(&$aEvent)
+    {
+    	$oModule = $this->getModule();
+    	$sPrefix = $this->_oConfig->getPrefix('common_post');
+		$sType = str_replace($sPrefix, '', $aEvent['type']);
+
+    	$aResult = array(
+    		'owner_id' => $aEvent['object_id'],
+    		'content_type' => $sType,
+    		'content' => array(
+    			'sample' => _t('_bx_timeline_txt_common_' . $sType),
+    			'url' => $this->_oConfig->getItemViewUrl($aEvent)
+    		), //a string to display or array to parse default template before displaying.
+    		'comments' => '',
+    		'title' => '', //may be empty.
+    		'description' => '' //may be empty. 
+    	);
+
+		switch($sType) {
+			case BX_TIMELINE_PARSE_TYPE_TEXT:
+			case BX_TIMELINE_PARSE_TYPE_LINK:
+				if(empty($aEvent['content']))
+					break;
+
+				$aResult['content'] = array_merge($aResult['content'], unserialize($aEvent['content']));
+				break;
+
+			case BX_TIMELINE_PARSE_TYPE_PHOTO:
+				$aPhotos = $this->_oDb->getPhotos($aEvent['id']);
+				if(!is_array($aPhotos) || empty($aPhotos))
+					break;
+
+	        	$aFirst = current($aPhotos);
+	        	if($aFirst !== false) {
+	        		$aResult['content']['title'] = isset($aFirst['title']) ? $aFirst['title'] : '';
+	        		$aResult['content']['text'] = isset($aFirst['text']) ? $aFirst['text'] : '';
+	        	}
+
+				bx_import('BxDolImageTranscoder');
+	        	$oTranscoder = BxDolImageTranscoder::getObjectInstance($this->_oConfig->getObject('transcoder_preview'));
+
+				foreach($aPhotos as $aPhoto)
+					$aResult['content']['images'][] = array(
+						'src' => $oTranscoder->getImageUrl($aPhoto['id']),
+						'title' => isset($aPhoto['title']) ? $aPhoto['title'] : '' 
+					); 
+				break;
+
+			case BX_TIMELINE_PARSE_TYPE_SHARE:
+				if(empty($aEvent['content']))
+					break;
+
+				$aContent = unserialize($aEvent['content']);
+
+				if(!$this->_oConfig->isSystem($aContent['type'] , $aContent['action'])) {
+					$aShared = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $aContent['object_id']));
+					$aShared = $this->_getCommonData($aShared);
+				}
+				else
+					$aShared = $this->_getSystemData($aContent); 
+
+				$aResult['content'] = array_merge($aContent, $aShared['content']);
+				$aResult['content']['parse_type'] = $aShared['content_type'];
+				$aResult['content']['owner_id'] = $aShared['owner_id'];
+				list($aResult['content']['owner_name'], $aResult['content']['owner_url']) = $oModule->getUserInfo($aShared['owner_id']);
+				break;
+		}
+
+		$sSystem = $this->_oConfig->getSystemName('comment');
+        if($oModule->getCmtsObject($sSystem, $aEvent['id']) !== false)
+        	$aResult['comments'] = array(
+        		'system' => $sSystem,
+        		'object_id' => $aEvent['id'],
+				'count' => $aEvent['comments']
+			);
+
+		return $aResult;
+    }
+
 	protected function _prepareTextForOutput($s)
     {
 		$s = bx_process_output($s, BX_DATA_TEXT);

+ 9 - 2
modules/boonex/timeline/install/langs/en.xml

@@ -96,11 +96,11 @@
 	<string name="_bx_timeline_menu_title_item_actions"><![CDATA[Item Actions]]></string>
     <string name="_bx_timeline_menu_set_title_item_actions"><![CDATA[Item Actions]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_comment"><![CDATA[Comment]]></string>
-    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[Comment]]></string>
+    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[Comment{counter_comments}]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_vote"><![CDATA[Vote]]></string>
     <string name="_bx_timeline_menu_item_title_item_vote"><![CDATA[Vote]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_share"><![CDATA[Share]]></string>
-    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[Share]]></string>
+    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[Share{counter_shares}]]></string>
 
     <string name="_bx_timeline_menu_item_title_system_timeline"><![CDATA[Timeline]]></string>
     <string name="_bx_timeline_menu_item_title_timeline"><![CDATA[Timeline]]></string>
@@ -119,6 +119,13 @@
 	<string name="_bx_timeline_txt_wrote"><![CDATA[wrote]]></string>
 	<string name="_bx_timeline_txt_shared_link"><![CDATA[shared a link]]></string>
 	<string name="_bx_timeline_txt_added_photo"><![CDATA[added a photo]]></string>
+	<string name="_bx_timeline_txt_common_text"><![CDATA[text]]></string>
+	<string name="_bx_timeline_txt_common_link"><![CDATA[link]]></string>
+	<string name="_bx_timeline_txt_common_photo"><![CDATA[photo]]></string>
+	
+	<string name="_bx_timeline_txt_shared"><![CDATA[Shared {0}'s {1}.]]></string>
+	<string name="_bx_timeline_txt_err_cannot_share"><![CDATA[Cannot share. Please report.]]></string>
+	<string name="_bx_timeline_txt_msg_success_share"><![CDATA[Shared successfully.]]></string>
 
 	<string name="_bx_timeline_txt_plus"><![CDATA[Plus]]></string>
 	

+ 1 - 1
modules/boonex/timeline/install/sql/enable.sql

@@ -54,7 +54,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{js_object_view}.commentItem(this, ''{comments_system}'', {content_id})', '_self', 'comment', '', 2147483647, 1, 0, 0),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '_bx_timeline_menu_item_title_item_vote', 'javascript:void(0)', 'javascript:{js_object_view}.voteItem(this, {content_id})', '_self', 'plus', '', 2147483647, 1, 0, 0),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{js_object_view}.shareItem(this, {content_id})', '_self', 'fa-share-square-o', '', 2147483647, 1, 0, 0);
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{share_onclick}', '_self', 'share-square-o', '', 2147483647, 1, 0, 0);
 
 -- MENU: Account Settings
 SET @iMIOrder = (SELECT MAX(`order`) FROM `sys_menu_items` WHERE `set_name`='sys_account_settings' LIMIT 1);

+ 1 - 0
modules/boonex/timeline/install/sql/install.sql

@@ -12,6 +12,7 @@ CREATE TABLE IF NOT EXISTS `bx_timeline_events` (
   `title` varchar(255) collate utf8_unicode_ci NOT NULL,
   `description` text collate utf8_unicode_ci NOT NULL,
   `comments` int(11) unsigned NOT NULL default '0',
+  `shares` int(11) unsigned NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `owner_id` (`owner_id`)

+ 2 - 2
modules/boonex/timeline/js/main.js

@@ -5,8 +5,8 @@ function BxTimelineMain() {
 	this.sIdItem = '#bx-timeline-item-';
 
 	this.sClassMasonry = 'bx-tl-masonry';
-	this.sClassActions = 'bx-tl-actions';
-	this.sClassComments = 'bx-tl-comments';
+	this.sClassActions = 'bx-tl-item-actions';
+	this.sClassComments = 'bx-tl-item-comments';
 }
 
 BxTimelineMain.prototype.isMasonry = function() {

+ 1 - 1
modules/boonex/timeline/js/post.js

@@ -110,7 +110,7 @@ BxTimelinePost.prototype._getForm = function(oElement, sType) {
 BxTimelinePost.prototype._getPost = function(oElement, iPostId) {
     var $this = this;
     var oData = this._getDefaultData();
-    oData['post_id'] = iPostId;
+    oData['id'] = iPostId;
 
     var oView = $(this.sIdView);
     this.loadingInBlock(oView, true);

+ 27 - 51
modules/boonex/timeline/js/view.js

@@ -20,26 +20,6 @@ function BxTimelineView(oOptions) {
 
 BxTimelineView.prototype = new BxTimelineMain();
 
-BxTimelineView.prototype.initSlider = function(oOptions) {
-	var $this = this;
-	var oSlider = $(this.sIdView + ' .bx-tl-timeline-slider');
-	if(oSlider.length > 0) {
-		oSlider.slider({
-			min: oOptions.min,
-			max: oOptions.max,
-			value: oOptions.value,
-			slide: function(e, ui) {
-			    $(ui.handle).html(ui.value);
-			},
-			change: function(e, ui) {
-				$this.changeTimeline(e, ui);
-			}
-		});
-
-		$('.ui-slider-handle', oSlider).html(oSlider.slider('value'));
-	}
-};
-
 BxTimelineView.prototype.changePage = function(oElement, iStart, iPerPage) {
 	this._oRequestParams.start = iStart;
     this._oRequestParams.per_page = iPerPage;
@@ -53,20 +33,9 @@ BxTimelineView.prototype.changeFilter = function(oLink) {
     this._oRequestParams.start = 0;
     this._oRequestParams.filter = sId.substr(sId.lastIndexOf('-') + 1, sId.length);
 
-    this._getTimeline(oLink);
     this._getPosts(oLink, 'filter');
 };
 
-/*
-//TODO: Remove if old timeline slider is not used
-BxTimelineView.prototype.changeTimeline = function(oEvent, oUi) {
-	this._oRequestParams.start = 0;
-    this._oRequestParams.timeline = oUi.value;
-
-	this._getPosts($(oUi.handle), 'timeline');
-};
-*/
-
 BxTimelineView.prototype.changeTimeline = function(oLink, iYear) {
 	this._oRequestParams.start = 0;
     this._oRequestParams.timeline = iYear;
@@ -78,7 +47,7 @@ BxTimelineView.prototype.deletePost = function(oLink, iId) {
     var $this = this;
     var oView = $(this.sIdView);
     var oData = this._getDefaultData();
-    oData['post_id'] = iId;
+    oData['id'] = iId;
 
     this.loadingInBlock(oLink, true);
 
@@ -190,6 +159,32 @@ BxTimelineView.prototype.voteItem = function(oLink) {
 	alert('Votes will be here.');
 };
 
+BxTimelineView.prototype.shareItem = function(oLink, iOwnerId, sType, sAction, iId) {
+	var $this = this;
+	var oDate = new Date();
+	var oParams = {
+		owner_id: iOwnerId,
+		type: sType,
+		action: sAction,
+		object_id: iId,
+		_t: oDate.getTime()	
+	};
+
+	this.loadingInItem(oLink, true);
+
+	jQuery.post(
+        this._sActionsUrl + 'share/',
+        oParams,
+        function(oData) {
+        	$this.loadingInItem(oLink, false);
+
+        	if(oData && oData.msg != undefined)
+                alert(oData.msg);
+        },
+        'json'
+    );
+};
+
 BxTimelineView.prototype._getPosts = function(oElement, sAction) {
     var $this = this;
     var oView = $(this.sIdView);
@@ -246,22 +241,3 @@ BxTimelineView.prototype._getPosts = function(oElement, sAction) {
         'json'
     );
 };
-
-BxTimelineView.prototype._getTimeline = function(oElement) {
-    var $this = this;
-    var oView = $(this.sIdView);
-
-    this.loadingInBlock(oElement, true);
-
-    jQuery.post (
-        this._sActionsUrl + 'get_timeline/',
-        this._getDefaultData(),
-        function(oData) {                                    
-        	$this.loadingInBlock(oElement, false);
-
-        	if($.trim(oData.timeline).length > 0)
-        		oView.find('.bx-tl-timeline').replaceWith(oData.timeline);
-        },
-        'json'
-    );
-};

+ 1 - 1
modules/boonex/timeline/template/comments.html

@@ -1,3 +1,3 @@
-<div id="bx-timeline-comments-__id__" class="__style_prefix__-comments bx-def-margin-top">
+<div id="bx-timeline-comments-__id__" class="__style_prefix__-item-comments bx-def-margin-top">
 	<div class="__style_prefix__-comments-cnt">__content__</div>
 </div>

+ 39 - 11
modules/boonex/timeline/template/css/view.css

@@ -36,6 +36,7 @@ div.bx-tl-item-cnt {
 	position: relative;
 	background-color: #ffffff;
 }
+/*+++ Item Menu +++*/
 div.bx-tl-item-menu {
 	position: absolute;
 	top: 0px;
@@ -57,6 +58,22 @@ div.bx-tl-item-menu-button a:hover {
 	text-decoration: none;
 	color: rgba(0, 102, 153, 1.0);
 }
+
+/*+++ Item Owner +++*/
+div.bx-tl-item-owner {
+	position: relative;
+}
+div.bx-tl-owner-icon {
+	position: absolute;
+	top: 0px;
+	left: 0px;
+}
+div.bx-tl-owner-name,
+div.bx-tl-item-info {
+	margin-left: 42px;
+}
+
+/*+++ Item Image +++*/
 div.bx-tl-item-image {
 	margin-left: -20px;
 	margin-right: -20px;
@@ -68,21 +85,32 @@ div.bx-tl-item-image img {
 	max-width: 319px;
 	max-height: 319px;
 }
-div.bx-tl-owner {
-	position: relative;
+
+/*+++ Item Text +++*/
+div.bx-tl-item-text {}
+span.bx-tl-content-see-more a {
+	font-weight: bold;
 }
-div.bx-tl-owner-icon {
-	position: absolute;
-	top: 0px;
-	left: 0px;
+
+/*+++ Item Shared +++*/
+div.bx-tl-shared div.bx-tl-item-text {
+	padding-left: 5px;
+	border-left: 1px solid #999999;
 }
-div.bx-tl-owner-name,
-div.bx-tl-date {
-	margin-left: 42px;
+div.bx-tl-shared div.bx-tl-title {
+	font-size: 1.0em;
 }
-span.bx-tl-content-see-more a {
-	font-weight: bold;
+div.bx-tl-shared div.bx-tl-title a {
+	color: #999999;
 }
+div.bx-tl-shared div.bx-tl-content {
+	font-size: 0.875em;
+	color: #999999;
+}
+
+
+/*+++ Item Actions +++*/
+div.bx-tl-item-actions {}
 
 
 /*--- View Item Popup Style ---*/

+ 53 - 0
modules/boonex/timeline/template/item.html

@@ -0,0 +1,53 @@
+<div id="bx-timeline-item-__id__" class="__style_prefix__-item bx-tl-grid-sizer">
+	<div class="__style_prefix__-item-ind bx-def-padding-sec">
+	    <div class="__style_prefix__-item-cnt bx-def-padding bx-def-round-corners bx-def-shadow">
+	    	<div class="__style_prefix__-item-owner bx-def-margin-bottom bx-def-icon-size-min-height"> 
+		       	<div class="__style_prefix__-owner-icon bx-def-icon bx-def-icon-size">
+					<bx_if:show_icon>
+						<img src="__author_icon__" />
+					</bx_if:show_icon>
+					<bx_if:show_icon_empty>
+						<i class="sys-icon user"></i>
+					</bx_if:show_icon_empty>
+				</div>
+				<div class="__style_prefix__-owner-name">
+					<a href="__item_owner_url__" class="__style_prefix__-owner-name">__item_owner_name__</a>
+		            <bx_if:show_timeline_owner>
+			        	<i class="sys-icon caret-right"></i>
+			        	<a href="__owner_url__" class="__style_prefix__-timeline-owner-name">__owner_username__</a>
+			        </bx_if:show_timeline_owner>
+				</div>
+				<div class="__style_prefix__-item-info bx-def-font-small bx-def-font-grayed">
+					<a class="__style_prefix__-date" href="__item_view_url__" onclick="javascript:return __js_object__.showItem(this, __id__)">__item_date__</a>
+					<!--
+					//Comments and Shares counters
+
+					<bx_if:show_counter_comments>
+						<span class="bullet">&#183;</span>&nbsp;<i class="sys-icon comment"></i>__counter__
+					</bx_if:show_counter_comments>
+					<bx_if:show_counter_shares>
+						<span class="bullet">&#183;</span>&nbsp;<i class="sys-icon share-square-o"></i>__counter__
+					</bx_if:show_counter_shares>
+					-->
+				</div>
+				<bx_if:show_menu_item_manage>
+					<div class="__style_prefix__-item-menu">
+						__menu_item_manage__
+						<div class="__style_prefix__-item-menu-button">
+				   			<a href="javascript:void(0)" onclick="javascript:__js_object__.showItemMenu(this);">
+								<i class="sys-icon chevron-down"></i>
+							</a>
+						</div>
+					</div>
+			   	</bx_if:show_menu_item_manage>
+			</div>
+			__content__
+			<bx_if:show_menu_item_actions>
+				<div class="__style_prefix__-item-actions">
+					__menu_item_actions__
+				</div>
+			</bx_if:show_menu_item_actions>
+			__comments__
+		</div>
+	</div>
+</div>

+ 8 - 0
modules/boonex/timeline/template/share.html

@@ -0,0 +1,8 @@
+<bx_if:show_title>
+	<div class="__style_prefix__-title bx-def-margin-sec-bottom bx-def-font-large">__title__</div>
+</bx_if:show_title>
+<bx_if:show_content>
+	<div class="__style_prefix__-content __style_prefix__-shared bx-def-margin-sec-bottom">
+	__content__
+	</div>
+</bx_if:show_content>

+ 14 - 54
modules/boonex/timeline/template/text.html

@@ -1,55 +1,15 @@
-<div id="bx-timeline-item-__id__" class="__style_prefix__-item bx-tl-grid-sizer">
-	<div class="__style_prefix__-item-ind bx-def-padding-sec">
-	    <div class="__style_prefix__-item-cnt bx-def-padding bx-def-round-corners bx-def-shadow">
-	    	<div class="__style_prefix__-owner bx-def-margin-bottom bx-def-icon-size-min-height"> 
-		       	<div class="__style_prefix__-owner-icon bx-def-icon bx-def-icon-size">
-					<bx_if:show_icon>
-						<img src="__author_icon__" />
-					</bx_if:show_icon>
-					<bx_if:show_icon_empty>
-						<i class="sys-icon user"></i>
-					</bx_if:show_icon_empty>
-				</div>
-				<div class="__style_prefix__-owner-name">
-					<a href="__item_owner_url__" class="__style_prefix__-owner-name">__item_owner_name__</a>
-		            <bx_if:show_timeline_owner>
-			        	<i class="sys-icon caret-right"></i>
-			        	<a href="__owner_url__" class="__style_prefix__-timeline-owner-name">__owner_username__</a>
-			        </bx_if:show_timeline_owner>
-				</div>
-				<div class="__style_prefix__-date bx-def-font-small bx-def-font-grayed">
-					<a href="__item_view_url__" onclick="javascript:return __js_object__.showItem(this, __id__)">__item_date__</a>
-				</div>
-				<bx_if:show_menu_item_manage>
-					<div class="__style_prefix__-item-menu">
-						__menu_item_manage__
-						<div class="__style_prefix__-item-menu-button">
-				   			<a href="javascript:void(0)" onclick="javascript:__js_object__.showItemMenu(this);">
-								<i class="sys-icon chevron-down"></i>
-							</a>
-						</div>
-					</div>
-			   	</bx_if:show_menu_item_manage>
-			</div>
-			<bx_if:show_images>
-	    		<bx_repeat:images>
-		    		<div class="__style_prefix__-item-image bx-def-thumb bx-def-margin-bottom">__image__</div>
-		    	</bx_repeat:images>
-	    	</bx_if:show_images>
-			<bx_if:show_title>
-				<div class="__style_prefix__-title bx-def-margin-sec-bottom bx-def-font-large">__title__</div>
-			</bx_if:show_title>
-			<bx_if:show_content>
-				<div class="__style_prefix__-content bx-def-margin-sec-bottom">
-				__item_content__<bx_if:show_more><span class="__style_prefix__-content-see-more">... <a class="bx-def-font-small" href="javascript:void(0)" onclick="__js_object__.showMoreContent(this);"><bx_text:_see_more /></a></span><span style="display:none;"> __item_content_more__</span></bx_if:show_more>
-				</div>
-			</bx_if:show_content>
-			<bx_if:show_menu_item_actions>
-				<div class="__style_prefix__-actions">
-					__menu_item_actions__
-				</div>
-			</bx_if:show_menu_item_actions>
-			__comments__
+<bx_if:show_images>
+	<bx_repeat:images>
+   		<div class="__style_prefix__-item-image bx-def-thumb bx-def-margin-bottom">__image__</div>
+   	</bx_repeat:images>
+</bx_if:show_images>
+<div class="__style_prefix__-item-text">
+	<bx_if:show_title>
+		<div class="__style_prefix__-title bx-def-margin-sec-bottom bx-def-font-large">__title__</div>
+	</bx_if:show_title>
+	<bx_if:show_content>
+		<div class="__style_prefix__-content bx-def-margin-sec-bottom">
+		__item_content__<bx_if:show_more><span class="__style_prefix__-content-see-more">... <a class="bx-def-font-small" href="javascript:void(0)" onclick="__js_object__.showMoreContent(this);"><bx_text:_see_more /></a></span><span style="display:none;"> __item_content_more__</span></bx_if:show_more>
 		</div>
-	</div>
-</div>
+	</bx_if:show_content>
+</div>

+ 0 - 14
modules/boonex/timeline/template/timeline.html

@@ -1,14 +0,0 @@
-<div class="__style_prefix__-timeline bx-def-margin-sec-bottom">
-    <div class="__style_prefix__-timeline-slider"></div>
-    <div class="__style_prefix__-timeline-date-from bx-def-margin-thd-left bx-def-font-small bx-def-font-grayed">
-        <bx_text:_bx_timeline_txt_date_from />
-    </div>
-    <div class="__style_prefix__-timeline-date-to bx-def-margin-thd-right bx-def-font-small bx-def-font-grayed">
-        <bx_text:_bx_timeline_txt_date_to />
-    </div>
-    <script>
-    	$(document).ready(function() {
-			__js_object__.initSlider({min: __min__, max: __max__, value: __value__});
-    	});
-    </script>
-</div>