Пример #1
0
function fruitful_slider_images()
{
    global $fruitful_theme_options;
    $slides = get_option($fruitful_theme_options->args['opt_name']);
    $vcount_slides = 0;
    if (!empty($slides['slides'])) {
        $vcount_slides = count($slides['slides']);
    }
    ?>
		<div class="slides-btn">
			<span class="collapse_all"><?php 
    _e('Collapse all', 'fruitful');
    ?>
</span>
			<span class="expand_all"><?php 
    _e('Expand all', 'fruitful');
    ?>
</span>
		</div>
		<ul class="slides">
			<?php 
    /*Init First Slide for noraml work script*/
    if ($vcount_slides == 0) {
        echo fruitful_get_slide(1, -1);
    } else {
        foreach ($slides['slides'] as $key => $slide) {
            $slide_inndex = -1;
            $attach_id = $slide['attach_id'];
            $link_url = null;
            $is_blank = 'off';
            $slide_inndex = trim(substr($key, strrpos($key, '-') + 1, 5));
            if (isset($slide['link'])) {
                $link_url = $slide['link'];
            }
            if (isset($slide['is_blank'])) {
                $is_blank = $slide['is_blank'];
            }
            echo fruitful_get_slide($slide_inndex, $attach_id, esc_url($link_url), $is_blank);
        }
    }
    ?>
		</ul>
		<input type="button" class="button-primary add_new_btn" value="<?php 
    _e('Add New Slide', 'fruitful');
    ?>
" />
<?php 
}
Пример #2
0
function fruitful_new_slide()
{
    $slides = (array) get_option('fruitful_theme_slides_options');
    $data = $_POST['data'];
    echo fruitful_get_slide($data, -1, '');
    die;
}