You are here

views.inc in Rotor Banner 5

Provides views integration for Rotor.

@author Tom Kirkpatrick, tkp AT kirkdesigns.co.uk. http://www.kirkdesigns.co.uk

File

views.inc
View source
<?php

/**
 * @file
 * Provides views integration for Rotor.
 *
 * @author Tom Kirkpatrick, tkp AT kirkdesigns.co.uk. http://www.kirkdesigns.co.uk
 */

/**
 * Implementation of hook_views_style_plugins()
 */
function rotor_views_style_plugins() {
  $items['rotor_gallery'] = array(
    'name' => t('Rotor: Rotating nodes'),
    'theme' => 'rotor_gallery_view',
    'validate' => 'views_ui_plugin_validate_list',
    'needs_fields' => TRUE,
  );
  return $items;
}

/**
 * Display the nodes of a view as an image gallery.
 */
function theme_rotor_gallery_view($view, $nodes, $type) {
  drupal_add_css(drupal_get_path('module', 'rotor') . '/rotor.css');
  _rotor_setup_js();
  $items = array();
  foreach ($nodes as $node) {
    $actual_node = node_load($node->nid);
    $items[] = (object) array(
      'title' => $node->title,
      'body' => node_view($actual_node, FALSE, FALSE, FALSE),
      'format' => $actual_node->format,
    );
  }
  $content = theme_rotor_block($items);
  return $content;
}

Functions

Namesort descending Description
rotor_views_style_plugins Implementation of hook_views_style_plugins()
theme_rotor_gallery_view Display the nodes of a view as an image gallery.