32 lines
1021 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
{
2011-12-19 16:48:03 +00:00
public function Select($name, $libelle, $liste, $color = false)
2011-12-16 09:00:12 +00:00
{
2011-12-21 09:37:24 +00:00
2011-12-16 09:00:12 +00:00
$session = new Zend_Session_Namespace('ciblage');
$compar = $session->ciblage[$name][0];
2011-12-16 09:00:12 +00:00
$select = '<option value="tous">Tous</option>';
2011-12-21 09:37:24 +00:00
2011-12-16 09:00:12 +00:00
foreach($liste as $item => $value) {
2011-12-20 15:22:09 +00:00
$select .= '<option '.(($compar != 't' and $compar == $value)?'selected="selected"':null).' value="'.$value.'">'.$item.'</option>';
2011-12-16 09:00:12 +00:00
}
2011-12-21 14:36:58 +00:00
$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>';
2011-12-16 09:00:12 +00:00
$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>';
2011-12-21 09:37:24 +00:00
$champ .= '</li>';
2011-12-21 14:36:58 +00:00
$champ .= '</div>';
2011-12-16 09:00:12 +00:00
return ($champ);
}
}