/** * Wrap content of Scrollable list * * @param array $content_items The array of Raw HTML output (is not wrapped) of each item * @param array $content The output array * * @return array Array of rows, each row contains columns */ static function scrollable_wrapper($content_items, &$content) { $dargs = PT_CV_Functions::get_global_variable('dargs'); // ID for the wrapper of scrollable list $wrapper_id = PT_CV_Functions::string_random(); // Store all output of Scrollale list (indicators, content, controls) $scrollable_html = array(); $scrollable_content_data = self::scrollable_content($content_items); $count_slides = $scrollable_content_data['count_slides']; $scrollable_content = $scrollable_content_data['scrollable_content']; // Js code $interval = apply_filters(PT_CV_PREFIX_ . 'scrollable_interval', 'false'); $js = "\$('#{$wrapper_id}').carousel({ interval : {$interval} })"; $scrollable_html[] = PT_CV_Html::inline_script($js); // Default value off setting options $enable = apply_filters(PT_CV_PREFIX_ . 'scrollable_fields_enable', 1); // Indicator html $show_indicator = isset($dargs['view-type-settings']['indicator']) ? $dargs['view-type-settings']['indicator'] : $enable; $scrollable_html[] = self::scrollable_indicator($show_indicator, $wrapper_id, $count_slides); // Content html $scrollable_html[] = $scrollable_content; // Control html $show_navigation = isset($dargs['view-type-settings']['navigation']) ? $dargs['view-type-settings']['navigation'] : $enable; $scrollable_html[] = self::scrollable_control($show_navigation, $wrapper_id, $count_slides); // Get wrapper class scrollable $scrollable_class = apply_filters(PT_CV_PREFIX_ . 'scrollable_class', 'carousel slide'); $content[] = sprintf('<div id="%s" class="%s" data-ride="carousel">%s</div>', esc_attr($wrapper_id), esc_attr($scrollable_class), implode("\n", $scrollable_html)); }