diff --git a/media_gallery.module b/media_gallery.module index 70f3932..66ffa21 100644 --- a/media_gallery.module +++ b/media_gallery.module @@ -673,17 +673,23 @@ function media_gallery_block_save($delta = '', $edit = array()) { * Implements hook_library(). */ function media_gallery_library() { - $library_path = variable_get('media_gallery_library_path', 'sites/all/libraries'); + $colorbox_path = variable_get('media_gallery_library_path', FALSE); + if ($colorbox_path === FALSE ) { + $colorbox_path = module_exists('libraries') ? libraries_get_path('colorbox') : 'sites/all/libraries/colorbox'; + } + else { + $colorbox_path .= '/colorbox'; + } $stylesheet = variable_get('media_gallery_colorbox_stylesheet', 'example1'); $libraries['colorbox'] = array( 'title' => 'Colorbox', 'website' => 'http://colorpowered.com/colorbox/', 'version' => '1.3.9', 'js' => array( - $library_path . '/colorbox/colorbox/jquery.colorbox-min.js' => array(), + $colorbox_path . '/colorbox/jquery.colorbox-min.js' => array(), ), 'css' => array( - $library_path . '/colorbox/' . $stylesheet . '/colorbox.css' => array( + $colorbox_path . '/' . $stylesheet . '/colorbox.css' => array( 'type' => 'file', 'media' => 'screen', ),