LSform // dataEntryForm : set default value of displayed elements

This commit is contained in:
Benjamin Renard 2013-03-18 12:57:39 +01:00
parent 2d80c4a852
commit 9b9324b120

View file

@ -652,6 +652,17 @@ class LSform {
} }
$this -> dataEntryForm = $dataEntryForm; $this -> dataEntryForm = $dataEntryForm;
$this -> dataEntryFormConfig = $config; $this -> dataEntryFormConfig = $config;
// Set default value of displayed elements
if(is_array($config['defaultValues'])) {
foreach($config['displayedElements'] as $el) {
if (isset($config['defaultValues'][$el])) {
if (isset($this -> elements[$el])) {
$this -> elements[$el] -> setValueFromPostData($config['defaultValues'][$el]);
}
}
}
}
return true; return true;
} }
LSerror :: addErrorCode('LSform_07',$dataEntryForm); LSerror :: addErrorCode('LSform_07',$dataEntryForm);