style_plugin->options; $handler = $view->style_plugin; $fields = &$view->field; $rows = &$vars['rows']; // Generate a unique ID for this cycle instance that we can pass to JS. $vars['cycle_id'] = 'views-cycle-'. $view->name .'-'. $view->style_plugin->display->id; // The $settings array is passed forward to Javascript to inform the code how // to build the cycle slideshow. We'll convert this to full Drupal.settings // format below. $settings = array( 'params' => $options['params'], ); // Javascript, or at least the cycle plugin, gets very cranky if you pass it // a string version of a number. We therefore have to force all numeric // values to actually be numeric data types so that they are passed as such // to Javascript. Fortunately we know that all of the numeric values that // cycle takes are integers. foreach ($settings['params'] as $key => $value) { if (is_numeric($value)) { $settings['params'][$key] = (int)$value; } } // If there are thumbnails, we need to build that list as well as fully rendered // HTML and pass it to Javascript. Technically the JS needs to "generate" the // HTML for the thumbnails for the cycle plugin to work, but we'll pre-theme // that server side and then just look it up on demand in the browser. if ($options['thumbnail_field']) { // This is just a temporary hack. See the note below. $keys = array_keys($view->field); // Grab each result row and add it to the thumbs list foreach ($view->result as $num => $row) { $classes = array(); if ($num == 0) { $classes[] = 'views-cycle-first'; } if ($num == (count($rows)-1)) { $classes[] = 'views-cycle-last'; } $classes[] = ($num % 2) ? "views-cycle-odd" : "views-cycle-even"; $classes[] = "views-cycle-thumb-{$num}"; $classes = implode(' ', $classes); // Append to the list items, which will later output in a single hidden list near the cycler. $vars['thumbs_data'] .= "