<div id="thememakers_shortcode_template" class="thememakers_shortcode_template clearfix">

    <div class="one-half">
        <h4 class="label"><?php _e('Blog Title', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
        <input type="text" value="Blog" class="js_shortcode_template_changer data-input" data-shortcode-field="title">
    </div><!--/ .ona-half-->


    <?php
    $posts_array = array();
    $posts_object = get_posts(array('numberposts' => 0, 'post_type' => 'post'));
    foreach ($posts_object as $key => $value) {
        $posts_array[$value->ID] = $value->post_title;
    }

    $games_posts_array = array();
    $games_posts_object = get_posts(array('numberposts' => 0, 'post_type' => 'games'));
    foreach ($games_posts_object as $key => $value) {
        $games_posts_array[$value->ID] = $value->post_title;
    }

    $release_posts_array = array();
    $release_posts_object = get_posts(array('numberposts' => 0, 'post_type' => 'release'));
    foreach ($release_posts_object as $key => $value) {
        $release_posts_array[$value->ID] = $value->post_title;
    }

    $review_posts_array = array();
    $review_posts_object = get_posts(array('numberposts' => 0, 'post_type' => 'review'));
    foreach ($review_posts_object as $key => $value) {
        $review_posts_array[$value->ID] = $value->post_title;
    }
	
	
    ?>

	<!-- -------------------------------------------------- -->
	<div class="one-half">
		<h4 class="label"><?php _e('Video', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
		<input type="text" value="<?php echo $video_link; ?>">
		&nbsp;<input type="button" value="+" onclick="add_carusel_item(this)" class="add_carusel_item">
	</div>
	<!-- -------------------------------------------------- -->
	
    <div class="one-half">
        <h4 class="label"><?php _e('Posts', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
        <select class="data-select">
            <?php if (!empty($posts_array)): ?>
                <?php foreach ($posts_array as $id => $name) : ?>
                    <option value="<?php echo $id ?>"><?php echo $name ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>&nbsp;<input type="button" value="+" onclick="add_carusel_item(this)" class="add_carusel_item">
    </div><!--/ .ona-half-->


    <div class="one-half">
        <h4 class="label"><?php _e('Games', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
        <select class="data-select">
            <?php if (!empty($games_posts_array)): ?>
                <?php foreach ($games_posts_array as $id => $name) : ?>
                    <option value="<?php echo $id ?>"><?php echo $name ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>&nbsp;<input type="button" value="+" onclick="add_carusel_item(this)" class="add_carusel_item">
    </div><!--/ .ona-half-->


    <div class="one-half">
        <h4 class="label"><?php _e('Releases', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
        <select class="data-select">
            <?php if (!empty($release_posts_array)): ?>
                <?php foreach ($release_posts_array as $id => $name) : ?>
                    <option value="<?php echo $id ?>"><?php echo $name ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>&nbsp;<input type="button" value="+" onclick="add_carusel_item(this)" class="add_carusel_item">
    </div><!--/ .ona-half-->


    <div class="one-half">
        <h4 class="label"><?php _e('Reviews', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
        <select class="data-select">
            <?php if (!empty($review_posts_array)): ?>
                <?php foreach ($review_posts_array as $id => $name) : ?>
                    <option value="<?php echo $id ?>"><?php echo $name ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>&nbsp;<input type="button" value="+" onclick="add_carusel_item(this)" class="add_carusel_item">
    </div><!--/ .ona-half-->



    <textarea class="js_shortcode_template_changer data-area carusel_collector_textarea" data-shortcode-field="content"></textarea><br />

    <ul class="carusel_collector_list"></ul>

</div><!--/ .thememakers_shortcode_template-->


<!-- --------------------------  PROCESSOR  --------------------------- -->

<div class="fullwidth-frame">

    <h4 class="label"><?php _e('Preview', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>

    <?php $frame_uri = Thememakers_Application_Shortcodes::get_application_uri() . "/preview.php"; ?>

    <div class="shortcode_app_frame_block">
        <div class="thememakers_shortcode_info_popup" style="display: none"></div>
        <iframe src="<?php echo $frame_uri ?>" class="shortcode_app_frame" frameborder="1" id="thememakers_shortcode_template_preview"></iframe>
    </div>

    <script type="text/javascript">
            var thememakers_app_shortcodes_preview_url = "<?php echo $frame_uri ?>";
            jQuery(function() {
                var shortcode_name = "carusel";
                thememakers_app_shortcodes.changer(shortcode_name);
                jQuery("#thememakers_shortcode_template .js_shortcode_template_changer").on('keyup, change', function() {
                    thememakers_app_shortcodes.changer(shortcode_name);
                });

            });
    </script>

</div><!--/ .fullwidth-frame-->




