class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract {
- public function featuresSection($title, $blocks) {
-
- $this->headScript()->addMasonry()->addJQueryTransform();
-
- $res = '<div class="content-wrapper grid wrap">';
- $res .= '<h1 class="title col-6">' . nl2br($title) . '</h1>';
- $res .= '<div class="feature-blocks">';
-
- foreach ($blocks as $block) {
-
- // Generate ID for CSS
- $id = 'block-' . strtolower(CubeIT_Util_Text::str2URL($block['title']));
-
- // Text colour is based on whether block has a gradient or not
- $text_colour = $this->hasGradient($block) ? 'light' : 'dark';
-
- $res .= '<div class="feature-block text-'. $text_colour .' '. $block['layout'] .'" id="'. $id .'">';
-
- $res .= $this->_CSS($id, $block);
-
- $res .= '<div class="feature-inner">';
-
- if (!empty($block['icon'])) {
- $res .= '<div class="feature-icon fb-'. $block['icon'] .'"></div>';
- }
-
- $res .= '<div class="feature-text">';
- $res .= '<h4 class="feature-title">'. $block['title'] .'</h4>';
- $res .= $this->markupDotclear($block['content']);
- $res .= '</div>'; // .feature-text
-
- $res .= '</div>'; // .feature-inner
- $res .= '</div>'; // .feature-block
- }
-
- $res .= '</div>'; // .feature-blocks
- $res .= '</div>'; // .content-wrapper
-
- return $res;
- }
-
- protected function hasGradient($block) {
- $gradient = $block['background_gradient'];
- return !(empty($gradient['color1']) || empty($gradient['color2']));
- }
-
- protected function hasBGImage($block) {
- return is_array($block['background_image']);
- }
-
- protected function _layoutData($layout) {
-
- switch($layout) {
- case 'square-top':
- case 'square-bottom':
- $w = 2;
- $h = 2;
- break;
- case 'rectangle-right':
- case 'rectangle-bottom':
- $w = 3;
- $h = 2;
- break;
- case 'small-rectangle-tall':
- $w = 1;
- $h = 2;
- break;
- case 'small-rectangle-wide':
- $w = 2;
- $h = 1;
- }
-
- if (!$w || !$h) return '';
-
- return 'data-w="'. $w .'" data-h="'. $h .'"';
- }
-
- protected function _CSS($id, $block) {
-
- // Set the width background images should disappear and be replaced by CSS gradients
- // This should match the setting at the top of "410-features.less"
- $breakpoint_single_column = '767px';
-
- $res = '<style scoped>';
-
- $res .= "#$id {";
- $res .= $this->_backgroundColour($block);
-
- // Main CSS - block can have a bg image, a gradient, both or neither.
- if ($this->hasBGImage($block)) {
- $res .= $this->_backgroundImage($block);
- } elseif ($this->hasGradient($block)) {
- $res .= $this->_gradient($block);
- }
-
- $res .= '}';
-
- // 1 column version - swap background images for a gradient / solid colour
- $res .= "@media screen and (max-width: $breakpoint_single_column) {";
- $res .= "#$id {";
-
- if ($this->hasGradient($block)) {
- $res .= $this->_gradient($block);
- } else {
- $res .= 'background-image: none;';
- }
-
- $res .= '}';
- $res .= '}';
- $res .= '</style>';
-
- return $res;
- }
-
- protected function _backgroundColour($block) {
- if (empty($block['background_gradient']['color1'])) {
- return '';
- }
-
- return 'background-color: '. $block['background_gradient']['color1'] .';';
- }
-
- protected function _backgroundImage($block) {
- if (!is_array($block['background_image'])) return '';
-
- $path = CubeIT_View_Helper_ImageCms::getPath($block['background_image']);
-
- return "background-image: url('$path');";
- }
-
- protected function _gradient($block) {
-
- $gradient = $block['background_gradient'];
-
- if (empty($gradient['color1']) || empty($gradient['color2'])) {
- return '';
- }
-
- $angle = '45deg';
- $c1 = $gradient['color1'];
- $c2 = $gradient['color2'];
-
- return "background-image: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
+ public function featuresSection($title, $blocks) {
+
+ $this->headScript()->addMasonry()->addJQueryTransform();
+
+ $res = '<div class="content-wrapper grid wrap">';
+ $res .= $this->title($title, 'h1', array('class' => 'col-6'));
+ $res .= '<div class="feature-blocks">';
+
+ foreach ($blocks as $block) {
+
+ // Generate ID for CSS
+ $id = 'block-' . strtolower(CubeIT_Util_Text::str2URL($block['title']));
+
+ // Text colour is based on whether block has a gradient or not
+ $text_colour = $this->hasGradient($block) ? 'light' : 'dark';
+
+ $res .= '<div class="feature-block text-' . $text_colour . ' ' . $block['layout'] . '" id="' . $id . '">';
+
+ $res .= $this->_CSS($id, $block);
+
+ $res .= '<div class="feature-inner">';
+
+ if (!empty($block['icon'])) {
+ $res .= '<div class="feature-icon fb-' . $block['icon'] . '"></div>';
+ }
+
+ $res .= '<div class="feature-text">';
+ $res .= '<h4 class="feature-title">' . $block['title'] . '</h4>';
+ $res .= $this->markupDotclear($block['content']);
+ $res .= '</div>'; // .feature-text
+
+ $res .= '</div>'; // .feature-inner
+ $res .= '</div>'; // .feature-block
+ }
+
+ $res .= '</div>'; // .feature-blocks
+ $res .= '</div>'; // .content-wrapper
+
+ return $res;
+ }
+
+ protected function hasGradient($block) {
+ $gradient = $block['background_gradient'];
+ return !(empty($gradient['color1']) || empty($gradient['color2']));
+ }
+
+ protected function hasBGImage($block) {
+ return is_array($block['background_image']);
+ }
+
+ protected function _layoutData($layout) {
+
+ switch ($layout) {
+ case 'square-top':
+ case 'square-bottom':
+ $w = 2;
+ $h = 2;
+ break;
+ case 'rectangle-right':
+ case 'rectangle-bottom':
+ $w = 3;
+ $h = 2;
+ break;
+ case 'small-rectangle-tall':
+ $w = 1;
+ $h = 2;
+ break;
+ case 'small-rectangle-wide':
+ $w = 2;
+ $h = 1;
+ }
+
+ if (!$w || !$h)
+ return '';
+
+ return 'data-w="' . $w . '" data-h="' . $h . '"';
+ }
+
+ protected function _CSS($id, $block) {
+
+ // Set the width background images should disappear and be replaced by CSS gradients
+ // This should match the setting at the top of "410-features.less"
+ $breakpoint_single_column = '767px';
+
+ $res = '<style scoped>';
+
+ $res .= "#$id {";
+ $res .= $this->_backgroundColour($block);
+
+ // Main CSS - block can have a bg image, a gradient, both or neither.
+ if ($this->hasBGImage($block)) {
+ $res .= $this->_backgroundImage($block);
+ } elseif ($this->hasGradient($block)) {
+ $res .= $this->_gradient($block);
+ }
+
+ $res .= '}';
+
+ // 1 column version - swap background images for a gradient / solid colour
+ $res .= "@media screen and (max-width: $breakpoint_single_column) {";
+ $res .= "#$id {";
+
+ if ($this->hasGradient($block)) {
+ $res .= $this->_gradient($block);
+ } else {
+ $res .= 'background-image: none;';
+ }
+
+ $res .= '}';
+ $res .= '}';
+ $res .= '</style>';
+
+ return $res;
+ }
+
+ protected function _backgroundColour($block) {
+ if (empty($block['background_gradient']['color1'])) {
+ return '';
+ }
+
+ return 'background-color: ' . $block['background_gradient']['color1'] . ';';
+ }
+
+ protected function _backgroundImage($block) {
+ if (!is_array($block['background_image']))
+ return '';
+
+ $path = CubeIT_View_Helper_ImageCms::getPath($block['background_image']);
+
+ return "background-image: url('$path');";
+ }
+
+ protected function _gradient($block) {
+
+ $gradient = $block['background_gradient'];
+
+ if (empty($gradient['color1']) || empty($gradient['color2'])) {
+ return '';
+ }
+
+ $angle = '45deg';
+ $c1 = $gradient['color1'];
+ $c2 = $gradient['color2'];
+
+ return "background-image: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
background-image: -webkit-linear-gradient($angle, $c1 0%, $c2 100%);
background-image: linear-gradient($angle, $c1 0%, $c2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$c1', endColorstr='$c2',GradientType=1);";
- }
+ }
}
\ No newline at end of file
class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract {
- public function quoteForm($formID = null) {
+ public function quoteForm($formID = null) {
- $this->headScript()->addScriptAndStyle('315-quote');
+ $this->headScript()->addScriptAndStyle('315-quote');
- $form = new Fluidbook_Form_RequestQuote();
+ $form = new Fluidbook_Form_RequestQuote();
- if ($formID) {
- $form->setId($formID);
- $form->setAction($form->getAction() .'/'. $formID);
- }
+ if ($formID) {
+ $form->setId($formID);
+ $form->setAction($form->getAction() . '/' . $formID);
+ }
- $res = '<div class="request-quote content-wrapper grid">';
- $res .= '<div class="text col-2">';
- $res .= '<h1 class="title">'. nl2br($this->option('quote_heading')) .'</h1>';
- $res .= $this->markupDotclear($this->option('quote_description'));
- $res .= '</div>'; // .text
- $res .= '<div class="form col-4">';
- $res .= $form;
- $res .= '<div class="validation-messages"></div>';
- $res .= '</div>'; // .form
- $res .= '</div>'; // .request-quote
-
- return $res;
- }
+ $res = '<div class="request-quote content-wrapper grid">';
+ $res .= '<div class="text col-2">';
+ $res .= $this->title($this->option('quote_heading'));
+ $res .= $this->markupDotclear($this->option('quote_description'));
+ $res .= '</div>'; // .text
+ $res .= '<div class="form col-4">';
+ $res .= $form;
+ $res .= '<div class="validation-messages"></div>';
+ $res .= '</div>'; // .form
+ $res .= '</div>'; // .request-quote
+
+ return $res;
+ }
}
\ No newline at end of file