' . "\n "; $output .= $hidden_elements; $output .= '\n\n"; return $output; } /** * These are the slideshow elements themselves; not actually displayed, but used to give the html to the main element. */ function theme_views_slideshow_no_display_section($view, $rows, $id, $mode, $teaser = TRUE) { $output = '
' . "\n"; if ($mode == VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER) { foreach ($view->result as $count => $node) { $output .= theme('views_slideshow_no_display_teaser', node_view(node_load($node->nid), $teaser, FALSE, FALSE), $id, $count); } } else { // Add support for the jQuery Cycle plugin. // If we have the jQ module installed, use that to add the Cycle plugin if possible. // That allows for version control. if (module_exists('jq')) { $js = jq_add('cycle'); } // Otherwise, we'll add the version included with this module. if (!$js) { drupal_add_js(drupal_get_path('module', 'views_slideshow') .'/js/jquery.cycle.all.min.js', 'module'); } foreach ($rows as $count => $item) { $output .= theme('views_slideshow_no_display_teaser', $item, $id, $count); } } $output .= "
\n\n"; return $output; } /** * The html that will be placed into the element in its turn during its frame. */ function theme_views_slideshow_no_display_teaser($item, $id, $count) { $hidden = $count ? 'class="views_slideshow_hidden"' : ''; $output = '
' . "\n "; $output .= $item . "\n"; $output .= '
' . "\n\n"; return $output; } /** * These are teasers that may be pointed at with a mouse to change the element directly. */ function theme_views_slideshow_breakout_teasers($items, $id) { $output = '
' . "\n"; $js = "$(document).ready(function() {\n"; foreach ($items as $count => $item) { $output .= theme('views_slideshow_breakout_teaser', $item, $id, $count); $js .= theme('views_slideshow_breakout_teaser_js', $id, $count); } $js .= "})\n"; drupal_add_js($js, 'inline'); $output .= "
\n\n"; return $output; } /** * The mouseover event code for each breakout teaser. */ function theme_views_slideshow_breakout_teaser_js($id, $count) { // Return the js to set the main div to this teaser's element. $hover = (module_invoke('jq', 'add', 'hoverIntent')) ? 'hoverIntent' : 'hover'; $js = ' $("#views_slideshow_div_breakout_teaser_' . $id . '_' . $count . '").' . $hover . '( function() { views_slideshow_switch("' . $id . '", ' . $count . '); views_slideshow_pause("' . $id . '"); }, function() { views_slideshow_resume("' . $id . '"); }); '; return $js; } /** * An individual breakout teaser. */ function theme_views_slideshow_breakout_teaser($item, $id, $count) { $class = $count ? '' : ' views_slideshow_active_teaser'; $output = '
' . "\n "; $output .= $item . "\n"; $output .= '
' . "\n\n"; return $output; }