From: stephen@cubedesigners.com Date: Wed, 27 Jul 2016 16:12:07 +0000 (+0000) Subject: WIP #492 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3fd01d6645ddb5e3742dbdd36b43a1fd085bbe64;p=fluidbook-v3.git WIP #492 @0.75 --- 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'); }