<?php\r
\r
-\r
class Fluidbook_Form_CMS_Fonctionnalites extends Fluidbook_Form_CMS_Base {\r
\r
+ public function init() {\r
+ parent::init();\r
+\r
+ $features_title = new Zend_Form_Element_Textarea('features_title');\r
+ $features_title->setLabel('Titre pour "Fonctionnalités incluses de série"');\r
+ $features_title->setAttrib('rows', 3);\r
+ $this->addElement($features_title);\r
+\r
+ $features = new Fluidbook_Form_CMS_Sub_Features_Features();\r
+ $features->setLegend('Fonctionnalités incluses de série');\r
+ $this->addSubForm($features, 'features');\r
+\r
+ $services_title = new Zend_Form_Element_Textarea('services_title');\r
+ $services_title->setLabel('Titre pour "Services inclus de série"');\r
+ $services_title->setAttrib('rows', 3);\r
+ $this->addElement($services_title);\r
+\r
+ $services = new Fluidbook_Form_CMS_Sub_Features_Features();\r
+ $services->setLegend('Services inclus de série');\r
+ $this->addSubForm($services, 'services');\r
+\r
+ $extras_title = new Zend_Form_Element_Textarea('extras_title');\r
+ $extras_title->setLabel('Titre pour "Enrichissements et services optionnels"');\r
+ $extras_title->setAttrib('rows', 3);\r
+ $this->addElement($extras_title);\r
+\r
+ $extras = new Fluidbook_Form_CMS_Sub_Features_Features();\r
+ $extras->setLegend('Enrichissements et services optionnels');\r
+ $this->addSubForm($extras, 'extras');\r
+ }\r
}
\ No newline at end of file
--- /dev/null
+<?php
+
+class Fluidbook_Form_CMS_Sub_Features_Feature extends CubeIT_Form_SubForm {
+
+ public function init() {
+ parent::init();
+
+ $title = new Zend_Form_Element_Text('title');
+ $title->setLabel('Titre du bloc');
+ $this->addElement($title);
+
+ $content = new CubeIT_Form_Element_Markitup('content');
+ $content->setLabel('Contenus');
+ $this->addElement($content);
+
+ $icon = new CubeIT_Form_Element_File_Image('icon');
+ $icon->setLabel('Pictogramme');
+ $this->addElement($icon);
+
+ $bg_gradient = new Fluidbook_Form_CMS_Sub_Gradient();
+ $bg_gradient->setLegend('Background Gradient');
+ $this->addSubForm($bg_gradient, 'background_gradient');
+
+ $bg_image = new CubeIT_Form_Element_File_Image('background_image');
+ $bg_image->setLabel('Background Image');
+ $this->addElement($bg_image);
+
+ $layout = new Zend_Form_Element_Select('layout');
+ $layout->setLabel('Layout');
+ $layout->setMultiOptions(array(
+ 'square-top' => 'Square block with image top',
+ 'square-bottom' => 'Square block with image bottom',
+ 'rectangle-right' => 'Large rectangle with image right',
+ 'rectangle-bottom' => 'Large rectangle with image bottom',
+ 'small-rectangle-tall' => 'Small rectangle (tall)',
+ 'small-rectangle-wide' => 'Small rectangle (wide)',
+ ));
+ $this->addElement($layout);
+
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class Fluidbook_Form_CMS_Sub_Features_Features extends CubeIT_Form_Multi_SubForm {
+
+ public function init() {
+ parent::init();
+
+ $feature = new Fluidbook_Form_CMS_Sub_Features_Feature();
+ $this->setBaseSubForm($feature);
+ $this->setBaseLegend('Edition du bloc « $title »');
+ $this->setNewLegend('Nouveau bloc');
+
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class Fluidbook_Form_CMS_Sub_Gradient extends CubeIT_Form_SubForm
+{
+
+ public function init() {
+ parent::init();
+
+ $color1 = new CubeIT_Form_Element_Color('color1');
+ $color1->setLabel('Couleur 1');
+ $this->addElement($color1);
+
+ $color2 = new CubeIT_Form_Element_Color('color2');
+ $color2->setLabel('Couleur 2');
+ $this->addElement($color2);
+
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract {
+
+ public function featuresSection($title, $blocks) {
+
+ $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) {
+
+ $gradient = $this->_gradient($block['background_gradient']);
+ $text_colour = $gradient ? 'light' : 'dark';
+
+ $res .= '<div class="feature-block text-'. $text_colour .'" style="'. $gradient .'">';
+ $res .= '<h4>'. $block['title'] .'</h4>';
+ $res .= $this->markupDotclear($block['content']);
+ $res .= '</div>'; // .feature-block
+ }
+
+ $res .= '</div>'; // .feature-blocks
+ $res .= '</div>'; // .content-wrapper
+
+ return $res;
+ }
+
+
+ protected function _gradient($gradient) {
+ if (empty($gradient['color1']) || empty($gradient['color2'])) {
+ return false;
+ }
+
+ $angle = '45deg';
+ $c1 = $gradient['color1'];
+ $c2 = $gradient['color2'];
+
+ return "background: $c1;
+background: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
+background: -webkit-linear-gradient($angle, $c1 0%, $c2 100%);
+background: linear-gradient($angle, $c1 0%, $c2 100%);
+filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$c1', endColorstr='$c2',GradientType=1);";
+ }
+
+}
\ No newline at end of file
<?php\r
\r
-echo $this->introBlock($this->intro, '');\r
-echo $this->contactFooter();
\ No newline at end of file
+$res = $this->introBlock($this->intro, '');\r
+\r
+$res .= $this->featuresSection($this->features_title, $this->features);\r
+$res .= $this->featuresSection($this->services_title, $this->services);\r
+$res .= $this->featuresSection($this->extras_title, $this->extras);\r
+\r
+$res .= $this->contactFooter();\r
+\r
+echo $res;
\ No newline at end of file