AntonLV 7 ani în urmă
părinte
comite
01b9980bcc

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

@@ -1325,15 +1325,14 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $aTmplVarsLinks = array();
         if(!empty($aContent['links']))
             foreach($aContent['links'] as $aLink) {
-                $bTmplVarsEmbed = false;
-                $aTmplVarsEmbed = array();
+                $sLink = '';
+
                 $oEmbed = BxDolEmbed::getObjectInstance();
                 if ($oEmbed) {
-                    $bTmplVarsEmbed = true;
-                    $aTmplVarsEmbed = array(
+                    $sLink = $this->parseHtmlByName('link_embed_provider.html', array(
                         'style_prefix' => $sStylePrefix,
                         'embed' => $oEmbed->getLinkHTML($aLink['url'], $aLink['title']),
-                    );
+                    ));
                 }
                 else {
                     $aLinkAttrs = array(
@@ -1350,7 +1349,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                     foreach($aLinkAttrs as $sKey => $sValue)
                         $sLinkAttrs .= ' ' . $sKey . '="' . bx_html_attribute($sValue) . '"';
 
-                    $aTmplVarsEmbed = array(
+                    $sLink = $this->parseHtmlByName('link_embed_common.html', array(
                         'bx_if:show_thumbnail' => array(
                             'condition' => !empty($aLink['thumbnail']),
                             'content' => array(
@@ -1370,19 +1369,12 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                                 'text' => $aLink['text']
                             )
                         )
-                    );
+                    ));
                 }
 
                 $aTmplVarsLinks[] = array(
                     'style_prefix' => $sStylePrefix,
-                    'bx_if:show_embed_outer' => array(
-                            'condition' => $bTmplVarsEmbed,
-                            'content' => $aTmplVarsEmbed
-                        ),
-                        'bx_if:show_embed_inner' => array(
-                            'condition' => !$bTmplVarsEmbed,
-                            'content' => $aTmplVarsEmbed
-                    )
+                    'link' => $sLink
                 );
             }
 

+ 9 - 0
modules/boonex/timeline/template/link_embed_common.html

@@ -0,0 +1,9 @@
+<div class="__style_prefix__-il-embed __style_prefix__-il-embed-common bx-def-padding-sec bx-def-border bx-def-round-corners">
+    <bx_if:show_thumbnail>
+        <div class="__style_prefix__-il-thumbnail"><a href="__link__"__attrs__><img src="__thumbnail__" /></a></div>
+    </bx_if:show_thumbnail>
+    <div class="__style_prefix__-il-title"><a href="__link__"__attrs__>__content__</a></div>
+    <bx_if:show_text>
+        <div class="__style_prefix__-il-text bx-def-font-small bx-def-font-grayed">__text__</div>
+    </bx_if:show_text>
+</div>

+ 1 - 0
modules/boonex/timeline/template/link_embed_provider.html

@@ -0,0 +1 @@
+<div class="__style_prefix__-il-embed __style_prefix__-il-embed-provider">__embed__</div>

+ 1 - 14
modules/boonex/timeline/template/type_post.html

@@ -30,20 +30,7 @@
 <bx_if:show_links>
     <div class="__style_prefix__-item-links bx-def-margin-topbottom bx-def-margin-leftright">
         <bx_repeat:links>
-            <div class="__style_prefix__-item-link bx-def-margin-top-auto bx-def-padding-sec bx-def-border">
-                <bx_if:show_embed_outer>
-                    <div class="__style_prefix__-il-embed">__embed__</div>
-                </bx_if:show_embed_outer>
-                <bx_if:show_embed_inner>
-                    <bx_if:show_thumbnail>
-                        <div class="__style_prefix__-il-thumbnail"><a href="__link__"__attrs__><img src="__thumbnail__" /></a></div>
-                    </bx_if:show_thumbnail>
-                    <div class="__style_prefix__-il-title"><a href="__link__"__attrs__>__content__</a></div>
-                    <bx_if:show_text>
-                        <div class="__style_prefix__-il-text bx-def-font-small bx-def-font-grayed">__text__</div>
-                    </bx_if:show_text>
-                </bx_if:show_embed_inner>
-            </div>
+            <div class="__style_prefix__-item-link bx-def-margin-top-auto">__link__</div>
         </bx_repeat:links>
     </div>
 </bx_if:show_links>