";
date_print_calendar("trigger".$p_name);
date_finish_calendar( $p_name, "trigger".$p_name);
} else {
$t_chars = preg_split( '//', $p_format, -1, PREG_SPLIT_NO_EMPTY );
if( $p_date != 0 ) {
$t_date = preg_split( '/-/', date( 'Y-m-d', $p_date ), -1, PREG_SPLIT_NO_EMPTY );
} else {
$t_date = array(
0,
0,
0,
);
}
$t_disable = '';
if( $p_default_disable == true ) {
$t_disable = ' disabled="disabled"';
}
$t_blank_line = '';
if( $p_allow_blank == true ) {
$t_blank_line = "";
}
foreach( $t_chars as $t_char ) {
if( strcmp( $t_char, "M" ) == 0 ) {
echo "\n";
}
if( strcmp( $t_char, "m" ) == 0 ) {
echo "\n";
}
if( strcasecmp( $t_char, "D" ) == 0 ) {
echo "\n";
}
if( strcasecmp( $t_char, "Y" ) == 0 ) {
echo "\n";
}
}
}
}
/*
* in core/gpc_api.php replace the function gpc_isset_custom_field with the one listed below
*/
function gpc_isset_custom_field( $p_var_name, $p_custom_field_type ) {
$t_field_name = 'custom_field_' . $p_var_name;
switch ($p_custom_field_type ) {
case CUSTOM_FIELD_TYPE_DATE:
if (ON == config_get( 'use_date_picker_javascript' )) {
return gpc_isset( $t_field_name ) ;
} else {
return gpc_isset( $t_field_name . '_day' ) &&
gpc_get_int( $t_field_name . '_day', 0 ) != 0 &&
gpc_isset( $t_field_name . '_month' ) &&
gpc_get_int( $t_field_name . '_month', 0 ) != 0 &&
gpc_isset( $t_field_name . '_year' ) &&
gpc_get_int( $t_field_name . '_year', 0 ) != 0 ;
}
case CUSTOM_FIELD_TYPE_STRING:
case CUSTOM_FIELD_TYPE_NUMERIC:
case CUSTOM_FIELD_TYPE_FLOAT:
case CUSTOM_FIELD_TYPE_ENUM:
case CUSTOM_FIELD_TYPE_EMAIL:
return gpc_isset( $t_field_name ) && !is_blank( gpc_get_string( $t_field_name ) );
default:
return gpc_isset( $t_field_name );
}
}
/*
* in core/gpc_api.php replace the function gpc_get_custom_field with the one listed below
*/
function gpc_get_custom_field( $p_var_name, $p_custom_field_type, $p_default = null ) {
switch( $p_custom_field_type ) {
case CUSTOM_FIELD_TYPE_MULTILIST:
case CUSTOM_FIELD_TYPE_CHECKBOX:
// ensure that the default is an array, if set
if ( ($p_default !== null) && !is_array($p_default) ) {
$p_default = array( $p_default );
}
$t_values = gpc_get_string_array( $p_var_name, $p_default );
if( is_array( $t_values ) ) {
return implode( '|', $t_values );
} else {
return '';
}
break;
case CUSTOM_FIELD_TYPE_DATE:
if (ON == config_get( 'use_date_picker_javascript' )) {
return strtotime( gpc_get_string( $p_var_name, time() ));
} else {
$t_day = gpc_get_int( $p_var_name . '_day', 0 );
$t_month = gpc_get_int( $p_var_name . '_month', 0 );
$t_year = gpc_get_int( $p_var_name . '_year', 0 );
if(( $t_year == 0 ) || ( $t_month == 0 ) || ( $t_day == 0 ) ) {
if( $p_default == null ) {
return '';
} else {
return $p_default;
}
} else {
return strtotime( $t_year . '-' . $t_month . '-' . $t_day );
}
}
break;
default:
return gpc_get_string( $p_var_name, $p_default );
}
}