You are here

function photoswipe_init in PhotoSwipe 7

Same name and namespace in other branches
  1. 6 photoswipe.module \photoswipe_init()

Implements hook_init().

File

./photoswipe.module, line 48
Photswipe integration with Drupal module.

Code

function photoswipe_init() {
  $path = libraries_get_path('photoswipe');
  $version = photoswipe_get_version($path);
  drupal_add_js($path . '/lib/klass.min.js');
  drupal_add_js($path . '/code.photoswipe.jquery-' . $version . '.js');
  drupal_add_js(drupal_get_path('module', 'photoswipe') . '/js/photoswipe.jquery.js');
  drupal_add_css($path . '/photoswipe.css');
  $settings = variable_get('photoswipe_settings', photoswipe_get_default_settings());
  drupal_add_js(array(
    'photoswipe' => array(
      'options' => $settings,
    ),
  ), array(
    'type' => 'setting',
    'scope' => JS_DEFAULT,
  ));
}