<?php

global $fullscreen_lite_themename;
global $fullscreen_lite_shortname;

/**
 * Initialize the options before anything else. 
 */
add_action( 'admin_init', 'fullscreen_lite_theme_options', 1 );

/**
 * Theme Mode demo code of all the available option types.
 *
 * @return    void
 *
 * @access    private
 * @since     2.0
 */
function fullscreen_lite_theme_options() {

global $fullscreen_lite_themename;
global $fullscreen_lite_shortname;
  
   /**
    * Get a copy of the saved settings array. 
    */
	$saved_settings = get_option( 'option_tree_settings', array() );

	
	// If using image radio buttons, define a directory path
	$imagepath  =  get_template_directory_uri() . '/images/';
	$sktsiteurl = home_url();
	$sktsitenm  = get_bloginfo('name');
	
	// BACKGROUND DEFAULTS
	$background_defaults = array(
		'background-color'     => '#000000',
		'background-image'     => '',
		'background-repeat'    => 'repeat-y',
		'background-position'  => 'center top',
		'background-attachment'=>'fixed' 
	);

  /**
   * Create a custom settings array that we pass to 
   * the OptionTree Settings API Class.
   */
  $custom_settings = array(
    'contextual_help' => array(
		'content'       => array( 
			array(
				'id'        => 'general_help',
				'title'     => __('General', 'fullscreen-lite'),
				'content'   => __('<p>Help content goes here!</p>', 'fullscreen-lite')
			)
		),
		'sidebar'     => __('<p>Sidebar content goes here!</p>', 'fullscreen-lite')
    ),
    'sections'        => array(
		array(
			'title'   => __('General Settings', 'fullscreen-lite'),
			'id'      => 'general_default'
		),
		array(
			'title'   => __('Header Settings', 'fullscreen-lite'),
			'id'      => 'header_settings'
		),  		
		array(
			'title'   => __('Blog Settings', 'fullscreen-lite'),
			'id'      => 'blog_settings'
		), 			 		
		array(
			'title'   => __('Home Landing Page Section', 'fullscreen-lite'),
			'id'      => 'home_landing_section'
		),		
		array(      
			'title'   => __('Social Links', 'fullscreen-lite'),
			'id'      => 'social_links'
		), 		
		array(      
			'title'   => __('Footer Section ', 'fullscreen-lite'),
			'id'      => 'footer_section'
		)
    ),
    'settings'        => array(
	
		//==================================================================
		// GENERAL SETTINGS SECTION STARTS =================================
		//==================================================================
		
		array(
			'label'       => __( 'Color Scheme', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_colorpicker',
			'type'        => 'colorpicker',
			'desc'        => __('Set color scheme', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'general_default'
		  ),
		array(
			'label'       => __( 'Change Logo (full path to logo image size: width * height (156px * 40px) )', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_logo_img',
			'type'        => 'upload',
			'desc'        => __('This creates a custom logo for your website.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'general_default'
		),
		array(
			'id'          => $fullscreen_lite_shortname.'_logo_alt',
			'label'       => __( 'Logo ALT Text', 'fullscreen-lite'),
			'desc'        => __('Enter logo image alt attribute text.', 'fullscreen-lite'),
			'std'         => '',
			'type'        => 'text',
			'section'     => 'general_default'
		),
		array(
			'label'       => __( 'Upload Favicon', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_favicon',
			'type'        => 'upload',
			'desc'        => __('This creates a custom favicon for your website.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'general_default'
		),
		

		//------ END GENERAL SETTINGS SECTION ------------------------------
		
		//==================================================================
		// HEADER SETTINGS SECTION STARTS ==================================
		//==================================================================	

		array(
			'label'       => __( 'Home page Image', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_frontslider_stype',
			'type'        => 'upload',
			'desc'        => __('Choose image for home page. Size: Width 1600px and Height 500px.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'header_settings'
		),

		//------ END HEADER SETTINGS SECTION -------------------------------
		
		//==================================================================
		// BLOG SETTINGS SECTION STARTS ==================================
		//==================================================================	

		array(
			'id'          => $fullscreen_lite_shortname.'_blogpage_heading',
			'label'       => __( 'Enter Blog Page Title', 'fullscreen-lite'),
			'desc'        => __('Enter Blog Page Title text.', 'fullscreen-lite'),
			'std'         => 'Blog',
			'type'        => 'text',
			'section'     => 'blog_settings'
		),
					
		//------ END BLOG SETTINGS SECTION -------------------------------
		
		
		
		//==================================================================
		// Home FIRST SECTION STARTS ==================================
		//==================================================================

		array(
			'id'          => $fullscreen_lite_shortname.'_rat_first_section_title',
			'label'       => __( 'Home First Section Title </br>(Create a custom link in Menus and put <b>#section1</b> in URL and Navigation Label according to you for landing page.))', 'fullscreen-lite'),
			'desc'        => __('Enter title for home first section.', 'fullscreen-lite'),
			'std'         => '',
			'type'        => 'text',
			'section'     => 'home_landing_section'
		),
		array(
			'label'       => __('Home First Section Content', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_rat_first_section_content',
			'type'        => 'textarea',
			'desc'        => __('Enter content for Home First Section', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'home_landing_section'
		),
		
		//==================================================================
		// Home SECOND SECTION STARTS ==================================
		//==================================================================
		
		array(
			'id'          => $fullscreen_lite_shortname.'_rat_second_section_title',
			'label'       => __( 'Home Second Section Title </br>(Create a custom link in Menus and put <b>#section2</b> in URL and Navigation Label according to you for landing page.)', 'fullscreen-lite'),
			'desc'        => __('Enter title for home second section.', 'fullscreen-lite'),
			'std'         => '',
			'type'        => 'text',
			'section'     => 'home_landing_section'
		),
		array(
			'label'       => __('Home Second Section Content', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_rat_second_section_content',
			'type'        => 'textarea',
			'desc'        => __('Enter content for home second section', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'home_landing_section'
		),
		
		
		//==================================================================
		// Home THIRD SECTION STARTS ==================================
		//==================================================================
		
		array(
			'id'          => $fullscreen_lite_shortname.'_rat_third_section_title',
			'label'       => __( 'Home Third Section Title </br>(Create a custom link in Menus and put <b>#section3</b> in URL and Navigation Label according to you for landing page.)', 'fullscreen-lite'),
			'desc'        => __('Enter title for home third section.', 'fullscreen-lite'),
			'std'         => '',
			'type'        => 'text',
			'section'     => 'home_landing_section'
		),
		array(
			'label'       => __('Home Third Section Content', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_rat_third_section_content',
			'type'        => 'textarea',
			'desc'        => __('Enter content for home third section', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'home_landing_section'
		),
		
		
		//------ END HOME THIRD SETTINGS SECTION -------------------------------
		
		
	  	//==================================================================
		// SOCIAL LINKS SETTINGS SECTION STARTS ============================
		//==================================================================
	  	array(
			'label'       => __('Facebook Link', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_fbook_link',
			'type'        => 'text',
			'desc'        => __('Enter Facebook Link.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'social_links'
		),
		array(
			'label'       => __('Twitter Link', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_twitter_link',
			'type'        => 'text',
			'desc'        => __('Enter Twitter link.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'social_links'
		),
		array(
			'label'       => __('Pinterest Link', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_pinterest_link',
			'type'        => 'text',
			'desc'        => __('Enter Pinterest link.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'social_links'
		),	
		array(
			'label'       => __('Dribbble Link', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_dribbble_link',
			'type'        => 'text',
			'desc'        => __('Enter Dribbble link.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'social_links'
		),
		array(
			'label'       => __('Tumblr Link', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_tumblr_link',
			'type'        => 'text',
			'desc'        => __('Enter Tumblr link.', 'fullscreen-lite'),
			'std'         => '',
			'section'     => 'social_links'
		),		
			   
		//------ END SOCIAL LINKS SETTINGS SECTION -------------------------
	
		//==================================================================
		// FOOTER SETTINGS SECTION STARTS ==================================
		//==================================================================
		array(
			'label'       => __('Copyright Text', 'fullscreen-lite'),
			'id'          => $fullscreen_lite_shortname.'_copyright',
			'type'        => 'textarea',
			'desc'        => __('You can use HTML for links etc..', 'fullscreen-lite'),
			'std'         => 'copyright text',
			'section'     => 'footer_section'
		),		
		
		//------ END FOOTER SETTINGS SECTION -------------------------------
    )
  );
  
  /* allow settings to be filtered before saving */
  $custom_settings = apply_filters( 'option_tree_settings_args', $custom_settings );
  
  /* settings are not the same update the DB */
  if ( $saved_settings !== $custom_settings ) {
    update_option( 'option_tree_settings', $custom_settings ); 
  }
  
}

?>