| 1 |
<?php |
<?php |
| 2 |
// $Id: views_bulk_operations_plugin_style.inc,v 1.1.2.27 2009/04/14 06:54:29 kratib Exp $ |
// $Id: jcarousellite_views_plugin_style.inc,v 1.1.2.1 2009/09/16 23:54:12 owahab Exp $ |
| 3 |
|
|
| 4 |
class jcarousellite_views_plugin_style extends views_plugin_style_list { |
class jcarousellite_views_plugin_style extends views_plugin_style_list { |
| 5 |
function options(&$options) { |
function options(&$options) { |
| 6 |
parent::options($options); |
parent::options($options); |
| 7 |
$options['display_result'] = TRUE; |
$options['items_visilbe'] = 4; |
|
$options['merge_single_action'] = TRUE; |
|
|
//$this->populate_operations($options); |
|
| 8 |
} |
} |
| 9 |
|
|
| 10 |
function options_form(&$form, &$form_values) { |
function options_form(&$form, &$form_values) { |
| 11 |
parent::options_form($form, $form_values); |
parent::options_form($form, $form_values); |
| 12 |
unset($form['alignment']); |
unset($form['alignment']); |
| 13 |
/* |
$form['items_visible'] = array( |
| 14 |
$form['display_result'] = array( |
'#type' => 'textfield', |
| 15 |
'#type' => 'checkbox', |
'#title' => t('Visible items'), |
| 16 |
'#title' => t('Display processing result'), |
'#description' => t('Specify how many items visible in the Carousel.'), |
| 17 |
'#description' => t('Check this box to let Drupal display a message with the result of processing the selected objects.'), |
'#default_value' => $this->options['items_visible'], |
|
'#default_value' => $this->options['display_result'], |
|
| 18 |
); |
); |
|
$form['merge_single_action'] = array( |
|
|
'#type' => 'checkbox', |
|
|
'#title' => t('Merge single action\'s form with node selection view'), |
|
|
'#description' => t('In case only one action is selected *and* this action is configurable, display its action form along with the node selection view.'), |
|
|
'#default_value' => $this->options['merge_single_action'], |
|
|
); |
|
|
*/ |
|
| 19 |
} |
} |
| 20 |
|
|
| 21 |
function options_validate(&$form, &$form_values) { |
function options_validate(&$form, &$form_values) { |
| 22 |
} |
} |
| 23 |
|
|
| 24 |
function render() { |
function render() { |
| 25 |
//dpr($this); |
; |
| 26 |
|
static $counter; |
| 27 |
|
// Keep count of number of rendered views per page |
| 28 |
|
$counter[$this->view->vid]++; |
| 29 |
drupal_add_css(drupal_get_path('module', 'jcarousellite_views') .'/jcarousellite_views.css'); |
drupal_add_css(drupal_get_path('module', 'jcarousellite_views') .'/jcarousellite_views.css'); |
| 30 |
drupal_add_js(drupal_get_path('module', 'jcarousellite') . '/js/jcarousellite.js'); |
$js_code = jcarousellite_callback('add_view_js', $this->view->vid, $counter[$this->view->vid], $this->options); |
| 31 |
drupal_add_js(drupal_get_path('module', 'jcarousellite') . '/js/jquery.easing.js'); |
jcarousellite_add($js_code); |
|
drupal_add_js(drupal_get_path('module', 'jcarousellite') . '/js/jquery.mousewheel.js'); |
|
|
drupal_add_js("$('.view-id-test .view-content .item-list').jCarouselLite({ |
|
|
btnNext: '.jcarousellite-next', |
|
|
btnPrev: '.jcarousellite-prev', |
|
|
mouseWheel: true, |
|
|
visible: 4 |
|
|
});", 'inline', 'footer'); |
|
| 32 |
// Group the rows according to the grouping field, if specified. |
// Group the rows according to the grouping field, if specified. |
| 33 |
$sets = $this->render_grouping($this->view->result, $this->options['grouping']); |
$sets = $this->render_grouping($this->view->result, $this->options['grouping']); |
| 34 |
|
$this->options['counter'] = $counter[$this->view->vid]; |
| 35 |
// Render each group separately and concatenate. Plugins may override this |
// Render each group separately and concatenate. Plugins may override this |
| 36 |
// method if they wish some other way of handling grouping. |
// method if they wish some other way of handling grouping. |
| 37 |
$output = $view_output = ''; |
$output = $view_output = ''; |
| 47 |
} |
} |
| 48 |
$view_output .= theme($this->theme_functions(), $this->view, $this->options, $rows, $title); |
$view_output .= theme($this->theme_functions(), $this->view, $this->options, $rows, $title); |
| 49 |
} |
} |
| 50 |
$output .= jcarousellite_callback('add_prev', $view->vid, $counter[$view->vid]); |
$output .= jcarousellite_callback('add_prev', $this->view->vid, $counter[$this->view->vid]); |
| 51 |
$output .= $view_output; |
$output .= $view_output; |
| 52 |
$output .= jcarousellite_callback('add_next', $view->vid, $counter[$view->vid]); |
$output .= jcarousellite_callback('add_next', $this->view->vid, $counter[$this->view->vid]); |
| 53 |
|
|
| 54 |
return $output; |
return $output; |
| 55 |
} |
} |