From: stephen@cubedesigners.com Date: Tue, 5 Jul 2016 16:25:05 +0000 (+0000) Subject: WIP #488 @5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=941d8b27e9b3e84c0750ced95bf4dabfbae29a91;p=fluidbook-v3.git WIP #488 @5 --- diff --git a/framework/application/forms/CMS/Fonctionnalites.php b/framework/application/forms/CMS/Fonctionnalites.php index 718eadf..3451b5a 100644 --- a/framework/application/forms/CMS/Fonctionnalites.php +++ b/framework/application/forms/CMS/Fonctionnalites.php @@ -1,6 +1,35 @@ setLabel('Titre pour "Fonctionnalités incluses de série"'); + $features_title->setAttrib('rows', 3); + $this->addElement($features_title); + + $features = new Fluidbook_Form_CMS_Sub_Features_Features(); + $features->setLegend('Fonctionnalités incluses de série'); + $this->addSubForm($features, 'features'); + + $services_title = new Zend_Form_Element_Textarea('services_title'); + $services_title->setLabel('Titre pour "Services inclus de série"'); + $services_title->setAttrib('rows', 3); + $this->addElement($services_title); + + $services = new Fluidbook_Form_CMS_Sub_Features_Features(); + $services->setLegend('Services inclus de série'); + $this->addSubForm($services, 'services'); + + $extras_title = new Zend_Form_Element_Textarea('extras_title'); + $extras_title->setLabel('Titre pour "Enrichissements et services optionnels"'); + $extras_title->setAttrib('rows', 3); + $this->addElement($extras_title); + + $extras = new Fluidbook_Form_CMS_Sub_Features_Features(); + $extras->setLegend('Enrichissements et services optionnels'); + $this->addSubForm($extras, 'extras'); + } } \ 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 index 0000000..d088350 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Features/Feature.php @@ -0,0 +1,41 @@ +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 index 0000000..7bfc359 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Features/Features.php @@ -0,0 +1,14 @@ +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 index 0000000..6968457 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Gradient.php @@ -0,0 +1,19 @@ +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 index 0000000..8666576 --- /dev/null +++ b/framework/application/views/helpers/FeaturesSection.php @@ -0,0 +1,45 @@ +'; + $res .= '

' . nl2br($title) . '

'; + $res .= '
'; + + foreach ($blocks as $block) { + + $gradient = $this->_gradient($block['background_gradient']); + $text_colour = $gradient ? 'light' : 'dark'; + + $res .= '
'; + $res .= '

'. $block['title'] .'

'; + $res .= $this->markupDotclear($block['content']); + $res .= '
'; // .feature-block + } + + $res .= '
'; // .feature-blocks + $res .= ''; // .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 diff --git a/framework/application/views/scripts/templates/fonctionnalites.phtml b/framework/application/views/scripts/templates/fonctionnalites.phtml index e387391..13f1e66 100644 --- a/framework/application/views/scripts/templates/fonctionnalites.phtml +++ b/framework/application/views/scripts/templates/fonctionnalites.phtml @@ -1,4 +1,11 @@ introBlock($this->intro, ''); -echo $this->contactFooter(); \ No newline at end of file +$res = $this->introBlock($this->intro, ''); + +$res .= $this->featuresSection($this->features_title, $this->features); +$res .= $this->featuresSection($this->services_title, $this->services); +$res .= $this->featuresSection($this->extras_title, $this->extras); + +$res .= $this->contactFooter(); + +echo $res; \ No newline at end of file