";
// Enum - Select tag
if($field_type == 'select') {
$html->buildInput($field, $name, 'select', $value, array('options' => $data));
// Date Field.
} elseif($field_type == 'datetime' or $field_type == 'date') {
if($field_type == 'datetime') $js_date_format = $GLOBALS['config']['time_format'];
else $js_date_format = $GLOBALS['config']['date_format'];
if($value and $value != '0000-00-00 00:00:00' and $value != '0000-00-00') $value = date(phpDateFormat($js_date_format), strtotime($value));
elseif($this->action == 'add' and $field == 'added_on') $value = date(phpDateFormat($js_date_format)); // Its the good old added_on field. If we are creating a new row, put the current time there.
elseif($this->action == 'edit' and $field == 'edited_on') $value = date(phpDateFormat($js_date_format)); // Same for edited_on field.
else $value = '';
$js_date_format = jsDateFormat($js_date_format);
$html->buildInput($field, $name, 'text', $value, array('class'=>'text-long'), "
");
$print_time = 1;
// I use this method to make sure this is called only after the calendar.js files are loaded.
$js_code .= <<
buildInput($field, '', 'hidden', $hidden_value);
} else {
//if($field_type == 'checkbox' and $value === false) $value = $data;
if($field_type == 'checkbox' or $field_type == 'radio' or $field_type == 'textarea') $attributes = array();
else $attributes = array('class'=>'text-long');
if($data and !$value) $value = $data;
$html->buildInput($field, $name, $field_type, isset($PARAM[$field]) ? $PARAM[$field] : $value, $attributes);
}
if(isset($this->validation_errors[$field])) {
if(count($this->validation_errors[$field]) > 1) {
print "- " . implode("
- ", $this->validation_errors[$field]) . "
";
}
else print "". $this->validation_errors[$field][0] . "";
}
if($field_type != 'hidden') print " \n";
}
$html->buildInput("row_id", "", "hidden", i($QUERY, 'id'));
$html->buildInput("id", "", "hidden", i($QUERY, 'id'));
$save_current_state = array('search','search_in', 'sp_page','sp_items_per_page', 'sortasc', 'sortdesc');
foreach($save_current_state as $state_name) {
if(!empty($QUERY[$state_name]))
$html->buildInput($state_name, "", "hidden", $QUERY[$state_name]);
}
// The action area.
print "