AntonLV 6 лет назад
Родитель
Сommit
f2d14b1595

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

@@ -24,6 +24,7 @@
     <string name="_bx_timeline_option_rss_length"><![CDATA[Количество элементов в RSS-ленте]]></string>
     <string name="_bx_timeline_option_events_hide"><![CDATA[Показывать события]]></string>
     <string name="_bx_timeline_option_enable_dynamic_cards"><![CDATA[Включить динамическую загрузку карточек]]></string>
+    <string name="_bx_timeline_option_enable_brief_cards"><![CDATA[Включить лаконичные карточки]]></string>
     <string name="_bx_timeline_option_videos_autoplay"><![CDATA[Автоматически проигрывать видео ролики (доступно только для Ленты)]]></string>
     <string name="_bx_timeline_option_videos_autoplay_off"><![CDATA[Отключено]]></string>
     <string name="_bx_timeline_option_videos_autoplay_on_mute"><![CDATA[Включено (без звука)]]></string>

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

@@ -35,6 +35,8 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
     protected $_iCharsDisplayMaxTitle;
 
     protected $_bDynamicCards;
+    protected $_bBriefCards;
+    protected $_aBriefCardsTags;
     protected $_sVideosAutoplay;
     protected $_iPreloadComments;
     protected $_iPreloadCommentsMax;
@@ -286,6 +288,8 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
             "meta_description" => "/<meta[\s]+[^>]*?name[\s]?=[\s\"\']+description[\s\"\']+content[\s]?=[\s\"\']+(.*?)[\"\']+.*?>/",
             "url" => "/(([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_!]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?/"
         );
+
+        $this->_aBriefCardsTags = array('a', 'b', 'i');
     }
 
     public function init(&$oDb)
@@ -321,6 +325,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         $this->_iCharsDisplayMaxTitle = 64;
 
         $this->_bDynamicCards = getParam($sOptionPrefix . 'enable_dynamic_cards') == 'on';
+        $this->_bBriefCards = getParam($sOptionPrefix . 'enable_brief_cards') == 'on';
 
         $this->_sVideosAutoplay = getParam($sOptionPrefix . 'videos_autoplay');
 
@@ -421,6 +426,11 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         return $this->_bDynamicCards;
     }
 
+    public function isBriefCards()
+    {
+        return $this->_bBriefCards;
+    }
+
     public function isJumpTo()
     {
         return $this->_bJumpTo;
@@ -547,6 +557,11 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         return $this->_iCharsDisplayMaxTitle;
     }
 
+    public function getBriefCardsTags($bAsString = false)
+    {
+        return !$bAsString ? $this->_aBriefCardsTags : '<' . implode('><', $this->_aBriefCardsTags) . '>';
+    }
+
     public function getVideosAutoplay()
     {
         return $this->_sVideosAutoplay;

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

@@ -2642,10 +2642,13 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
     protected function _prepareTextForOutput($s, $iEventId = 0)
     {
+        if($this->_oConfig->isBriefCards())
+            $s = strip_tags($s, $this->_oConfig->getBriefCardsTags(true));
+
     	$s = bx_process_output($s, BX_DATA_HTML);
 
         $oMetatags = BxDolMetatags::getObjectInstance($this->_oConfig->getObject('metatags'));
-		$s = $oMetatags->metaParse($iEventId, $s);
+        $s = $oMetatags->metaParse($iEventId, $s);
 
         return $s;
     }

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

@@ -24,6 +24,7 @@
     <string name="_bx_timeline_option_rss_length"><![CDATA[The length of RSS feed]]></string>
     <string name="_bx_timeline_option_events_hide"><![CDATA[Show events]]></string>
     <string name="_bx_timeline_option_enable_dynamic_cards"><![CDATA[Enable dynamic cards loading]]></string>
+    <string name="_bx_timeline_option_enable_brief_cards"><![CDATA[Enable brief cards]]></string>
     <string name="_bx_timeline_option_videos_autoplay"><![CDATA[Videos autoplay (for Timeline view only)]]></string>
     <string name="_bx_timeline_option_videos_autoplay_off"><![CDATA[Disabled]]></string>
     <string name="_bx_timeline_option_videos_autoplay_on_mute"><![CDATA[Enabled without sound]]></string>

+ 4 - 3
modules/boonex/timeline/install/sql/enable.sql

@@ -264,9 +264,10 @@ SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_params`, `check_error`, `extra`, `order`) VALUES
 ('bx_timeline_enable_dynamic_cards', '', @iCategId, '_bx_timeline_option_enable_dynamic_cards', 'checkbox', '', '', '', '', 1),
-('bx_timeline_videos_autoplay', 'off', @iCategId, '_bx_timeline_option_videos_autoplay', 'select', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_options_videos_autoplay";}', 2),
-('bx_timeline_preload_comments', '0', @iCategId, '_bx_timeline_option_preload_comments', 'digit', '', '', '', '', 3),
-('bx_timeline_attachments_layout', 'gallery', @iCategId, '_bx_timeline_option_attachments_layout', 'select', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_options_attachments_layout";}', 4);
+('bx_timeline_enable_brief_cards', 'on', @iCategId, '_bx_timeline_option_enable_brief_cards', 'checkbox', '', '', '', '', 2),
+('bx_timeline_videos_autoplay', 'off', @iCategId, '_bx_timeline_option_videos_autoplay', 'select', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_options_videos_autoplay";}', 10),
+('bx_timeline_preload_comments', '0', @iCategId, '_bx_timeline_option_preload_comments', 'digit', '', '', '', '', 20),
+('bx_timeline_attachments_layout', 'gallery', @iCategId, '_bx_timeline_option_attachments_layout', 'select', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_options_attachments_layout";}', 30);
 
 -- Category: Cache
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)