Skip to content
Snippets Groups Projects
Commit 7ba2e4e5 authored by gloas's avatar gloas
Browse files

rel #9218 amelioration de l'affichage du résultat d un catalogue et d un panier

parent 37dee466
Branches
Tags 7.2.0
No related merge requests found
......@@ -50,6 +50,11 @@ trait Trait_Translator {
}
/**
* exemple: $str_resas = $this->_plural($nb_resas,
* "Vous n'avez aucune réservation en cours.",
* "Vous avez %d réservation en cours",
* "Vous avez %d réservations en cours",
* $nb_resas);
* @return string
*/
public function _plural() {
......
......@@ -23,33 +23,44 @@ class ZendAfi_View_Helper_TagTitreEtNombreDeResultats extends Zend_View_Helper_H
public function tagTitreEtNombreDeResultats($nombre_resultats, $criteres_recherche){
xdebug_break();
$expression_recherche = $criteres_recherche->getExpressionRecherche();
if(!$expression_recherche){
if($criteres_recherche->getCatalogue())
$expression_recherche = $criteres_recherche->getCatalogue()->getLibelle();
if($criteres_recherche->getPanier())
$expression_recherche = $criteres_recherche->getPanier()->getLibelle();
$expression_recherche = $this->_getExpressionRecherche($criteres_recherche);
$plural_expression = $this->view->_plural( $nombre_resultats,
"Aucun résultat trouvé",
"Il y a <span class='nombre-recherche'>&nbsp;%d&nbsp;</span> résultat",
"Il y a <span class='nombre-recherche'>&nbsp;%d&nbsp;</span> résultats",
$nombre_resultats);
}
$html='<div class="info-recherche">';
if(!$nombre_resultats)
$html.=
'<span>'.$this->view->_('Aucun résultat trouvé pour :').'&nbsp;</span>'.
'<span class="expression-recherche" >'.$expression_recherche.'</span>';
if($nombre_resultats == 1)
$html.=
'<span>'.$this->view->_('Il y a').'&nbsp;</span>'.
'<span class="nombre-recherche">1</span>'.
'<span>&nbsp;'.$this->view->_('résultat pour :').'&nbsp;</span>'.
'<span class="expression-recherche" >'.$expression_recherche.'</span>';
if($nombre_resultats > 1)
$html.=
'<span>'.$this->view->_('Il y a').'&nbsp;</span>'.
'<span class="nombre-recherche">'.$nombre_resultats.'</span>'.
'<span>&nbsp;'.$this->view->_('résultats pour :').'&nbsp;</span>'.
'<span class="expression-recherche" >'.$expression_recherche.'</span>';
$html.='<span>'.$plural_expression.'&nbsp;'.$expression_recherche.'</span>';
return $html.='</div>';
}
protected function _getExpressionRecherche( $criteres_recherche ) {
xdebug_break();
$expression_critere_recherche =$criteres_recherche->getExpressionRecherche();
$expression=$this->view->_('pour:&nbsp;');
$catalogue=$this->view->_('dans le catalogue:&nbsp;');
$panier=$this->view->_('dans le panier:&nbsp;');
$expression_recherche =$expression.$this->_addClassExpressionRecherche($expression_critere_recherche);
if(!$expression_critere_recherche){
if($criteres_recherche->getCatalogue())
$expression_recherche = $catalogue.$this->_addClassExpressionRecherche($criteres_recherche->getCatalogue()->getLibelle());
if($criteres_recherche->getPanier())
$expression_recherche = $panier.$this->_addClassExpressionRecherche($criteres_recherche->getPanier()->getLibelle());
}
return $expression_recherche;
}
protected function _addClassExpressionRecherche($expression_recherche) {
return '<span class="expression-recherche" >'.$expression_recherche.'</span>';
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment