Browse Source

Ticket #507
1. Timeline and Outline views
2. 'Post to Timeline' block on Home page.

AntonLV 10 years ago
parent
commit
f43a63e453

+ 1 - 0
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -468,6 +468,7 @@ class BxBaseModGeneralModule extends BxDolModule
 
         return array(
             'owner_id' => $aContentInfo[$CNF['FIELD_AUTHOR']],
+            'icon' => !empty($CNF['ICON']) ? $CNF['ICON'] : '',
             'content' => $this->_getContentForTimelinePost($aEvent, $aContentInfo), //a string to display or array to parse default template before displaying.
             'date' => $aContentInfo[$CNF['FIELD_ADDED']],
             'votes' => $aVotes,

+ 0 - 4
modules/base/notifications/classes/BxBaseModNotificationsTemplate.php

@@ -34,10 +34,6 @@ class BxBaseModNotificationsTemplate extends BxBaseModGeneralTemplate
     {
         $oModule = $this->getModule();
 
-        $sBaseUri = $this->_oConfig->getBaseUri();
-        $sJsClass = $this->_oConfig->getJsClass($sType);
-        $sJsObject = $this->_oConfig->getJsObject($sType);
-
         $aParams = array_merge(array(
         	'iOwnerId' => $oModule->_iOwnerId,
             'sAnimationEffect' => $this->_oConfig->getAnimationEffect(),

+ 8 - 5
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -59,13 +59,15 @@
 	<string name="_bx_timeline_page_title_account"><![CDATA[Лента]]></string>
 	<string name="_bx_timeline_page_block_title_post"><![CDATA[Разместить в Ленте]]></string>
 	<string name="_bx_timeline_page_block_title_view"><![CDATA[Лента]]></string>
-	<string name="_bx_timeline_page_block_title_post_profile_persons"><![CDATA[Разместить в Ленте]]></string>
-	<string name="_bx_timeline_page_block_title_post_profile_organizations"><![CDATA[Разместить в Ленте]]></string>
-	<string name="_bx_timeline_page_block_title_view_profile_persons"><![CDATA[Лента]]></string>
-	<string name="_bx_timeline_page_block_title_view_profile_organizations"><![CDATA[Лента]]></string>
+	<string name="_bx_timeline_page_block_title_post_profile"><![CDATA[Разместить в Ленте]]></string>
+	<string name="_bx_timeline_page_block_title_view_profile"><![CDATA[Лента]]></string>
+	<string name="_bx_timeline_page_block_title_view_profile_outline"><![CDATA[Сводка]]></string>
 	<string name="_bx_timeline_page_block_title_item"><![CDATA[Элемент]]></string>
 	<string name="_bx_timeline_page_block_title_view_account"><![CDATA[Лента Подписки]]></string>
-	<string name="_bx_timeline_page_block_title_view_home"><![CDATA[Сводка]]></string>
+	<string name="_bx_timeline_page_block_title_view_account_outline"><![CDATA[Сводка Подписки]]></string>
+	<string name="_bx_timeline_page_block_title_post_home"><![CDATA[Разместить в Ленте]]></string>
+	<string name="_bx_timeline_page_block_title_view_home"><![CDATA[Лента]]></string>
+	<string name="_bx_timeline_page_block_title_view_home_outline"><![CDATA[Сводка]]></string>
 	<string name="_bx_timeline_page_block_title_browse_cmts"><![CDATA[Лента - Комментарии]]></string>
 
     <string name="_bx_timeline_menu_item_view_all"><![CDATA[Все сообщения]]></string>
@@ -130,6 +132,7 @@
 	<string name="_bx_timeline_txt_sample_ext"><![CDATA[сообщение в ленте]]></string>
 	<string name="_bx_timeline_txt_sample_comment_single"><![CDATA[комментарий к сообщению в ленте]]></string>
 	<string name="_bx_timeline_txt_sample_vote_single"><![CDATA[голос за сообщение в ленте]]></string>
+    <string name="_bx_timeline_txt_today"><![CDATA[Сегодня]]></string>
 
 	<string name="_bx_timeline_txt_do_share"><![CDATA[Поделиться]]></string>
 	<string name="_bx_timeline_txt_shared"><![CDATA[Поделился {0} {1}.]]></string>

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

@@ -108,23 +108,33 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
             'share' => 'oTimelineShare'
         );
 
-        $sHtmlPrefix = str_replace('_', '-', $this->_sName);
+        $sHp = str_replace('_', '-', $this->_sName);
+        $sHpT = BX_TIMELINE_VIEW_TIMELINE;
+        $sHpO = BX_TIMELINE_VIEW_OUTLINE;
         $this->_aHtmlIds = array(
-            'view' => array(
-        		'main' => $sHtmlPrefix,
-        		'item' => $sHtmlPrefix . '-item-',
-                'menu_popup' => $sHtmlPrefix . '-menu-popup-',
-                'photo_popup' => $sHtmlPrefix . '-photo-popup',
+        	'view' => array(
+                'main_' . $sHpT => $sHp . '-' . $sHpT,
+        		'item_' . $sHpT => $sHp . '-item-' . $sHpT . '-',
+                'photo_popup_' . $sHpT => $sHp . '-photo-popup-' . $sHpT,
+
+        		'main_' . $sHpO => $sHp . '-' . $sHpO,
+        		'item_' . $sHpO => $sHp . '-item-' . $sHpO . '-',
+                'photo_popup_' . $sHpO => $sHp . '-photo-popup-' . $sHpO,
+
+				'menu_popup' => $sHp . '-menu-popup-',
             ),
             'post' => array(
-                'attach_link_popup' =>  $sHtmlPrefix . '-attach-link-popup',
-                'attach_link_form_field' => $sHtmlPrefix . '-attach-link-form_field',
-                'attach_link_item' => $sHtmlPrefix . '-attach-link-item-',
+                'attach_link_popup' =>  $sHp . '-attach-link-popup',
+                'attach_link_form_field' => $sHp . '-attach-link-form_field',
+                'attach_link_item' => $sHp . '-attach-link-item-',
+
+            	'main_' . $sHpT => $sHp . '-' . $sHpT,
+            	'main_' . $sHpO => $sHp . '-' . $sHpO,
             ),
             'share' => array(
-                'main' => $sHtmlPrefix . '-share-',
-                'counter' => $sHtmlPrefix . '-share-counter-',
-                'by_popup' => $sHtmlPrefix . '-share-by-',
+                'main' => $sHp . '-share-',
+                'counter' => $sHp . '-share-counter-',
+                'by_popup' => $sHp . '-share-by-',
             )
         );
 

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

@@ -332,7 +332,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             	list($sMethod, $sSelectClause, $sJoinClause, $sWhereClause, $sOrderClause, $sLimitClause) = parent::_getSqlPartsEvents($aParams);
         }
 
-		$sSelectClause .= "YEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `year`, ";
+		$sSelectClause .= "DAYOFYEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `days`, DAYOFYEAR(NOW()) AS `today`, ROUND((UNIX_TIMESTAMP() - `{$this->_sTable}`.`date`)/86400) AS `ago_days`, YEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `year`, ";
 		if($aParams['browse'] == 'list')
 			$sOrderClause = "ORDER BY `{$this->_sTable}`.`pinned` DESC, `{$this->_sTable}`.`date` DESC";
 
@@ -401,7 +401,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
 
 			case BX_BASE_MOD_NTFS_TYPE_PUBLIC:
 				$sCommonPostPrefix = $this->_oConfig->getPrefix('common_post');
-				$sWhereClause .= "AND SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") <> '" . $sCommonPostPrefix . "' ";
+				$sWhereClause .= $this->prepareAsString("AND (SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") <> '" . $sCommonPostPrefix . "' OR `{$this->_sTable}`.`owner_id`=?) ", 0);
 				break;
 		}
 

+ 4 - 5
modules/boonex/timeline/classes/BxTimelineMenuItemActions.php

@@ -22,13 +22,9 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         parent::__construct($aObject, $oTemplate);
 
         $this->_oModule = BxDolModule::getInstance('bx_timeline');
-
-        $this->addMarkers(array(
-            'js_object_view' => $this->_oModule->_oConfig->getJsObject('view'),
-        ));
     }
 
-    public function setEvent($aEvent)
+    public function setEvent($sView, $aEvent)
     {
         if(empty($aEvent) || !is_array($aEvent))
             return;
@@ -44,6 +40,9 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         }
 
         $this->addMarkers(array(
+        	'js_object_view' => $this->_oModule->_oConfig->getJsObject('view_' . $sView),
+
+            'view' => $sView,
             'content_id' => $aEvent['id'],
 
             'comment_system' => $sCommentsSystem,

+ 207 - 130
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -15,6 +15,10 @@ bx_import('BxBaseModNotificationsModule');
 define('BX_TIMELINE_TYPE_ITEM', 'view_item');
 define('BX_TIMELINE_TYPE_DEFAULT', BX_BASE_MOD_NTFS_TYPE_OWNER);
 
+define('BX_TIMELINE_VIEW_TIMELINE', 'timeline');
+define('BX_TIMELINE_VIEW_OUTLINE', 'outline');
+define('BX_TIMELINE_VIEW_DEFAULT', BX_TIMELINE_VIEW_OUTLINE);
+
 define('BX_TIMELINE_FILTER_ALL', 'all');
 define('BX_TIMELINE_FILTER_OWNER', 'owner');
 define('BX_TIMELINE_FILTER_OTHER', 'other');
@@ -86,30 +90,31 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         if(!$this->_oDb->updateEvent(array('pinned' => $aEvent['pinned']), array('id' => $iId)))
         	return echoJson(array('code' => 2));
 
-        $aResult = array('code' => 0, 'id' => $iId);
-		if($aEvent['pinned'] != 0)
-			$aResult['content'] = $this->_oTemplate->getPost($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId, 'dynamic_mode' => true));
-
-		echoJson($aResult);
+		echoJson(array(
+			'code' => 0, 
+			'id' => $iId, 
+			'eval' => $this->_oConfig->getJsObject('view') . '.onPinPost(oData)'
+		));
     }
 
     function actionDelete()
     {
         $this->_iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
 
-        $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
-        $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iId));
+        $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => bx_process_input(bx_get('id'), BX_DATA_INT)));
 
         $mixedAllowed = $this->isAllowedDelete($aEvent, true);
-        if($mixedAllowed !== true) {
-            echoJson(array('code' => 1, 'msg' => strip_tags($mixedAllowed)));
-            return;
-        }
+        if($mixedAllowed !== true)
+            return echoJson(array('code' => 1, 'msg' => strip_tags($mixedAllowed)));
 
         if(!$this->deleteEvent($aEvent))
-        	echoJson(array('code' => 2));
-        else 
-        	echoJson(array('code' => 0, 'id' => $iId));
+            return echoJson(array('code' => 2));
+
+        echoJson(array(
+        	'code' => 0, 
+        	'id' => $aEvent['id'], 
+        	'eval' => $this->_oConfig->getJsObject('view') . '.onDeletePost(oData)'
+        ));
     }
 
     public function actionShare()
@@ -173,12 +178,24 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
     function actionGetPost()
     {
+        $sView = bx_process_input(bx_get('view'));
         $this->_iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
 
-        $iEvent = bx_process_input(bx_get('id'), BX_DATA_INT);
-        $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iEvent));
-
-        echoJson(array('item' => $this->_oTemplate->getPost($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId, 'dynamic_mode' => true))));
+        $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => bx_process_input(bx_get('id'), BX_DATA_INT)));
+        if(empty($aEvent) || !is_array($aEvent))
+            return echoJson(array());
+
+        echoJson(array(
+            'id' => $aEvent['id'],
+            'view' => $sView,
+        	'item' => $this->_oTemplate->getPost($aEvent, array(
+        		'view' => $sView, 
+        		'type' => 'owner', 
+        		'owner_id' => $this->_iOwnerId, 
+        		'dynamic_mode' => true
+            )),
+            'eval' => $this->_oConfig->getJsObject('post') . "._onGetPost(oData)"
+        ));
     }
 
     function actionGetPosts()
@@ -186,7 +203,13 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $aParams = $this->_prepareParamsGet();
         list($sItems, $sLoadMore, $sBack) = $this->_oTemplate->getPosts($aParams);
 
-        echoJson(array('items' => $sItems, 'load_more' => $sLoadMore, 'back' => $sBack));
+        echoJson(array(
+        	'view' => $aParams['view'],
+        	'items' => $sItems, 
+        	'load_more' => $sLoadMore, 
+        	'back' => $sBack, 
+        	'eval' => $this->_oConfig->getJsObject('view') . "._onGetPosts(oData)"
+        ));
     }
 
     public function actionGetPostForm($sType)
@@ -305,7 +328,10 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 		if(empty($iProfileId) && isLogged())
 			$iProfileId = bx_get_logged_profile_id();
 
-        return $this->getBlockPost($iProfileId);
+        if(!$iProfileId)
+            return array();
+
+        return $this->_getBlockPost($iProfileId);
     }
 
     public function serviceGetBlockPostProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0)
@@ -320,7 +346,13 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 		if(empty($oProfile))
 			return array();
 
-		return $this->getBlockPost($oProfile->id());
+		return $this->_getBlockPost($oProfile->id());
+    }
+
+    public function serviceGetBlockPostHome()
+    {
+        $iProfileId = 0;
+        return $this->_getBlockPost($iProfileId);
     }
 
     /*
@@ -328,54 +360,46 @@ class BxTimelineModule extends BxBaseModNotificationsModule
      */
     public function serviceGetBlockView($iProfileId = 0)
     {
-    	if(empty($iProfileId) && bx_get('profile_id') !== false)
-			$iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
+    	return $this->_serviceGetBlockView($iProfileId, BX_TIMELINE_VIEW_TIMELINE);
+    }
 
-		if(empty($iProfileId) && isLogged())
-			$iProfileId = bx_get_logged_profile_id();
+    public function serviceGetBlockViewOutline($iProfileId = 0)
+    {
+        return $this->_serviceGetBlockView($iProfileId, BX_TIMELINE_VIEW_OUTLINE);
+    }
 
-        $aBlock = $this->getBlockView($iProfileId);
-        if(!empty($aBlock))
-            return $aBlock;
+    public function serviceGetBlockViewProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
+    {
+        $sView = BX_TIMELINE_VIEW_TIMELINE;
 
-        return array('content' => MsgBox(_t('_bx_timeline_txt_msg_no_results')));
+        return $this->_serviceGetBlockViewProfile($sProfileModule, $iProfileContentId, $sView, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
     }
 
-	public function serviceGetBlockViewProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
+	public function serviceGetBlockViewProfileOutline($sProfileModule = 'bx_persons', $iProfileContentId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
     {
-    	if(empty($sProfileModule))
-    		return array();
+        $sView = BX_TIMELINE_VIEW_OUTLINE;
 
-    	if(empty($iProfileContentId) && bx_get('id') !== false)
-    		$iProfileContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        return $this->_serviceGetBlockViewProfile($sProfileModule, $iProfileContentId, $sView, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
+    }
 
-		$oProfile = BxDolProfile::getInstanceByContentAndType($iProfileContentId, $sProfileModule);
-		if(empty($oProfile))
-			return array();
+    public function serviceGetBlockViewHome($iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
+    {
+        return $this->_serviceGetBlockViewByType($iProfileId, BX_TIMELINE_VIEW_TIMELINE, BX_BASE_MOD_NTFS_TYPE_PUBLIC, $iStart, $iPerPage, $this->_oConfig->getPerPage('home'), $iTimeline, $sFilter, $aModules);
+    }
 
-        return $this->getBlockView($oProfile->id(), $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
+	public function serviceGetBlockViewHomeOutline($iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
+    {
+        return $this->_serviceGetBlockViewByType($iProfileId, BX_TIMELINE_VIEW_OUTLINE, BX_BASE_MOD_NTFS_TYPE_PUBLIC, $iStart, $iPerPage, $this->_oConfig->getPerPage('home'), $iTimeline, $sFilter, $aModules);
     }
 
     public function serviceGetBlockViewAccount($iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
     {
-        $aParams = $this->_prepareParams(BX_BASE_MOD_NTFS_TYPE_CONNECTIONS, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
-        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('account');
-
-        $this->_iOwnerId = $aParams['owner_id'];
-
-        $sContent = $this->_oTemplate->getViewBlock($aParams);
-        return array('content' => $sContent);
+        return $this->_serviceGetBlockViewByType($iProfileId, BX_TIMELINE_VIEW_TIMELINE, BX_BASE_MOD_NTFS_TYPE_CONNECTIONS, $iStart, $iPerPage, $this->_oConfig->getPerPage('account'), $iTimeline, $sFilter, $aModules);
     }
 
-	public function serviceGetBlockViewHome($iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
+    public function serviceGetBlockViewAccountOutline($iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
     {
-        $aParams = $this->_prepareParams(BX_BASE_MOD_NTFS_TYPE_PUBLIC, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
-        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('home');
-
-        $this->_iOwnerId = $aParams['owner_id'];
-
-        $sContent = $this->_oTemplate->getViewBlock($aParams);
-        return array('content' => $sContent);
+        return $this->_serviceGetBlockViewByType($iProfileId, BX_TIMELINE_VIEW_OUTLINE, BX_BASE_MOD_NTFS_TYPE_CONNECTIONS, $iStart, $iPerPage, $this->_oConfig->getPerPage('account'), $iTimeline, $sFilter, $aModules);
     }
 
     public function serviceGetBlockItem()
@@ -549,51 +573,6 @@ class BxTimelineModule extends BxBaseModNotificationsModule
     /*
      * COMMON METHODS
      */
-	public function getBlockPost($iProfileId)
-    {
-    	if(!$iProfileId)
-            return array();
-
-        $this->_iOwnerId = $iProfileId;
-
-        if($this->isAllowedPost() !== true)
-            return array();
-
-		$sContent = $this->_oTemplate->getPostBlock($this->_iOwnerId);
-        return array('content' => $sContent);
-    }
-
-    public function getBlockView($iProfileId, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
-    {
-        if(!$iProfileId)
-			return array();
-
-        $sJsObject = $this->_oConfig->getJsObject('view');
-        $aParams = $this->_prepareParams(BX_BASE_MOD_NTFS_TYPE_OWNER, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
-        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('profile');
-
-        $this->_iOwnerId = $aParams['owner_id'];
-        list($sUserName, $sUserUrl) = $this->getUserInfo($aParams['owner_id']);
-
-        $aMenu = array(
-            array('id' => 'timeline-view-all', 'name' => 'timeline-view-all', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_all'), 'active' => 1),
-            array('id' => 'timeline-view-owner', 'name' => 'timeline-view-owner', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_owner', $sUserName)),
-            array('id' => 'timeline-view-other', 'name' => 'timeline-view-other', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_other')),
-            array('id' => 'timeline-get-rss', 'name' => 'timeline-get-rss', 'class' => '', 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $iProfileId . '/', 'target' => '_blank', 'title' => _t('_bx_timeline_menu_item_get_rss')),
-        );
-
-        $sContent = '';
-        $oProfileOwner = BxDolProfile::getInstance($this->_iOwnerId);
-        bx_alert($oProfileOwner->getModule(), $this->_oConfig->getUri() . '_view', $this->_iOwnerId, $this->getUserId(), array('override_content' => &$sContent, 'params' => &$aParams, 'menu' => &$aMenu));
-
-        $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> 'timeline-view-all', 'menu_items' => $aMenu));
-        $oMenu->setSelected('', 'timeline-view-all');
-
-        if (!$sContent)
-            $sContent = $this->_oTemplate->getViewBlock($aParams);
-
-        return array('content' => $sContent, 'menu' => $oMenu);
-    }
     public function deleteEvent($aEvent)
     {
     	if(empty($aEvent) || !is_array($aEvent) || !$this->_oDb->deleteEvent(array('id' => (int)$aEvent['id'])))
@@ -787,19 +766,19 @@ class BxTimelineModule extends BxBaseModNotificationsModule
     }
 
     //--- Check permissions methods ---//
-
     public function isAllowedPost($bPerform = false)
     {
         if(isAdmin())
             return true;
 
         $iUserId = $this->getUserId();
-        if($this->_iOwnerId == $this->getUserId())
+        if($iUserId != 0 && $iUserId == $this->_iOwnerId)
             return true;
 
         $aCheckResult = checkActionModule($iUserId, 'post', $this->getName(), $bPerform);
 
-        if ($oProfileOwner = BxDolProfile::getInstance($this->_iOwnerId))
+        $oProfileOwner = BxDolProfile::getInstance($this->_iOwnerId);
+        if($oProfileOwner !== false)
             bx_alert($oProfileOwner->getModule(), $this->_oConfig->getUri() . '_post', $oProfileOwner->id(), $iUserId, array('check_result' => &$aCheckResult));
 
         return $aCheckResult[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $aCheckResult[CHECK_ACTION_MESSAGE] : true;
@@ -1041,6 +1020,97 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         return array($sSystem, $iObjectId, $iCount);
     }
 
+    /**
+     * Protected Methods 
+     */
+    protected function _serviceGetBlockView($iProfileId = 0, $sView = BX_TIMELINE_VIEW_DEFAULT)
+    {
+        if(empty($iProfileId) && bx_get('profile_id') !== false)
+			$iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
+
+		if(empty($iProfileId) && isLogged())
+			$iProfileId = bx_get_logged_profile_id();
+
+        $aBlock = $this->_getBlockView($iProfileId, $sView);
+        if(!empty($aBlock))
+            return $aBlock;
+
+        return array('content' => MsgBox(_t('_bx_timeline_txt_msg_no_results')));
+    }
+
+    protected function _serviceGetBlockViewProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0, $sView = BX_TIMELINE_VIEW_DEFAULT, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
+    {
+    	if(empty($sProfileModule))
+    		return array();
+
+    	if(empty($iProfileContentId) && bx_get('id') !== false)
+    		$iProfileContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+
+		$oProfile = BxDolProfile::getInstanceByContentAndType($iProfileContentId, $sProfileModule);
+		if(empty($oProfile))
+			return array();
+
+        return $this->_getBlockView($oProfile->id(), $sView, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
+    }
+
+    protected function _serviceGetBlockViewByType($iProfileId = 0, $sView = BX_TIMELINE_VIEW_DEFAULT, $sType = BX_TIMELINE_TYPE_DEFAULT, $iStart = -1, $iPerPage = -1, $iPerPageDefault = -1,  $iTimeline = -1, $sFilter = '', $aModules = array())
+    {
+        $aParams = $this->_prepareParams($sType, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
+
+        $aParams['view'] = $sView;
+        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : ((int)$iPerPageDefault > 0 ? $iPerPageDefault : $this->_oConfig->getPerPage());
+
+        $this->_iOwnerId = $aParams['owner_id'];
+
+        $sContent = $this->_oTemplate->getViewBlock($aParams);
+        return array('content' => $sContent);
+    }
+
+    protected function _getBlockPost($iProfileId)
+    {
+        $this->_iOwnerId = $iProfileId;
+
+        if($this->isAllowedPost() !== true)
+            return array();
+
+		$sContent = $this->_oTemplate->getPostBlock($this->_iOwnerId);
+        return array('content' => $sContent);
+    }
+
+    protected function _getBlockView($iProfileId, $sView = BX_TIMELINE_VIEW_DEFAULT, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
+    {
+        if(!$iProfileId)
+			return array();
+
+        $aParams = $this->_prepareParams(BX_BASE_MOD_NTFS_TYPE_OWNER, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
+
+        $aParams['view'] = $sView;
+        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('profile');
+
+        $this->_iOwnerId = $aParams['owner_id'];
+        list($sUserName, $sUserUrl) = $this->getUserInfo($aParams['owner_id']);
+
+        $sJsObject = $this->_oConfig->getJsObject('view');
+        $aMenu = array(
+            array('id' => 'timeline-view-all', 'name' => 'timeline-view-all', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_all'), 'active' => 1),
+            array('id' => 'timeline-view-owner', 'name' => 'timeline-view-owner', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_owner', $sUserName)),
+            array('id' => 'timeline-view-other', 'name' => 'timeline-view-other', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_other')),
+            array('id' => 'timeline-get-rss', 'name' => 'timeline-get-rss', 'class' => '', 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $iProfileId . '/', 'target' => '_blank', 'title' => _t('_bx_timeline_menu_item_get_rss')),
+        );
+
+        $sContent = '';
+        $oProfileOwner = BxDolProfile::getInstance($this->_iOwnerId);
+        bx_alert($oProfileOwner->getModule(), $this->_oConfig->getUri() . '_view', $this->_iOwnerId, $this->getUserId(), array('override_content' => &$sContent, 'params' => &$aParams, 'menu' => &$aMenu));
+
+        $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> 'timeline-view-all', 'menu_items' => $aMenu));
+        $oMenu->setSelected('', 'timeline-view-all');
+
+        if (!$sContent)
+            $sContent = $this->_oTemplate->getViewBlock($aParams);
+
+        return array('content' => $sContent, 'menu' => $oMenu);
+    }
+
 	protected function _isAllowedPin($aEvent, $bPerform = false)
     {
         if(isAdmin())
@@ -1102,46 +1172,53 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
     protected function _prepareParams($sType, $iOwnerId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline)
     {
-        $aParams = array();
-        $aParams['browse'] = 'list';
-        $aParams['type'] = !empty($sType) ? $sType : BX_TIMELINE_TYPE_DEFAULT;
-        $aParams['owner_id'] = (int)$iOwnerId != 0 ? $iOwnerId : $this->getUserId();
-        $aParams['start'] = (int)$iStart > 0 ? $iStart : 0;
-        $aParams['per_page'] = (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage();
-        $aParams['filter'] = !empty($sFilter) ? $sFilter : BX_TIMELINE_FILTER_ALL;
-        $aParams['modules'] = is_array($aModules) && !empty($aModules) ? $aModules : array();
-        $aParams['timeline'] = (int)$iTimeline > 0 ? $iTimeline : 0;
-        $aParams['active'] = 1;
-        $aParams['hidden'] = 0;
-
-        return $aParams;
+        return array(
+            'view' => BX_TIMELINE_VIEW_DEFAULT,
+
+            'browse' => 'list',
+            'type' => !empty($sType) ? $sType : BX_TIMELINE_TYPE_DEFAULT,
+            'owner_id' => (int)$iOwnerId != 0 ? $iOwnerId : $this->getUserId(),
+            'filter' => !empty($sFilter) ? $sFilter : BX_TIMELINE_FILTER_ALL,
+            'modules' => is_array($aModules) && !empty($aModules) ? $aModules : array(),
+            'timeline' => (int)$iTimeline > 0 ? $iTimeline : 0,
+            'active' => 1,
+            'hidden' => 0,
+
+            'start' => (int)$iStart > 0 ? $iStart : 0,
+            'per_page' => (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage(),
+        );
     }
 
     protected function _prepareParamsGet()
     {
-        $aParams = array();
-        $aParams['browse'] = 'list';
-        $aParams['dynamic_mode'] = true;
+        $aParams = array(
+            'browse' => 'list',
+            'dynamic_mode' => true,
+        );
+
+        $aParams['view'] = bx_get('view');
+        $aParams['view'] = $aParams['view'] !== false ? bx_process_input($aParams['view'], BX_DATA_TEXT) : BX_TIMELINE_VIEW_DEFAULT;
 
-        $sType = bx_get('type');
-        $aParams['type'] = $sType !== false ? bx_process_input($sType, BX_DATA_TEXT) : BX_TIMELINE_TYPE_DEFAULT;
+        $aParams['type'] = bx_get('type');
+        $aParams['type'] = $aParams['type'] !== false ? bx_process_input($aParams['type'], BX_DATA_TEXT) : BX_TIMELINE_TYPE_DEFAULT;
 
-        $aParams['owner_id'] = $sType !== false ? bx_process_input(bx_get('owner_id'), BX_DATA_INT) : $this->getUserId();
+        $aParams['owner_id'] = bx_get('owner_id');
+        $aParams['owner_id'] = $aParams['owner_id'] !== false ? bx_process_input($aParams['owner_id'], BX_DATA_INT) : $this->getUserId();
 
-        $iStart = bx_get('start');
-        $aParams['start'] = $iStart !== false ? bx_process_input($iStart, BX_DATA_INT) : 0;
+        $aParams['start'] = bx_get('start');
+        $aParams['start'] = $aParams['start'] !== false ? bx_process_input($aParams['start'], BX_DATA_INT) : 0;
 
-        $iPerPage = bx_get('per_page');
-        $aParams['per_page'] = $iPerPage !== false ? bx_process_input($iPerPage, BX_DATA_INT) : $this->_oConfig->getPerPage();
+        $aParams['per_page'] = bx_get('per_page');
+        $aParams['per_page'] = $aParams['per_page'] !== false ? bx_process_input($aParams['per_page'], BX_DATA_INT) : $this->_oConfig->getPerPage();
 
-        $sFilter = bx_get('filter');
-        $aParams['filter'] = $sFilter !== false ? bx_process_input($sFilter, BX_DATA_TEXT) : BX_TIMELINE_FILTER_ALL;
+        $aParams['filter'] = bx_get('filter');
+        $aParams['filter'] = $aParams['filter'] !== false ? bx_process_input($aParams['filter'], BX_DATA_TEXT) : BX_TIMELINE_FILTER_ALL;
 
-        $aModules = bx_get('modules');
-        $aParams['modules'] = $aModules !== false ? bx_process_input($aModules, BX_DATA_TEXT) : array();
+        $aParams['modules'] = bx_get('modules');
+        $aParams['modules'] = $aParams['modules'] !== false ? bx_process_input($aParams['modules'], BX_DATA_TEXT) : array();
 
-        $iTimeline = bx_get('timeline');
-        $aParams['timeline'] = $iTimeline !== false ? bx_process_input($iTimeline, BX_DATA_INT) : 0;
+        $aParams['timeline'] = bx_get('timeline');
+        $aParams['timeline'] = $aParams['timeline'] !== false ? bx_process_input($aParams['timeline'], BX_DATA_INT) : 0;
 
         $aParams['active'] = 1;
         $aParams['hidden'] = 0;

+ 93 - 23
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -58,11 +58,12 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
         return $this->parseHtmlByName('block_view.html', array(
             'style_prefix' => $this->_oConfig->getPrefix('style'),
-        	'html_id' => $this->_oConfig->getHtmlIds('view', 'main'),
+        	'html_id' => $this->_oConfig->getHtmlIds('view', 'main_' . $aParams['view']),
+            'view' => $aParams['view'],
             'back' => $sBack,
             'content' => $sContent,
             'load_more' =>  $sLoadMore,
-        	'view_image_popup' => $this->_getImagePopup(),
+        	'view_image_popup' => $this->_getImagePopup($aParams),
             'js_content' => $this->getJsCode('view', array(
             	'oRequestParams' => array(
 	                'type' => $aParams['type'],
@@ -83,9 +84,14 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(empty($aEvent))
             return '';
 
+        $aParams = array(
+        	'view' => BX_TIMELINE_VIEW_DEFAULT, 
+        	'type' => BX_TIMELINE_TYPE_ITEM
+        );
+         
         $sContent = $this->getJsCode('view');
-        $sContent .= $this->getPost($aEvent, array('type' => BX_TIMELINE_TYPE_ITEM));
-        $sContent .= $this->_getImagePopup();
+        $sContent .= $this->getPost($aEvent, $aParams);
+        $sContent .= $this->_getImagePopup($aParams);
 
         return $sContent;
     }
@@ -116,6 +122,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         }
 
         $aEvent['object_owner_id'] = $aResult['owner_id'];
+        $aEvent['icon'] = !empty($aResult['icon']) ? $aResult['icon'] : '';
         $aEvent['content'] = $aResult['content'];
         $aEvent['votes'] = $aResult['votes'];
         $aEvent['reports'] = $aResult['reports'];
@@ -127,12 +134,15 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
     public function getPosts($aParams)
     {
+        $bViewTimeline = $aParams['view'] == BX_TIMELINE_VIEW_TIMELINE;
+
         $iStart = $aParams['start'];
         $iPerPage = $aParams['per_page'];
 
         $aParamsDb = $aParams;
 
         //--- Check for Previous
+        $iDays = -1;
         $bPrevious = false;
         if($iStart - 1 >= 0) {
             $aParamsDb['start'] -= 1;
@@ -145,8 +155,10 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $aEvents = $this->_oDb->getEvents($aParamsDb);
 
         //--- Check for Previous
-        if($bPrevious)
+        if($bPrevious) {
             $aEvent = array_shift($aEvents);
+            $iDays = (int)$aEvent['days'];
+        }
 
         //--- Check for Next
         $bNext = false;
@@ -157,20 +169,27 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
         $iEvents = count($aEvents);
         $sContent = $this->getEmpty($iEvents <= 0);
+        if($bViewTimeline && $iEvents <= 0)
+        	$sContent .= $this->getDividerToday();
 
+        $bFirst = true;
         foreach($aEvents as $aEvent) {
             $sEvent = $this->getPost($aEvent, $aParams);
-            if(empty($sEvent))
+            $bEvent = !empty($sEvent);
+            if(!$bEvent)
                 continue;
 
+            if($bViewTimeline && $bFirst) {
+                $sContent .= $this->getDividerToday($aEvent);
+                $bFirst = false;
+            }
+
+            $sContent .= $bViewTimeline && $bEvent ? $this->getDivider($iDays, $aEvent) : '';
             $sContent .= $sEvent;
         }
 
-        $iYearSel = (int)$aParams['timeline'];
-        $iYearMin = $this->_oDb->getMaxDuration($aParams);
-
-        $sBack = $this->getBack($iYearSel);
-        $sLoadMore = $this->getLoadMore($iStart, $iPerPage, $bNext, $iYearSel, $iYearMin, $iEvents > 0);
+        $sBack = $this->getBack($aParams);
+        $sLoadMore = $this->getLoadMore($aParams, $bNext, $iEvents > 0);
         return array($sContent, $sLoadMore, $sBack);
     }
 
@@ -183,8 +202,45 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         ));
     }
 
-    public function getBack($iYearSel)
+    public function getDivider(&$iDays, &$aEvent)
     {
+        if($iDays == $aEvent['days'])
+            return "";
+
+        $iDays = $aEvent['days'];
+        $iDaysAgo = (int)$aEvent['ago_days'];
+        if($aEvent['today'] == $aEvent['days'] || (($aEvent['today'] - $aEvent['days']) == 1 && $iDaysAgo == 0))
+            return "";
+
+        return $this->parseHtmlByName('divider.html', array(
+        	'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'type' => 'common',
+            'bx_if:show_hidden' => array(
+                'condition' => false,
+                'content' => array()
+            ),
+            'content' => bx_time_js($aEvent['date'])
+        ));
+    }
+
+    public function getDividerToday($aEvent = array())
+    {
+    	$bToday = !empty($aEvent) && ($aEvent['today'] == $aEvent['days'] || (($aEvent['today'] - $aEvent['days']) == 1 && (int)$aEvent['ago_days'] == 0));
+
+        return $this->parseHtmlByName('divider.html', array(
+        	'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'type' => 'today',
+        	'bx_if:show_hidden' => array(
+                'condition' => !$bToday,
+                'content' => array()
+            ),
+            'content' => _t('_bx_timeline_txt_today')
+        ));
+    }
+
+    public function getBack($aParams)
+    {
+        $iYearSel = (int)$aParams['timeline'];
         if($iYearSel == 0)
             return '';
 
@@ -203,8 +259,13 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         ));
     }
 
-    public function getLoadMore($iStart, $iPerPage, $bEnabled, $iYearSel, $iYearMin, $bVisible = true)
+    public function getLoadMore($aParams, $bEnabled, $bVisible = true)
     {
+        $iStart = $aParams['start'];
+        $iPerPage = $aParams['per_page'];
+        $iYearSel = (int)$aParams['timeline'];
+        $iYearMin = $this->_oDb->getMaxDuration($aParams);
+
         $sStylePrefix = $this->_oConfig->getPrefix('style');
         $sJsObject = $this->_oConfig->getJsObject('view');
 
@@ -226,7 +287,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
         $aTmplVars = array(
             'style_prefix' => $sStylePrefix,
-            'visible' => $bEnabled && $bVisible ? 'block' : 'none',
+            'visible' => ($aParams['view'] == BX_TIMELINE_VIEW_TIMELINE && $bVisible) || ($aParams['view'] == BX_TIMELINE_VIEW_OUTLINE && $bEnabled && $bVisible) ? 'block' : 'none',
             'bx_if:is_disabled' => array(
                 'condition' => !$bEnabled,
                 'content' => array()
@@ -505,6 +566,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             $aTmplVarsTimelineOwner = $this->_getTmplVarsTimelineOwner($aEvent);
 
         $bBrowseItem = isset($aBrowseParams['type']) && $aBrowseParams['type'] == BX_TIMELINE_TYPE_ITEM;
+        $bViewTimeline = isset($aBrowseParams['view']) && $aBrowseParams['view'] == BX_TIMELINE_VIEW_TIMELINE;
 
         $oMetatags = BxDolMetatags::getObjectInstance($this->_oConfig->getObject('metatags'));
  		$sLocation = $oMetatags->locationsString($aEvent['id']);
@@ -512,19 +574,27 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $aTmplVars = array (
             'style_prefix' => $sStylePrefix,
             'js_object' => $sJsObject,
-        	'html_id' => $this->_oConfig->getHtmlIds('view', 'item') . $aEvent['id'],
-            'class' => $bBrowseItem ? 'bx-tl-view-sizer' : 'bx-tl-grid-sizer',
+        	'html_id' => $this->_oConfig->getHtmlIds('view', 'item_' . $aBrowseParams['view']) . $aEvent['id'],
+            'class' => $bBrowseItem || $bViewTimeline ? 'bx-tl-view-sizer' : 'bx-tl-grid-sizer',
         	'class_content' => $bBrowseItem ? 'bx-def-color-bg-block' : 'bx-def-color-bg-box',
-            'bx_if:show_icon' => array(
+            'id' => $aEvent['id'],
+            'bx_if:show_owner_icon' => array(
                 'condition' => $bAuthorIcon,
                 'content' => array(
-                    'author_icon' => $sAuthorIcon
+                    'owner_icon' => $sAuthorIcon
                 )
             ),
-            'bx_if:show_icon_empty' => array(
+            'bx_if:show_owner_icon_empty' => array(
                 'condition' => !$bAuthorIcon,
                 'content' => array()
             ),
+            'bx_if:show_item_icon' => array(
+                'condition' => !empty($aEvent['icon']),
+                'content' => array(
+            		'style_prefix' => $sStylePrefix,
+                    'item_icon' => $aEvent['icon'],
+                )
+            ),
             'item_owner_url' => $sAuthorUrl,
             'item_owner_title' => bx_html_attribute($sAuthorName),
             'item_owner_name' => $sAuthorName,
@@ -555,7 +625,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'comments' => $bBrowseItem ? $this->_getComments($aEvent['comments']) : '',
         );
 
-        return $this->parseHtmlByName('item.html', $aTmplVars);
+        return $this->parseHtmlByName('item_' . $aBrowseParams['view'] . '.html', $aTmplVars);
     }
 
     protected function _getContent($sType, $aEvent, $aBrowseParams = array())
@@ -578,9 +648,9 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return $this->getComments($sSystem, $iObjectId);
     }
 
-    protected function _getImagePopup()
+    protected function _getImagePopup($aParams)
     {
-        $sViewImagePopupId = $this->_oConfig->getHtmlIds('view', 'photo_popup');
+        $sViewImagePopupId = $this->_oConfig->getHtmlIds('view', 'photo_popup_' . $aParams['view']);
         $sViewImagePopupContent = $this->parseHtmlByName('popup_image.html', array(
     		'image_url' => ''
     	));
@@ -591,7 +661,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
     protected function _getTmplVarsMenuItemActions(&$aEvent, $aBrowseParams = array())
     {
         $oMenu = BxDolMenu::getObjectInstance($this->_oConfig->getObject('menu_item_actions'));
-        $oMenu->setEvent($aEvent);
+        $oMenu->setEvent($aBrowseParams['view'], $aEvent);
         $oMenu->setDynamicMode(isset($aBrowseParams['dynamic_mode']) && $aBrowseParams['dynamic_mode'] === true);
 
         $sMenu = $oMenu->getCode();

+ 8 - 5
modules/boonex/timeline/install/langs/en.xml

@@ -59,13 +59,15 @@
 	<string name="_bx_timeline_page_title_account"><![CDATA[Timeline]]></string>
 	<string name="_bx_timeline_page_block_title_post"><![CDATA[Post to Timeline]]></string>
 	<string name="_bx_timeline_page_block_title_view"><![CDATA[Timeline]]></string>
-	<string name="_bx_timeline_page_block_title_post_profile_persons"><![CDATA[Post to Timeline]]></string>
-	<string name="_bx_timeline_page_block_title_post_profile_organizations"><![CDATA[Post to Timeline]]></string>
-	<string name="_bx_timeline_page_block_title_view_profile_persons"><![CDATA[Timeline]]></string>
-	<string name="_bx_timeline_page_block_title_view_profile_organizations"><![CDATA[Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_post_profile"><![CDATA[Post to Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_view_profile"><![CDATA[Timeline]]></string>	
+	<string name="_bx_timeline_page_block_title_view_profile_outline"><![CDATA[Outline]]></string>
 	<string name="_bx_timeline_page_block_title_item"><![CDATA[Item]]></string>
 	<string name="_bx_timeline_page_block_title_view_account"><![CDATA[Subscriptions Timeline]]></string>
-	<string name="_bx_timeline_page_block_title_view_home"><![CDATA[Outline]]></string>
+	<string name="_bx_timeline_page_block_title_view_account_outline"><![CDATA[Subscriptions Outline]]></string>
+	<string name="_bx_timeline_page_block_title_post_home"><![CDATA[Post to Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_view_home"><![CDATA[Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_view_home_outline"><![CDATA[Outline]]></string>
 	<string name="_bx_timeline_page_block_title_browse_cmts"><![CDATA[Timelines' Comments]]></string>
 
     <string name="_bx_timeline_menu_item_view_all"><![CDATA[All posts]]></string>
@@ -130,6 +132,7 @@
 	<string name="_bx_timeline_txt_sample_ext"><![CDATA[timeline post]]></string>
 	<string name="_bx_timeline_txt_sample_comment_single"><![CDATA[timeline post's comment]]></string>
     <string name="_bx_timeline_txt_sample_vote_single"><![CDATA[timeline post's vote]]></string>
+    <string name="_bx_timeline_txt_today"><![CDATA[Today]]></string>
 
 	<string name="_bx_timeline_txt_do_share"><![CDATA[Repost]]></string>
 	<string name="_bx_timeline_txt_shared"><![CDATA[Reposted {0}'s {1}.]]></string>

+ 15 - 9
modules/boonex/timeline/install/sql/enable.sql

@@ -6,6 +6,7 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
 ('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_post', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_post";}', 0, 0, 1),
 ('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_view";}', 0, 0, 2),
+('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_outline";}', 0, 0, 3),
 
 ('bx_timeline_item', 1, 'bx_timeline', '_bx_timeline_page_block_title_item', 0, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_item";}', 0, 0, 1);
 
@@ -13,23 +14,28 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designb
 SET @iPBCellDashboard = 1;
 SET @iPBOrderDashboard = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard' AND `cell_id` = @iPBCellDashboard LIMIT 1);
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
-('sys_dashboard', @iPBCellDashboard, 'bx_timeline', '_bx_timeline_page_block_title_view_account', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_account";}', 0, 1, @iPBOrderDashboard + 1);
+('sys_dashboard', @iPBCellDashboard, 'bx_timeline', '_bx_timeline_page_block_title_view_account', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_account";}', 0, 1, @iPBOrderDashboard + 1),
+('sys_dashboard', @iPBCellDashboard, 'bx_timeline', '_bx_timeline_page_block_title_view_account_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_block_view_account_outline";}', 0, 1, @iPBOrderDashboard + 2);
 
 -- PAGES: add page block on home
 SET @iPBCellHome = 1;
 SET @iPBOrderHome = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = @iPBCellHome ORDER BY `order` DESC LIMIT 1);
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_view_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_view_home";}', 0, 1, @iPBOrderHome + 1);
+('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_post_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_post_home";}', 0, 1, @iPBOrderHome + 1),
+('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_view_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_view_home";}', 0, 1, @iPBOrderHome + 2),
+('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_view_home_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_block_view_home_outline";}', 0, 1, @iPBOrderHome + 3);
 
 -- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
 SET @iPBCellProfile = 2;
 SET @iPBCellGroup = 4;
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
-('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_post_profile_persons', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
-('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_persons', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_post_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_view_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_outline', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_block_view_profile_outline";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
 
-('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_post_profile_persons', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
-('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_persons', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0);
+('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_post_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
+('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_view_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
+('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_outline', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile_outline";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0);
 
 -- MENU: Item Manage (Delete)
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
@@ -39,8 +45,8 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_timeline_menu_item_manage', 'bx_timeline', '_bx_timeline_menu_set_title_item_manage', 0);
 
 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_manage', 'bx_timeline', 'item-pin', '_bx_timeline_menu_item_title_system_item_pin', '_bx_timeline_menu_item_title_item_pin', 'javascript:void(0)', 'javascript:{js_object_view}.pinPost(this, {content_id})', '_self', 'thumb-tack', '', 2147483647, 1, 0, 0),
-('bx_timeline_menu_item_manage', 'bx_timeline', 'item-unpin', '_bx_timeline_menu_item_title_system_item_unpin', '_bx_timeline_menu_item_title_item_unpin', 'javascript:void(0)', 'javascript:{js_object_view}.unpinPost(this, {content_id})', '_self', 'thumb-tack', '', 2147483647, 1, 0, 1),
+('bx_timeline_menu_item_manage', 'bx_timeline', 'item-pin', '_bx_timeline_menu_item_title_system_item_pin', '_bx_timeline_menu_item_title_item_pin', 'javascript:void(0)', 'javascript:{js_object_view}.pinPost(this, {content_id}, 1)', '_self', 'thumb-tack', '', 2147483647, 1, 0, 0),
+('bx_timeline_menu_item_manage', 'bx_timeline', 'item-unpin', '_bx_timeline_menu_item_title_system_item_unpin', '_bx_timeline_menu_item_title_item_unpin', 'javascript:void(0)', 'javascript:{js_object_view}.pinPost(this, {content_id}, 0)', '_self', 'thumb-tack', '', 2147483647, 1, 0, 1),
 ('bx_timeline_menu_item_manage', 'bx_timeline', 'item-delete', '_bx_timeline_menu_item_title_system_item_delete', '_bx_timeline_menu_item_title_item_delete', 'javascript:void(0)', 'javascript:{js_object_view}.deletePost(this, {content_id})', '_self', 'remove', '', 2147483647, 1, 0, 2);
 
 -- MENU: Item Actions (Comment, Plus)
@@ -51,7 +57,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_timeline_menu_item_actions', 'bx_timeline', '_bx_timeline_menu_set_title_item_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `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:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:2:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";}}', '', 0, 2147483647, 1, 0, 1, 1),
+('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:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:3:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";i:2;s:6:"{view}";}}', '', 0, 2147483647, 1, 0, 1, 1),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 0, 2),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 0, 3),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-report', '_bx_timeline_menu_item_title_system_item_report', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 0, 4),

+ 92 - 13
modules/boonex/timeline/js/main.js

@@ -1,29 +1,51 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
 function BxTimelineMain() {
 	this.sIdPost = '#bx-timeline-post';
 
-	this.sIdView = '#bx-timeline';
+	this.sIdView = '#bx-timeline-';
+	this.sIdViewTimeline = '#bx-timeline-timeline';
+	this.sIdViewOutline = '#bx-timeline-outline';
 	this.sIdItem = '#bx-timeline-item-';
+	this.sIdItemTimeline = '#bx-timeline-item-timeline-';
+	this.sIdItemOutline = '#bx-timeline-item-outline-';
 
 	this.sSP = 'bx-tl';
+	this.sClassView = this.sSP + '-view';
 	this.sClassMasonry = this.sSP + '-masonry';
 	this.sClassItems = this.sSP + '-items';
 	this.sClassItem = this.sSP + '-item';
+	this.sClassDividerToday = this.sSP + '-divider-today';
 	this.sClassItemComments = this.sSP + '-item-comments-holder';
 	this.sClassItemImages = this.sSP + '-item-images';
 	this.sClassItemImage = this.sSP + '-item-image';
+
+	this.oViewTimeline = null;
+	this.bViewTimeline = false;
+
+	this.oViewOutline = null;
+	this.bViewOutline = false;
 }
 
 BxTimelineMain.prototype.isMasonry = function() {
-	return $(this.sIdView + ' .' + this.sClassItems).hasClass(this.sClassMasonry);
+	return $(this.sIdViewOutline + ' .' + this.sClassItems).hasClass(this.sClassMasonry);
 };
 
 BxTimelineMain.prototype.isMasonryEmpty = function() {
-	return $(this.sIdView + ' .' + this.sClassItems + ' .' + this.sClassItem).length == 0;
+	return $(this.sIdViewOutline + ' .' + this.sClassItems + ' .' + this.sClassItem).length == 0;
 };
 
 BxTimelineMain.prototype.initMasonry = function() {
 	var $this = this;
-	var oHolder = $(this.sIdView + ' .' + this.sClassItems);
+	var oHolder = $(this.sIdViewOutline + ' .' + this.sClassItems);
 
 	var oItems = oHolder.find('.' + this.sClassItem);
 	if(oItems.length == 0) 
@@ -40,7 +62,7 @@ BxTimelineMain.prototype.initMasonry = function() {
 };
 
 BxTimelineMain.prototype.destroyMasonry = function() {
-	$(this.sIdView + ' .' + this.sClassItems).removeClass(this.sClassMasonry).masonry('destroy');
+	$(this.sIdViewOutline + ' .' + this.sClassItems).removeClass(this.sClassMasonry).masonry('destroy');
 };
 
 BxTimelineMain.prototype.appendMasonry = function(oItems) {
@@ -52,7 +74,7 @@ BxTimelineMain.prototype.appendMasonry = function(oItems) {
 		$this.reloadMasonry();
 	});
 
-	var oHolder = $(this.sIdView + ' .' + this.sClassItems).masonry('layout').append(oItems);
+	var oHolder = $(this.sIdViewOutline + ' .' + this.sClassItems).masonry('layout').append(oItems);
 	if(!this.isMasonry())
 		this.initMasonry();
 	else
@@ -68,7 +90,7 @@ BxTimelineMain.prototype.prependMasonry = function(oItems) {
 		$this.reloadMasonry();
 	});
 
-	var oHolder = $(this.sIdView + ' .' + this.sClassItems).masonry('layout').prepend(oItems);
+	var oHolder = $(this.sIdViewOutline + ' .' + this.sClassItems).masonry('layout').prepend(oItems);
 	if(!this.isMasonry())
 		this.initMasonry();
 	else
@@ -79,7 +101,7 @@ BxTimelineMain.prototype.removeMasonry = function(oItems, onRemove) {
 	var $this = this;
 	var oItems = $(oItems);
 
-	var oHolder = $(this.sIdView + ' .' + this.sClassItems);
+	var oHolder = $(this.sIdViewOutline + ' .' + this.sClassItems);
 	if(typeof onRemove === 'function')
 		oHolder.masonry('once', 'removeComplete', onRemove);
 
@@ -87,13 +109,13 @@ BxTimelineMain.prototype.removeMasonry = function(oItems, onRemove) {
 };
 
 BxTimelineMain.prototype.reloadMasonry = function() {
-	$(this.sIdView + ' .' + this.sClassItems).masonry('reloadItems').masonry('layout');
+	$(this.sIdViewOutline + ' .' + this.sClassItems).masonry('reloadItems').masonry('layout');
 };
 
 BxTimelineMain.prototype.initFlickity = function() {
 	var $this = this;
 
-	$(this.sIdView + ' .' + this.sClassItemImages).each(function() {
+	$('.' + this.sClassView + ' .' + this.sClassItemImages).each(function() {
 		if($(this).find('.' + $this.sClassItemImage).length <= 1)
 			return;
 
@@ -106,6 +128,43 @@ BxTimelineMain.prototype.initFlickity = function() {
 	});
 };
 
+BxTimelineMain.prototype.processResult = function(oData) {
+	var $this = this;
+
+	if(oData && oData.msg != undefined && oData.msg.length != 0)
+    	alert(oData.msg);
+
+	if(oData && oData.message != undefined && oData.message.length != 0)
+    	alert(oData.message);
+
+    if(oData && oData.reload != undefined && parseInt(oData.reload) == 1)
+    	document.location = document.location;
+
+    if(oData && oData.popup != undefined) {
+    	var oPopup = null;
+    	var oOptions = {
+            fog: {
+				color: '#fff',
+				opacity: .7
+            },
+            closeOnOuterClick: false
+        };
+
+    	if(typeof(oData.popup) == 'object') {
+    		oOptions = $.extend({}, oOptions, oData.popup.options);
+    		oPopup = $(oData.popup.html);
+    	}
+    	else 
+    		oPopup = $(oData.popup);
+
+    	$('#' + oPopup.attr('id')).remove();
+        oPopup.hide().prependTo('body').bxTime().dolPopup(oOptions);
+    }
+
+    if (oData && oData.eval != undefined)
+        eval(oData.eval);
+};
+
 BxTimelineMain.prototype.loadingInButton = function(e, bShow) {
 	if($(e).length)
 		bx_loading_btn($(e), bShow);
@@ -114,7 +173,10 @@ BxTimelineMain.prototype.loadingInButton = function(e, bShow) {
 };
 
 BxTimelineMain.prototype.loadingInItem = function(e, bShow) {
-	var oParent = $(e).length ? $(e).parents('.' + this.sClassItem + ':first') : $('body'); 
+	var oParent = $('body');
+	if($(e).length)
+		oParent = !$(e).hasClass(this.sClassItem) ? $(e).parents('.' + this.sClassItem + ':first') : $(e);
+
 	bx_loading(oParent, bShow);
 };
 
@@ -133,7 +195,24 @@ BxTimelineMain.prototype._loading = function(e, bShow) {
 	bx_loading(oParent, bShow);
 };
 
-BxTimelineMain.prototype._getDefaultData = function () {
+BxTimelineMain.prototype._getView = function(oView) {
+	oView = $(oView);
+	if(!oView.hasClass(this.sClassView))
+		oView = oView.parents('.bx-db-container:first').find('.' + this.sClassView + ':first');
+
+	if(oView.hasClass(this.sClassView + '-timeline'))
+		return 'timeline';
+
+	if(oView.hasClass(this.sClassView + '-outline'))
+		return 'outline';
+
+	return '';
+};
+
+BxTimelineMain.prototype._getDefaultData = function(oElement) {
 	var oDate = new Date();
-    return jQuery.extend({}, this._oRequestParams, {_t:oDate.getTime()});
+    return jQuery.extend({}, this._oRequestParams, {
+    	view: oElement != undefined ? this._getView(oElement) : '',
+		_t:oDate.getTime()
+    });
 };

+ 52 - 15
modules/boonex/timeline/js/post.js

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
 function BxTimelinePost(oOptions) {
 	this._sActionsUri = oOptions.sActionUri;
     this._sActionsUrl = oOptions.sActionUrl;
@@ -53,7 +63,12 @@ BxTimelinePost.prototype.afterFormPostSubmit = function (oForm, oData)
         if(iId <= 0) 
         	return;
 
-        this._getPost(oForm, iId);
+        if($('#' + this._aHtmlIds['main_timeline']).length)
+        	this._getPost(oForm, iId, 'timeline');
+
+        if($('#' + this._aHtmlIds['main_outline']).length)
+        	this._getPost(oForm, iId, 'outline');
+
         this._getForm(oForm, $(oForm).find("input[name = 'type']").val());
 
         return;
@@ -177,30 +192,52 @@ BxTimelinePost.prototype._getForm = function(oElement, sType) {
 	);
 };
 
-BxTimelinePost.prototype._getPost = function(oElement, iPostId) {
+BxTimelinePost.prototype._getPost = function(oElement, iId, sView) {
     var $this = this;
     var oData = this._getDefaultData();
-    oData['id'] = iPostId;
+    oData['id'] = iId;
+    oData['view'] = sView;
 
-    var oView = $(this.sIdView);
-    this.loadingInBlock(oView, true);
+    var oElementView = $('#' + this._aHtmlIds['main_' + sView]);
+    this.loadingInBlock(oElementView, true);
 
     jQuery.post (
         this._sActionsUrl + 'get_post/',
         oData,
         function(oData) {
-        	$this.loadingInBlock(oView, false);
+        	$this.loadingInBlock(oElementView, false);
 
-        	if($.trim(oData.item).length) {
-        		if(!oView.find('.' + $this.sSP + '-load-more').is(':visible'))
-        			oView.find('.' + $this.sSP + '-load-more').show();
-
-        		if(oView.find('.' + $this.sSP + '-empty').is(':visible'))
-        			oView.find('.' + $this.sSP + '-empty').hide();
-
-        		$this.prependMasonry($(oData.item).bxTime());
-        	}
+        	$this.processResult(oData);
         },
         'json'
     );
 };
+
+BxTimelinePost.prototype._onGetPost = function(oData) {
+	if(!$.trim(oData.item).length) 
+		return;
+
+	var oView = $('#' + this._aHtmlIds['main_' + oData.view]);
+
+	var oLoadMore = oView.find('.' + this.sSP + '-load-more');
+	if(!oLoadMore.is(':visible'))
+		oLoadMore.show();
+
+	var oEmpty = oView.find('.' + this.sSP + '-empty');
+	if(oEmpty.is(':visible'))
+		oEmpty.hide();
+
+	switch(oData.view) {
+		case 'timeline':
+			var oViewTimeline = $('#' + this._aHtmlIds['main_timeline']);
+			if(!oViewTimeline.find('.' + this.sClassDividerToday).is(':visible'))
+				oViewTimeline.find('.' + this.sClassDividerToday).show();
+		
+			oViewTimeline.find('.' + this.sClassDividerToday).after($(oData.item).bxTime().hide()).next('.' + this.sClassItem + ':hidden').bx_anim('show', this._sAnimationEffect, this._iAnimationSpeed);
+			break;
+
+		case 'outline':
+			this.prependMasonry($(oData.item).bxTime());
+			break;
+	}
+};

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

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
 function BxTimelineShare(oOptions) {
 	this._sActionsUri = oOptions.sActionUri;
     this._sActionsUrl = oOptions.sActionUrl;

+ 219 - 127
modules/boonex/timeline/js/view.js

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
 function BxTimelineView(oOptions) {
 	this._sActionsUri = oOptions.sActionUri;
     this._sActionsUrl = oOptions.sActionUrl;
@@ -10,13 +20,22 @@ function BxTimelineView(oOptions) {
 
     var $this = this;
     $(document).ready(function() {
-    	$this.initMasonry();
-    	$('.bx-tl-item').resize(function() {
-    		$this.reloadMasonry();
-    	});
-    	$('img.bx-tl-item-image').load(function() {
-    		$this.reloadMasonry();
-    	});
+    	$this.oViewTimeline = $('#' + $this._aHtmlIds['main_timeline'])
+    	$this.bViewTimeline = $this.oViewTimeline.length > 0;
+
+    	$this.oViewOutline = $('#' + $this._aHtmlIds['main_outline'])
+    	$this.bViewOutline = $this.oViewOutline.length > 0;	
+
+    	if($this.bViewOutline) {
+	    	$this.initMasonry();
+
+	    	$this.oViewOutline.find('.' + $this.sClassItem).resize(function() {
+	    		$this.reloadMasonry();
+	    	});
+	    	$this.oViewOutline.find('img.' + $this.sClassItemImage).load(function() {
+	    		$this.reloadMasonry();
+	    	});
+    	}
 
     	$this.initFlickity();
     });
@@ -24,89 +43,86 @@ function BxTimelineView(oOptions) {
 
 BxTimelineView.prototype = new BxTimelineMain();
 
-BxTimelineView.prototype.changePage = function(oElement, iStart, iPerPage) {
+BxTimelineView.prototype.changePage = function(oLink, iStart, iPerPage) {
+	var $this = this;
+	var sView = this._getView(oLink);
+
+	this.loadingInButton(oLink, true);
+
 	this._oRequestParams.start = iStart;
     this._oRequestParams.per_page = iPerPage;
-
-    this._getPosts(oElement, 'page');
+    this._getPosts(oLink, function(oData) {
+    	$this.loadingInButton(oLink, false);
+
+    	var oView = null;
+    	var sItems = $.trim(oData.items);
+    	switch(sView) {
+    		case 'timeline':
+    			oView = $this.oViewTimeline;
+    			oView.find('.' + $this.sClassItems).append($(sItems).hide()).find('.' + $this.sClassItem + ':hidden').bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+					$(this).bxTime();
+			    });
+    			break;
+
+    		case 'outline':
+    			oView = $this.oViewOutline;
+    			$this.appendMasonry($(sItems).bxTime());
+    			break;
+    	
+    	}
+
+    	if(oView && oData && oData.load_more != undefined)
+    		oView.find('.' + $this.sSP + '-load-more-holder').html($.trim(oData.load_more));
+
+    	if(oView && oData && oData.back != undefined)
+    		oView.find('.' + $this.sSP + '-back-holder').html($.trim(oData.back));
+    });
 };
 
 BxTimelineView.prototype.changeFilter = function(oLink) {
     var sId = $(oLink).attr('id');
+    sId = sId.substr(sId.lastIndexOf('-') + 1, sId.length);
 
-    this._oRequestParams.start = 0;
-    this._oRequestParams.filter = sId.substr(sId.lastIndexOf('-') + 1, sId.length);
+    this.loadingInBlock(oLink, true);
 
-    this._getPosts(oLink, 'filter');
+    this._oRequestParams.start = 0;
+    this._oRequestParams.filter = sId;
+    this._getPosts(oLink);
 };
 
 BxTimelineView.prototype.changeTimeline = function(oLink, iYear) {
+	this.loadingInBlock(oLink, true);
+
 	this._oRequestParams.start = 0;
     this._oRequestParams.timeline = iYear;
-
-	this._getPosts(oLink, 'timeline');
-};
-
-BxTimelineView.prototype.pinPost = function(oLink, iId) {
-	this._pinPost(oLink, iId, 1);
-};
-
-BxTimelineView.prototype.unpinPost = function(oLink, iId) {
-	this._pinPost(oLink, iId, 0);
-};
-
-BxTimelineView.prototype.deletePost = function(oLink, iId) {
-    var $this = this;
-    var oView = $(this.sIdView);
-    var oData = this._getDefaultData();
-    oData['id'] = iId;
-
-    this.loadingInBlock(oLink, true);
-
-    $.post(
-        this._sActionsUrl + 'delete/',
-        oData,
-        function(oData) {
-        	$this.loadingInBlock(oLink, false);
-
-        	if(oData && oData.msg != undefined)
-                alert(oData.msg);
-
-            if(oData && oData.code == 0) {
-            	$(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide();
-
-                $($this.sIdItem + oData.id).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
-                    $(this).remove();
-
-                    if(oView.find('.bx-tl-item').length != 0) {
-                    	$this.reloadMasonry();
-                    	return;
-                    } 
-
-                    $this.destroyMasonry();
-                    oView.find('.bx-tl-load-more').hide();
-                    oView.find('.bx-tl-empty').show();
-                });
-            }
-        },
-        'json'
-    );
+	this._getPosts(oLink);
 };
 
 BxTimelineView.prototype.showMoreContent = function(oLink) {
+	var sView = this._getView(oLink);
+
 	$(oLink).parent('span').next('span').show().prev('span').remove();
-	this.reloadMasonry();
+
+	switch(sView) {
+		case 'timeline':
+			break;
+	
+		case 'outline':
+			this.reloadMasonry();
+			break;
+	}	
 };
 
 BxTimelineView.prototype.showPhoto = function(oLink, sUrl) {
-	$('#' + this._aHtmlIds['photo_popup']).dolPopupImage(sUrl, $(oLink).parent());
+	var sView = this._getView(oLink);
+
+	$('#' + this._aHtmlIds['photo_popup_' + sView]).dolPopupImage(sUrl, $(oLink).parent());
 };
 
 BxTimelineView.prototype.commentItem = function(oLink, sSystem, iId) {
 	var $this = this;
-
-    var oData = this._getDefaultData();
-    oData['system'] = sSystem;    
+    var oData = this._getDefaultData(oLink);
+    oData['system'] = sSystem;
     oData['id'] = iId;
 
     var oComments = $(oLink).parents('.' + this.sClassItem + ':first').find('.' + this.sClassItemComments);
@@ -134,93 +150,169 @@ BxTimelineView.prototype.commentItem = function(oLink, sSystem, iId) {
     );
 };
 
-BxTimelineView.prototype._pinPost = function(oLink, iId, iWay) {
-    var $this = this;
-    var oView = $(this.sIdView);
+BxTimelineView.prototype.pinPost = function(oLink, iId, iWay) {
+	var $this = this;
     var oData = this._getDefaultData();
     oData['id'] = iId;
 
-    this.loadingInBlock(oView, true);
+    $(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide({
+		onHide: function(oPopup) {
+			$(oPopup).remove();
+		}
+	});
+
+    if(this.bViewTimeline)
+    	this.loadingInItem($(this.sIdItemTimeline + iId), true);
+
+    if(this.bViewOutline)
+    	this.loadingInItem($(this.sIdItemOutline + iId), true);
 
     $.post(
         this._sActionsUrl + 'pin/',
         oData,
         function(oData) {
-        	$this.loadingInBlock(oView, false);
-
-        	if(oData && oData.msg != undefined)
-                alert(oData.msg);
-
-            if(oData && oData.code == 0) {
-            	$(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide({
-            		onHide: function(oPopup) {
-            			$(oPopup).remove();
-            		}
-            	});
-
-            	$this.removeMasonry(($this.sIdItem + oData.id), function() {
-            		if(iWay == 0) {
-                		$this._oRequestParams.start = 0;
-    	                $this._getPosts(oView, 'pin');
-                	}
-            		else
-            			$this.prependMasonry($(oData.content).bxTime());
-            	});
-            }
+        	$this.processResult(oData);
         },
         'json'
     );
 };
 
-BxTimelineView.prototype._getPosts = function(oElement, sAction) {
-    var $this = this;
-    var oView = $(this.sIdView);
+BxTimelineView.prototype.onPinPost = function(oData) {
+	var $this = this;
 
-	switch(sAction) {
-		case 'page':
-			this.loadingInButton(oElement, true);
-			break;
+	//--- Pin on Timeline (if available)
+	if(this.bViewTimeline) {
+		var sItemTimeline = this.sIdItemTimeline + oData.id;
 
-		default:
-			this.loadingInBlock(oElement, true);
-			break;
+		this._oRequestParams.start = 0;
+        this._getPosts(this.oViewTimeline, function(oData) {
+        	$(sItemTimeline).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+    	        $(this).remove();
+
+    	        $this.processResult(oData);
+        	});
+        });
 	}
 
-    jQuery.get(
-        this._sActionsUrl + 'get_posts/',
-        this._getDefaultData(),
+	//--- Pin on Outline (if available)
+	if(this.bViewOutline) {
+		var sItemOutline = this.sIdItemOutline + oData.id;
+
+		this._oRequestParams.start = 0;
+        this._getPosts(this.oViewOutline, function(oData) {
+        	$this.removeMasonry(sItemOutline, function() {
+        		$this.processResult(oData);
+    		});
+        });
+	}
+};
+
+BxTimelineView.prototype.deletePost = function(oLink, iId) {
+    var $this = this;
+    var oData = this._getDefaultData();
+    oData['id'] = iId;
+
+    $(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide();
+
+    if(this.bViewTimeline)
+    	this.loadingInItem($(this.sIdItemTimeline + iId), true);
+
+    if(this.bViewOutline)
+    	this.loadingInItem($(this.sIdItemOutline + iId), true);
+
+    $.post(
+        this._sActionsUrl + 'delete/',
+        oData,
         function(oData) {
-        	if(oData && oData.items != undefined) {
-        		var sItems = $.trim(oData.items);
+        	$this.processResult(oData);
+        },
+        'json'
+    );
+};
 
-	        	switch(sAction) { 
-	        		case 'page':
-	        			$this.loadingInButton(oElement, false);
-	        			$this.appendMasonry($(sItems).bxTime());
-			            break;
+BxTimelineView.prototype.onDeletePost = function(oData) {
+	var $this = this;
+
+	//--- Delete from Timeline (if available)
+	if(this.bViewTimeline) {
+		$(this.sIdItemTimeline + oData.id).bx_anim('hide', this._sAnimationEffect, this._iAnimationSpeed, function() {
+	        $(this).remove();
+
+	        if($this.oViewTimeline.find('.' + $this.sClassItem).length == 0) {
+	        	$this.oViewTimeline.find('.' + $this.sClassDividerToday).hide();
+	        	$this.oViewTimeline.find('.' + $this.sSP + '-load-more').hide();
+	        	$this.oViewTimeline.find('.' + $this.sSP + '-empty').show();
+	        }
+	    });
+	}
 
-	        		default:
-	        			$this.loadingInBlock(oElement, false);
+	//--- Delete from Outline (if available)
+	if(this.bViewOutline) {
+		$(this.sIdItemOutline + oData.id).bx_anim('hide', this._sAnimationEffect, this._iAnimationSpeed, function() {
+	        $(this).remove();
 
-	        			oView.find('.' + $this.sClassItems).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
-			                $(this).html(sItems).show().bxTime();
+	        if($this.oViewOutline.find('.' + $this.sClassItem).length == 0) {
+	        	$this.destroyMasonry();
+
+	        	$this.oViewOutline.find('.' + $this.sSP + '-load-more').hide();
+	        	$this.oViewOutline.find('.' + $this.sSP + '-empty').show();
+	        } 
+	        else
+	        	$this.reloadMasonry();
+	    });
+	}
+};
 
-			                $this.destroyMasonry();
-			                if($this.isMasonryEmpty())
-			                	return;
+BxTimelineView.prototype._getPosts = function(oElement, onComplete) {
+	var $this = this;
+	var oData = this._getDefaultData(oElement);
 
-			                $this.initMasonry();
-			            });
-		            	break;
-	            }
-        	}
+	jQuery.get(
+        this._sActionsUrl + 'get_posts/',
+        oData,
+        function(oData) {
+        	if(typeof onComplete === 'function')
+        		return onComplete(oData);
 
-        	if(oData && oData.load_more != undefined)
-        		oView.find('.' + $this.sSP + '-load-more-holder').html($.trim(oData.load_more));
+        	$this.loadingInBlock(oElement, false);
 
-        	if(oData && oData.back != undefined)
-        		oView.find('.' + $this.sSP + '-back-holder').html($.trim(oData.back));
+        	$this.processResult(oData);
         },
         'json'
     );
 };
+
+BxTimelineView.prototype._onGetPosts = function(oData) {
+	var $this = this;
+	var oView = $('#' + this._aHtmlIds['main_' + oData.view]);
+
+	if(oData && oData.items != undefined) {
+		var sItems = $.trim(oData.items);
+
+		switch(oData.view) {
+			case 'timeline':
+				oView.find('.' + this.sClassItems).bx_anim('hide', this._sAnimationEffect, this._iAnimationSpeed, function() {
+					$(this).html(sItems).show().bxTime();
+			    });
+				break;
+	
+			case 'outline':
+				oView.find('.' + this.sClassItems).bx_anim('hide', this._sAnimationEffect, this._iAnimationSpeed, function() {
+			        $(this).html(sItems).show().bxTime();
+
+			        $this.destroyMasonry();
+			        if($this.isMasonryEmpty())
+			        	return;
+
+			        $this.initMasonry();
+			    });
+				break;
+		}
+	}
+
+	if(oData && oData.load_more != undefined)
+		oView.find('.' + this.sSP + '-load-more-holder').html($.trim(oData.load_more));
+
+	if(oData && oData.back != undefined)
+		oView.find('.' + this.sSP + '-back-holder').html($.trim(oData.back));
+};

+ 4 - 10
modules/boonex/timeline/template/block_view.html

@@ -1,14 +1,8 @@
-<div id="__html_id__" class="__style_prefix__-view bx-def-bc-margin">
+<div id="__html_id__" class="__style_prefix__-view __style_prefix__-view-__view__ bx-def-bc-margin">
 	<div class="__style_prefix__-cnt">
-        <div class="__style_prefix__-back-holder">
-            __back__
-        </div>
-		<div class="__style_prefix__-items bx-def-margin-sec-leftright-neg">
-			__content__
-		</div>
-		<div class="__style_prefix__-load-more-holder">
-			__load_more__
-		</div>
+        <div class="__style_prefix__-back-holder">__back__</div>
+		<div class="__style_prefix__-items bx-def-margin-sec-leftright-neg">__content__</div>
+		<div class="__style_prefix__-load-more-holder">__load_more__</div>
 	</div>
 	__view_image_popup__
     __js_content__

+ 107 - 24
modules/boonex/timeline/template/css/view.css

@@ -20,7 +20,9 @@ div.bx-tl-view {
 
 
 /*--- Load More Style ---*/
-div.bx-tl-load-more {}
+div.bx-tl-view-timeline div.bx-tl-load-more {
+	padding-top: 0px;
+}
 
 div.bx-tl-jump-to {
 	position: relative;
@@ -29,65 +31,146 @@ div.bx-tl-jump-to {
 	line-height: 2.25rem;
 }
 
+/*--- Divider Styles ---*/
+div.bx-tl-divider {
+    position: relative;
+    padding-bottom: 10px;
+    font-size: 11px;
+}
+
+div.bx-tl-divider-cnt {
+    position: relative;
+    box-sizing: border-box;
+
+    width: 100%;
+    padding-top: 2px;
+    padding-bottom: 2px;
+
+    border: 2px solid #cccccc;
+    border-radius: 20px;
+    -moz-border-radius: 20px;
+    -webkit-border-radius: 20px;
+    background-color: #ffffff;
+    
+    text-align: center;
+    text-transform: uppercase;
+    font-weight: bold;
+    color: #999999;
+}
+
+/*--- Timeline Item Style ---*/
+div.bx-tl-view-timeline div.bx-tl-items {
+	margin-left: 0px;
+	margin-right: 0px;
+}
+div.bx-tl-view-timeline div.bx-tl-divider:before,
+div.bx-tl-view-timeline div.bx-tl-divider-today:before,
+div.bx-tl-view-timeline div.bx-tl-item:before {
+    content: '';
+    position: absolute;
+    top: 0px;
+    left: 24px;
+	left: 1.5rem;
+    width: 2px;
+    height: 100%;
+
+    background: #cccccc;
+}
+div.bx-tl-view-timeline div.bx-tl-item {
+    position: relative;
+}
+div.bx-tl-view-timeline div.bx-tl-item-cnt {
+    position: relative;
+
+	margin: 0px 0px 0px 85px;
+}
+div.bx-tl-view-timeline div.bx-tl-item-owner {
+	position: absolute;
+    top: 0px;
+    left: 0px;
+}
+div.bx-tl-view-timeline div.bx-tl-item-circle {
+    position: absolute;
+
+    right: 10px;
 
-/*--- Item Style ---*/
-div.bx-tl-item {
+    text-align: center;
+    color: #999999;
+    opacity: 0.2;
+}
+div.bx-tl-view-timeline div.bx-tl-item-circle .sys-icon {
+    font-size: 32px;
+	font-size: 2rem;
+    text-align: center;
+}
+
+
+
+/*--- Outline Item Style ---*/
+div.bx-tl-view-outline div.bx-tl-item {
 	position: relative;
 }
-div.bx-tl-item-ind {
+div.bx-tl-view-outline div.bx-tl-item-ind {
 	position: relative;
 }
-div.bx-tl-item-cnt {
+div.bx-tl-view-outline div.bx-tl-item-cnt {
 	position: relative;
 	overflow: hidden;
 }
 
 /*+++ Item Owner +++*/
-div.bx-tl-item-owner {
+div.bx-tl-view-outline div.bx-tl-item-owner {
 	position: relative;
 }
-div.bx-tl-owner-avatar {
+div.bx-tl-view-outline div.bx-tl-owner-avatar {
 	position: absolute;
 	top: 0px;
 	left: 0px;
 }
-div.bx-tl-owner-info {
+div.bx-tl-view-outline div.bx-tl-owner-info {
 	white-space: nowrap;
 }
-div.bx-tl-owner-name,
-div.bx-tl-item-info {
+div.bx-tl-view-outline div.bx-tl-owner-name,
+div.bx-tl-view-outline div.bx-tl-item-info {
 	text-overflow: ellipsis;
 	overflow: hidden;
 }
-div.bx-tl-item-info .bx-tl-date,
-div.bx-tl-item-info .bx-tl-pinned .sys-icon {
+div.bx-tl-view-outline div.bx-tl-item-info .bx-tl-date,
+div.bx-tl-view-outline div.bx-tl-item-info .bx-tl-pinned .sys-icon {
 	color: rgba(40, 60, 80, 0.5);
 }
-div.bx-tl-item-info .bx-tl-pinned .sys-icon {
+div.bx-tl-view-outline div.bx-tl-item-info .bx-tl-pinned .sys-icon {
 	cursor: default;
 }
 
 /*+++ Item Text +++*/
-div.bx-tl-item-text div.bx-tl-title {
+div.bx-tl-view-outline div.bx-tl-item-text div.bx-tl-title {
 	font-weight: bold;
 }
-span.bx-tl-content-see-more a {
+div.bx-tl-view-outline span.bx-tl-content-see-more a {
 	font-weight: bold;
 }
 
 /*+++ Item Image +++*/
-div.bx-tl-item-images {
+div.bx-tl-view-timeline div.bx-tl-item-images,
+div.bx-tl-view-outline div.bx-tl-item-images {
 	position: relative;
 	white-space: nowrap;
 	overflow: hidden;
 }
-div.bx-tl-item-image {
+div.bx-tl-view-timeline div.bx-tl-item-images {
+	margin-left: 0px;
+	margin-right: 0px;
+}
+div.bx-tl-view-timeline div.bx-tl-item-image,
+div.bx-tl-view-outline div.bx-tl-item-image {
 	display: inline-block;
 	width: 100%;
 	text-align: center;
 	overflow: hidden;
 }
-div.bx-tl-item-image img {
+div.bx-tl-view-timeline div.bx-tl-item-image img,
+div.bx-tl-view-outline div.bx-tl-item-image img {
 	max-width: 100%;
 	min-height: 12.5rem;
 	max-height: 18.4375rem;
@@ -96,10 +179,10 @@ div.bx-tl-item-image img {
 }
 
 /*+++ Item Link +++*/
-div.bx-tl-item-link {
+div.bx-tl-view-outline div.bx-tl-item-link {
 	text-align: center;
 }
-div.bx-tl-il-thumbnail img {
+div.bx-tl-view-outline div.bx-tl-il-thumbnail img {
 	width: 100%;
 	max-width: 100px;
 	height: 100%;
@@ -107,20 +190,20 @@ div.bx-tl-il-thumbnail img {
 }
 
 /*+++ Item Shared +++*/
-div.bx-tl-shared div.bx-tl-item-text {
+div.bx-tl-view-outline div.bx-tl-shared div.bx-tl-item-text {
 	padding-left: 5px;
 	padding-left: 0.3rem;
 
 	border-left: 1px solid #999999;
 	border-left: 0.07rem solid #999999;
 }
-div.bx-tl-shared div.bx-tl-title {
+div.bx-tl-view-outline div.bx-tl-shared div.bx-tl-title {
 	font-size: 1.0rem;
 }
-div.bx-tl-shared div.bx-tl-title a {
+div.bx-tl-view-outline div.bx-tl-shared div.bx-tl-title a {
 	color: #999999;
 }
-div.bx-tl-shared div.bx-tl-content {
+div.bx-tl-view-outline div.bx-tl-shared div.bx-tl-content {
 	font-size: 0.875rem;
 	color: #999999;
 }

+ 3 - 0
modules/boonex/timeline/template/divider.html

@@ -0,0 +1,3 @@
+<div class="__style_prefix__-divider __style_prefix__-divider-__type__" <bx_if:show_hidden>style="display:none"</bx_if:show_hidden>>
+    <div class="__style_prefix__-divider-cnt bx-def-font-small">__content__</div>
+</div>

+ 7 - 7
modules/boonex/timeline/template/item.html → modules/boonex/timeline/template/item_outline.html

@@ -4,12 +4,12 @@
 	    	<div class="__style_prefix__-item-owner bx-def-margin-bottom"> 
 		       	<div class="__style_prefix__-owner-avatar bx-def-thumb bx-def-thumb-size">
                     <a href="__item_owner_url__" class="__style_prefix__-owner-avatar" title="__item_owner_title__">
-						<bx_if:show_icon>
-							<img class="bx-def-thumb bx-def-thumb-size" src="__author_icon__" />
-						</bx_if:show_icon>
-						<bx_if:show_icon_empty>
+						<bx_if:show_owner_icon>
+							<img class="bx-def-thumb bx-def-thumb-size" src="__owner_icon__" />
+						</bx_if:show_owner_icon>
+						<bx_if:show_owner_icon_empty>
 							<i class="sys-icon user"></i>
-						</bx_if:show_icon_empty>
+						</bx_if:show_owner_icon_empty>
                     </a>
 				</div>
 				<div class="__style_prefix__-owner-info bx-def-thumb-size-min-height bx-def-thumb-size-left-indent">
@@ -32,10 +32,10 @@
 			</div>
 			__content__
 			<bx_if:show_location>
-				<div class="__style_prefix__-location bx-def-margin-top bx-def-font-grayed bx-clearfix">__location__</div>
+				<div class="__style_prefix__-item-location bx-def-margin-top bx-def-font-grayed bx-clearfix">__location__</div>
 			</bx_if:show_location>
 			<bx_if:show_menu_item_actions>
-				<div class="__style_prefix__-activity bx-def-margin-top bx-clearfix">__menu_item_actions__</div>
+				<div class="__style_prefix__-item-activity bx-def-margin-top bx-clearfix">__menu_item_actions__</div>
 			</bx_if:show_menu_item_actions>
 			<div class="__style_prefix__-item-comments-holder">__comments__</div>
 		</div>

+ 42 - 0
modules/boonex/timeline/template/item_timeline.html

@@ -0,0 +1,42 @@
+<div id="__html_id__" class="__style_prefix__-item __class__ bx-def-thumb-size-min-height bx-def-padding-bottom">
+    <a name="timeline-event-__id__"></a>
+    <div class="__style_prefix__-item-owner">
+		<div class="__style_prefix__-owner-avatar bx-def-thumb bx-def-thumb-size">
+		    <a href="__item_owner_url__" class="__style_prefix__-owner-avatar" title="__item_owner_title__">
+		        <bx_if:show_owner_icon>
+		            <img class="bx-def-thumb bx-def-thumb-size" src="__owner_icon__" />
+		        </bx_if:show_owner_icon>
+		        <bx_if:show_owner_icon_empty>
+		            <i class="sys-icon user"></i>
+		        </bx_if:show_owner_icon_empty>
+		    </a>
+		</div>
+    </div>
+    <div class="__style_prefix__-item-cnt __class_content__ bx-def-padding-sec-topbottom bx-def-border bx-def-round-corners">
+        <bx_if:show_item_icon>
+            <div class="__style_prefix__-item-circle"><i class="sys-icon __item_icon__"></i></div>
+        </bx_if:show_item_icon>
+		<div class="__style_prefix__-owner-name bx-def-padding-leftright">
+		    <a href="__item_owner_url__" class="__style_prefix__-owner-name" title="__item_owner_title__">__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>
+		    <span>&#183;</span>
+		    <a class="__style_prefix__-date" href="__item_view_url__">__item_date__</a>
+			<bx_if:show_pinned>
+			    <span class="__style_prefix__-pinned">
+			        <i class="sys-icon thumb-tack bx-def-margin-thd-left" title="<bx_text_attribute:_bx_timeline_txt_pinned />"></i>
+			    </span>
+			</bx_if:show_pinned>
+		</div>
+		<div class="__style_prefix__-item-content bx-def-padding-leftright bx-def-margin-top bx-clearfix">__content__</div>
+		<bx_if:show_location>
+		    <div class="__style_prefix__-item-location bx-def-padding-leftright bx-def-margin-top bx-def-font-grayed bx-clearfix">__location__</div>
+		</bx_if:show_location>
+		<bx_if:show_menu_item_actions>
+		    <div class="__style_prefix__-item-activity bx-def-padding-leftright bx-def-margin-top bx-clearfix">__menu_item_actions__</div>
+		</bx_if:show_menu_item_actions>
+		<div class="__style_prefix__-item-comments-holder bx-def-padding-leftright">__comments__</div>
+    </div>
+</div>