AntonLV 8 лет назад
Родитель
Сommit
ae8fb57938

+ 6 - 0
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -23,8 +23,13 @@
 	<string name="_bx_timeline_form_post"><![CDATA[Сообщение]]></string>
 	<string name="_bx_timeline_form_post_display_add"><![CDATA[Написать сообщение]]></string>
 	<string name="_bx_timeline_form_post_display_add_public"><![CDATA[Написать публичное сообщение]]></string>
+	<string name="_bx_timeline_form_post_display_add_profile"><![CDATA[Написать сообщение в профиль]]></string>
 	<string name="_bx_timeline_form_post_display_edit"><![CDATA[Изменить сообщение]]></string>
 	<string name="_bx_timeline_form_post_input_sys_owner_id"><![CDATA[ID владельца]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id"><![CDATA[Контекст]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id_err"><![CDATA[Поле Контекст является обязательным. Пожалуйста, выберите значение.]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id_own"><![CDATA[Собственный профиль]]></string>
+    <string name="_bx_timeline_form_post_input_owner_id_following_group"><![CDATA[Отслеживаемые {0}]]></string>
 	<string name="_bx_timeline_form_post_input_sys_action"><![CDATA[Действие]]></string>
 	<string name="_bx_timeline_form_post_input_sys_type"><![CDATA[Тип]]></string>
 	<string name="_bx_timeline_form_post_input_sys_text"><![CDATA[Содержимое]]></string>
@@ -170,6 +175,7 @@
 
 	<string name="_bx_timeline_txt_msg_no_results"><![CDATA[Пусто]]></string>
 	<string name="_bx_timeline_txt_msg_performed_action"><![CDATA[Действие было успешно выполнено.]]></string>
+	<string name="_bx_timeline_txt_msg_posted"><![CDATA[Успешно опубликовано.]]></string>
 	<string name="_bx_timeline_txt_err_cannot_perform_action"><![CDATA[Невозможно выполнить действие. Пожалуйста, оповестите нас об этой проблеме.]]></string>
 	<string name="_bx_timeline_txt_err_empty_post"><![CDATA[Сообщение пусто.]]></string>
 

+ 1 - 0
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -116,6 +116,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         	'form_attach_link' => $this->_sName . '_attach_link',
         	'form_display_post_add' => $this->_sName . '_post_add',
         	'form_display_post_add_public' => $this->_sName . '_post_add_public',
+        	'form_display_post_add_profile' => $this->_sName . '_post_add_profile',
             'form_display_post_edit' => $this->_sName . '_post_edit',
         	'form_display_attach_link_add' => $this->_sName . '_attach_link_add'
         ));

+ 8 - 3
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -454,7 +454,8 @@ class BxTimelineDb extends BxBaseModNotificationsDb
 				$sJoinClause .= " " . $aJoin1['type'] . " JOIN `" . $aJoin1['table'] . "` AS `" . $aJoin1['table_alias'] . "` ON ((" . $aJoin1['condition'] . ") OR (SUBSTRING(`" . $this->_sTable . "`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "' AND " . $aJoin2['condition'] . "))";
 
 				//--- Exclude Own (Direct) posts on timelines of following members.
-                $sWhereSubclause = $this->prepareAsString("IF(SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "', `{$this->_sTable}`.`object_id` <> ?, 1)", $aParams['owner_id']);
+				//--- Note. Disabled for now.
+                //$sWhereSubclause = $this->prepareAsString("IF(SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "', `{$this->_sTable}`.`object_id` <> ?, 1)", $aParams['owner_id']);
 
                 //--- Select Promoted posts.
 		        $sWhereSubclause .= " OR `{$this->_sTable}`.`promoted` <> '0'";
@@ -482,8 +483,12 @@ class BxTimelineDb extends BxBaseModNotificationsDb
 				//--- Select Own Public (Direct) posts from Home Page Timeline (Public Feed).
 				$sWhereSubclause .= $this->prepareAsString(" OR (`{$this->_sTable}`.`owner_id` = '0' AND IF(SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "', `{$this->_sTable}`.`object_id` = ?, 1))", $aParams['owner_id']);
 
-				//--- Exclude Own (Direct) posts on timelines of following members. 
-				$sWhereSubclause .= $this->prepareAsString(" OR (NOT ISNULL(`c`.`content`) AND IF(SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "', `{$this->_sTable}`.`object_id` <> ?, 1))", $aParams['owner_id']);
+				//--- Exclude Own (Direct) posts on timelines of following members.
+				//--- Note. Disabled for now and next check is used instead. 
+				//$sWhereSubclause .= $this->prepareAsString(" OR (NOT ISNULL(`c`.`content`) AND IF(SUBSTRING(`{$this->_sTable}`.`type`, 1, " . strlen($sCommonPostPrefix) . ") = '" . $sCommonPostPrefix . "', `{$this->_sTable}`.`object_id` <> ?, 1))", $aParams['owner_id']);
+
+				//--- All posts on timelines of following members.
+                $sWhereSubclause .= " OR NOT ISNULL(`c`.`content`)";				
 
 				//--- Select Promoted posts.
 		        $sWhereSubclause .= " OR `{$this->_sTable}`.`promoted` <> '0'";

+ 34 - 2
modules/boonex/timeline/classes/BxTimelineFormPost.php

@@ -15,6 +15,7 @@
 class BxTimelineFormPost extends BxBaseModGeneralFormEntry
 {
     protected $_bPublicMode;
+    protected $_bProfileMode;
 
     public function __construct($aInfo, $oTemplate = false)
     {
@@ -26,9 +27,40 @@ class BxTimelineFormPost extends BxBaseModGeneralFormEntry
         $iOwnerId = $this->_oModule->getOwnerId();
 
         $this->_bPublicMode = isset($this->aParams['display']) && $this->aParams['display'] == $this->_oModule->_oConfig->getObject('form_display_post_add_public');
+        $this->_bProfileMode = isset($this->aParams['display']) && $this->aParams['display'] == $this->_oModule->_oConfig->getObject('form_display_post_add_profile');
 
 		$this->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'post/';
-        $this->aInputs['owner_id']['value'] = $iOwnerId;
+        
+		$this->aInputs['owner_id']['value'] = $iOwnerId;
+        if(!$this->_bPublicMode && !$this->_bProfileMode) {
+            $this->aInputs['owner_id']['values'] = array(
+                array ('key' => $iUserId, 'value' => _t('_bx_timeline_form_post_input_owner_id_own')),
+            );
+            
+            $oProfileQuery = BxDolProfileQuery::getInstance();
+
+            $sConnections = $this->_oModule->_oConfig->getObject('conn_subscriptions');
+            $aConnections = BxDolConnection::getObjectInstance($sConnections)->getConnectedContent($iUserId);
+
+            $aCnnGroups = array();
+            foreach($aConnections as $iId) {
+                $aProfileInfo = $oProfileQuery->getInfoById($iId);
+                if(empty($aProfileInfo) || !is_array($aProfileInfo))
+                    continue;
+
+                $aCnnGroups[$aProfileInfo['type']][] = $aProfileInfo['id'];
+            }
+
+            $oProfile = BxDolProfile::getInstance();
+            foreach($aCnnGroups as $sCnnGroup => $aCnnGroup) {
+                $this->aInputs['owner_id']['values'][] = array('type' => 'group_header', 'value' => _t('_bx_timeline_form_post_input_owner_id_following_group', _t('_' . $sCnnGroup)));
+                foreach($aCnnGroup as $iId)
+                    $this->aInputs['owner_id']['values'][] = array('key' => $iId, 'value' => $oProfile->getDisplayName($iId));
+                $this->aInputs['owner_id']['values'][] = array('type' => 'group_end');
+            }
+        }
+        else
+            $this->aInputs['owner_id']['type'] = 'hidden';
 
         if(isset($this->aInputs['text'])) {
             if(empty($this->aInputs['text']['attrs']) || !is_array($this->aInputs['text']['attrs']))
@@ -42,7 +74,7 @@ class BxTimelineFormPost extends BxBaseModGeneralFormEntry
                 'title' => _t('_bx_timeline_form_post_input_object_privacy_view')
             )));
 
-            if($this->_bPublicMode || ($iOwnerId != 0 && $iOwnerId != $iUserId))
+            if($this->_bPublicMode || ($this->_bProfileMode && $iOwnerId != $iUserId))
                 foreach($this->aInputs['object_privacy_view']['values'] as $iKey => $aValue)
                     if($aValue['key'] !== BX_DOL_PG_ALL)
                         unset($this->aInputs['object_privacy_view']['values'][$iKey]);

+ 23 - 4
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -232,18 +232,28 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             $sJsObject = $this->_oConfig->getJsObject('post');
 
         $sView = bx_process_input(bx_get('view'));
+        $sType = bx_process_input(bx_get('type'));
         $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
 
+        $bAfpsLoading = (int)bx_get('afps_loading') === 1;
+
         $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iId));
         if(empty($aEvent) || !is_array($aEvent))
             return echoJson(array());
 
+        /**
+         * Note. Disabled for now, because Own posts on Timelines of Following members 
+         * became visible on posts' author Dashboard Timeline.
+         */
+        //if($bAfpsLoading && $this->_iOwnerId != $aEvent['owner_id'])
+        //    return echoJson(array('message' => _t('_bx_timeline_txt_msg_posted')));
+            
         echoJson(array(
             'id' => $aEvent['id'],
             'view' => $sView,
         	'item' => $this->_oTemplate->getPost($aEvent, array(
         		'view' => $sView, 
-        		'type' => 'owner', 
+        		'type' => !empty($sType) ? $sType : BX_TIMELINE_TYPE_DEFAULT,
         		'owner_id' => $this->_iOwnerId, 
         		'dynamic_mode' => true
             )),
@@ -607,7 +617,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         if(!$iProfileId)
             return array();
 
-        return $this->_getBlockPost($iProfileId);
+        return $this->_getBlockPost($iProfileId, array(
+        	'form_display' => 'form_display_post_add_profile'
+        ));
     }
 
     /**
@@ -641,7 +653,10 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 		if(empty($oProfile))
 			return array();
 
-		return $this->_getBlockPost($oProfile->id());
+		return $this->_getBlockPost($oProfile->id(), array(
+		    'type' => BX_BASE_MOD_NTFS_TYPE_OWNER,
+			'form_display' => 'form_display_post_add_profile'
+		));
     }
 
     /**
@@ -665,6 +680,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
     {
         $iProfileId = 0;
         return $this->_getBlockPost($iProfileId, array(
+        	'type' => BX_BASE_MOD_NTFS_TYPE_PUBLIC,
             'form_display' => 'form_display_post_add_public'
         ));
     }
@@ -692,7 +708,10 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             return '';
 
         $iProfileId = $this->getProfileId();
-		return $this->_getBlockPost($iProfileId);
+		return $this->_getBlockPost($iProfileId, array(
+		    'type' => BX_TIMELINE_TYPE_OWNER_AND_CONNECTIONS,
+			'form_display' => 'form_display_post_add'
+		));
     }
 
     /**

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

@@ -68,7 +68,10 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'js_object' => $this->_oConfig->getJsObject('post'),
             'js_content' => $this->getJsCode('post', array(
         		'sVideosAutoplay' => $this->_oConfig->getVideosAutoplay(),
-            	'oRequestParams' => array('owner_id' => $iOwnerId)
+            	'oRequestParams' => array(
+            		'type' => isset($aParams['type']) ? $aParams['type'] : BX_TIMELINE_TYPE_DEFAULT, 
+            		'owner_id' => $iOwnerId
+                )
         	)),
             'form' => $aForm['form']
         ));

+ 6 - 0
modules/boonex/timeline/install/langs/en.xml

@@ -23,8 +23,13 @@
 	<string name="_bx_timeline_form_post"><![CDATA[Post]]></string>
 	<string name="_bx_timeline_form_post_display_add"><![CDATA[Write Post]]></string>
 	<string name="_bx_timeline_form_post_display_add_public"><![CDATA[Write Public Post]]></string>
+	<string name="_bx_timeline_form_post_display_add_profile"><![CDATA[Write Profile Post]]></string>
 	<string name="_bx_timeline_form_post_display_edit"><![CDATA[Edit Post]]></string>
 	<string name="_bx_timeline_form_post_input_sys_owner_id"><![CDATA[Owner ID]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id"><![CDATA[Context]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id_err"><![CDATA[The Context field is essential. Please select some value.]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id_own"><![CDATA[Your profile]]></string>
+	<string name="_bx_timeline_form_post_input_owner_id_following_group"><![CDATA[Following {0}]]></string>
 	<string name="_bx_timeline_form_post_input_sys_action"><![CDATA[Action]]></string>
 	<string name="_bx_timeline_form_post_input_sys_type"><![CDATA[Type]]></string>
 	<string name="_bx_timeline_form_post_input_sys_text"><![CDATA[Content]]></string>
@@ -170,6 +175,7 @@
 
 	<string name="_bx_timeline_txt_msg_no_results"><![CDATA[Empty]]></string>
 	<string name="_bx_timeline_txt_msg_performed_action"><![CDATA[The action was successfully performed.]]></string>
+	<string name="_bx_timeline_txt_msg_posted"><![CDATA[Posted successfully.]]></string>
 	<string name="_bx_timeline_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
 	<string name="_bx_timeline_txt_err_empty_post"><![CDATA[The post is empty.]]></string>
 

+ 18 - 4
modules/boonex/timeline/install/sql/install.sql

@@ -292,13 +292,14 @@ INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_att
 INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
 ('bx_timeline_post_add', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add', 0),
 ('bx_timeline_post_add_public', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_public', 0),
+('bx_timeline_post_add_profile', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_profile', 0),
 
 ('bx_timeline_post_edit', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_edit', 0);
--- TODO: Continue from here. Check Pass type for the 'published' field.
+
 INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
 ('bx_timeline_post', @sName, 'type', 'post', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
 ('bx_timeline_post', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
-('bx_timeline_post', @sName, 'owner_id', '0', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_timeline_post', @sName, 'owner_id', '0', '', 0, 'select', '_bx_timeline_form_post_input_sys_owner_id', '_bx_timeline_form_post_input_owner_id', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
 ('bx_timeline_post', @sName, 'text', '', '', 0, 'textarea', '_bx_timeline_form_post_input_sys_text', '_bx_timeline_form_post_input_text', '', 0, 0, 3, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
 ('bx_timeline_post', @sName, 'date', '', '', 0, 'datetime', '_bx_timeline_form_post_input_sys_date', '_bx_timeline_form_post_input_date', '_bx_timeline_form_post_input_date_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
 ('bx_timeline_post', @sName, 'object_privacy_view', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_object_privacy_view', '_bx_timeline_form_post_input_object_privacy_view', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
@@ -314,8 +315,8 @@ INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `c
 INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
 ('bx_timeline_post_add', 'type', 2147483647, 1, 1),
 ('bx_timeline_post_add', 'action', 2147483647, 1, 2),
-('bx_timeline_post_add', 'owner_id', 2147483647, 1, 3),
-('bx_timeline_post_add', 'text', 2147483647, 1, 4),
+('bx_timeline_post_add', 'text', 2147483647, 1, 3),
+('bx_timeline_post_add', 'owner_id', 2147483647, 1, 4),
 ('bx_timeline_post_add', 'object_privacy_view', 2147483647, 1, 5),
 ('bx_timeline_post_add', 'date', 192, 1, 6),
 ('bx_timeline_post_add', 'location', 2147483647, 1, 7),
@@ -338,6 +339,19 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('bx_timeline_post_add_public', 'attachments', 2147483647, 1, 11),
 ('bx_timeline_post_add_public', 'do_submit', 2147483647, 1, 12),
 
+('bx_timeline_post_add_profile', 'type', 2147483647, 1, 1),
+('bx_timeline_post_add_profile', 'action', 2147483647, 1, 2),
+('bx_timeline_post_add_profile', 'owner_id', 2147483647, 1, 3),
+('bx_timeline_post_add_profile', 'text', 2147483647, 1, 4),
+('bx_timeline_post_add_profile', 'object_privacy_view', 2147483647, 1, 5),
+('bx_timeline_post_add_profile', 'date', 192, 1, 6),
+('bx_timeline_post_add_profile', 'location', 2147483647, 1, 7),
+('bx_timeline_post_add_profile', 'link', 2147483647, 1, 8),
+('bx_timeline_post_add_profile', 'photo', 2147483647, 1, 9),
+('bx_timeline_post_add_profile', 'video', 2147483647, 1, 10),
+('bx_timeline_post_add_profile', 'attachments', 2147483647, 1, 11),
+('bx_timeline_post_add_profile', 'do_submit', 2147483647, 1, 12),
+
 ('bx_timeline_post_edit', 'type', 2147483647, 1, 1),
 ('bx_timeline_post_edit', 'action', 2147483647, 1, 2),
 ('bx_timeline_post_edit', 'owner_id', 2147483647, 1, 3),

+ 3 - 1
modules/boonex/timeline/js/main.js

@@ -237,12 +237,14 @@ BxTimelineMain.prototype._getDefaultData = function(oElement) {
 };
 
 
-BxTimelineMain.prototype._getPost = function(oElement, iId, sView) {
+BxTimelineMain.prototype._getPost = function(oElement, iId, sView, aParams) {
     var $this = this;
     var oData = this._getDefaultData();
     oData['js_object'] = this._sObjName;
     oData['view'] = sView;
     oData['id'] = iId;
+    if(aParams != undefined)
+    	oData = jQuery.extend({}, oData, aParams);
 
     var oElementView = $('#' + this._aHtmlIds['main_' + sView]);
     this.loadingInBlock(oElementView, true);

+ 48 - 39
modules/boonex/timeline/js/post.js

@@ -114,10 +114,10 @@ BxTimelinePost.prototype.afterFormPostSubmit = function (oForm, oData)
 	        	return;
 
 	        if($('#' + $this._aHtmlIds['main_timeline']).length)
-	        	$this._getPost(oForm, iId, 'timeline');
+	        	$this._getPost(oForm, iId, 'timeline', {afps_loading: 1});
 
 	        if($('#' + $this._aHtmlIds['main_outline']).length)
-	        	$this._getPost(oForm, iId, 'outline');
+	        	$this._getPost(oForm, iId, 'outline', {afps_loading: 1});
 
 	        $this._getForm(oForm);
 
@@ -292,54 +292,63 @@ BxTimelinePost.prototype._getForm = function(oElement) {
 };
 
 BxTimelinePost.prototype._onGetPost = function(oData) {
-	if(!$.trim(oData.item).length) 
-		return;
-
 	var $this = this;
-	var oView = $('#' + this._aHtmlIds['main_' + oData.view]);
+	var fContinue = 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 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();
+		var oEmpty = oView.find('.' + $this.sSP + '-empty');
+		if(oEmpty.is(':visible'))
+			oEmpty.hide();
 
-	var oContent = $(oData.item).bxTime();
-	switch(oData.view) {
-		case 'timeline':
-			var oTimeline = $('#' + this._aHtmlIds['main_timeline']);
-			var oItems = oTimeline.find('.' + this.sClassItems);
-			var oDivider  = oItems.find('.' + this.sClassDividerToday);
-			var bDivider = oDivider.length > 0;
+		var oContent = $(oData.item).bxTime();
+		switch(oData.view) {
+			case 'timeline':
+				var oTimeline = $('#' + $this._aHtmlIds['main_timeline']);
+				var oItems = oTimeline.find('.' + $this.sClassItems);
+				var oDivider  = oItems.find('.' + $this.sClassDividerToday);
+				var bDivider = oDivider.length > 0;
 
-			if(bDivider && !oDivider.is(':visible'))
-				oDivider.show();
+				if(bDivider && !oDivider.is(':visible'))
+					oDivider.show();
 
-			oContent.hide();
+				oContent.hide();
 
-			var oItem = bDivider ? oDivider.after(oContent).next('.' + this.sClassItem + ':hidden') : oContent.prependTo(oItems);
-			oItem.bx_anim('show', this._sAnimationEffect, this._iAnimationSpeed, function() {
-				$(this).find('.bx-tl-item-text .bx-tl-content').checkOverflowHeight($this.sSP + '-overflow', function(oElement) {
-					$this.onFindOverflow(oElement);
+				var oItem = bDivider ? oDivider.after(oContent).next('.' + $this.sClassItem + ':hidden') : oContent.prependTo(oItems);
+				oItem.bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+					$(this).find('.bx-tl-item-text .bx-tl-content').checkOverflowHeight($this.sSP + '-overflow', function(oElement) {
+						$this.onFindOverflow(oElement);
+					});
+
+					$this.initFlickity();
 				});
 
-				$this.initFlickity();
-			});
+				if($this._sVideosAutoplay != 'off')
+					$this.initVideos(oTimeline);
+				break;
 
-			if(this._sVideosAutoplay != 'off')
-				this.initVideos(oTimeline);
-			break;
+			case 'outline':
+				$this.prependMasonry(oContent, function(oItems) {
+					$(oItems).find('.bx-tl-item-text .bx-tl-content').checkOverflowHeight($this.sSP + '-overflow', function(oElement) {
+						$this.onFindOverflow(oElement);
+					});
 
-		case 'outline':
-			this.prependMasonry(oContent, function(oItems) {
-				$(oItems).find('.bx-tl-item-text .bx-tl-content').checkOverflowHeight($this.sSP + '-overflow', function(oElement) {
-					$this.onFindOverflow(oElement);
+					$this.initFlickity();
 				});
+				break;
+		}
+	};
 
-				$this.initFlickity();
-			});
-			break;
-	}
+	if(oData && oData.message != undefined && oData.message.length != 0)
+		bx_alert(oData.message, function() {
+			fContinue(oData);
+		});
+	else
+		fContinue(oData);	
 };