function _jquery_carousel_settings_format in jQuery carousel 7
Same name and namespace in other branches
- 8 jquery_carousel.module \_jquery_carousel_settings_format()
Helper function to prepare the settings to be exposed in JS.
Helps convert boolean 1s & 0s into boolean strings.
3 calls to _jquery_carousel_settings_format()
- theme_jquery_carousel_field_formatter in ./
jquery_carousel.module - Theme callback for jQeury carousel field formatter.
- _jquery_carousel_include_css_js in ./
jquery_carousel.module - Helper function to inject required Css & Js.
- _jquery_carousel_preprocess_jquery_carousel in views/
theme/ jquery_carousel.theme.inc - Preprocessor for jquery carousel view style plugin.
File
- ./
jquery_carousel.module, line 357 - Provide jquery carousel style plugin for views.
Code
function _jquery_carousel_settings_format(&$settings) {
$carousel_form = jquery_carousel_config_form();
foreach (array_keys($settings) as $key) {
if (isset($carousel_form[$key]['#boolean']) && $carousel_form[$key]['#boolean']) {
$settings[$key] = (bool) $settings[$key];
}
}
if (isset($settings['itemsPerTransition']) && empty($settings['itemsPerTransition'])) {
$settings['itemsPerTransition'] = "auto";
}
}