<?php

/*
 *	Get Main Slider Form
 *
 *	@since 1.0
**/
function cloudfw_main_slider_forms( 
	$this_page = NULL,
	$lastID = NULL,
	$slider_data = array(),
	$id = NULL ){
		
	# Load Render Functions
	include_once(TMP_ADMIN_PATH .'/inc/theme_sources.sliders.php');
	require_once(TEMPLATEPATH . '/cloudfw/inc/core/core.render.php');
	
	global $data;
	$data = $slider_data;
	

	$slider_type = cloudfw_get_slider_type($id);
				
	if ($id) 
		$slider_type = cloudfw_get_slider_type($id);
		
	if (!$slider_type): echo 'Slider Cannot Found'; return false; endif;


	if (file_exists(TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.php"))
		require(TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.php");
	else
		exit ('File Cannot Found:'. TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.php");
}


/*
 *	Get The Forms of A Slider Item
 *
 *	@since 1.0
**/
function cloudfw_sub_slider_forms(
	$this_page = NULL,
	$lastID = NULL,
	$slider_data = array(),
	$id = NULL,
	$main_slider_id = NULL
){
	
	# Load Render Functions
	include_once(TMP_ADMIN_PATH .'/inc/theme_sources.sliders.php');
	require_once(TEMPLATEPATH . '/cloudfw/inc/core/core.render.php');

	global $data;
	$data = $slider_data;
	$slider_type = cloudfw_get_slider_type($main_slider_id);
	
	if (file_exists(TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.items.php"))
		require(TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.items.php");
	else
		exit ('File Cannot Found:'. TMP_ADMIN_PATH . "/inc/core/core.slider.get_form.items.php");
} 

/*
 *	Loop All Slider Items
 *
 *	@since 1.0
**/
function cloudfw_loop_slider_items($data, $case = NULL, $main_slider_id = NULL) {                   
	echo '
	<div id="slider_items">

	<form id="sorting_form" method="post" class="ajax_form ctrl_s_form" action="'. $this_page .'">
	
	<input type="hidden" id="comeback" name="comeback" value="'.$this_page.'" />
	<input type="hidden" id="main_slider_id" name="main_slider_id" value="'.$main_slider_id.'" />
	<input type="hidden" id="form_selector" name="form_selector" value="'.PFIX.'_slider_sorting" />

	';
                    
		require (TMP_ADMIN_PATH.'/inc/core/core.slider.loop_items.php');	
	
	echo '</form></div>';
}

/*
 *	Loop Main Sliders
 *
 *	@since 1.0
**/
function cloudfw_loop_all_sliders($data, $case=NULL, $this_page = NULL) {
	require (TMP_ADMIN_PATH.'/inc/core/core.slider.loop_main.php');				
}



?>