Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3349 → Rev 3350

/trunk/widget/modules/saisie2/Saisie2.php
179,17 → 179,12
$retour[$projet]['champs-supp'][$key]['unit'] = $this->clean_string( $chsup['unit'] );
 
if ( isset( $chsup['fieldValues'] ) ) {
$retour[$projet]['champs-supp'][$key]['fieldValues'] = json_decode( $chsup['fieldValues'], true );
if ( isset($retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] ) ) {
$retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] = $this->clean_string( $retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] );
}
$retour[$projet]['champs-supp'][$key]['fieldValues'] = json_decode( $this->clean_string( $chsup['fieldValues'] ), true );
 
if ( isset( $retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'] ) ) {
foreach( $retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'] as $list_key => $list_value_array ) {
$retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'][$list_key][0] = $this->clean_string( $list_value_array[0] );
// Obtenir une liste de valeurs utilisables dans les attributs for id ou name par exemple
$retour[$projet]['champs-supp'][$key]['fieldValues']['cleanListValue'][] = 'val-' . preg_replace( '/[^A-Za-z0-9_\-]/', '', $this->remove_accents( $list_value_array[0] ) );
$retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'][$list_key][1] = $this->clean_string( $list_value_array[1] );
$retour[$projet]['champs-supp'][$key]['fieldValues']['cleanListValue'][] = ($list_value_array !== 'other') ? 'val-' . preg_replace( '/[^A-Za-z0-9_\-]/', '', $this->remove_accents( strtolower($list_value_array[0] ) ) ) : '';
}
}
}