2); } /** * Implementation of hook_views_init(). */ function viewscarousel_views_init() { //Add the JS lib if (module_exists('jq')) { $loaded_plugins = jq_plugins(); if (!empty($loaded_plugins['jcarousel'])) { $js1 = jq_add('jcarousel'); } } } /** * Themes the Views Carousel View. */ function theme_viewscarousel_view($view, $options = array(), $rows = array()) { // Remove the skin and skin path from the options. $skin = $options['skin']; $path = ($skin == 'custom') ? $options['skin_path'] : NULL; unset($options['skin'], $options['skin_path']); // Remove any empty options and convert any numbers to float values. foreach ($options as $key => $value) { if (is_numeric($value)) { $options[$key] = (float)$value; } if (empty($value)) { unset($options[$key]); } } // Use jCarousel to create the carousel. return theme('jcarousel', $rows, $options, $skin, $path, 'viewscarousel-'. $view->name .'-'. $view->current_display); }