<?php\r
\r
-class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract {\r
- /**\r
- * @return string\r
- */\r
- public function backgroundBlock($content, $data, $class = array('content-wrapper', 'no-shrink')) {\r
- $style = '';\r
- $attributes = array('class' => $class);\r
+class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract\r
+{\r
+ /**\r
+ * @return string\r
+ */\r
+ public function backgroundBlock($content, $data, $class = array('content-wrapper', 'no-shrink'))\r
+ {\r
+ $style = '';\r
+ $attributes = array('class' => $class);\r
\r
- if (isset($data['backgroundimage']) && !isset($data['bg_image'])) {\r
- $data['bg_image'] = $data['backgroundimage'];\r
- }\r
- if (isset($data['backgroundcolor']) && !isset($data['bg_color'])) {\r
- $data['bg_color'] = $data['backgroundcolor'];\r
- }\r
- if (isset($data['bg_image'])) {\r
- $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
- $extra_attributes = array();\r
- if ($bgimage) {\r
- $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
+ if (isset($data['backgroundimage']) && !isset($data['bg_image'])) {\r
+ $data['bg_image'] = $data['backgroundimage'];\r
+ }\r
+ if (isset($data['backgroundcolor']) && !isset($data['bg_color'])) {\r
+ $data['bg_color'] = $data['backgroundcolor'];\r
+ }\r
+ if (isset($data['bg_image'])) {\r
+ $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
+ $extra_attributes = array();\r
+ if ($bgimage) {\r
+ $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
\r
- // Work out the ratio of the background image\r
- CubeIT_Image::getDimensions($image_path, $image_width, $image_height);\r
- $image_ratio = $image_height / $image_width;\r
- $attributes['data-bg-ratio'] = $image_ratio;\r
+ // Work out the ratio of the background image\r
+ CubeIT_Image::getDimensions($image_path, $image_width, $image_height);\r
+ $image_ratio = $image_height / $image_width;\r
+ $attributes['data-bg-ratio'] = $image_ratio;\r
\r
- // Create a cropped version of the image for mobile that cuts off the left 45% of the image\r
+ // Create a cropped version of the image for mobile that cuts off the left 45% of the image\r
// Make sure image is not wider than 900px when finished\r
$mobile_max_width = 900;\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
- $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_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
+ $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' => 1680\r
+ $bg = $this->htmlElement($this->picture([\r
+ [\r
+ 'src' => $image_path,\r
+ 'width' => 1920\r
],\r
[\r
'src' => $mobile,\r
- 'width' => 900,\r
+ 'width' => $mobile_max_width,\r
'media' => '(max-width: 900px)'\r
]\r
],\r
- [\r
- 'alt' => $data['title']\r
- ]), 'div', array('class' => 'picture'));\r
- $content = $bg . $content;\r
- }\r
- }\r
+ [\r
+ 'alt' => $data['title']\r
+ ]), 'div', array('class' => 'picture'));\r
+ $content = $bg . $content;\r
+ }\r
+ }\r
\r
- if (isset($data['bg_color'])) {\r
- $style .= "background-color:" . $data['bg_color'] . ";";\r
- }\r
- $attributes['style'] = $style;\r
+ if (isset($data['bg_color'])) {\r
+ $style .= "background-color:" . $data['bg_color'] . ";";\r
+ }\r
+ $attributes['style'] = $style;\r
\r
- return $this->htmlElement($content, 'div', $attributes);\r
- }\r
+ return $this->htmlElement($content, 'div', $attributes);\r
+ }\r
}\r
<?php\r
\r
-class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract {\r
- public $data;\r
-\r
- protected function _layer($content, $class, $attributes = array(), $outerContent = '') {\r
-\r
- $section = $class;\r
-\r
- $class .= ' section ' . $this->data['headerstyle'];\r
-\r
- $defaultAttributes = array('class' => $class,\r
- 'data-headerstyle' => $this->data['headerstyle'],\r
- 'data-themecolor' => $this->data['themecolor'],\r
- 'data-section-name' => $section, 'data-puce' => $this->data['puce']);\r
- $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
-\r
- $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
- $content .= $outerContent;\r
- $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
-\r
- return $this->htmlElement($content, 'section', $attributes);\r
- }\r
-\r
- protected function _leftText($title_element = 'h2') {\r
- $res = $this->title($this->data['title'], $title_element);\r
- $res .= $this->markupDotclear($this->data['content']);\r
- $res .= $this->linkCMS($this->data['button'], ['class' => 'btn', 'style' => 'background:' . $this->data['themecolor']]);\r
- return $res;\r
- }\r
+class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract\r
+{\r
+ public $data;\r
+\r
+ protected function _layer($content, $class, $attributes = array(), $outerContent = '')\r
+ {\r
+\r
+ $section = $class;\r
+\r
+ $class .= ' section ' . $this->data['headerstyle'];\r
+\r
+ $defaultAttributes = array('class' => $class,\r
+ 'data-headerstyle' => $this->data['headerstyle'],\r
+ 'data-themecolor' => $this->data['themecolor'],\r
+ 'data-has-mobile' => isset($this->data['backgroundmobileimage']),\r
+ 'data-section-name' => $section, 'data-puce' => $this->data['puce']);\r
+ $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
+\r
+ $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
+ $content .= $outerContent;\r
+ $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
+\r
+ return $this->htmlElement($content, 'section', $attributes);\r
+ }\r
+\r
+ protected function _leftText($title_element = 'h2')\r
+ {\r
+ $res = $this->title($this->data['title'], $title_element);\r
+ $res .= $this->markupDotclear($this->data['content']);\r
+ $res .= $this->linkCMS($this->data['button'], ['class' => 'btn', 'style' => 'background:' . $this->data['themecolor']]);\r
+ return $res;\r
+ }\r
}\r
<?php
-class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract {
-
- public function introBlock($intro, $additionnalContent = '', $outsideContent = '', $paddingTop = true) {
- $this->addScriptAndStyle('102-intro');
-
-
- $res = '<div class="grid">';
- $res .= '<div class="col-2">';
- $res .= $this->title($intro['title']);
- $res .= $this->_content($intro['content']);
- if ($additionnalContent) {
- $res .= $additionnalContent;
- }
-
- $res .= '</div>'; // .col-2
- $res .= '</div>'; // .grid
-
- $attrs = array('class' => array('intro'));
-
- if ($outsideContent) {
- $res .= $outsideContent;
- }
-
- if (isset($intro['backgroundimage']) && !isset($intro['bg_image'])) {
- $intro['bg_image'] = $intro['backgroundimage'];
- }
- if (!isset($intro['bg_image']) || !$intro['bg_image']) {
- $attrs['class'][] = 'nobg';
- } else {
- $attrs['data-bg'] = print_r($intro['bg_image'], true);
- }
-
- $res = $this->backgroundBlock($res, $intro);
- if ($intro['chapo']) {
- $res .= $this->htmlElement($this->htmlElement(nl2br($intro['chapo']), 'div'), 'blockquote');
- }
-
-
- if (!$paddingTop) {
- $attrs['class'][] = 'nopad';
- }
-
- if ($intro['header_theme']) {
- $attrs['data-header-theme'] = 'light';
- }
-
- $style = '';
- if ($intro['text_color']) {
- $s = '@color:' . $intro['text_color'] . ' ;';
- $s .= '.intro{' . "\n";
- $s .= 'h1,h2,h3,h4,h5,h6,b,strong,i,em,p,a,address{color:@color !important;}' . "\n";
- $s .= 'h1.title,h2.title,hr{&:after{background-color:@color !important;}}' . "\n";
- $s .= '}';
- $style = $this->styleLess($s);
- }
-
- return $style . $this->htmlElement($res, 'section', $attrs);
- }
-
- protected function _content($c) {
-
- $res = $this->markupDotclear($c);
- if (stristr($res, '$adresse')) {
- $address = $this->option('address');
- $locale = new Zend_Locale();
- $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));
- $content = '<address>';
- $content .= '<h4>' . $address['company'] . '</h4>';
- $content .= $address['adresse'];
- $content .= '<br>';
- $content .= "{$address['code_postal']} {$address['ville']} - $country";
- $content .= '<br>';
- $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);
- $content .= '<br>';
- $content .= __('email :') . ' ' . $this->linkEmail($address['email']);
- $content .= '</address>';
-
- $res = str_replace('$adresse', $content, $res);
- }
- return $res;
- }
+class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract
+{
+
+ public function introBlock($intro, $additionnalContent = '', $outsideContent = '', $paddingTop = true)
+ {
+ $this->addScriptAndStyle('102-intro');
+
+
+ $res = '<div class="grid">';
+ $res .= '<div class="col-2">';
+ $res .= $this->title($intro['title']);
+ $res .= $this->_content($intro['content']);
+ if ($additionnalContent) {
+ $res .= $additionnalContent;
+ }
+
+ $res .= '</div>'; // .col-2
+ $res .= '</div>'; // .grid
+
+ $attrs = array('class' => array('intro'));
+
+ if ($outsideContent) {
+ $res .= $outsideContent;
+ }
+
+ if (isset($intro['backgroundimage']) && !isset($intro['bg_image'])) {
+ $intro['bg_image'] = $intro['backgroundimage'];
+ }
+ if (!isset($intro['bg_image']) || !$intro['bg_image']) {
+ $attrs['class'][] = 'nobg';
+ } else {
+ $attrs['data-bg'] = print_r($intro['bg_image'], true);
+ }
+
+ $res = $this->backgroundBlock($res, $intro);
+ if ($intro['chapo']) {
+ $res .= $this->htmlElement($this->htmlElement(nl2br($intro['chapo']), 'div'), 'blockquote');
+ }
+
+
+ if (!$paddingTop) {
+ $attrs['class'][] = 'nopad';
+ }
+
+ if ($intro['header_theme']) {
+ $attrs['data-header-theme'] = 'light';
+ }
+
+ $style = '';
+ if ($intro['text_color']) {
+ $s = '@color:' . $intro['text_color'] . ' ;';
+ $s .= '.intro{' . "\n";
+ $s .= 'h1,h2,h3,h4,h5,h6,b,strong,i,em,p,a,address{color:@color !important;}' . "\n";
+ $s .= 'h1.title,h2.title,hr{&:after{background-color:@color !important;}}' . "\n";
+ $s .= '}';
+ $style = $this->styleLess($s);
+ }
+
+ return $style . $this->htmlElement($res, 'section', $attrs);
+ }
+
+ protected function _content($c)
+ {
+
+ $res = $this->markupDotclear($c);
+ if (stristr($res, '$adresse')) {
+ $address = $this->option('address');
+ $locale = new Zend_Locale();
+ $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));
+ $content = '<address>';
+ $content .= '<h4>' . $address['company'] . '</h4>';
+ $content .= $address['adresse'];
+ $content .= '<br>';
+ $content .= "{$address['code_postal']} {$address['ville']} - $country";
+ $content .= '<br>';
+ $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);
+ $content .= '<br>';
+ $content .= __('email :') . ' ' . $this->linkEmail($address['email']);
+ $content .= '</address>';
+
+ $res = str_replace('$adresse', $content, $res);
+ }
+ return $res;
+ }
}
\ No newline at end of file
@import "000-imports";\r
\r
.home {\r
- .content-wrapper.fullheight {\r
- position: relative;\r
- background-position: bottom right;\r
-\r
- @media @m900 {\r
- background-size: 180%;\r
- }\r
- }\r
-\r
- .content-inner {\r
- position: absolute;\r
- padding: 0 5%;\r
- top: 50%;\r
- left: 0;\r
- width: 100%;\r
- transform: translateY(-50%);\r
-\r
- @media @m900 {\r
- position: relative;\r
- transform: none;\r
- padding-top: 5%;\r
- padding-bottom: 80%;\r
- text-align: center;\r
- }\r
- }\r
-\r
- .btn {\r
- .button();\r
- .longarrow-button(16px, 40px, 18px);\r
- color: #fff;\r
- margin-top: 30px;\r
- }\r
-\r
- section {\r
- overflow: hidden;\r
-\r
- &.light {\r
- color: #fff;\r
-\r
- .title {\r
- color: #fff;\r
-\r
- &:after {\r
- background-color: #fff;\r
- }\r
- }\r
- }\r
-\r
- .dotclear {\r
- max-width: 500px;\r
-\r
- @media @m900 {\r
- max-width: none;\r
-\r
- ul {\r
- display: inline-block;\r
- text-align: left;\r
- }\r
- }\r
- }\r
- }\r
+ .content-wrapper.fullheight {\r
+ position: relative;\r
+ background-position: bottom right;\r
+\r
+ @media @m900 {\r
+ background-size: 180%;\r
+ }\r
+\r
+ &[data-has-mobile="1"] .content-inner {\r
+ @media @m900 {\r
+ padding-bottom: 55%;\r
+ }\r
+ }\r
+ }\r
+\r
+ .content-inner {\r
+ position: absolute;\r
+ padding: 0 5%;\r
+ top: 50%;\r
+ left: 0;\r
+ width: 100%;\r
+ transform: translateY(-50%);\r
+\r
+ @media @m900 {\r
+ position: relative;\r
+ transform: none;\r
+ padding-top: 5%;\r
+ padding-bottom: 80%;\r
+ text-align: center;\r
+\r
+\r
+ }\r
+\r
+\r
+ }\r
+\r
+ .btn {\r
+ .button();\r
+ .longarrow-button(16px, 40px, 18px);\r
+ color: #fff;\r
+ margin-top: 30px;\r
+ }\r
+\r
+ section {\r
+ overflow: hidden;\r
+\r
+ &.light {\r
+ color: #fff;\r
+\r
+ .title {\r
+ color: #fff;\r
+\r
+ &:after {\r
+ background-color: #fff;\r
+ }\r
+ }\r
+ }\r
+\r
+ .dotclear {\r
+ max-width: 500px;\r
+\r
+ @media @m900 {\r
+ max-width: none;\r
+\r
+ ul {\r
+ display: inline-block;\r
+ text-align: left;\r
+ }\r
+ }\r
+ }\r
+ }\r
}\r
\r
.pagination {\r
- position: fixed;\r
- top: 50%;\r
- left: 15px;\r
- transform: translateY(-50%);\r
- font-size: 30px;\r
- line-height: 1;\r
- transition: opacity 0.3s;\r
- cursor: pointer;\r
- z-index: 10;\r
- display: none; // Displayed only when in pagination mode\r
- list-style: none;\r
-\r
- .fullpages & {\r
- display: block;\r
- }\r
-\r
- li {\r
- //margin: 10px 0;\r
- height: 22px;\r
- position: relative;\r
- padding: 0 10px 0 25px;\r
- &:before {\r
- content: "";\r
- background-color: #e1e2e3;\r
- display: block;\r
- width: 10px;\r
- height: 10px;\r
- border-radius: 5px;\r
- position: absolute;\r
- left: 6px;\r
- top: 6px;\r
- }\r
- &:hover {\r
- &:before {\r
- background-color: #fff !important;\r
- }\r
- border-radius: 10px;\r
- span {\r
- position: relative;\r
- display: inline-block;\r
- color: #fff;\r
- top: -10px;\r
- }\r
- }\r
- span {\r
- font-size: 14px;\r
- line-height: 22px;\r
- }\r
- }\r
-\r
- span {\r
- display: none;\r
- }\r
+ position: fixed;\r
+ top: 50%;\r
+ left: 15px;\r
+ transform: translateY(-50%);\r
+ font-size: 30px;\r
+ line-height: 1;\r
+ transition: opacity 0.3s;\r
+ cursor: pointer;\r
+ z-index: 10;\r
+ display: none; // Displayed only when in pagination mode\r
+ list-style: none;\r
+\r
+ .fullpages & {\r
+ display: block;\r
+ }\r
+\r
+ li {\r
+ //margin: 10px 0;\r
+ height: 22px;\r
+ position: relative;\r
+ padding: 0 10px 0 25px;\r
+\r
+ &:before {\r
+ content: "";\r
+ background-color: #e1e2e3;\r
+ display: block;\r
+ width: 10px;\r
+ height: 10px;\r
+ border-radius: 5px;\r
+ position: absolute;\r
+ left: 6px;\r
+ top: 6px;\r
+ }\r
+\r
+ &:hover {\r
+ &:before {\r
+ background-color: #fff !important;\r
+ }\r
+\r
+ border-radius: 10px;\r
+\r
+ span {\r
+ position: relative;\r
+ display: inline-block;\r
+ color: #fff;\r
+ top: -10px;\r
+ }\r
+ }\r
+\r
+ span {\r
+ font-size: 14px;\r
+ line-height: 22px;\r
+ }\r
+ }\r
+\r
+ span {\r
+ display: none;\r
+ }\r
}
\ No newline at end of file