This commit is contained in:
Damien LASSERRE 2011-12-21 09:37:24 +00:00
parent ac99182df0
commit 604daa6afd
3 changed files with 5 additions and 6 deletions

View File

@ -4,14 +4,16 @@ 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 style="cursor:move;'.((empty($session->ciblage[$name]) or $session->ciblage[$name] == 'tous')?null:'background-color:#CCF8D2').';padding:5px;">';
$champ = '<li class="ui-state-default" style="display:block;">';
$champ .= '<div id="'.$name.'" style="cursor:move;'.((!is_string($session->ciblage[$name]) or $session->ciblage[$name] == 'tous')?null:'background-color:#CCF8D2;').'padding:5px;">';
$champ .= '<div style="float:left;text-align:left;">
<label>'.$libelle.'</label>
</div>';
@ -21,6 +23,7 @@ Class Zend_View_Helper_Select extends Zend_View_Helper_Abstract
</select>
</div>';
$champ .= '</div>';
$champ .= '</li>';
return ($champ);
}

View File

@ -10,9 +10,7 @@ ul {list-style-type: none;}
$valeur = explode(':', $champ['type']);
switch ($valeur[0]) {
case 'select':
echo '<li id="'.$champ['name'].'" class="ui-state-default" style="display:block;">';
echo $this->Select($champ['name'], $champ['libelle'], $champ['parametres']);
echo '</li>';
$i++;
break;
case 'interval':

View File

@ -39,12 +39,10 @@ $(document).ready(function(){
var block = $('#'+$(this).attr('name')).css('display');
if(block == 'block') {
$(this).css('background-image', 'url(/themes/default/images/ajouter.png)');
/*$('#'+name).css('display', 'none');*/
$('#'+name).hide('slide');
}
else {
$(this).css('background-image', 'url(/themes/default/images/moins.png)');
/*$('#'+name).css('display', 'block');*/
$('#'+name).show('slide');
}
})