diff --git contrib/views_slideshow_cycle/views_slideshow_cycle.module contrib/views_slideshow_cycle/views_slideshow_cycle.module index 93d8f41..f0da9ec 100644 --- contrib/views_slideshow_cycle/views_slideshow_cycle.module +++ contrib/views_slideshow_cycle/views_slideshow_cycle.module @@ -19,7 +19,15 @@ function views_slideshow_cycle_init() { $js = jq_add('cycle'); } } - + + if (!$js && module_exists('libraries')) { + $path = libraries_get_path('jquery.cycle'); + if (!empty($path) && file_exists($path . '/jquery.cycle.all.min.js')) { + $js = TRUE; + drupal_add_js($path . '/jquery.cycle.all.min.js'); + } + } + // Set location of the libraries directory. $libraries_path = 'sites/all/libraries'; @@ -27,14 +35,14 @@ function views_slideshow_cycle_init() { if (!$js && file_exists($libraries_path . '/jquery.cycle/jquery.cycle.all.min.js')) { drupal_add_js($libraries_path . '/jquery.cycle/jquery.cycle.all.min.js'); } - + if (file_exists($libraries_path . '/json2/json2.js')) { drupal_add_js($libraries_path . '/json2/json2.js'); } $module_path = drupal_get_path('module', 'views_slideshow_cycle'); drupal_add_js($module_path . '/js/views_slideshow_cycle.js'); - + drupal_add_css($module_path . '/views_slideshow_cycle.css', 'module'); } @@ -52,7 +60,7 @@ function views_slideshow_cycle_theme($existing, $type, $theme, $path) { 'variables' => array('vss_id' => NULL, 'view' => NULL, 'settings' => NULL, 'rows' => NULL), 'template' => 'theme/views-slideshow-cycle-main-frame', 'file' => 'theme/views_slideshow_cycle.theme.inc', - ), + ), 'views_slideshow_cycle_main_frame_row' => array( 'variables' => array('vss_id' => NULL, 'items' => NULL, 'count' => NULL), 'template' => 'theme/views-slideshow-cycle-main-frame-row',