You are here

function template_process_bxslider in BxSlider 7

BxSlider template preprocess handler.

File

./bxslider.module, line 1256
Fields integration with BxSlider.

Code

function template_process_bxslider(&$vars) {
  $vars['slider_id'] = $vars['settings']['slider_id'];
  $a = libraries_load('bxslider');

  // JavaScript settings.
  $js_settings = $vars['settings'];
  drupal_add_js(array(
    'bxslider' => array(
      $vars['slider_id'] => $js_settings,
    ),
  ), 'setting');
  drupal_add_css(drupal_get_path('module', 'bxslider') . '/css/bxslider.css');
  drupal_add_js(drupal_get_path('module', 'bxslider') . '/js/bxslider.js', array(
    'type' => 'file',
    'scope' => 'footer',
  ));
  if (isset($vars['settings']['slider_settings']['pagerCustom_type']) && $vars['settings']['slider_settings']['pagerCustom_type'] == 'thumbnail_pager_method2') {
    drupal_add_css(drupal_get_path('module', 'bxslider') . '/css/bxslider_method2.css');
  }
  if (isset($vars['settings']['slider_settings']['pagerCustom_type']) && $vars['settings']['slider_settings']['pagerCustom_type'] == 'thumbnail_pager_method1') {
    $vars['settings']['slider_settings']['pagerCustom'] = str_replace(array(
      '#',
      '.',
    ), '', $vars['settings']['slider_settings']['pagerCustom']);
  }
}