diff --git a/core/cfdefs/cfdef_standard.php b/core/cfdefs/cfdef_standard.php
new file mode 100644
index 0000000000..b89deb7ebe
--- /dev/null
+++ b/core/cfdefs/cfdef_standard.php
@@ -0,0 +1,275 @@
+.
+
+ # --------------------------------------------------------
+ # $Id: Exp $
+ # --------------------------------------------------------
+
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_STRING ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => null,
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_textbox',
+ '#function_string_value' => null,
+ '#function_string_value_for_email' => null,
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_NUMERIC ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => null,
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_textbox',
+ '#function_string_value' => null,
+ '#function_string_value_for_email' => null,
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_FLOAT ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => null,
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_textbox',
+ '#function_string_value' => null,
+ '#function_string_value_for_email' => null,
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_ENUM ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => 'cfdef_prepare_list_distinct_values',
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_list',
+ '#function_string_value' => 'cfdef_prepare_list_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_list_value_for_email',
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_EMAIL ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => null,
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_textbox',
+ '#function_string_value' => 'cfdef_prepare_email_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_email_value_for_email',
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_CHECKBOX ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => 'cfdef_prepare_list_distinct_values',
+ '#function_value_to_database' => 'cfdef_prepare_list_value_to_database',
+ '#function_database_to_value' => 'cfdef_prepare_list_database_to_value',
+ '#function_print_input' => 'cfdef_input_checkbox',
+ '#function_string_value' => 'cfdef_prepare_list_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_list_value_for_email',
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_LIST ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => 'cfdef_prepare_list_distinct_values',
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_list',
+ '#function_string_value' => 'cfdef_prepare_list_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_list_value_for_email',
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_MULTILIST ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => 'cfdef_prepare_list_distinct_values',
+ '#function_value_to_database' => 'cfdef_prepare_list_value_to_database',
+ '#function_database_to_value' => 'cfdef_prepare_list_database_to_value',
+ '#function_print_input' => 'cfdef_input_list',
+ '#function_string_value' => 'cfdef_prepare_list_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_list_value_for_email',
+ );
+
+ $g_custom_field_type_definition[ CUSTOM_FIELD_TYPE_DATE ] = array (
+ '#display_possible_values' => TRUE,
+ '#display_valid_regexp' => TRUE,
+ '#display_length_min' => TRUE,
+ '#display_length_max' => TRUE,
+ '#display_default_value' => TRUE,
+ '#function_return_distinct_values' => null,
+ '#function_value_to_database' => null,
+ '#function_database_to_value' => null,
+ '#function_print_input' => 'cfdef_input_date',
+ '#function_string_value' => 'cfdef_prepare_date_value',
+ '#function_string_value_for_email' => 'cfdef_prepare_date_value_for_email',
+ );
+
+ function cfdef_prepare_list_database_to_value($p_value) {
+ return str_replace( '||', '', '|' . $p_value . '|' );
+ }
+
+ function cfdef_prepare_list_value_for_email($p_value) {
+ return str_replace( '|', ', ', $p_value );
+ }
+
+ function cfdef_prepare_email_value_for_email($p_value) {
+ return 'mailto:'.$p_value;
+ }
+
+ function cfdef_prepare_date_value_for_email($p_value) {
+ if ($p_value != null) {
+ return date( config_get( 'short_date_format' ), $p_value) ;
+ }
+ }
+
+ #string_custom_field_value
+ function cfdef_prepare_list_value($p_value) {
+ return str_replace( '|', ', ', $p_value );
+ }
+
+ function cfdef_prepare_email_value($p_value) {
+ return "$p_value";
+ }
+
+ function cfdef_prepare_date_value($p_value) {
+ if ($p_value != null) {
+ return date( config_get( 'short_date_format'), $p_value);
+ }
+ }
+
+
+ #print_custom_field_input
+
+ function cfdef_input_list($p_field_def, $t_custom_field_value) {
+ $t_values = explode( '|', custom_field_prepare_possible_values( $p_field_def['possible_values'] ) );
+ $t_list_size = $t_possible_values_count = count( $t_values );
+
+ if ( $t_possible_values_count > 5 ) {
+ $t_list_size = 5;
+ }
+
+ if ( $p_field_def['type'] == CUSTOM_FIELD_TYPE_ENUM ) {
+ $t_list_size = 0; # for enums the size is 0
+ }
+
+ if ( $p_field_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ) {
+ echo '