$questions = new CCGM_Form_CMS_Sub_Faq_Questions();
$questions->setLegend('Question / Réponses');
$this->addSubForm($questions, 'questions');
+
+ $titret = new Zend_Form_Element_Text('titre_temoignages');
+ $titret->setLabel('Titre de la rubrique "témoignages"');
+ $this->addElement($titret);
+
+ $temoignages = new CCGM_Form_CMS_Sub_Faq_Temoignages();
+ $temoignages->setLegend('Témoignages');
+ $this->addSubForm($temoignages, 'temoignages');
}
}
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Temoignage extends CubeIT_Form_SubForm {
+
+ public function init() {
+ parent::init();
+
+ $temoignage = new Zend_Form_Element_Textarea('temoignage');
+ $temoignage->setLabel('Témoignage');
+ $temoignage->setAttrib('rows', 3);
+ $this->addElement($temoignage);
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Temoignages extends CubeIT_Form_Multi_SubForm {
+
+ public function init() {
+ parent::init();
+ $base = new CCGM_Form_CMS_Sub_Faq_Temoignage();
+ $this->setBaseSubForm($base);
+ $this->setNewLegend('Nouvau témoignage');
+ $this->setBaseLegend('Editer le témoignage « $temoignage »');
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_View_Helper_Temoignages extends Zend_View_Helper_Abstract {
+
+ public function temoignages($titre, $temoignages) {
+ $this->view->headScript()->addScriptAndStyle('rightbar');
+ $res = '<aside id="rightbar" class="temoignages">';
+ $res.='<h2>' . $titre . '</h2>';
+ foreach ($temoignages as $t) {
+ $res.='<article>' . nl2br($t['temoignage']) . '</article>';
+ }
+ $res.='</aside>';
+ return $res;
+ }
+
+}
+
+?>
<h1><?php echo $this->titre ?></h1>\r
<?php echo $this->faq($this->questions); ?>\r
</div>\r
- <?php echo $this->rightbar() ?>\r
+ <?php echo $this->temoignages($this->titre_temoignages,$this->temoignages) ?>\r
</section>
\ No newline at end of file
.faq dd{
margin:12px 0 20px 0;
+}
+
+#rightbar.temoignages{
+ h2{
+ color:#e30186;
+ font-size: 24px;
+ }
+
+ article{
+ background-color:#f1f0f0;
+ color:#898989;
+ font-weight: 300;
+ font-size: 13px;
+ font-style: italic;
+ padding:20px 25px;
+ margin:0 0 30px 0;
+ position:relative;
+
+ &:after {
+ border-color: transparent #f1f0f0;
+ border-style: solid;
+ border-width: 0 0 17px 20px;
+ bottom: -17px;
+ content: "";
+ display: block;
+ position: absolute;
+ right: 91px;
+ width: 0;
+ }
+ }
}
\ No newline at end of file