32 lines
1021 B
PHP
32 lines
1021 B
PHP
<?php
|
|
Class Zend_View_Helper_Select extends Zend_View_Helper_Abstract
|
|
{
|
|
|
|
public function Select($name, $libelle, $liste, $color = false)
|
|
{
|
|
|
|
$session = new Zend_Session_Namespace('ciblage');
|
|
$compar = $session->ciblage[$name][0];
|
|
$select = '<option value="tous">Tous</option>';
|
|
|
|
foreach($liste as $item => $value) {
|
|
$select .= '<option '.(($compar != 't' and $compar == $value)?'selected="selected"':null).' value="'.$value.'">'.$item.'</option>';
|
|
}
|
|
|
|
$champ .= '<div class="'.$name.' ui-state-default" style="cursor:move;'.((!is_string($session->ciblage[$name]) or $session->ciblage[$name] == 'tous')?null:'background-color:#CCF8D2;').'padding:5px;">';
|
|
$champ .= '<li>';
|
|
$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 .= '</li>';
|
|
$champ .= '</div>';
|
|
|
|
|
|
return ($champ);
|
|
}
|
|
} |