' . "\n";
+ $classes = array(
+ 'views_slideshow_singleframe_controls',
+ 'views_slideshow_controls',
+ );
+
+ $attributes['class'] = implode(' ', $classes);
+ $attributes['id'] = "views_slideshow_singleframe_controls_$id";
+ $attributes = drupal_attributes($attributes);
+
+ $output = "
";
$output .= theme('views_slideshow_singleframe_control_previous', $id, $view, $options);
$output .= theme('views_slideshow_singleframe_control_pause', $id, $view, $options);
$output .= theme('views_slideshow_singleframe_control_next', $id, $view, $options);
@@ -96,30 +121,67 @@ function theme_views_slideshow_singlefra
}
/**
- * Themed Previous Control
+ * The "previous" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_singleframe_control_previous($id, $view, $options) {
- return '
' . t('Previous') . "\n";
+ return l(t('Previous'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_singleframe_previous views_slideshow_previous',
+ 'id' => "views_slideshow_singleframe_prev_$id",
+ )));
}
/**
- * Themed Pause Control
+ * The "pause" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_singleframe_control_pause($id, $view, $options) {
- return '
' . t('Pause') . "\n";
+ return l(t('Pause'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_singleframe_pause views_slideshow_pause',
+ 'id' => "views_slideshow_singleframe_playpause_$id",
+ )));
}
/**
- * Themed Next Control
+ * The "next" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_singleframe_control_next($id, $view, $options) {
- return '
' . t('Next') . "\n";
+ return l(t('Next'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_singleframe_next views_slideshow_next',
+ 'id' => "views_slideshow_singleframe_next_$id",
+ )));
}
+/**
+ * The pager.
+ *
+ * @ingroup themeable
+ */
function theme_views_slideshow_singleframe_pager($id, $view, $options) {
- return '';
+ $pager_type = $options['singleframe']['pager_type'];
+
+ $attributes['class'] = "views_slideshow_singleframe_pager views_slideshow_pager$pager_type";
+ $attributes['id'] = "views_slideshow_singleframe_pager_$id";
+ $attributes = drupal_attributes($attributes);
+
+ return "
";
}
+/**
+ * The image counter.
+ *
+ * @ingroup themeable
+ */
function theme_views_slideshow_singleframe_image_count($id, $view, $options) {
- return '
' . t('of') .'
';
+ $attributes['class'] = 'views_slideshow_singleframe_image_count views_slideshow_image_count';
+ $attributes['id'] = "views_slideshow_singleframe_image_count_$id";
+ $attributes = drupal_attributes($attributes);
+
+ $counter = '
' . t('of') . '
';
+
+ return "
$counter
";
}
Index: contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views-slideshow-thumbnailhover.tpl.php,v
retrieving revision 1.1.2.1.2.5
diff -u -p -r1.1.2.1.2.5 views-slideshow-thumbnailhover.tpl.php
--- contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php 17 Nov 2009 05:55:19 -0000 1.1.2.1.2.5
+++ contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php 14 Feb 2010 03:09:45 -0000
@@ -2,41 +2,31 @@
// $Id: views-slideshow-thumbnailhover.tpl.php,v 1.1.2.1.2.5 2009/11/17 05:55:19 redndahead Exp $
/**
- * @file
- * Views Slideshow: Thumbnail Hover
+ * @file
+ * Views Slideshow: Thumbnail Hover template file.
*/
- if ($options['thumbnailhover']['controls'] == 1) {
- print theme('views_slideshow_thumbnailhover_controls', $id, $view, $options);
- }
-
- if ($options['thumbnailhover']['image_count'] == 1) {
- print theme('views_slideshow_thumbnailhover_image_count', $id, $view, $options);
- }
-
- $teaser = ($options['thumbnailhover']['hover_breakout'] == 'teaser' ? TRUE : FALSE);
- $output = '';
- $view_teasers = FALSE;
- // As we're using the 'thumbnail hover' mode, then we need to display all the view thumbnails.
- $view_teasers = theme('views_slideshow_thumbnailhover_breakout_teasers', $view, $rows, $id, $options);
- if (!$options['thumbnailhover']['teasers_last']) {
- $output .= $view_teasers;
- }
+// Add controls, image count and teasers above the main slideshow.
+if ($options['thumbnailhover']['controls'] == 1) {
+ print $controls;
+}
+if ($options['thumbnailhover']['image_count'] == 1) {
+ print $image_count;
+}
+if (!$options['thumbnailhover']['teasers_last']) {
+ print $view_teasers;
+}
- // These are hidden elements, used to cycle through the main div
- $hidden_elements = theme('views_slideshow_thumbnailhover_no_display_section', $view, $rows, $id, $options, $teaser);
- $output .= theme('views_slideshow_main_section', $id, $hidden_elements, 'thumbnailhover');
+// The main slideshow including all the hidden elements.
+print $slideshow;
- if ($view_teasers && $options['thumbnailhover']['teasers_last']) {
- $output .= $view_teasers;
- }
- if ($options['thumbnailhover']['controls'] == 2) {
- print theme('views_slideshow_thumbnailhover_controls',$id, $view, $options);
- }
-
- if ($options['thumbnailhover']['image_count'] == 2) {
- print theme('views_slideshow_thumbnailhover_image_count', $id, $view, $options);
- }
- print $output;
-
-?>
+// Add controls, image count and teasers below the main slideshow.
+if ($view_teasers && $options['thumbnailhover']['teasers_last']) {
+ print $view_teasers;
+}
+if ($options['thumbnailhover']['controls'] == 2) {
+ print $controls;
+}
+if ($options['thumbnailhover']['image_count'] == 2) {
+ print $image_count;
+}
Index: contrib/views_slideshow_thumbnailhover/views_slideshow.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow.js,v
retrieving revision 1.1.2.2.2.14
diff -u -p -r1.1.2.2.2.14 views_slideshow.js
--- contrib/views_slideshow_thumbnailhover/views_slideshow.js 17 Nov 2009 04:26:19 -0000 1.1.2.2.2.14
+++ contrib/views_slideshow_thumbnailhover/views_slideshow.js 14 Feb 2010 03:09:45 -0000
@@ -103,7 +103,7 @@ Drupal.behaviors.viewsSlideshowThumbnail
);
});
}
-
+
if (settings.controls > 0) {
// Show controls for people who have js enabled browsers.
$('#views_slideshow_thumbnailhover_controls_' + settings.id).show();
Index: contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow_thumbnailhover.module,v
retrieving revision 1.1.2.1.2.4
diff -u -p -r1.1.2.1.2.4 views_slideshow_thumbnailhover.module
--- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module 15 Oct 2009 08:47:04 -0000 1.1.2.1.2.4
+++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module 14 Feb 2010 03:09:45 -0000
@@ -2,17 +2,18 @@
// $Id: views_slideshow_thumbnailhover.module,v 1.1.2.1.2.4 2009/10/15 08:47:04 redndahead Exp $
/**
- * @file
- * The Views Slideshow: ThumbnailHover works with node views only.
- * It adds two parts to the view: the first part is a series of items
- * displayed as a list, while the second part is either full or teaser.
- * The slide show will synchronize the two, so that the 'active' item
- * will correspond to the single full/teaser item. The slide show can
- * be set to move automatically and/or on mouse hover.
+ * @file
+ * Views Slideshow: ThumbnailHover has options for working with node views.
+ *
+ * The ThumbnailHover mode adds two parts to the view: the first part is a
+ * series of items displayed as a list, the second part is either a full node
+ * or a node teaser. The slideshow will synchronize the two, so that the
+ * 'active' item will correspond to the single full/teaser item. The slide show
+ * can be set to advance automatically or on mouse hover/click.
*/
/**
- * Implements hook_theme().
+ * Implements hook_theme().
*/
function views_slideshow_thumbnailhover_theme($existing, $type, $theme, $path) {
return array(
@@ -61,17 +62,17 @@ function views_slideshow_thumbnailhover_
}
/**
- * Implementation of hook_help().
+ * Implements hook_help().
*/
function views_slideshow_thumbnailhover_help($path, $arg) {
switch ($path) {
case 'admin/help#views_slideshow_thumbnailhover':
if (module_exists('advanced_help')) {
- $output = '
'. t('Click here to view the documentation for Views Slideshow Thumbnailhover.', array('@help' => base_path() . 'admin/advanced_help/views_slideshow_thumbnailhover')) .'
';
+ $output = '
' . l(t('Click here to view the documentation for Views Slideshow Thumbnailhover'), 'admin/advanced_help/views_slideshow_thumbnailhover') . '
';
}
else {
- $output = '
'. t('Views Slideshow Thumbnailhover help can be found by installing and enabling the Advanced Help module.', array('@advanced_help' => 'http://drupal.org/project/advanced_help')) .'
';
+ $output = '
' . t('Views Slideshow Thumbnailhover help can be found by installing and enabling the !advanced_help.', array('!advanced_help' => l(t('Advanced Help module'), 'http://drupal.org/project/advanced_help'))) . '
';
}
return $output;
}
-}
\ No newline at end of file
+}
Index: contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow_thumbnailhover.theme.inc,v
retrieving revision 1.1.2.1.2.15
diff -u -p -r1.1.2.1.2.15 views_slideshow_thumbnailhover.theme.inc
--- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 18 Jan 2010 01:00:51 -0000 1.1.2.1.2.15
+++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 14 Feb 2010 03:09:45 -0000
@@ -2,26 +2,27 @@
// $Id: views_slideshow_thumbnailhover.theme.inc,v 1.1.2.1.2.15 2010/01/18 01:00:51 redndahead Exp $
/**
- * @file
- * Theme & preprocess functions for the Views Slideshow: ThumbnailHover module.
+ * @file
+ * Theme & preprocess functions for the Views Slideshow: ThumbnailHover module.
*/
/**
- * Implement template_preprocess_hook_THEMENAME().
+ * Implements template_preprocess_hook_THEMENAME().
*/
function template_preprocess_views_slideshow_thumbnailhover(&$vars) {
- $options = $vars['options'];
- $base = drupal_get_path('module', 'views_slideshow_thumbnailhover');
- drupal_add_js($base . '/views_slideshow.js', 'module');
- drupal_add_css($base . '/views_slideshow.css', 'module');
+ $module_path = drupal_get_path('module', 'views_slideshow_thumbnailhover');
+ drupal_add_js($module_path . '/views_slideshow.js', 'module');
+ drupal_add_css($module_path . '/views_slideshow.css', 'module');
- $num_divs = sizeof($vars['rows']);
- $teasers_last = $options['thumbnailhover']['teasers_last'] ? 'true' : 'false';
+ $options = $vars['options'];
+ $id = $vars['id'];
+ $view = $vars['view'];
+ $rows = $vars['rows'];
$settings = array_merge(
array(
- 'num_divs' => $num_divs,
- 'teasers_last' => $teasers_last,
+ 'num_divs' => sizeof($vars['rows']),
+ 'teasers_last' => ($options['thumbnailhover']['teasers_last']) ? 'true' : 'false',
'id_prefix' => '#views_slideshow_thumbnailhover_main_',
'div_prefix' => '#views_slideshow_thumbnailhover_div_',
'id' => $vars['id'],
@@ -29,7 +30,10 @@ function template_preprocess_views_slide
$options['thumbnailhover']
);
- drupal_add_js(array('viewsSlideshowThumbnailHover' => array('#views_slideshow_thumbnailhover_main_'. $vars['id'] => $settings)), 'setting');
+ drupal_add_js(array('viewsSlideshowThumbnailHover' => array(
+ "#views_slideshow_thumbnailhover_main_$id" => $settings)), 'setting');
+
+ // Add the hoverIntent plugin.
if ($settings['pager_event'] == 'hoverIntent') {
if (module_exists('jq')) {
$loaded_plugins = jq_plugins();
@@ -41,17 +45,25 @@ function template_preprocess_views_slide
hoverintent_add();
}
}
-}
+ $teaser = ($options['thumbnailhover']['hover_breakout'] == 'teaser') ? TRUE : FALSE;
+ $hidden_elements = theme('views_slideshow_thumbnailhover_no_display_section', $view, $rows, $id, $options, $teaser);
+
+ $vars['controls'] = theme('views_slideshow_thumbnailhover_controls', $id, $view, $options);
+ $vars['image_count'] = theme('views_slideshow_thumbnailhover_image_count', $id, $view, $options);
+ $vars['view_teasers'] = theme('views_slideshow_thumbnailhover_breakout_teasers', $view, $rows, $id, $options);
+ $vars['slideshow'] = theme('views_slideshow_main_section', $id, $hidden_elements, 'thumbnailhover');
+}
/**
- * These are the slideshow elements themselves; not actually displayed, but used to give the html to the main element.
+ * Add the jQuery Cycle plugin the HTML for the hidden slideshow elements.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_no_display_section($view, $rows, $id, $options, $teaser = TRUE) {
- // 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.
- $js = 0;
+ // If the jQ module is installed, use that to add the jQuery Cycle plugin.
+ // This allows different versions of the plugin to be used.
+ $js = FALSE;
if (module_exists('jq')) {
$loaded_plugins = jq_plugins();
if (!empty($loaded_plugins['cycle'])) {
@@ -61,9 +73,15 @@ function theme_views_slideshow_thumbnail
// 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');
+ drupal_add_js(drupal_get_path('module', 'views_slideshow') . '/js/jquery.cycle.all.min.js');
}
- $output = '
' . "\n";
+
+ // Add the slideshow elements.
+ $attributes['id'] = "views_slideshow_thumbnailhover_teaser_section_$id";
+ $attributes['class'] = 'views_slideshow_thumbnailhover_teaser_section views_slideshow_teaser_section';
+ $attributes = drupal_attributes($attributes);
+
+ $output = "
";
foreach ($view->result as $count => $node) {
if ($view->display_handler->uses_fields()) {
$rendered = '';
@@ -81,36 +99,46 @@ function theme_views_slideshow_thumbnail
}
$output .= theme('views_slideshow_thumbnailhover_no_display_teaser', $rendered, $id, $count);
}
- $output .= "
\n\n";
+ $output .= "
";
return $output;
}
/**
- * The html that will be placed into the element in its turn during its frame.
+ * The active element.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_no_display_teaser($item, $id, $count) {
- $class = 'views_slideshow_thumbnailhover_slide views_slideshow_slide views-row-' . ($count + 1);
+ $current = $count + 1;
+
+ $classes = array(
+ 'views_slideshow_thumbnailhover_slide',
+ "views_slideshow_slide views-row-$current",
+ );
+
if ($count) {
- $class = ' views_slideshow_thumbnailhover_hidden';
+ $classes[] = 'views_slideshow_thumbnailhover_hidden';
}
+ $classes[] = ($count % 2) ? 'views-row-even' : 'views-row-odd';
- if ($count % 2) {
- $class .= ' views-row-even';
- }
- else {
- $class .= ' views-row-odd';
- }
- $output = '
' . "\n ";
- $output .= $item . "\n";
- $output .= '
' . "\n\n";
- return $output;
+ $attributes['id'] = "views_slideshow_thumbnailhover_div_${id}_${count}";
+ $attributes['class'] = implode(' ', $classes);
+ $attributes = drupal_attributes($attributes);
+
+ return "
$item
";
}
/**
- * These are teasers that may be pointed at with a mouse to change the element directly.
+ * The pager in the form of node teasers.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_breakout_teasers($view, $items, $id, $options) {
- $output = '
' . "\n";
+ $attributes['id'] = "views_slideshow_thumbnailhover_breakout_teasers_$id";
+ $attributes['class'] = 'views_slideshow_thumbnailhover_breakout_teasers clear-block';
+ $attributes = drupal_attributes($attributes);
+
+ $output = "
";
if ($view->display_handler->uses_fields()) {
foreach ($view->result as $count => $node) {
$rendered_fields = '';
@@ -130,39 +158,50 @@ function theme_views_slideshow_thumbnail
$output .= theme('views_slideshow_thumbnailhover_breakout_teaser', $item, $id, $count);
}
}
-
- $output .= "
\n\n";
+ $output .= "
\n";
return $output;
}
/**
- * An individual breakout teaser.
+ * The breakout teaser.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_breakout_teaser($item, $id, $count) {
- $class = 'views_slideshow_thumbnailhover_div_breakout_teaser';
+ $current = $count + 1;
+ $classes = array(
+ 'views_slideshow_thumbnailhover_div_breakout_teaser',
+ );
if (!$count) {
- $class .= ' views_slideshow_thumbnailhover_active_teaser';
+ $classes[] = 'views_slideshow_thumbnailhover_active_teaser';
}
+ $classes[] = ($count % 2) ? 'views-row-even' : 'views-row-odd';
- if ($count % 2) {
- $class .= ' views-row-even';
- }
- else {
- $class .= ' views-row-odd';
- }
- $output = '
' . "\n ";
- $output .= $item . "\n";
- $output .= '
' . "\n\n";
- return $output;
-}
+ $attributes['class'] = implode(' ', $classes);
+ $attributes['id'] = "views_slideshow_thumbnailhover_div_breakout_teaser_${id}_${count}";
+ $attributes = drupal_attributes($attributes);
+ return "
$item
\n";
+}
/**
- * Themed slideshow controls.
+ * The slideshow controls.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_controls($id, $view, $options) {
- $output = '
' . "\n";
+ $classes = array(
+ 'views_slideshow_thumbnailhover_controls',
+ 'views_slideshow_controls',
+ );
+
+ $attributes['class'] = implode(' ', $classes);
+
+ $attributes['id'] = "views_slideshow_thumbnailhover_controls_$id";
+ $attributes = drupal_attributes($attributes);
+
+ $output = "
";
$output .= theme('views_slideshow_thumbnailhover_control_previous', $id, $view, $options);
$output .= theme('views_slideshow_thumbnailhover_control_pause', $id, $view, $options);
$output .= theme('views_slideshow_thumbnailhover_control_next', $id, $view, $options);
@@ -171,27 +210,52 @@ function theme_views_slideshow_thumbnail
}
/**
- * Themed Previous Control
+ * The "previous" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_control_previous($id, $view, $options) {
- return '
' . t('Previous') . "\n";
+ return l(t('Previous'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_thumbnailhover_previous views_slideshow_previous',
+ 'id' => "views_slideshow_thumbnailhover_prev_$id",
+ )));
}
/**
- * Themed Pause Control
+ * The "pause" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_control_pause($id, $view, $options) {
- return '
' . t('Pause') . "\n";
+ return l(t('Pause'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',
+ 'id' => "views_slideshow_thumbnailhover_playpause_$id",
+ )));
}
/**
- * Themed Next Control
+ * The "next" control.
+ *
+ * @ingroup themeable
*/
function theme_views_slideshow_thumbnailhover_control_next($id, $view, $options) {
- return '
' . t('Next') . "\n";
+ return l(t('Next'), '#', array('attributes' => array(
+ 'class' => 'views_slideshow_thumbnailhover_next views_slideshow_next',
+ 'id' => "views_slideshow_thumbnailhover_next_$id",
+ )));
}
+/**
+ * The image counter.
+ *
+ * @ingroup themeable
+ */
function theme_views_slideshow_thumbnailhover_image_count($id, $view, $options) {
- $output = '
' . t('of') .'
';
- return $output;
+ $attributes['class'] = 'views_slideshow_thumbnailhover_image_count views_slideshow_image_count';
+ $attributes['id'] = "views_slideshow_thumbnailhover_image_count_$id";
+ $attributes = drupal_attributes($attributes);
+
+ $counter = '
' . t('of') .'
';
+
+ return "
$counter
";
}