#1036974 A file, date_plugin_display_attachment.inc, was omitted from the repository.
authorKaren Stevenson
Fri, 18 Feb 2011 15:09:47 +0000 (15:09 +0000)
committerKaren Stevenson
Fri, 18 Feb 2011 15:09:47 +0000 (15:09 +0000)
date_views/includes/date_plugin_display_attachment.inc [new file with mode: 0644]

diff --git a/date_views/includes/date_plugin_display_attachment.inc b/date_views/includes/date_plugin_display_attachment.inc
new file mode 100644 (file)
index 0000000..bf958ae
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Views display plugin for Date API.
+ */
+
+/**
+ * The plugin that handles date navigation attachments.
+ * 
+ * Creates a special attachment for this purpose only. 
+ */
+class date_plugin_display_attachment extends views_plugin_display_attachment {
+
+  // Require the date_nav style. That style has a date_nav type
+  // so it won't show up as a style option on any other display.
+  function get_style_type() { return 'date_nav'; }
+
+  // No options to set style, force it to the right value.
+  function defaultable_sections($section = NULL) {
+    if (in_array($section, array('row_options', 'row_plugin', 'items_per_page'))) {
+      return FALSE;
+    }
+    return parent::defaultable_sections($section);
+  }
+
+  /**
+   * Override some of the parent options.
+   */
+  function options(&$display) {
+    parent::options($display);
+    $display['style_plugin'] = 'date_nav';
+    $display['items_per_page'] = 0;
+    $display['row_plugin']['default'] = '';
+    $display['default']['style_plugin'] = FALSE;
+    $display['default']['style_options'] = FALSE;
+    $display['default']['items_per_page'] = FALSE;
+    $display['default']['row_plugin'] = FALSE;
+    $display['default']['row_options'] = FALSE;
+
+    return $display;
+  } 
+}