You are here

function floating_block_init in Floating block 6

Same name and namespace in other branches
  1. 7 floating_block.module \floating_block_init()

Implements hook_init().

File

./floating_block.module, line 12
The floating_block module allows parts of the site to stay on the page when scrolling.

Code

function floating_block_init() {
  $floating_blocks = variable_get('floating_blocks', array());

  //Only load the javascript if floating blocks have been configured.
  if (count($floating_blocks)) {
    drupal_add_js(array(
      'floating_block' => $floating_blocks,
    ), 'setting');
    drupal_add_js(drupal_get_path('module', 'floating_block') . '/floating_block.js');
  }
}