30 lines
820 B
PHP
30 lines
820 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|