]> _ Git - fluidbook-v3.git/commitdiff
wip #3375 @3
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 29 Jan 2020 18:21:00 +0000 (18:21 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 29 Jan 2020 18:21:00 +0000 (18:21 +0000)
framework/application/views/helpers/BackgroundBlock.php
less/002-common.less

index 78e49a2e588c8b5f9921706ec5f3f2d52d7fe314..cc38ba05f3a809bb51f99c644227f2dcbf08f892 100644 (file)
@@ -17,6 +17,7 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract
             $data['bg_color'] = $data['backgroundcolor'];\r
         }\r
         if (isset($data['bg_image'])) {\r
+\r
             $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
             $extra_attributes = array();\r
             if ($bgimage) {\r
@@ -33,40 +34,47 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract
                 // Scale image, factoring in crop that will take place...\r
                 // Image will be cropped to 900px wide so ensure that we have 45% extra and then determine the target height\r
                 $target_height = ($mobile_max_width / 0.55) * $image_ratio;\r
-                //$mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $image_width * 0.55, $image_height, array(), 'C', 'R', 'M');\r
-                if (isset($data['backgroundmobileimage'])) {\r
-                    $bgmobileimage = CubeIT_Util_Cms::extractFile($data['backgroundmobileimage']);\r
-                    if ($bgmobileimage) {\r
-                        $attributes['data-has-mobile']='1';\r
-                        $mobile_path = CubeIT_View_Helper_ImageCms::getPath($bgmobileimage);\r
-                        CubeIT_Image::getDimensions($mobile_path, $image_width, $image_height);\r
-                        $image_ratio = $image_height / $image_width;\r
-                        $attributes['data-mobile-ratio'] = $image_ratio;\r
-                        $target_height = $mobile_max_width * $image_ratio;\r
-                        $mobile = $this->imageProcess()->imageProcessGetURL($mobile_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
-                    }else{\r
+\r
+                if (stripos($image_path, '.oam') !== false) {\r
+                    $pict = $this->view->imageCms($image_path);\r
+                } else {\r
+                    if (isset($data['backgroundmobileimage'])) {\r
+                        $bgmobileimage = CubeIT_Util_Cms::extractFile($data['backgroundmobileimage']);\r
+                        if ($bgmobileimage) {\r
+                            $attributes['data-has-mobile'] = '1';\r
+                            $mobile_path = CubeIT_View_Helper_ImageCms::getPath($bgmobileimage);\r
+                            CubeIT_Image::getDimensions($mobile_path, $image_width, $image_height);\r
+                            $image_ratio = $image_height / $image_width;\r
+                            $attributes['data-mobile-ratio'] = $image_ratio;\r
+                            $target_height = $mobile_max_width * $image_ratio;\r
+                            $mobile = $this->imageProcess()->imageProcessGetURL($mobile_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                        } else {\r
+                            $attributes['data-bg-ratio'] = $attributes['data-bg-ratio'];\r
+                            $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                        }\r
+                    } else {\r
                         $attributes['data-bg-ratio'] = $attributes['data-bg-ratio'];\r
                         $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
                     }\r
-                } else {\r
-                    $attributes['data-bg-ratio'] = $attributes['data-bg-ratio'];\r
-                    $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
-                }\r
 \r
-                $bg = $this->htmlElement($this->picture([\r
-                    [\r
-                        'src' => $image_path,\r
-                        'width' => 1920\r
+                    $pict = $this->picture([\r
+                        [\r
+                            'src' => $image_path,\r
+                            'width' => 1920\r
+                        ],\r
+                        [\r
+                            'src' => $mobile,\r
+                            'width' => $mobile_max_width,\r
+                            'media' => '(max-width: 900px)'\r
+                        ]\r
                     ],\r
-                    [\r
-                        'src' => $mobile,\r
-                        'width' => $mobile_max_width,\r
-                        'media' => '(max-width: 900px)'\r
-                    ]\r
-                ],\r
-                    [\r
-                        'alt' => $data['title']\r
-                    ]), 'div', array('class' => 'picture'));\r
+                        [\r
+                            'alt' => $data['title']\r
+                        ]);\r
+\r
+\r
+                }\r
+                $bg = $this->htmlElement($pict, 'div', array('class' => 'picture'));\r
                 $content = $bg . $content;\r
             }\r
         }\r
index 0030995f7b8d609aff637b071a2ed757fbe01a62..3d5358440cc7f8a7078321582e9a7affa3cb992e 100644 (file)
@@ -140,6 +140,7 @@ a {
                height: 1000px;\r
                z-index: 0;\r
 \r
+\r
                picture {\r
                        img {\r
                                width: 100%;\r
@@ -150,6 +151,12 @@ a {
                                bottom: 0;\r
                        }\r
                }\r
+\r
+               iframe{\r
+                       //right: 0;\r
+                       //bottom: 0;\r
+                       //position: absolute;\r
+               }\r
        }\r
 \r
        .grid {\r