home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (date_plugin_display_attachment.inc)

This example Drupal source code file (date_plugin_display_attachment.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

date_nav, date_plugin_display_attachment, defaultable_sections, extends, false, function, null, option_definition, options, php, return, row_plugin, section, views_plugin_display_attachment

The date_plugin_display_attachment.inc Drupal example source code

<?php
// $Id: date_plugin_display_attachment.inc,v 1.1.2.3 2010/03/05 11:55:53 karens Exp $
/**
 * 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);
  }

  function option_definition() {
    $options = parent::option_definition();
    $options['style_plugin']['default'] = 'date_nav';
    $options['items_per_page']['default'] = 0;
    $options['row_plugin']['default'] = '';
    //$options['defaults']['default']['style_plugin'] = FALSE;
    $options['defaults']['default']['style_options'] = FALSE;
    $options['defaults']['default']['items_per_page'] = FALSE;
    $options['defaults']['default']['row_plugin'] = FALSE;
    $options['defaults']['default']['row_options'] = FALSE;

    return $options;
  } 
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal date_plugin_display_attachment.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.