summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.18/sites/all/modules/date/date.module')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.module19
1 files changed, 16 insertions, 3 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
index 4f6a013..6f4560b 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
@@ -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'] = '';
@@ -543,6 +547,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 +558,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 +574,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;
+ }
}
/**