$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
// 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