security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Defines date/time field types.
|
||||
*/
|
||||
|
||||
module_load_include('theme', 'date', 'date');
|
||||
module_load_include('inc', 'date', 'date.field');
|
||||
module_load_include('inc', 'date', 'date_elements');
|
||||
@@ -78,6 +76,8 @@ function date_theme() {
|
||||
'attributes' => array(),
|
||||
'rdf_mapping' => NULL,
|
||||
'add_rdf' => NULL,
|
||||
'microdata' => NULL,
|
||||
'add_microdata' => NULL,
|
||||
),
|
||||
),
|
||||
'date_display_range' => $base + array(
|
||||
@@ -95,6 +95,8 @@ function date_theme() {
|
||||
'attributes_end' => array(),
|
||||
'rdf_mapping' => NULL,
|
||||
'add_rdf' => NULL,
|
||||
'microdata' => NULL,
|
||||
'add_microdata' => NULL,
|
||||
)),
|
||||
'date_display_combination' => $base + array(
|
||||
'variables' => array(
|
||||
@@ -110,6 +112,8 @@ function date_theme() {
|
||||
'attributes' => array(),
|
||||
'rdf_mapping' => NULL,
|
||||
'add_rdf' => NULL,
|
||||
'microdata' => NULL,
|
||||
'add_microdata' => NULL,
|
||||
),
|
||||
),
|
||||
'date_display_interval' => $base + array(
|
||||
@@ -247,7 +251,7 @@ function date_formatter_process($formatter, $entity_type, $entity, $field, $inst
|
||||
elseif ($format == 'format_calendar_day') {
|
||||
$dates[$processed]['calendar_day'] = date_format_calendar_day($date);
|
||||
}
|
||||
elseif ($format == 'U') {
|
||||
elseif ($format == 'U' || $format == 'r' || $format == 'c') {
|
||||
$dates[$processed]['formatted'] = date_format_date($date, 'custom', $format);
|
||||
$dates[$processed]['formatted_date'] = date_format_date($date, 'custom', $format);
|
||||
$dates[$processed]['formatted_time'] = '';
|
||||
@@ -532,6 +536,7 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
|
||||
if (!empty($field['settings']['todate'])) {
|
||||
// Define a simple data structure containing both dates.
|
||||
$property['type'] = ($field['cardinality'] != 1) ? 'list<struct>' : 'struct';
|
||||
$property['auto creation'] = 'date_entity_metadata_struct_create';
|
||||
$property['getter callback'] = 'entity_metadata_field_verbatim_get';
|
||||
$property['setter callback'] = 'entity_metadata_field_verbatim_set';
|
||||
$property['property info'] = array(
|
||||
@@ -543,6 +548,8 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
|
||||
// The getter and setter callbacks for 'value' and 'value2'
|
||||
// will not provide the field name as $name, we'll add it to $info.
|
||||
'field_name' => $field['field_name'],
|
||||
// Alert Microdata module that this value can be exposed in microdata.
|
||||
'microdata' => TRUE,
|
||||
),
|
||||
'value2' => array(
|
||||
'type' => 'date',
|
||||
@@ -552,6 +559,8 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
|
||||
// The getter and setter callbacks for 'value' and 'value2'
|
||||
// will not provide the field name as $name, we'll add it to $info.
|
||||
'field_name' => $field['field_name'],
|
||||
// Alert Microdata module that this value can be exposed in microdata.
|
||||
'microdata' => TRUE,
|
||||
),
|
||||
'duration' => array(
|
||||
'type' => 'duration',
|
||||
@@ -566,6 +575,11 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
|
||||
);
|
||||
unset($property['query callback']);
|
||||
}
|
||||
else {
|
||||
// If this doesn't have a todate, it is handled as a date rather than a
|
||||
// struct. Enable microdata on the field itself rather than the properties.
|
||||
$property['microdata'] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -632,6 +646,16 @@ function date_entity_metadata_field_setter(&$entity, $name, $value, $langcode, $
|
||||
drupal_static_reset('field_language');
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto creation callback for fields which contain two date values in one
|
||||
*/
|
||||
function date_entity_metadata_struct_create($name, $property_info) {
|
||||
return array(
|
||||
'date_type' => $property_info['field']['columns'][$name]['type'],
|
||||
'timezone_db' => $property_info['field']['settings']['timezone_db'],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for setting an individual field value if a to-date may be there too.
|
||||
* Based on entity_property_verbatim_set().
|
||||
|
||||
Reference in New Issue
Block a user