Meilleur detection des valeurs en session

This commit is contained in:
Michael RICOIS 2015-06-11 15:01:15 +00:00
parent 33927fc6dc
commit 8267cdad14

View File

@ -22,12 +22,20 @@ class Scores_Ciblage_Field_One
$html.= '<div class="btn-group ciblage-one pull-right" data-toggle="buttons" name="'.$this->name.'">';
if ( count($this->data)>0 ) {
foreach ( $this->data as $value => $label ) {
$active = '';
if( $valueSelected === $value ) {
$active = ' active';
$class = ' btn-default';
if ( $value === '' ) {
if ( count($valueSelected['in']) == 0 ) {
$class = ' btn-primary active';
}
}
if ($valueSelected != null) {
if ( count($valueSelected['in']) != 0 && $valueSelected['in'][0] == $value ) {
$class = ' btn-primary active';
}
}
$html.= '<label class="btn btn-primary btn-xs'.$active.'">'.
$html.= '<label class="btn btn-xs'.$class.'">'.
'<input type="radio" name="'.$this->name.'" value="'.$value.'">'.$label.
'</label>';
}