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

#24 - Timeline.
1. RSS in view block.
2. Separate View Timeline page.

AntonLV 13 лет назад
Родитель
Сommit
3807ca6754

+ 2 - 2
inc/classes/BxDolRssFactory.php

@@ -28,8 +28,8 @@ class BxDolRssFactory extends BxDol {
     function GenRssByData($aRssData, $sUnitTitleC, $sMainLink) {
 
         return $this->GenRssByCustomData($aRssData, $sUnitTitleC, $sMainLink, array(
+        	'Guid' => 'UnitID',
             'Link' => 'UnitLink',
-            'Guid' => 'UnitID',
             'Title' => 'UnitTitle',
             'DateTimeUTS' => 'UnitDateTimeUTS',
             'Desc' => 'UnitDesc',
@@ -93,7 +93,7 @@ class BxDolRssFactory extends BxDol {
             $sRSSImage = "<image><url>{$sImage}</url><title>{$sRSSTitle}</title><link>{$sMainLink}</link></image>";
         }
 
-        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\"><channel><title>{$sRSSTitle}</title><link>{$sMainLink}</link><description>{$sRSSTitle}</description><lastBuildDate>{$sRSSLast}</lastBuildDate>{$sRSSImage}{$sUnitRSSFeed}</channel></rss>";
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\"><channel><title>{$sRSSTitle}</title><link><![CDATA[{$sMainLink}]]></link><description>{$sRSSTitle}</description><lastBuildDate>{$sRSSLast}</lastBuildDate>{$sRSSImage}{$sUnitRSSFeed}</channel></rss>";
     }
 
 }

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

@@ -290,6 +290,12 @@ class BxTimelineConfig extends BxDolModuleConfig
     /**
      * Ancillary functions
      */
+	public function getViewUrl($iOwnerId)
+    {
+    	bx_import('BxDolPermalinks');
+		return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=timeline-view&id=' . $iOwnerId);
+    }
+
     public function getItemViewUrl(&$aEvent)
     {
     	bx_import('BxDolPermalinks');

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

@@ -200,12 +200,6 @@ class BxTimelineDb extends BxDolModuleDb
 
 				//--- Apply timeline
 		        if(isset($aParams['timeline']) && !empty($aParams['timeline'])) {
-		        	/*
-		        	//TODO: Remove if old timeline slider is not used
-		            $iDays = (int)$aParams['timeline'];
-		            $iNowMorning = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
-		            $sWhereClause .= $this->prepare("AND `date`>=? ", ($iNowMorning - 86400 * $iDays));
-		            */
 		        	$iYear = (int)$aParams['timeline'];
 		        	$sWhereClause .= $this->prepare("AND `date`<=? ", mktime(23, 59, 59, 12, 31, $iYear));
 		        }
@@ -266,6 +260,8 @@ class BxTimelineDb extends BxDolModuleDb
                 `{$this->_sTable}`.`object_id` AS `object_id`,
                 `{$this->_sTable}`.`content` AS `content`,
                 `{$this->_sTable}`.`comments` AS `comments`,
+                `{$this->_sTable}`.`title` AS `title`,
+                `{$this->_sTable}`.`description` AS `description`,
                 `{$this->_sTable}`.`shares` AS `shares`,
                 `{$this->_sTable}`.`date` AS `date`,
                 YEAR(FROM_UNIXTIME(`{$this->_sTable}`.`date`)) AS `year`,
@@ -351,40 +347,6 @@ class BxTimelineDb extends BxDolModuleDb
         return $sFilterAddon;
     }
 
-    
-    
-    
-    
-    
-    
-    
-    //--- View Events Functions ---//
-    function getEventsCount($iOwnerId, $sFilter, $sTimeline, $aModules)
-    {
-        $sWhereClause = "";
-        if(!empty($iOwnerId)) {
-            if(!is_array($iOwnerId))
-                $sWhereClause = "`owner_id`='" . $iOwnerId . "' ";
-            else
-                $sWhereClause = "`owner_id` IN ('" . implode("','", $iOwnerId) . "') ";
-        }
-
-    	if(!empty($sTimeline) && strpos($sTimeline, BX_WALL_DIVIDER_TIMELINE) !== false) {
-            list($iTLStart, $iTLEnd) = explode(BX_WALL_DIVIDER_TIMELINE, $sTimeline);
-
-            $iNowMorning = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
-            $iNowEvening = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
-            $sWhereClause .= "AND `date`>='" . ($iNowMorning - 86400 * $iTLEnd) . "' AND `date`<='" . ($iNowEvening - 86400 * $iTLStart) . "' ";
-        }
-
-        if(!empty($aModules) && is_array($aModules))
-        	$sWhereClause .= "AND `type` IN ('" . implode("','", $aModules) . "') ";
-
-		$sWhereClause .= $this->_getFilterAddon($iOwnerId, $sFilter);
-
-        $sSql = "SELECT COUNT(*) FROM `{$this->_sTable}` WHERE " . $sWhereClause . " LIMIT 1";
-        return $this->getOne($sSql);
-    }
 
     function updateSimilarObject($iId, &$oAlert, $sDuration = 'day')
     {
@@ -430,13 +392,6 @@ class BxTimelineDb extends BxDolModuleDb
 
         return $mixedResult;
     }
-
-    //--- Comment Functions ---//
-    function getCommentsCount($iId)
-    {
-        $sSql = "SELECT COUNT(`cmt_id`) FROM `" . $this->_sPrefix . "comments` WHERE `cmt_object_id`='" . $iId . "' AND `cmt_parent_id`='0' LIMIT 1";
-        return (int)$this->getOne($sSql);
-    }
 }
 
 /** @} */ 

+ 58 - 59
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -189,6 +189,36 @@ class BxTimelineModule extends BxDolModule
     	$this->_echoResultJson(array('popup' => $sContent));
     }
 
+    function actionRss($iOwnerId)
+    {
+    	list($sUserName) = $this->getUserInfo($iOwnerId);
+
+    	$sRssCaption = _t('_bx_timeline_txt_rss_caption', $sUserName);
+    	$sRssLink = $this->_oConfig->getViewUrl($iOwnerId);
+
+    	$aParams = $this->_prepareParams('owner', $iOwnerId, 0, $this->_oConfig->getRssLength(), '', array(), 0);
+        $aEvents = $this->_oDb->getEvents($aParams);
+
+        $aRssData = array();
+        foreach($aEvents as $aEvent) {
+            if(empty($aEvent['title'])) continue;
+
+            $aRssData[$aEvent['id']] = array(
+               'UnitID' => $aEvent['id'],
+               'UnitTitle' => $aEvent['title'],
+               'UnitLink' => $this->_oConfig->getItemViewUrl($aEvent),
+               'UnitDesc' => $aEvent['description'],
+               'UnitDateTimeUTS' => $aEvent['date'],
+            );
+        }
+
+        bx_import('BxDolRssFactory');
+        $oRss = new BxDolRssFactory();
+
+        header('Content-Type: text/html; charset=utf-8');
+        echo $oRss->GenRssByData($aRssData, $sRssCaption, $sRssLink);
+    }
+
 	/**
      * SERVICE METHODS
      */
@@ -229,11 +259,17 @@ class BxTimelineModule extends BxDolModule
         $oResponse->response($oAlert);
     }
 
+    public function serviceGetBlockPost($iProfileId = 0)
+    {
+    	return $this->serviceGetBlockPostProfile($iProfileId);
+    }
+
 	public function serviceGetBlockPostProfile($iProfileId = 0)
 	{
-		if (!$iProfileId && bx_get('id') !== false) {
-			$iProfileId = bx_process_input(bx_get('id'), BX_DATA_INT);
-            $iProfileId = BxDolProfile::getInstanceByContentAndType($iProfileId, 'bx_persons')->id();
+		if(!$iProfileId && bx_get('id') !== false) {
+			$oProfile = BxDolProfile::getInstanceByContentAndType(bx_process_input(bx_get('id'), BX_DATA_INT), 'bx_persons');
+			if(!empty($oProfile))
+            	$iProfileId = $oProfile->id();
 		}
 
         if (!$iProfileId)
@@ -254,11 +290,21 @@ class BxTimelineModule extends BxDolModule
         return array('content' => $sContent, 'menu' => $oMenu);
 	}
 
+	public function serviceGetBlockView($iProfileId = 0)
+	{
+		$aBlock = $this->serviceGetBlockViewProfile($iProfileId);
+		if(!empty($aBlock))
+			return $aBlock;
+
+    	return array('content' => MsgBox(_t('_bx_timeline_txt_msg_no_results'))); 
+    }
+
 	public function serviceGetBlockViewProfile($iProfileId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
 	{
-		if (!$iProfileId) {
-			$iProfileId = bx_process_input(bx_get('id'), BX_DATA_INT);
-            $iProfileId = BxDolProfile::getInstanceByContentAndType($iProfileId, 'bx_persons')->id();
+		if(!$iProfileId && bx_get('id') !== false) {
+			$oProfile = BxDolProfile::getInstanceByContentAndType(bx_process_input(bx_get('id'), BX_DATA_INT), 'bx_persons');
+			if(!empty($oProfile))
+            	$iProfileId = $oProfile->id();
 		}
 
         if (!$iProfileId)
@@ -274,13 +320,13 @@ class BxTimelineModule extends BxDolModule
 			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' => '_self', 'title' => _t('_bx_timeline_menu_item_get_rss')),
+            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')),
         );
 
         bx_import('BxTemplMenuInteractive');
 		$oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> 'timeline-view-all', 'menu_items' => $aMenu));
 		$oMenu->setSelected('', 'timeline-view-all');
-		
+
 		$sContent = $this->_oTemplate->getViewBlock($aParams);
         return array('content' => $sContent, 'menu' => $oMenu);
     }
@@ -470,17 +516,17 @@ class BxTimelineModule extends BxDolModule
 
         	$aPhIds = $oForm->getCleanValue('content');
         	BxDolForm::setSubmittedValue('content', serialize(array()), $oForm->aFormAttrs['method']);
+        	$iPhIds = count($aPhIds);
 
         	$iId = $oForm->insert(array(
         		'object_id' => $iUserId,
         		'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault(),
-				'title' => bx_process_input($sUserName . ' ' . _t('_bx_timeline_txt_added_photo')),
+				'title' => bx_process_input($sUserName . ' ' . _t('_bx_timeline_txt_added_photo' . ($iPhIds > 1 ? 's' : ''))),
 				'description' => '',
         		'date' => time()
 			));
 
 			if(!empty($iId)) {
-				$iPhIds = count($aPhIds);
 				if($iPhIds > 0) {
 					$aPhTitles = $oForm->getCleanValue('file_title');
 					$aPhTexts = $oForm->getCleanValue('file_text');
@@ -658,6 +704,7 @@ class BxTimelineModule extends BxDolModule
     protected function _prepareParams($sType, $iOwnerId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline)
     {
     	$aParams = array();
+    	$aParams['browse'] = 'list';
     	$aParams['type'] = !empty($sType) ? $sType : BX_TIMELINE_TYPE_OWNER;
 		$aParams['owner_id'] = (int)$iOwnerId != 0 ? $iOwnerId : $this->getUserId();
     	$aParams['start'] = (int)$iStart > 0 ? $iStart : 0;
@@ -672,6 +719,7 @@ class BxTimelineModule extends BxDolModule
     protected function _prepareParamsGet()
     {
     	$aParams = array();
+    	$aParams['browse'] = 'list';
 
     	$sType = bx_get('type');
 		$aParams['type'] = $sType !== false ? bx_process_input($sType, BX_DATA_TEXT) : BX_TIMELINE_TYPE_OWNER;
@@ -730,55 +778,6 @@ class BxTimelineModule extends BxDolModule
             $s = '<textarea>' . $s . '</textarea>'; // http://jquery.malsup.com/form/#file-upload
         echo $s;
     }
-    
-    
-    
-    
-    
-    
-    
-   
-   
-    /**
-     * Get RSS for specified owner.
-     *
-     * @param  string $sUsername wall owner username
-     * @return string with RSS.
-     */
-    function actionRss($sUsername)
-    {
-        $aOwner = $this->_oDb->getUser($sUsername, 'username');
-
-        $aEvents = $this->_oDb->getEvents(array(
-            'type' => 'owner',
-            'owner_id' => $aOwner['id'],
-            'order' => 'desc',
-            'start' => 0,
-            'count' => $this->_oConfig->getRssLength(),
-            'filter' => ''
-        ));
-
-        $sRssBaseUrl = $this->_oConfig->getBaseUri() . 'index/' . $aOwner['username'] . '/';
-        $aRssData = array();
-        foreach($aEvents as $aEvent) {
-            if(empty($aEvent['title'])) continue;
-
-            $aRssData[$aEvent['id']] = array(
-               'UnitID' => $aEvent['id'],
-               'OwnerID' => $aOwner['id'],
-               'UnitTitle' => $aEvent['title'],
-               'UnitLink' => BX_DOL_URL_ROOT . $sRssBaseUrl . '#wall-event-' . $aEvent['id'],
-               'UnitDesc' => $aEvent['description'],
-               'UnitDateTimeUTS' => $aEvent['date'],
-               'UnitIcon' => ''
-            );
-        }
-
-        $oRss = new BxDolRssFactory();
-
-        header('Content-Type: text/html; charset=utf-8');
-        return $oRss->GenRssByData($aRssData, $aOwner['username'] . ' ' . _t('_wall_rss_caption'), $sRssBaseUrl);
-    }
 }
 
 /** @} */ 

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

@@ -64,6 +64,7 @@ class BxTimelineResponse extends BxDolAlertsResponse
 		        if(!empty($iId))
 		        	$this->_oModule->onPost($iId);
 
+				//TODO: Remove the call and the function itself if GROUPING feature won't be used. 
 		        $this->_oModule->_oDb->updateSimilarObject($iId, $oAlert);		
 		        break;
 

+ 26 - 7
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -128,11 +128,24 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 		if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
 			return '';
 
-		if((empty($aEvent['title']) && !empty($aResult['title'])) || (empty($aEvent['description']) && !empty($aResult['description'])))
+		list($sUserName) = $this->getModule()->getUserInfo($aResult['owner_id']);
+
+		if(empty($aEvent['title']) || empty($aEvent['description'])) {
+			$sTitle = !empty($aResult['title']) ? $aResult['title'] : '';
+			if($sTitle == '') {
+				$sSample = !empty($aResult['content']['sample']) ? $aResult['content']['sample'] : '_bx_timeline_txt_sample';
+				$sTitle = _t('_bx_timeline_txt_user_added_sample', $sUserName, _t($sSample));
+			}
+
+			$sDescription = !empty($aResult['description']) ? $aResult['description'] : '';
+			if($sDescription == '' && !empty($aResult['content']['text']))
+				$sDescription = $aResult['content']['text'];
+
         	$this->_oDb->updateEvent(array(
-            	'title' => bx_process_input($aResult['title'], BX_TAGS_STRIP),
-                'description' => bx_process_input($aResult['description'], BX_TAGS_STRIP)
+            	'title' => bx_process_input(strip_tags($sTitle)),
+                'description' => bx_process_input(strip_tags($sDescription))
 			), array('id' => $aEvent['id']));
+		}
 
 		if(is_string($aResult['content']))
 			return $aResult['content'];
@@ -161,7 +174,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         }
 
         //--- Check for Next
-        $aParamsDb['browse'] = 'list';
         $aParamsDb['per_page'] += 1;
         $aEvents = $this->_oDb->getEvents($aParamsDb);
 
@@ -563,11 +575,12 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 			'content' => $aContent['owner_name']
 		));
 
-		$sSampleLink = empty($aContent['url']) ? $aContent['sample'] : $this->parseHtmlByName('bx_a.html', array(
+		$sSample = _t($aContent['sample']);
+		$sSampleLink = empty($aContent['url']) ? $sSample : $this->parseHtmlByName('bx_a.html', array(
 			'href' => $aContent['url'],
 			'title' => '',
 			'bx_repeat:attrs' => array(),
-			'content' => $aContent['sample']
+			'content' => $sSample
 		));
 
 		$sTitle = _t('_bx_timeline_txt_shared', $sOwnerLink, $sSampleLink);
@@ -625,7 +638,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     		'owner_id' => $aEvent['object_id'],
     		'content_type' => $sType,
     		'content' => array(
-    			'sample' => _t('_bx_timeline_txt_common_' . $sType),
+    			'sample' => '_bx_timeline_txt_common_' . $sType,
     			'url' => $this->_oConfig->getItemViewUrl($aEvent)
     		), //a string to display or array to parse default template before displaying.
     		'comments' => '',
@@ -680,6 +693,12 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 				$aResult['content']['parse_type'] = $aShared['content_type'];
 				$aResult['content']['owner_id'] = $aShared['owner_id'];
 				list($aResult['content']['owner_name'], $aResult['content']['owner_url']) = $oModule->getUserInfo($aShared['owner_id']);
+
+				list($sUserName) = $oModule->getUserInfo($aEvent['object_id']);
+				$sSample = !empty($aResult['content']['sample']) ? $aResult['content']['sample'] : '_bx_timeline_txt_sample';
+
+				$aResult['title'] = _t('_bx_timeline_txt_user_shared_sample', $sUserName, $aResult['content']['owner_name'], _t($sSample));
+				$aResult['description'] = '';
 				break;
 		}
 

+ 11 - 13
modules/boonex/timeline/install/langs/en.xml

@@ -52,28 +52,19 @@
 	<string name="_bx_timeline_acl_action_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_timeline_acl_action_comment"><![CDATA[Comment]]></string>
 
-	<string name="_bx_timeline_page_title_sys_view"><![CDATA[View Timeline]]></string>
-	<string name="_bx_timeline_page_title_view"><![CDATA[View Timeline]]></string>
+	<string name="_bx_timeline_page_title_sys_view"><![CDATA[Timeline]]></string>
+	<string name="_bx_timeline_page_title_view"><![CDATA[Timeline]]></string>
 	<string name="_bx_timeline_page_title_sys_item"><![CDATA[Timeline Item]]></string>
 	<string name="_bx_timeline_page_title_item"><![CDATA[Timeline Item]]></string>
 	<string name="_bx_timeline_page_title_sys_account"><![CDATA[Timeline]]></string>
 	<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[View Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_view"><![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_item"><![CDATA[Item]]></string>
 	<string name="_bx_timeline_page_block_title_view_account"><![CDATA[Timeline]]></string>
 
-	<!--
-	<string name="_bx_timeline_menu_title_XXX"><![CDATA[View Person Submenu]]></string>
-    <string name="_bx_timeline_menu_set_title_XXX"><![CDATA[Notes Submenu]]></string>
-    <string name="_bx_timeline_menu_item_title_system_XXX"><![CDATA[]]></string>
-    <string name="_bx_timeline_menu_item_title_XXX"><![CDATA[]]></string>
-
-	<string name="_bx_timeline_txt_error_XXX"><![CDATA[]]></string>
-    -->    
-
     <string name="_bx_timeline_menu_item_view_all"><![CDATA[All posts]]></string>
     <string name="_bx_timeline_menu_item_view_owner"><![CDATA[Posts by {0}]]></string>
     <string name="_bx_timeline_menu_item_view_other"><![CDATA[Posts by others]]></string>
@@ -116,13 +107,20 @@
 	<string name="_bx_timeline_txt_or_jump_to"><![CDATA[... or jump to:]]></string>
 	<string name="_bx_timeline_txt_jump_to_n_year"><![CDATA[Jump to {0} year]]></string>
 	<string name="_bx_timeline_txt_jump_to_recent"><![CDATA[Jump to recent posts]]></string>
+
 	<string name="_bx_timeline_txt_wrote"><![CDATA[wrote]]></string>
 	<string name="_bx_timeline_txt_shared_link"><![CDATA[shared a link]]></string>
 	<string name="_bx_timeline_txt_added_photo"><![CDATA[added a photo]]></string>
+	<string name="_bx_timeline_txt_added_photos"><![CDATA[added photos]]></string>
 	<string name="_bx_timeline_txt_common_text"><![CDATA[text]]></string>
 	<string name="_bx_timeline_txt_common_link"><![CDATA[link]]></string>
 	<string name="_bx_timeline_txt_common_photo"><![CDATA[photo]]></string>
-	
+
+	<string name="_bx_timeline_txt_rss_caption"><![CDATA[{0}'s timeline]]></string>
+	<string name="_bx_timeline_txt_user_added_sample"><![CDATA[{0} added {1}]]></string>
+	<string name="_bx_timeline_txt_user_shared_sample"><![CDATA[{0} shared {1}'s {2}]]></string>
+	<string name="_bx_timeline_txt_sample"><![CDATA[item]]></string>
+
 	<string name="_bx_timeline_txt_shared"><![CDATA[Shared {0}'s {1}.]]></string>
 	<string name="_bx_timeline_txt_err_cannot_share"><![CDATA[Cannot share. Please report.]]></string>
 	<string name="_bx_timeline_txt_msg_success_share"><![CDATA[Shared successfully.]]></string>

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

@@ -6,7 +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, 1, 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, 1, 2),
 
 ('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, 1, 1),