30 lines
820 B
PHP
Raw Normal View History

2011-12-16 09:00:12 +00:00
<?php
Class Zend_View_Helper_Select extends Zend_View_Helper_Abstract
{
public function Select($name, $libelle, $liste)
{
$session = new Zend_Session_Namespace('ciblage');
$compar = $session->ciblage[$name];
$select = '<option value="tous">Tous</option>';
foreach($liste as $item => $value) {
$select .= '<option '.(($compar != null and $compar == $value)?'selected="selected"':null).' value="'.$value.'">'.$item.'</option>';
}
$champ = '<div>';
$champ .= '<div style="float:left;text-align:left;">
<label>'.$libelle.'</label>
</div>';
$champ .= '<div style="text-align:right;">
<select class="criteres" name="'.$name.'">
'.$select.'
</select>
</div>';
$champ .= '<div>
<hr />
</div>';
$champ .= '</div>';
return ($champ);
}
}