/**
 * Get content for individual slide including
 * headline, description, and button.
 *
 * @since 1.1.0
 *
 * @param array $slider ID of slider
 * @param array $slide Data for individual slide
 * @param array $settings Settings for slider
 * @param string $slider_type Type of slider, standard, nivo, carrousel, bootstrap, or fallback
 * @return string $output Final HTML markup for content section
 */
function themeblvd_get_slide_content($slider, $slide, $settings, $slider_type = 'standard')
{
    $output = '';
    if (themeblvd_slide_has_element('headline', $slide) || themeblvd_slide_has_element('description', $slide) || themeblvd_slide_has_element('button', $slide)) {
        // Setup markup to wrap content area.
        $wrap_class = 'content';
        if ($slide['position'] != 'full') {
            $wrap_class .= ' grid_fifth_2';
        }
        $wrap_fmt = apply_filters('themeblvd_slide_content_wrap', '<div class="' . $wrap_class . '"><div class="content-inner">%s</div></div>');
        $content = '';
        // Headline
        if (themeblvd_slide_has_element('headline', $slide)) {
            $content .= sprintf('<div class="slide-title"><span>%s</span></div>', apply_filters('themeblvd_sliders_headline_text', stripslashes($slide['elements']['headline'])));
        }
        // Description + Button
        if (themeblvd_slide_has_element('description', $slide) || themeblvd_slide_has_element('button', $slide)) {
            $desc = '';
            // Description text
            if (themeblvd_slide_has_element('description', $slide)) {
                $text = apply_filters('themeblvd_sliders_desc_text', stripslashes($slide['elements']['description']));
                if (apply_filters('themeblvd_' . $slider_type . '_slider_desc', true, $slide, $slider, $settings)) {
                    $text = apply_filters('themeblvd_the_content', $text);
                }
                $desc .= sprintf('<div class="slide-description-text">%s</div>', $text);
            }
            // Button
            if (themeblvd_slide_has_element('button', $slide)) {
                $button_atts = apply_filters('themeblvd_' . $slider_type . '_slider_button', array('text' => apply_filters('themeblvd_sliders_button_text', $slide['elements']['button']['text']), 'url' => $slide['elements']['button']['url'], 'color' => 'default', 'target' => $slide['elements']['button']['target'], 'size' => 'medium'), $slide, $slider, $settings, $slider_type);
                $desc .= sprintf('<div class="slide-description-button">%s</div>', themeblvd_button(stripslashes($button_atts['text']), $button_atts['url'], $button_atts['color'], $button_atts['target'], $button_atts['size']));
            }
            $content .= sprintf('<div class="slide-description"><div class="slide-description-inner">%s</div></div>', $desc);
        }
        // Wrap and finalize content
        $output = sprintf($wrap_fmt, $content);
    }
    return apply_filters('themeblvd_slide_content', $output, $slider, $slide, $settings, $slider_type);
}
/**
 * Slidebar mobile fallback
 *
 * @since 1.0.0
 *
 * @param string $slider ID of current slider
 * @param array $slides Current slides for slider
 * @param string $fallback Type of fallback, full_list or first_slide
 * @param array $settings All current settings for slider
 */
function themeblvd_slider_fallback_default($slider, $slides, $fallback, $settings = array())
{
    echo '<div class="slider-fallback">';
    echo '<div class="slider-fallback-inner ' . $fallback . '">';
    if ($slides) {
        echo '<ul class="slider-fallback-list">';
        foreach ($slides as $slide) {
            echo '<li class="slider-fallback-slide">';
            echo '<div class="slider-fallback-slide-body">';
            if (isset($slide['custom'])) {
                // Custom Slide
                echo apply_filters('themeblvd_sliders_custom_content', $slide['custom']);
            } else {
                // Headline
                if (themeblvd_slide_has_element('headline', $slide)) {
                    printf('<h2>%s</h2>', stripslashes($slide['elements']['headline']));
                }
                // Media (Image or Video)
                themeblvd_slide_media(themeblvd_sliders_get_media_atts($slider, $slide, $settings, 'fallback'), array(), 'fallback');
                // Description
                if (themeblvd_slide_has_element('description', $slide)) {
                    $text = stripslashes($slide['elements']['description']);
                    if (apply_filters('themeblvd_fallback_slider_desc', true, $slide, $slider, $settings)) {
                        $text = apply_filters('themeblvd_the_content', $text);
                    }
                    printf('<div class="slide-description-text">%s</div>', $text);
                }
                // Button
                if (themeblvd_slide_has_element('button', $slide)) {
                    $button_atts = apply_filters('themeblvd_fallback_slider_button', array('text' => $slide['elements']['button']['text'], 'url' => $slide['elements']['button']['url'], 'color' => 'default', 'target' => $slide['elements']['button']['target'], 'size' => 'medium'), $slide, $slider, $settings, 'fallback');
                    printf('<div class="slide-description-button">%s</div>', themeblvd_button(stripslashes($button_atts['text']), $button_atts['url'], $button_atts['color'], $button_atts['target'], $button_atts['size']));
                }
            }
            echo '</div><!-- .slider-fallback-slide-body (end) -->';
            echo '</li>';
            // End the loop after first slide if we're only showing the first slide.
            if ($fallback == 'first_slide') {
                break;
            }
        }
        // End foreach ($slides)
        echo '</ul><!-- .slider-fallback-list (end) -->';
    }
    // End if ($slides)
    echo '</div><!-- .slider-fallback-inner (end) -->';
    echo '</div><!-- .slider-fallback(end) -->';
}