Procházet zdrojové kódy

#1339 - Embeds for all content types

RomanL před 4 roky
rodič
revize
35bb065806

+ 4 - 1
inc/classes/BxDolTemplate.php

@@ -870,8 +870,8 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
      */
     function getEmbed($sContent)
     {
-        header('Content-Security-Policy: frame-ancestors ' . getParam('sys_csp_frame_ancestors')) ;
         if ($sContent == ''){
+            header('Content-Security-Policy: frame-ancestors ' . getParam('sys_csp_frame_ancestors')) ;
             $this->displayPageNotFound('', BX_PAGE_EMBED);
             exit;
         }
@@ -3315,6 +3315,9 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 
         header( 'Content-type: text/html; charset=utf-8' );
         header( 'X-Frame-Options: sameorigin' );
+        if (BX_PAGE_EMBED == $oTemplate->getPageNameIndex())
+            header('Content-Security-Policy: frame-ancestors ' . getParam('sys_csp_frame_ancestors'));
+
         echo $oTemplate->parsePageByName('page_' . $oTemplate->getPageNameIndex() . '.html', $oTemplate->getPageContent());
     }
 }

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsContentInfoMedia.php

@@ -38,7 +38,7 @@ class BxAlbumsContentInfoMedia extends BxDolContentInfo
             return '';
         
         $sTitle = $this->getContentTitle($iContentId);
-        return $this->_oModule->_oTemplate->parseHtmlByName('embed.html', [
+        return $this->_oModule->_oTemplate->parseHtmlByName('embed_media.html', [
             'title' => $sTitle,
             'url' => BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'embed_media/' . $iContentId . '/'
         ]);

+ 1 - 1
modules/boonex/albums/template/embed.html

@@ -1 +1 @@
-<iframe width="300" height="330" src="__url__" frameborder="0" allowfullscreen></iframe>
+<iframe width="300" height="230" src="__url__" frameborder="0" allowfullscreen></iframe>

+ 1 - 0
modules/boonex/albums/template/embed_media.html

@@ -0,0 +1 @@
+<iframe width="300" height="330" src="__url__" frameborder="0" allowfullscreen></iframe>

+ 1 - 1
modules/boonex/market/template/embed.html

@@ -1 +1 @@
-<iframe width="300" height="270" src="__url__" frameborder="0" allowfullscreen></iframe>
+<iframe width="300" height="370" src="__url__" frameborder="0" allowfullscreen></iframe>

+ 5 - 0
modules/boonex/polls/classes/BxPollsModule.php

@@ -45,6 +45,11 @@ class BxPollsModule extends BxBaseModTextModule
         	'content' => $aBlock['content']
         ));
     }
+    
+    public function actionEmbed($iContentId, $sUnitTemplate = '')
+    {
+        return parent::actionEmbed($iContentId, 'unit_embed_common.html');
+    }
 
     public function actionEmbedEntry($iId = 0)
     {

+ 13 - 16
modules/boonex/videos/template/unit_gallery_embed.html

@@ -1,17 +1,14 @@
-
-        <bx_if:thumb>
-           
-                <div class="bx-def-round-corners bx-def-font-middle" >
-                    __entry_video__
-                </div>
-
-        </bx_if:thumb>
-        <bx_if:no_thumb>
-            <div class="bx-def-gal-img-column">
-                <div class="bx-base-text-unit-no-thumb bx-def-gal-div-size bx-def-font-middle bx-def-font-grayed bx-def-padding bx-def-box-sizing">
-                    __summary_plain__
-                    <div class="bx-base-text-unit-strecher">__strecher__</div>
-                </div>
-            </div>
-        </bx_if:no_thumb>
+<bx_if:thumb>
+    <div class="bx-def-round-corners bx-def-font-middle" style="height:100%;">
+        __entry_video__
+    </div>
+</bx_if:thumb>
+<bx_if:no_thumb>
+    <div class="bx-def-gal-img-column">
+        <div class="bx-base-text-unit-no-thumb bx-def-gal-div-size bx-def-font-middle bx-def-font-grayed bx-def-padding bx-def-box-sizing">
+            __summary_plain__
+            <div class="bx-base-text-unit-strecher">__strecher__</div>
+        </div>
+    </div>
+</bx_if:no_thumb>123
        

+ 10 - 1
template/css/embed.css

@@ -1,9 +1,18 @@
 body,
 .bx-embed{
     background-color: transparent !important;
+    height: 100% !important;
+}
+.bx-videos-iframe-aspect-ratio{
+    height: 100% !important;
 }
 .bx-embed{
-    width:100%;
+    width: 100%;
+    height: 100% !important;
+}
+.bx-embed iframe{
+    width: 100%;
+    height: 100% !important
 }
 .bx-embed .bx-base-pofile-unit-with-cover{
     display: block;