summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2010-11-25 12:36:19 (GMT)
committer Karen Stevenson2010-11-25 12:36:19 (GMT)
commit9bd927456cf685b1006c55e2f46fcf439f6425e2 (patch)
tree8e02776fb5f4e4f9d6e448c3f36473d594ea05e8
parent0dd5591edd067000916c1741e3f84b32af2370a4 (diff)
#978442 by KarenS, fix some remaining brokenness from ical validation fix.
-rw-r--r--date/date.theme30
1 files changed, 29 insertions, 1 deletions
diff --git a/date/date.theme b/date/date.theme
index 8551467..370df5c 100644
--- a/date/date.theme
+++ b/date/date.theme
@@ -12,6 +12,24 @@
*/
/**
* Theme from/to date combination in the view.
+ *
+ * $node->date_id
+ * If set, this will show only an individual date on a field with
+ * multiple dates. The value should be a string that contains
+ * the following values, separated with periods:
+ * - module name of the module adding the item
+ * - node nid
+ * - field name
+ * - delta value of the field to be displayed
+ * - other information the module's custom theme might need
+ *
+ * Used by the calendar module and available for other uses.
+ * example: 'date.217.field_date.3.test'
+ *
+ * $node->date_repeat_show
+ * If true, tells the theme to show all the computed values
+ * of a repeating date. If not true or not set, only the
+ * start date and the repeat rule will be displayed.
*
* $dates['format'] - the format string used on these dates
* $dates['value']['local']['object'] - the local date object for the From date
@@ -41,7 +59,17 @@ function theme_date_display_combination($vars) {
$options = $display['settings'];
$dates = $vars['dates'];
$output = '';
-
+
+ // If date_id is set for this field and the delta doesn't match, don't display it.
+ if (!empty($node->date_id)) {
+ foreach ((array) $node->date_id as $key => $id) {
+ list($module, $nid, $field_name, $item_delta, $other) = explode('.', $id);
+ if ($field_name == $field['field_name'] && isset($delta) && $item_delta != $delta) {
+ return $output;
+ }
+ }
+ }
+
// Check the formatter settings to see if the repeat rule should be
// displayed. Show it only with the first multiple value date.
list($id) = entity_extract_ids($entity_type, $entity);