//for each field in the add form, add it to the data_content.
foreach ($datarecord as $name => $value){
if (!in_array($name, $ignorenames)) {
- $namearr = explode('_',$name); // Second one is the field id
+ $namearr = explode('_', $name); // Second one is the field id
if (empty($field->field) || ($namearr[1] != $field->field->id)) { // Try to reuse classes
$field = data_get_field_from_id($namearr[1], $data);
}
if (!$rid){
print_heading(get_string('newentry','data'), '', 2);
}
-
+
/******************************************
* Regular expression replacement section *
******************************************/
* output: null *
*********************************************************/
function data_generate_empty_add_form($id, $rid=0){
-
$currentdata = get_record('data','id',$id);
//check if there is an add entry
if (!$currentdata->addtemplate){
$str .='<td valign="top">';
$g = data_get_field($cfield, $currentdata);
- $str .= $g->display_add_field($cfield->id,$rid);
+ $str .= $g->display_add_field($rid);
$str .= '</td>';
$str .= '</tr>';
unset($g);
$str .= '</div>';
}
-
echo $str;
}
}