Index: contrib/views_slideshow_cycle/views_slideshow_cycle.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/Attic/views_slideshow_cycle.js,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 views_slideshow_cycle.js
--- contrib/views_slideshow_cycle/views_slideshow_cycle.js	4 Sep 2010 07:14:35 -0000	1.1.2.6
+++ contrib/views_slideshow_cycle/views_slideshow_cycle.js	6 Sep 2010 08:00:32 -0000
@@ -37,13 +37,14 @@ Drupal.behaviors.viewsSlideshowCycle = f
           classes += ' even';
         }
         
+        // Call the theme function for the pager.
         var theme = 'viewsSlideshowPager' + settings.pager_type;
         return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : '';
       },
       allowPagerClickBubble:(settings.pager_hover || settings.pager_click_to_page),
       prev:(settings.controls > 0)?'#views_slideshow_cycle_prev_' + settings.vss_id:null,
       next:(settings.controls > 0)?'#views_slideshow_cycle_next_' + settings.vss_id:null,
-      pager:(settings.pager > 0)?'#views_slideshow_cycle_pager_' + settings.vss_id:null,
+      pager:(settings.pager != 0)?'#views_slideshow_cycle_pager_' + settings.vss_id:null,
       nowrap:settings.nowrap,
       after:function(curr, next, opts) {
         // Used for Slide Counter.
@@ -70,29 +71,6 @@ Drupal.behaviors.viewsSlideshowCycle = f
       cleartypeNoBg:(settings.cleartypenobg)? true : false
     }
     
-    // Build the pager if we are using number or thumbnails.
-    if (settings.pager_type == 'numbered' || settings.pager_type == 'thumbnails') {
-      settings.opts.pagerAnchorBuilder = function(idx, slide) {
-        var classes = 'pager-item pager-num-' + (idx+1);
-        if (idx == 0) {
-          classes += ' first';
-        }
-        if ($(slide).siblings().length == idx) {
-          classes += ' last';
-        }
-
-        if (idx % 2) {
-          classes += ' odd';
-        }
-        else {
-          classes += ' even';
-        }
-        
-        var theme = 'viewsSlideshowPager' + settings.pager_type;
-        return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : '';
-      }
-    }
-    
     // Set the starting slide if we are supposed to remember the slide
     if (settings.remember_slide) {
       var startSlide = readCookie(settings.vss_id);
@@ -266,6 +244,7 @@ viewsSlideshowCycleResume = function (se
   settings.paused = false;
 }
 
+// Theme the thumbnails type pager.
 Drupal.theme.prototype.viewsSlideshowPagerthumbnails = function (classes, idx, slide, settings) {
   var href = '#';
   if (settings.pager_click_to_page) {
@@ -275,6 +254,7 @@ Drupal.theme.prototype.viewsSlideshowPag
   return '<div class="' + classes + '"><a href="' + href + '"><img src="' + $(img).attr('src') + '" alt="' + $(img).attr('alt') + '" title="' + $(img).attr('title') + '"/></a></div>';
 }
 
+// Theme the numbered type pager.
 Drupal.theme.prototype.viewsSlideshowPagernumbered = function (classes, idx, slide, settings) {
   var href = '#';
   if (settings.pager_click_to_page) {
@@ -283,6 +263,7 @@ Drupal.theme.prototype.viewsSlideshowPag
   return '<div class="' + classes + '"><a href="' + href + '">' + (idx+1) + '</a></div>';
 }
 
+// Theme the fields type pager.
 Drupal.theme.prototype.viewsSlideshowPagerfields = function (classes, idx, slide, settings) {
   return '#views_slideshow_cycle_div_pager_item_' + settings.vss_id + '_' + idx;
 }
Index: contrib/views_slideshow_cycle/views_slideshow_cycle.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/Attic/views_slideshow_cycle.theme.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 views_slideshow_cycle.theme.inc
--- contrib/views_slideshow_cycle/views_slideshow_cycle.theme.inc	14 Aug 2010 04:07:18 -0000	1.1.2.4
+++ contrib/views_slideshow_cycle/views_slideshow_cycle.theme.inc	6 Sep 2010 08:00:32 -0000
@@ -233,41 +233,57 @@ function theme_views_slideshow_cycle_con
  * @ingroup themeable
  */
 function theme_views_slideshow_cycle_pager($vss_id, $view, $options) {
-  $pager_type = $options['views_slideshow_cycle']['pager_type'];
+  $output = '';
 
+  // Create some attributes
   $attributes['class'] = 'views_slideshow_cycle_pager views_slideshow_pager_' . $pager_type;
   $attributes['id'] = "views_slideshow_cycle_pager_" . $vss_id;
-  $attributes = drupal_attributes($attributes);
   
-  $output = '';
-  if ($pager_type == 'thumbnails' || $pager_type == 'numbered') {
-    $output = '<div' . $attributes . '></div>';
+  // Allow other modules change the output
+  // Using foreach instead of module_invoke_all because module_invoke_all
+  // doesn't support pass by reference.
+  foreach (module_implements('views_slideshow_cycle_pager_theme') as $module) {
+    $hook = $module . '_views_slideshow_cycle_pager_theme';
+    $hook($output, $vss_id, $view, $options['views_slideshow_cycle'], $attributes);
   }
-  else if ($pager_type == 'fields') {
-    $output = '<div' . $attributes . '>';
-    foreach ($view->result as $count => $node) {
-      $rendered_fields = '';
-      foreach ($options['views_slideshow_cycle']['pager_fields'] as $field => $use) {
-        if ($use !== 0 && is_object($view->field[$field])) {
-          $rendered_fields .= '<div class="views-field-'. views_css_safe($view->field[$field]->field) .'">';
-          if ($view->field[$field]->label()) {
-            $rendered_fields .= '<label class="view-label-'. views_css_safe($view->field[$field]->field) . '">';
-            $rendered_fields .= $view->field[$field]->label() . ':';
-            $rendered_fields .= '</label>';
+
+  return $output;
+}
+
+/**
+ * Implementation of hook_views_slideshow_cycle_pager_theme.
+ */
+function views_slideshow_cycle_views_slideshow_cycle_pager_theme(&$output, $vss_id, $view, $options, $attributes) {
+  switch($options['pager_type']) {
+    case 'numbered':
+    case 'thumbnails':
+      $output = '<div' . drupal_attributes($attributes) . '></div>';
+      break;
+    
+    case 'fields':
+      $output = '<div' . drupal_attributes($attributes) . '>';
+      foreach ($view->result as $count => $node) {
+        $rendered_fields = '';
+        foreach ($options['pager_fields'] as $field => $use) {
+          if ($use !== 0 && is_object($view->field[$field])) {
+            $rendered_fields .= '<div class="views-field-'. views_css_safe($view->field[$field]->field) .'">';
+            if ($view->field[$field]->label()) {
+              $rendered_fields .= '<label class="view-label-'. views_css_safe($view->field[$field]->field) . '">';
+              $rendered_fields .= $view->field[$field]->label() . ':';
+              $rendered_fields .= '</label>';
+            }
+            $rendered_fields .= '<div class="views-content-'. views_css_safe($view->field[$field]->field) .'">';
+            $rendered_fields .=  $view->style_plugin->rendered_fields[$count][$field];
+            $rendered_fields .= '</div>';
+            $rendered_fields .= '</div>';
           }
-          $rendered_fields .= '<div class="views-content-'. views_css_safe($view->field[$field]->field) .'">';
-          $rendered_fields .=  $view->style_plugin->rendered_fields[$count][$field];
-          $rendered_fields .= '</div>';
-          $rendered_fields .= '</div>';
         }
+    
+        $output .= theme('views_slideshow_cycle_pager_item', $rendered_fields, $vss_id, $count);
       }
-  
-      $output .= theme('views_slideshow_cycle_pager_item', $rendered_fields, $vss_id, $count);
-    }
-    $output .= '</div>';
+      $output .= '</div>';
+      break;
   }
-
-  return $output;
 }
 
 /**
Index: contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/Attic/views_slideshow_cycle.views_slideshow.inc,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 views_slideshow_cycle.views_slideshow.inc
--- contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc	16 Aug 2010 04:41:33 -0000	1.1.2.6
+++ contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc	6 Sep 2010 08:00:32 -0000
@@ -286,16 +286,30 @@ function views_slideshow_cycle_views_sli
       'bottom' => t('Bottom'),
     ),
     '#default_value' => $view->options['views_slideshow_cycle']['pager'],
-    '#description' => t('Determine if a pager for the slideshow (1|2|3) should appear, and if so whether they should appear before or after the slideshow.'),
+    '#description' => t('Determine if a pager should appear and if so whether they should appear before or after the slideshow.'),
   );
   
-  $options = array(
-    'numbered' => t('Numbered'),
-    'thumbnails' => t('Thumbnails'),
-  );
-  
-  if ($view->row_plugin->uses_fields()) {
-    $options['fields'] = t('Fields');
+  // Get all the pager info from other modules.
+  // hook_views_slideshow_pager_settings($view, $option_values, $dependency_prefix)
+  $pagers = module_invoke_all('views_slideshow_cycle_pager_settings', $view, $view->options['views_slideshow_cycle'], 'edit-style-options-views-slideshow-cycle-pager');
+  
+  // Prep the pager options and the fields
+  $options = array();
+  $pager_fields = array();
+  foreach ($pagers as $pager_key => $pager_info) {
+    $options[$pager_key] = $pager_info['title'];
+    if (isset($pager_info['fields'])) {
+      foreach ($pager_info['fields'] as $pager_field_key => $pager_field) {
+        $pager_field['#dependency']['edit-style-options-views-slideshow-cycle-pager'] = array('top', 'bottom');
+        $pager_field['#dependency']['edit-style-options-views-slideshow-cycle-pager-type'] = array($pager_key);
+        $pager_field['#dependency_count'] = count($pager_field['#dependency']);
+        if (!in_array('views_process_dependency', $pager_field['#process'])) {
+          $pager_field['#process'][] = 'views_process_dependency';
+        }
+        
+        $pager_fields[$pager_field_key] = $pager_field;
+      }
+    }
   }
   
   // Sort the options alphabetically.
@@ -305,36 +319,13 @@ function views_slideshow_cycle_views_sli
     '#title' => t('Pager Type'),
     '#options' => $options,
     '#default_value' => $view->options['views_slideshow_cycle']['pager_type'],
-    '#description' => t('What the pager should look like.  Thumbnails grabs the first image in each slideshow item.'),
+    '#description' => t('Style of the pager.'),
     '#process' => array('views_process_dependency'),
     '#dependency' => array('edit-style-options-views-slideshow-cycle-pager' => array('top', 'bottom')),
   );
   
-  if ($view->row_plugin->uses_fields()) {
-    $options = array();
-    foreach ($view->display->handler->get_handlers('field') as $field => $handler) {
-      $options[$field] = $handler->ui_name();
-    }
-
-    $form['views_slideshow_cycle']['pager_fields'] = array(
-      '#type' => 'checkboxes',
-      '#title' => t('Pager fields'),
-      '#options' => $options,
-      '#default_value' => $view->options['views_slideshow_cycle']['pager_fields'],
-      '#description' => t("Choose the fields that will appear in the pager."),
-      '#prefix' => '<div id="edit-style-options-views-slideshow-cycle-pager-fields-wrapper"><div id="edit-style-options-views-slideshow-cycle-pager-fields">',
-      '#process' => array(
-        'expand_checkboxes',
-        'views_process_dependency',
-      ),
-      '#dependency_count' => 2,
-      '#dependency' => array(
-        'edit-style-options-views-slideshow-cycle-pager' => array('top', 'bottom'),
-        'edit-style-options-views-slideshow-cycle-pager-type' => array('fields'),
-      ),
-      '#suffix' => '</div></div>',
-    );
-  }
+  // Add user defined pager fields to the form.
+  $form['views_slideshow_cycle'] = array_merge($form['views_slideshow_cycle'], $pager_fields);
   
   $form['views_slideshow_cycle']['pager_hover'] = array(
     '#type' => 'checkbox',
@@ -411,6 +402,40 @@ function views_slideshow_cycle_views_sli
   );
 }
 
+/**
+ * Implementation of hook_views_slideshow_cycle_pager_settings
+ */
+function views_slideshow_cycle_views_slideshow_cycle_pager_settings($view, $option_values, $dependency_prefix) {
+  $return_value['numbered'] = array('title' => t('Numbered'));
+  $return_value['thumbnails'] = array('title' => t('Thumbnails'));
+  
+  if ($view->row_plugin->uses_fields()) {
+    $options = array();
+    foreach ($view->display->handler->get_handlers('field') as $field => $handler) {
+      $options[$field] = $handler->ui_name();
+    }
+    $return_value['fields'] = array(
+      'title' => t('Fields'),
+      'fields' => array(
+        'pager_fields' => array(
+          '#type' => 'checkboxes',
+          '#title' => t('Pager fields'),
+          '#options' => $options,
+          '#default_value' => $option_values['pager_fields'],
+          '#description' => t("Choose the fields that will appear in the pager."),
+          '#prefix' => '<div id="edit-style-options-views-slideshow-cycle-pager-fields-wrapper"><div id="edit-style-options-views-slideshow-cycle-pager-fields">',
+          '#process' => array(
+            'expand_checkboxes',
+          ),
+          '#suffix' => '</div></div>',
+        ),
+      ),
+    );
+  }
+  
+  return $return_value;
+}
+
 function views_slideshow_cycle_views_slideshow_options_form_validate(&$form, &$form_state, &$view) {
   if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['speed'])) {
     form_error($form['views_slideshow_cycle']['speed'], t('!setting must be numeric!',array('Speed')));
