You are here

function janrain_capture_ui_init in Janrain Registration 7

Same name and namespace in other branches
  1. 6 janrain_capture_ui.module \janrain_capture_ui_init()

Implements hook_init().

File

./janrain_capture_ui.module, line 13
This module implements UI elements for Janrain Capture

Code

function janrain_capture_ui_init() {

  // Don't do anything if the module settings have not been configured.
  if (!janrain_capture_configured()) {
    return;
  }
  $js_css = janrain_capture_ui_js_css();
  foreach ($js_css as $type => $files) {
    foreach ($files as $name => $filename) {

      // Find the location of the library file and add it using the appropriate
      // function, i.e. drupal_add_js or drupal_add_css.
      $full_path = janrain_capture_ui_get_library_path($name) . '/' . $filename;
      $drupal_add = 'drupal_add_' . $type;
      $drupal_add($full_path, array(
        'every_page' => TRUE,
      ));
    }
  }

  // Finally, add the custom JavaScript.
  drupal_add_js(drupal_get_path('module', 'janrain_capture') . '/janrain_capture_ui.js', array(
    'every_page' => TRUE,
    'weight' => 10,
  ));
}