margin:20px 0;\r
}\r
#content ul{\r
- margin:0;\r
+ margin:20px 0;\r
padding:0;\r
list-style:none;\r
}\r
--- /dev/null
+#content ul.faq{
+ margin:30px 0 0 0;
+}
+
+.faq dt{
+ font-weight: 500;
+ margin:12px 0;
+}
+
+.faq dd{
+ margin:12px 0 20px 0;
+}
\ No newline at end of file
--- /dev/null
+.links{
+ font-size: 16px;
+ font-weight: 300;
+}
+
+.links li{
+ margin:30px 0;
+}
+
+.links li a{
+ display: block;
+ margin:10px 0 0 0;
+ color:#0ea6db;
+}
\ No newline at end of file
#rightbar{
width:262px;
display:inline-block;
+ margin:0 0 50px 0;
}
#rightbar>img{
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Faq extends CCGM_Form_CMS_Default {
+
+ public function init() {
+ parent::init();
+
+ $titre = new Zend_Form_Element_Text('titre');
+ $titre->setLabel('Titre');
+ $this->addElement($titre);
+
+ $questions = new CCGM_Form_CMS_Sub_Faq_Questions();
+ $questions->setLegend('Question / Réponses');
+ $this->addSubForm($questions, 'questions');
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Liens extends CCGM_Form_CMS_Default {
+
+ public function init() {
+ parent::init();
+
+ $titre = new Zend_Form_Element_Text('titre');
+ $titre->setLabel('Titre');
+ $this->addElement($titre);
+
+ $liens = new CCGM_Form_CMS_Sub_Liens();
+ $liens->setLegend('Liens');
+ $this->addSubForm($liens, 'liens');
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Question extends CubeIT_Form_SubForm {
+
+ public function init() {
+ parent::init();
+ $question = new Zend_Form_Element_Text('question');
+ $question->setLabel('Question');
+ $this->addElement($question);
+
+ $reponse = new CCGM_Form_Element_Markitup_Essential('reponse');
+ $reponse->setLabel('Réponse');
+ $reponse->setAttrib('rows', 6);
+ $this->addElement($reponse);
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Questions extends CubeIT_Form_Multi_SubForm {
+
+ public function init() {
+ parent::init();
+ $base=new CCGM_Form_CMS_Sub_Faq_Question();
+ $this->setBaseSubForm($base);
+ $this->setNewLegend('Nouvelle question');
+ $this->setBaseLegend('Editer la question « $question »');
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Liens extends CubeIT_Form_Multi_SubForm {
+
+ public function init() {
+ parent::init();
+
+ $base = new CCGM_Form_CMS_Sub_Liens_Lien();
+ $this->setBaseSubForm($base);
+ $this->setBaseLegend('Editer le lien « $label »');
+ $this->setNewLegend('Nouveau lien');
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Sub_Liens_Lien extends CubeIT_Form_Element_Link {
+
+ public function init() {
+ parent::init();
+
+ $this->pageEnabled(false);
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_View_Helper_Faq extends Zend_View_Helper_Abstract {
+
+ public function faq($questions) {
+ $items = array();
+ foreach ($questions as $q) {
+ $item = '<dl>';
+ $item.='<dt>' . $q['question'] . '</dt>';
+ $item.='<dd>' . $q['reponse'] . '</dd>';
+ $item.='</dl>';
+ $items[] = $item;
+ }
+
+ return $this->view->listUnordered($items, array('class' => 'faq'));
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_View_Helper_Liens extends Zend_View_Helper_Abstract {
+
+ public function liens($liens) {
+ $items = array();
+
+ foreach ($liens as $l) {
+ $item = $l['label'];
+ if (trim($l['url']) != '') {
+ if (!preg_match('#https?\:\/\/#i', $l['url'])) {
+ $l['url'] = 'http://' . $l['url'];
+ }
+ $label = preg_replace('#^https?\:\/\/#i', '', $l['url']);
+ $label = rtrim($label, '/');
+ $item.=$this->view->link($label, $l['url']);
+ }
+ $items[] = $item;
+ }
+
+ return '<section class="links">' . $this->view->listUnordered($items) . '</section>';
+ }
+
+}
+
+?>
--- /dev/null
+<?php $this->headScript()->addScriptAndStyle('faq') ?>\r
+<section id="content">\r
+ <div id="c">\r
+ <h1><?php echo $this->titre ?></h1>\r
+ <?php echo $this->faq($this->questions); ?>\r
+ </div>\r
+ <?php echo $this->rightbar() ?>\r
+</section>
\ No newline at end of file
--- /dev/null
+<?php $this->headScript()->addScriptAndStyle('liens') ?>\r
+<section id="content">\r
+ <div id="c">\r
+ <h1><?php echo $this->titre ?></h1>\r
+ <?php echo $this->liens($this->liens); ?>\r
+ </div>\r
+ <?php echo $this->rightbar() ?>\r
+</section>
\ No newline at end of file