<?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));
+ }
}