comparison sites/all/modules/flexslider_views_slideshow/flexslider_views_slideshow.module @ 2:b74b41bb73f0

-- Google analytics module
author danieleb <danielebarchiesi@me.com>
date Thu, 22 Aug 2013 17:22:54 +0100
parents
children
comparison
equal deleted inserted replaced
1:67ce89da90df 2:b74b41bb73f0
1 <?php
2
3 /**
4 * @file
5 * Adds FlexSlider as a slideshow option in Views Slideshow
6 *
7 * @author Mathew Winstone (minorOffense) <mwinstone@coldfrontlabs.ca>
8 */
9
10 /**
11 * Implements hook_help().
12 */
13 function flexslider_views_slideshow_help($path, $arg) {
14 switch ($path) {
15 // Main module help for the block module
16 case 'admin/help#flexslider_views_slideshow':
17 return '<p>' . t('More to come. For now see the README.txt file please.') . '</p>';
18 }
19 }
20
21 /**
22 * Implements hook_theme().
23 */
24 function flexslider_views_slideshow_theme($existing, $type, $theme, $path) {
25 return array(
26 'flexslider_views_slideshow' => array(
27 'variables' => array('view' => NULL, 'settings' => array(), 'rows' => array(), 'title' => ''),
28 'template' => 'theme/flexslider-views-slideshow',
29 'file' => 'theme/flexslider_views_slideshow.theme.inc',
30 'pattern' => 'flexslider_views_slideshow__',
31 ),
32 'flexslider_views_slideshow_main_frame' => array(
33 'variables' => array('vss_id' => NULL, 'view' => NULL, 'settings' => NULL, 'rows' => NULL),
34 'template' => 'theme/flexslider-views-slideshow-main-frame',
35 ),
36 'flexslider_views_slideshow_main_frame_row' => array(
37 'variables' => array('vss_id' => NULL, 'items' => NULL, 'count' => NULL, 'view' => NULL),
38 'template' => 'theme/flexslider-views-slideshow-main-frame-row',
39 ),
40 'flexslider_views_slideshow_main_frame_row_item' => array(
41 'variables' => array('item' => NULL, 'item_count' => NULL, 'view' => NULL),
42 'template' => 'theme/flexslider-views-slideshow-main-frame-row-item',
43 ),
44 );
45 }
46
47 /**
48 * Implements hook_views_pre_render().
49 **/
50 function flexslider_views_slideshow_views_pre_render(&$view) {
51 // This used to be where the captions were added. We won't be using that method anymore...
52 /*
53 if (get_class($view->style_plugin) == 'views_slideshow_plugin_style_slideshow' and isset($view->style_options['slideshow_type']) and $view->style_options['slideshow_type'] == 'flexslider_views_slideshow') {
54
55 $fieldname = $view->style_plugin->options['flexslider_views_slideshow']['caption_field'];
56 if ($fieldname == 'none' or !isset($view->field[$fieldname])) {
57 return;
58 }
59
60 $view->field[$fieldname]->options['element_type'] = 'p';
61 $view->field[$fieldname]->options['element_class'] = empty($view->field[$fieldname]->options['element_class'])? 'flex-caption': $view->field[$fieldname]->options['element_class'] . ' flex-caption';
62 $view->field[$fieldname]->options['element_label_type'] = '';
63 $view->field[$fieldname]->options['element_label_class'] = '';
64 $view->field[$fieldname]->options['element_label_colon'] = FALSE;
65 $view->field[$fieldname]->options['element_wrapper_type'] = '0';
66 $view->field[$fieldname]->options['element_wrapper_class'] = '';
67 $view->field[$fieldname]->options['element_default_classes'] = 0;
68 }*/
69 }
70
71 /**
72 * Based on notes from views_slideshow_cycle
73 * @see http://drupal.org/project/views_slideshow
74 *
75 * Need to have preprocess functions here because drupal doesn't cache them
76 * correctly in the theme.inc file.
77 *
78 * If you would like to override the preprocess functions make sure to look at
79 * the associated function in theme.inc.
80 */
81
82 // Trying to make sure the theme.inc get's loaded.
83 include_once('theme/flexslider_views_slideshow.theme.inc');
84
85 function template_preprocess_flexslider_views_slideshow_main_frame(&$vars) {
86 _flexslider_views_slideshow_preprocess_flexslider_views_slideshow_main_frame($vars);
87 }
88
89 function template_preprocess_flexslider_views_slideshow_main_frame_row(&$vars) {
90 _flexslider_views_slideshow_preprocess_flexslider_views_slideshow_main_frame_row($vars);
91 }
92
93 function template_preprocess_flexslider_views_slideshow_main_frame_row_item(&$vars) {
94 _flexslider_views_slideshow_preprocess_flexslider_views_slideshow_main_frame_row_item($vars);
95 }
96