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
--- /dev/null
+<?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
--- /dev/null
+<?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
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