You are here

function photoswipe_load_assets in PhotoSwipe 7.2

Loads photoswipe assets.

2 calls to photoswipe_load_assets()
photoswipe_field_formatter_view in ./photoswipe.module
Implements hook_field_formatter_view().
photoswipe_page_build in ./photoswipe.module
Implements hook_page_build().

File

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

Code

function photoswipe_load_assets() {
  if (!photoswipe_assets_loaded()) {
    libraries_load('photoswipe');
    drupal_add_js(drupal_get_path('module', 'photoswipe') . '/js/photoswipe.jquery.js', array(
      'scope' => 'footer',
    ));
    $settings = variable_get('photoswipe_settings', photoswipe_get_default_settings());
    drupal_add_js(array(
      'photoswipe' => array(
        'options' => $settings,
      ),
    ), array(
      'type' => 'setting',
      'scope' => JS_DEFAULT,
    ));
    photoswipe_assets_loaded(TRUE);
  }
}