]> _ Git - fluidbook-v3.git/commitdiff
WIP #492 @0.75
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 27 Jul 2016 16:12:07 +0000 (16:12 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 27 Jul 2016 16:12:07 +0000 (16:12 +0000)
framework/application/forms/CMS/Sub/Home/Services.php
framework/application/forms/CMS/Sub/Home/Services/Example.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Home/Services/Examples.php [new file with mode: 0644]
framework/application/views/helpers/HomeServices.php

index c24c90e528bee09fac9d926af250f7c8ab6e47e4..2cd98c8d53faa90551b5aeef714febe2b940def6 100644 (file)
@@ -3,5 +3,10 @@
 class Fluidbook_Form_CMS_Sub_Home_Services extends Fluidbook_Form_CMS_Sub_Home_Block {\r
        public function init() {\r
                parent::init();\r
+\r
+        $examples = new Fluidbook_Form_CMS_Sub_Home_Services_Examples();\r
+        $examples->setLegend('Exemples');\r
+        $this->addSubForm($examples, 'examples');\r
+\r
        }\r
 }
\ No newline at end of file
diff --git a/framework/application/forms/CMS/Sub/Home/Services/Example.php b/framework/application/forms/CMS/Sub/Home/Services/Example.php
new file mode 100644 (file)
index 0000000..9ffec33
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+class Fluidbook_Form_CMS_Sub_Home_Services_Example extends CubeIT_Form_SubForm {
+
+    public function init() {
+        parent::init();
+
+        $title = new Zend_Form_Element_Text('title');
+        $title->setLabel('Titre du exemple');
+        $this->addElement($title);
+
+        $image = new CubeIT_Form_Element_File_Image('image');
+        $image->setLabel('Image');
+        $this->addElement($image);
+    }
+}
\ No newline at end of file
diff --git a/framework/application/forms/CMS/Sub/Home/Services/Examples.php b/framework/application/forms/CMS/Sub/Home/Services/Examples.php
new file mode 100644 (file)
index 0000000..fa07187
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+class Fluidbook_Form_CMS_Sub_Home_Services_Examples extends CubeIT_Form_Multi_SubForm {
+
+    public function init() {
+        parent::init();
+
+        $example = new Fluidbook_Form_CMS_Sub_Home_Services_Example();
+        $this->setBaseSubForm($example);
+        $this->setBaseLegend('Edition du exemple « $title »');
+        $this->setNewLegend('Nouveau exemple');
+
+    }
+}
\ No newline at end of file
index 39a938433ed899d9a254ca229026be30a0c17667..544b0565e99947dfcc44e169481f8cfdc6e42826 100644 (file)
@@ -7,7 +7,12 @@ class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer
        public function homeServices($data) {\r
                $this->data = $data;\r
 \r
-        $res=$this->_leftText();\r
+        $res = $this->_leftText();\r
+\r
+        foreach ($data['examples'] as $example) {\r
+            $res .= '<h3>'. $example['title'] .'</h3>';\r
+            $res .= $this->imageCms($example['image'], $example['title']);\r
+        }\r
 \r
                return $this->_layer($res, 'services');\r
        }\r