<?php 
	
	$tab = $_GET['tab'];
	$this_page = CLOUD_PAGE;
	($tab) ? $this_page .= '&tab='.$tab:NULL;
	

	// Call Theme Options
	global $_opt;
	$config = NULL;
	$_opt = getCO(NULL,TRUE);
	general_page_operations();
?>
            
<div id="framework">

     <?php 
		
	$header_title = 'sliders';
	$nav_pages = NULL;
	$onloadscript = 'jQuery(".tabs").tabs({ cookie: { expires: 60, name: "CloudFW_PG_'.$sector_id.'" }});';

	require (TMP_ADMIN_PATH.'/inc/cloud_header.php'); 
	require (TMP_ADMIN_PATH.'/inc/core/core.slider.include_forms.php'); 
	$msid = $_GET["msid"];
	
	 if (!empty($msid))
		 $toggle_classes = array(1 => "hidden");
	else
		 $toggle_classes = array(0 => "hidden");
		
?>

                        
	  <?php echo '
        
        <input type="hidden" id="slider_form_option_getform" value="'.TMP_ADMIN.'/ajax/slider_content_forms.php" />
        <input type="hidden" id="slider_form_option_delete" value="'.TMP_ADMIN.'/ajax/slider_content_delete.php" />
        <input type="hidden" id="slider_form_option_thispage" value="'.$this_page.'" />
        <input type="hidden" id="slider_form_option_lastid" value="'.$lastID.'" />
		
        <input type="hidden" id="slider_form_action" value="loop" />
        <input type="hidden" id="slider_form_type" value="main_sliders" />
        
        '; ?>
    
        <div class="wrap">
                    
            <div class="framework_container" style="overflow:visible;" id="add-update-form">
        
        	<div class="header"></div>
        	
            <div class="content">
                
                <div class="head">
                <div style="float:right; margin-left:20px;">
               
                    <span id="goback-toggle" class="<?php echo $toggle_classes[0]; ?>"><a href="#" id="backtoAllSliders" class="small-button small-grey"><span><?php _e('Back','cloudfw'); ?></span></a></span>
                    <span id="createnew-toggle" class="<?php echo $toggle_classes[1]; ?>">
	              	<a href="#" title="<?php _e('Import Slider','cloudfw'); ?>" width="m" rel="mb_import_slider" class="small-button small-green help"><span><?php _e('Import','cloudfw'); ?></span></a>
                    <a href="#" title="<?php _e('Create New Slider','cloudfw'); ?>" width="m" rel="mb_create_slider" class="small-button small-brown help">
                        <span><?php _e('Create New Slider','cloudfw'); ?></span></a>
					</span>
                </div>
                <div id="small-loading" class="small_loading"></div> <div id="removed_message" class="item_deleted"><?php _e('Slider Deleted','cloudfw'); ?></div> <div class="area">1</div><h1><?php _e('Slider Management','cloudfw'); ?></h1>
                </div>
                
                <div id="sliderforms">
                
                	<?php 
					
					
					if (!empty($msid)) {
						$data_ = $_opt[PFIX."_slider_ids"];
						$data = $data_[$msid];
						cloudfw_main_slider_forms($this_page,$lastID,$data,$msid);
					}
							
					else 
					
					{
					
					cloudfw_loop_all_sliders($_opt[PFIX."_slider_ids"],NULL, $this_page);
					
					} ?>
                    
				</div>
             
                 	
      		</div>
            
         </div>
         
        <?php
            
		echo '</form>';
			
			?>
        
        
        
        </div>
        
        
<span style="display: none; height: auto;" id="mb_create_slider">
			
    <div style="padding: 20px 20px 0;">
    
    <div>
    
<form method="post" id="add_slider_form" class="slider_forms" action="<?php echo $this_page?>">
<input type="hidden" id="comeback" name="comeback" value="<?php echo $this_page?>" />
<input type="hidden" id="form_selector" name="form_selector" value="<?php echo 'manage_main_slider'; ?>" />
<input type="hidden" id="no_validate" name="no_validate" value="1" />
<input type="hidden" value="1" name="<?php echo PFIX;?>_update" id="<?php echo PFIX;?>_update">

 <div class="grid oneof4" style="padding-top: 10px;"><span class="title"><?php _e('Slider Name:','cloudfw'); ?></span></div>
    <div class="grid threeof4 last">

			<?php
			   admin_create_input(
					'title',//id
					'',//value
					"input",
					"text",
					"input input_300 bold"
				);
			   
			?>

    </div>
    	
<div class="clear"></div>

 <div class="grid oneof4" style="padding-top: 10px;"><span class="title"><?php _e('Slider Type:','cloudfw'); ?></span></div>
    <div class="grid threeof4 last">

            <?php								
							
			$theme_sliders = cloudfw_sliders();
			
			foreach ($theme_sliders as $slider_id => $slider_item) {
					$slides[] =  array(
					"item_title"	=> $slider_item["name"],
					"item_value"	=> $slider_id
					);
								
			}
						
			admin_create_selectlist(
					"slider_type", // id
					$slides, // items
					"default_slider", //default_value
					"select",
					$data["type"],
					"select",
					"input input_300"
			);?>

<div class="small-button small-sky" style="margin-top: 10px !important;"><input type="submit" value="<?php _e('Create','cloudfw'); ?>"></div>

    </div>
    	
<div class="clear"></div>



</form>

    </div>
    
    </div>

<div class="clear"></div>
</span>

<span style="display: none; height: auto;" id="mb_import_slider">
			
    <div style="padding: 20px 20px 0;">
    
    <?php include(TEMPLATEPATH.'/cloudfw/inc/slider.import_form.php'); ?>
    
    </div>

<div class="clear"></div>
</span>
        


</div>

<?php require (TMP_ADMIN_PATH.'/inc/cloud_footer.php');  ?>