From 3fd01d6645ddb5e3742dbdd36b43a1fd085bbe64 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Wed, 27 Jul 2016 16:12:07 +0000 Subject: [PATCH] WIP #492 @0.75 --- .../application/forms/CMS/Sub/Home/Services.php | 5 +++++ .../forms/CMS/Sub/Home/Services/Example.php | 16 ++++++++++++++++ .../forms/CMS/Sub/Home/Services/Examples.php | 14 ++++++++++++++ .../application/views/helpers/HomeServices.php | 7 ++++++- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 framework/application/forms/CMS/Sub/Home/Services/Example.php create mode 100644 framework/application/forms/CMS/Sub/Home/Services/Examples.php diff --git a/framework/application/forms/CMS/Sub/Home/Services.php b/framework/application/forms/CMS/Sub/Home/Services.php index c24c90e..2cd98c8 100644 --- a/framework/application/forms/CMS/Sub/Home/Services.php +++ b/framework/application/forms/CMS/Sub/Home/Services.php @@ -3,5 +3,10 @@ class Fluidbook_Form_CMS_Sub_Home_Services extends Fluidbook_Form_CMS_Sub_Home_Block { public function init() { parent::init(); + + $examples = new Fluidbook_Form_CMS_Sub_Home_Services_Examples(); + $examples->setLegend('Exemples'); + $this->addSubForm($examples, 'examples'); + } } \ 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 index 0000000..9ffec33 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Home/Services/Example.php @@ -0,0 +1,16 @@ +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 index 0000000..fa07187 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Home/Services/Examples.php @@ -0,0 +1,14 @@ +setBaseSubForm($example); + $this->setBaseLegend('Edition du exemple « $title »'); + $this->setNewLegend('Nouveau exemple'); + + } +} \ No newline at end of file diff --git a/framework/application/views/helpers/HomeServices.php b/framework/application/views/helpers/HomeServices.php index 39a9384..544b056 100644 --- a/framework/application/views/helpers/HomeServices.php +++ b/framework/application/views/helpers/HomeServices.php @@ -7,7 +7,12 @@ class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer public function homeServices($data) { $this->data = $data; - $res=$this->_leftText(); + $res = $this->_leftText(); + + foreach ($data['examples'] as $example) { + $res .= '

'. $example['title'] .'

'; + $res .= $this->imageCms($example['image'], $example['title']); + } return $this->_layer($res, 'services'); } -- 2.39.5