You are here

function _rotor_setup_js in Rotor Banner 5

Same name and namespace in other branches
  1. 6 rotor.module \_rotor_setup_js()

Add required js and css as appropriate.

2 calls to _rotor_setup_js()
rotor_block_content in ./rotor.module
Returns the block content.
theme_rotor_gallery_view in ./views.inc
Display the nodes of a view as an image gallery.

File

./rotor.module, line 659
A rotor banner consists in a set of images that will be changing. This module is made using jquery.

Code

function _rotor_setup_js() {
  static $rotor_initialized = FALSE;
  if ($rotor_initialized) {
    return;
  }
  $settings = array(
    'RotorBanner' => array(),
  );
  $settings['RotorBanner']['enabled'] = 'true';
  $settings['RotorBanner']['effect'] = variable_get('rotor_effect', 'fade');
  $settings['RotorBanner']['time'] = variable_get('rotor_seconds', 10);
  $settings['RotorBanner']['speed'] = variable_get('rotor_speed', 1) == 0 ? 1 : variable_get('rotor_speed', 1) * 1000;
  $settings['RotorBanner']['pause'] = variable_get('rotor_pause', 0);
  drupal_add_js($settings, 'setting');
  drupal_add_js(drupal_get_path('module', 'rotor') . '/rotor.js');
  jquery_plugin_add('cycle');
  $styles_ie6 = ".rotor-content {background-color:#FFFFFF;}";
  drupal_set_html_head('<!--[if lte IE 7]><style type="text/css" media="all">' . $styles_ie6 . '</style><![endif]-->');
  $rotor_initialized = TRUE;
}