]> _ Git - ccgm.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 14 Aug 2013 16:31:15 +0000 (16:31 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 14 Aug 2013 16:31:15 +0000 (16:31 +0000)
14 files changed:
css/common.css
css/faq.css [new file with mode: 0644]
css/liens.css [new file with mode: 0644]
css/rightbar.css
framework/application/forms/CMS/Faq.php [new file with mode: 0644]
framework/application/forms/CMS/Liens.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Faq/Question.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Faq/Questions.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Liens.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Liens/Lien.php [new file with mode: 0644]
framework/application/views/helpers/Faq.php [new file with mode: 0644]
framework/application/views/helpers/Liens.php [new file with mode: 0644]
framework/application/views/scripts/templates/faq.phtml [new file with mode: 0644]
framework/application/views/scripts/templates/liens.phtml [new file with mode: 0644]

index a53a1cca1354da1bea6e0d38d4019004bb98b0cb..a6ce9f67b5dfb63bdd29bf4030623e2338c0d6cf 100644 (file)
@@ -267,7 +267,7 @@ q:after{content:"";}
        margin:20px 0;\r
 }\r
 #content ul{\r
-       margin:0;\r
+       margin:20px 0;\r
        padding:0;\r
        list-style:none;\r
 }\r
diff --git a/css/faq.css b/css/faq.css
new file mode 100644 (file)
index 0000000..801f5bb
--- /dev/null
@@ -0,0 +1,12 @@
+#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
diff --git a/css/liens.css b/css/liens.css
new file mode 100644 (file)
index 0000000..4260058
--- /dev/null
@@ -0,0 +1,14 @@
+.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
index 95b59206209eb1bba981ebebbecc72cf22a970d6..085ba7fd2c487c14b0c8111e51c97cb0a7263003 100644 (file)
@@ -1,6 +1,7 @@
 #rightbar{
        width:262px;
        display:inline-block;
+       margin:0 0 50px 0;
 }
 
 #rightbar>img{
diff --git a/framework/application/forms/CMS/Faq.php b/framework/application/forms/CMS/Faq.php
new file mode 100644 (file)
index 0000000..2ff03d7
--- /dev/null
@@ -0,0 +1,19 @@
+<?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');
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Liens.php b/framework/application/forms/CMS/Liens.php
new file mode 100644 (file)
index 0000000..0012ef7
--- /dev/null
@@ -0,0 +1,19 @@
+<?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');
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Sub/Faq/Question.php b/framework/application/forms/CMS/Sub/Faq/Question.php
new file mode 100644 (file)
index 0000000..d6b03b5
--- /dev/null
@@ -0,0 +1,19 @@
+<?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);
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Sub/Faq/Questions.php b/framework/application/forms/CMS/Sub/Faq/Questions.php
new file mode 100644 (file)
index 0000000..a9b8f0d
--- /dev/null
@@ -0,0 +1,15 @@
+<?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 »');
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Sub/Liens.php b/framework/application/forms/CMS/Sub/Liens.php
new file mode 100644 (file)
index 0000000..fbde543
--- /dev/null
@@ -0,0 +1,16 @@
+<?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');
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Sub/Liens/Lien.php b/framework/application/forms/CMS/Sub/Liens/Lien.php
new file mode 100644 (file)
index 0000000..0f984fe
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+
+class CCGM_Form_CMS_Sub_Liens_Lien extends CubeIT_Form_Element_Link {
+
+       public function init() {
+               parent::init();
+
+               $this->pageEnabled(false);
+       }
+
+}
+
+?>
diff --git a/framework/application/views/helpers/Faq.php b/framework/application/views/helpers/Faq.php
new file mode 100644 (file)
index 0000000..f3d69be
--- /dev/null
@@ -0,0 +1,20 @@
+<?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'));
+       }
+
+}
+
+?>
diff --git a/framework/application/views/helpers/Liens.php b/framework/application/views/helpers/Liens.php
new file mode 100644 (file)
index 0000000..6562cdf
--- /dev/null
@@ -0,0 +1,26 @@
+<?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>';
+       }
+
+}
+
+?>
diff --git a/framework/application/views/scripts/templates/faq.phtml b/framework/application/views/scripts/templates/faq.phtml
new file mode 100644 (file)
index 0000000..798e426
--- /dev/null
@@ -0,0 +1,8 @@
+<?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
diff --git a/framework/application/views/scripts/templates/liens.phtml b/framework/application/views/scripts/templates/liens.phtml
new file mode 100644 (file)
index 0000000..12fef00
--- /dev/null
@@ -0,0 +1,8 @@
+<?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