You are here

function magnific_popup_library in Magnific Popup 7

Implements hook_library().

File

./magnific_popup.module, line 9
magnific_popup/magnific_popup.module

Code

function magnific_popup_library() {
  $libraries = array();
  $magnific_library_path = libraries_get_path('magnific-popup', FALSE);
  $module_path = drupal_get_path('module', 'magnific_popup');
  if (empty($magnific_library_path)) {
    drupal_set_message(t('Please install the Magnific Popup JS library in sites/.../libraries/magnific-popup/.'), 'error');
    return array();
  }
  $libraries['magnific_popup'] = array(
    'title' => 'Magnific Popup jQuery Plugin',
    'website' => 'http://dimsemenov.com/plugins/magnific-popup/',
    'version' => '1',
    'js' => array(
      "{$magnific_library_path}/dist/jquery.magnific-popup.js" => array(
        'type' => 'file',
      ),
    ),
    'css' => array(
      "{$magnific_library_path}/dist/magnific-popup.css" => array(
        'type' => 'file',
      ),
    ),
    'dependencies' => array(
      array(
        'system',
        'jquery',
      ),
    ),
  );
  $libraries['magnific_popup_formatter'] = array(
    'title' => 'Magnific Popup Module Extension',
    'website' => '',
    'version' => '1',
    'js' => array(
      "{$module_path}/js/behaviors.mfp-formatter.js" => array(
        'type' => 'file',
      ),
    ),
    'css' => array(
      "{$module_path}/css/mfp-formatter.css" => array(
        'type' => 'file',
      ),
    ),
    'dependencies' => array(
      array(
        'system',
        'jquery',
      ),
      array(
        'magnific_popup',
        'magnific_popup',
      ),
    ),
  );
  return $libraries;
}