<?php
				
if ($data):

ksort($data);

?>


<script>
jQuery(document).ready(function(){
	
	jQuery('#sorting_form').bind('ajaxPreSend',function(){
		
			jQuery(this).hide();
			jQuery(this).parents("#sliderforms").addClass("loading");
			toggle_goback_slider();
		
	});
	
	jQuery('#sorting_form').bind('ajaxCallback',function(){
		
			jQuery("#backtoAllSliders").click();
		
	});
	

});
</script>


<?php
	
echo '	<ul class="sortable_sliders slider_ajax">';
					
	foreach($data as $slider => $slider_item):
	
	($slider_item["slider_name"]) ? NULL: $slider_item["slider_name"] = "Unnamed";
	($slider_item["slider_image"]) ? NULL: $slider_item["slider_image"] = TMP_ADMIN_SRC."/no-image.png";
	
	($slider_item["slider_align"])? $align = '-'.$slider_item["slider_align"]:$align = NULL;
	($case=="")? $layout = '  <span class="sliderlayout-container-small '.$slider_item["kind"].'-layout-small'.$align.'" style="margin-bottom:0;"><span></span></span>': NULL;
	
	echo '
	<li class="sortable_item">
		
		<input type="hidden" name="s_'.$slider.'" id="s_'.$slider.'" class="sort_input" value="'.$slider.'" />
		<input type="hidden" name="d_'.$slider.'" id="d_'.$slider.'" class="delete_input" value="" autocomplete="off" />
		
		
		<div class="thumb"><img src="'.cloudfw_thumbnail(array('src' => $slider_item["slider_image"], 'w' => 150, 'h' => 60, 'r' => '2.5:1')).'" alt="" /></div>
		<div class="cont">
		
			<a href="#" rel="'.$slider.'" class="edit title">', (strlen($slider_item["slider_name"])>50) ? mb_substr($slider_item["slider_name"],0,50).'..': $slider_item["slider_name"] ,'</a>
			 
		</div>
		
	   <div class="layout">'.$layout.'</div>
		
		<div class="edit-remove">
		<a href="#" class="edit tooltip" title="'.__('Edit','cloudfw').'" rel="'.$slider.'"></a>
		<a href="#" class="remove tooltip" title="'.__('Delete','cloudfw').'" rel="'.$slider.'"></a>
		</div>
		
		<div class="handler">
			<span></span>
		</div>
		
		<div class="clear"></div>
	
	</li>
	
	';
	
	endforeach;
	
					
echo '

</ul>

<div class="module" id="apply-sorting" style="display:none;">
               
	<div style="float:right;">  
	<div class="small-button small-green"><input autocomplete="off" value="'.__('Apply Sorting','cloudfw').'" type="submit"/></div> 
	</div>
	<div class="clear"></div>
	
</div>


';
else:
				
				
	echo '<div class="module">
	<div class="thereisno" style="padding: 30px;">There is no any slider item</div>
	</div>';
				
				
				
endif;

?>