| 1 |
<?php |
<?php |
| 2 |
// $Id: jcarousellite_views.module,v 1.3 2009/03/07 21:05:23 owahab Exp $ |
// $Id: jcarousellite_views.module,v 1.3.2.1 2009/09/16 23:53:14 owahab Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 28 |
return $style_plugins; |
return $style_plugins; |
| 29 |
} |
} |
| 30 |
|
|
| 31 |
function jcarousellite_callback($callback, $vid, $c) { |
function jcarousellite_callback($callback, $vid, $c, $options = array()) { |
| 32 |
// Attempt to call a function to handle the required calback: |
// Attempt to call a function to handle the required calback: |
| 33 |
$functions[] = "jcarousellite_${callback}_vid${vid}_c${c}"; |
$functions[] = "jcarousellite_${callback}_vid${vid}_c${c}"; |
| 34 |
$functions[] = "jcarousellite_${callback}_vid${vid}"; |
$functions[] = "jcarousellite_${callback}_vid${vid}"; |
| 35 |
$functions[] = "jcarousellite_${callback}"; |
$functions[] = "jcarousellite_${callback}"; |
| 36 |
foreach ($functions as $func) { |
foreach ($functions as $func) { |
| 37 |
if (function_exists($func)) { |
if (function_exists($func)) { |
| 38 |
return $func($vid, $c); |
return $func($vid, $c, $options); |
| 39 |
} |
} |
| 40 |
} |
} |
| 41 |
} |
} |
| 42 |
|
|
| 43 |
function jcarousellite_add_prev($vid, $c) { |
function jcarousellite_add_prev($vid, $c, $options) { |
| 44 |
return l( |
return l( |
| 45 |
theme('image', drupal_get_path('module', 'jcarousellite_views') .'/images/prev-horizontal.png', |
theme('image', drupal_get_path('module', 'jcarousellite_views') .'/images/prev-horizontal.png', |
| 46 |
'<<', |
'<<', |
| 55 |
); |
); |
| 56 |
} |
} |
| 57 |
|
|
| 58 |
function jcarousellite_add_next($vid, $c) { |
function jcarousellite_add_next($vid, $c, $options) { |
| 59 |
return l( |
return l( |
| 60 |
theme('image', drupal_get_path('module', 'jcarousellite_views') .'/images/next-horizontal.png', |
theme('image', drupal_get_path('module', 'jcarousellite_views') .'/images/next-horizontal.png', |
| 61 |
'<<', |
'<<', |
| 70 |
); |
); |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
function jcarousellite_add_view_js($vid, $c) { |
function jcarousellite_add_view_js($vid, $c, $options) { |
| 74 |
return " |
return " |
| 75 |
$('.jcarousellite-$vid-$c .item-list').jCarouselLite({ |
$('.jcarousellite-$vid-$c .item-list').jCarouselLite({ |
| 76 |
btnNext: '.jcarousellite-next-$vid-$c', |
btnNext: '.jcarousellite-next-$vid-$c', |
| 77 |
btnPrev: '.jcarousellite-prev-$vid-$c', |
btnPrev: '.jcarousellite-prev-$vid-$c', |
| 78 |
mouseWheel: true, |
mouseWheel: true, |
| 79 |
visible: 4 |
visible: ". $options['items_visible'] ." |
| 80 |
});"; |
});"; |
| 81 |
} |
} |