]> _ Git - bloomsburie.git/commitdiff
wait #7235 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 Jan 2025 14:14:26 +0000 (15:14 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 Jan 2025 14:14:26 +0000 (15:14 +0100)
framework/application/forms/CMS/Agence.php
framework/application/views/helpers/HomeBlocs.php
framework/application/views/scripts/templates/agence.phtml

index 2b14dceb66b855935e221de9f2468a811f2e41d0..e60ba6178349ce6ef83c29c5951850accec6a802 100644 (file)
@@ -9,6 +9,10 @@ class Cubedesigners_Form_CMS_Agence extends Cubedesigners_Form_CMS {
         $titre->setLabel('Intro');
         $this->addElement($titre);
 
+        $blocs = new Cubedesigners_Form_CMS_Sub_Home_Agence_Blocs('figures');
+        $blocs->setLegend('Figures');
+        $this->addSubForm($blocs, 'figures');
+
         $photo = new CubeIT_Form_Element_File_Image('photo');
                $photo->setLabel('Picture');
                $this->addElement($photo);
index 980cf2810fb65e3d97c2f16b95fd436e9838c7d5..cc3a91650f8a23dcfd0c77e76a5c57cee999b09d 100644 (file)
@@ -1,46 +1,50 @@
 <?php
 
-class Cubedesigners_View_Helper_HomeBlocs extends Zend_View_Helper_Abstract {
+class Cubedesigners_View_Helper_HomeBlocs extends Zend_View_Helper_Abstract
+{
 
-       public function homeBlocs($blocs, $displayDetailsButton = false, $cols = 2,$pictoSize=92) {
+    public function homeBlocs($blocs, $displayDetailsButton = false, $cols = 2, $pictoSize = 92)
+    {
 
-               $blocs = $blocs['blocs'];
+        if (isset($blocs['blocs'])) {
+            $blocs = $blocs['blocs'];
+        }
 
-               $res = '';
-               $i = 0;
-               foreach ($blocs as $bloc) {
+        $res = '';
+        $i = 0;
+        foreach ($blocs as $bloc) {
 //                     if ($cols == 2) {
 //                             if (($i % 2) == 0 && $i != 0) {
 //                                     $res.='<div class="spacer"></div>';
 //                             }
 //                     }
-                       $image = $this->view->imageCms($bloc['picto'], $bloc['titre'], $pictoSize, $pictoSize);
+            $image = $this->view->imageCms($bloc['picto'], $bloc['titre'], $pictoSize, $pictoSize);
 
-            if(!empty($bloc['lien'])) {
+            if (!empty($bloc['lien'])) {
                 $image = $this->view->linkInternal($image, $bloc['lien']);
             }
 
-                       $res .= '<article class="sousbloc">';
-                       $res.= $image;
+            $res .= '<article class="sousbloc">';
+            $res .= $image;
 
-                       $res.= '<div class="text">';
+            $res .= '<div class="text">';
             $titre = !empty($bloc['lien']) ? $this->view->linkInternal($bloc['titre'], $bloc['lien']) : $bloc['titre'];
-                       $res.= '<h3>' . $titre . '</h3>';
-                       $res.=$this->view->markupDotclear($bloc['texte']);
-                       if ($displayDetailsButton && isset($bloc['lien']) && $bloc['lien']) {
-                               $res.=$this->view->linkInternal($this->view->linkArrow(__('En savoir plus')), $bloc['lien'], array('class' => 'animated-arrow mt-6'));
-                       }
-                       $res.='</div>';
-                       $res .= '</article>';
-                       $i++;
-               }
-
-               $class = array('blocs');
-               if ($cols == 2) {
-                       $class[] = 'two';
-               }
-
-               return $this->view->htmlElement($res, 'div', array('class' => $class));
-       }
+            $res .= '<h3>' . $titre . '</h3>';
+            $res .= $this->view->markupDotclear($bloc['texte']);
+            if ($displayDetailsButton && isset($bloc['lien']) && $bloc['lien']) {
+                $res .= $this->view->linkInternal($this->view->linkArrow(__('En savoir plus')), $bloc['lien'], array('class' => 'animated-arrow mt-6'));
+            }
+            $res .= '</div>';
+            $res .= '</article>';
+            $i++;
+        }
+
+        $class = array('blocs');
+        if ($cols == 2) {
+            $class[] = 'two';
+        }
+
+        return $this->view->htmlElement($res, 'div', array('class' => $class));
+    }
 
 }
index ef8c7c0c28ae807d9bb96cf6d44b060a0f8519ce..75c481fc1dcf5220f55d9e56a4184facf6e77ede 100644 (file)
@@ -3,6 +3,11 @@ $this->headScript()->addScriptAndStyle('agence');
 $this->headScript()->addScriptAndStyle('slideshow');
 echo $this->intro();
 ?>
+<div class="bloc-holder content">
+    <?php
+    echo $this->homeBlocs($this->figures);
+    ?>
+</div>
 
 
 <div class="agency-photo mb-4vw"><?php echo $this->imageSlideshowContinuous($this->photo, 650, array(), array('arrowspermanent' => 1)); ?></div>