]> _ Git - fluidbook-v3.git/commitdiff
WIP #488 @5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 5 Jul 2016 16:25:05 +0000 (16:25 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 5 Jul 2016 16:25:05 +0000 (16:25 +0000)
framework/application/forms/CMS/Fonctionnalites.php
framework/application/forms/CMS/Sub/Features/Feature.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Features/Features.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Gradient.php [new file with mode: 0644]
framework/application/views/helpers/FeaturesSection.php [new file with mode: 0644]
framework/application/views/scripts/templates/fonctionnalites.phtml

index 718eadf4385963fd644a9428f790685d8cf6f309..3451b5ab97c2bf176a2a163f3ac91b651a7fb645 100644 (file)
@@ -1,6 +1,35 @@
 <?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
diff --git a/framework/application/forms/CMS/Sub/Features/Feature.php b/framework/application/forms/CMS/Sub/Features/Feature.php
new file mode 100644 (file)
index 0000000..d088350
--- /dev/null
@@ -0,0 +1,41 @@
+<?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
diff --git a/framework/application/forms/CMS/Sub/Features/Features.php b/framework/application/forms/CMS/Sub/Features/Features.php
new file mode 100644 (file)
index 0000000..7bfc359
--- /dev/null
@@ -0,0 +1,14 @@
+<?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
diff --git a/framework/application/forms/CMS/Sub/Gradient.php b/framework/application/forms/CMS/Sub/Gradient.php
new file mode 100644 (file)
index 0000000..6968457
--- /dev/null
@@ -0,0 +1,19 @@
+<?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
diff --git a/framework/application/views/helpers/FeaturesSection.php b/framework/application/views/helpers/FeaturesSection.php
new file mode 100644 (file)
index 0000000..8666576
--- /dev/null
@@ -0,0 +1,45 @@
+<?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
index e38739125c54a0f12db026d12e78bd5717697d62..13f1e665222430089cece761aa6e6c8f143f7d1e 100644 (file)
@@ -1,4 +1,11 @@
 <?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