<?php
global $eptima_lite_themename;
global $eptima_lite_shortname;

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

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

global $eptima_lite_themename;
global $eptima_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', 'eptima-lite'),
				'content'   => __('<p>Help content goes here!</p>', 'eptima-lite')
			)
		),
		'sidebar'     => '<p>Sidebar content goes here!</p>'
		),
		'sections'        => array(
			array(
				'title'   => __( 'General Settings', 'eptima-lite' ),
				'id'      => 'general_default'
			),			
			array(
				'title'   => __( 'Header Settings', 'eptima-lite' ),
				'id'      => 'header_settings'
			), 
			array(      
				'title'   => __( 'Top Bar Settings', 'eptima-lite' ),
				'id'      => 'head_topbar_settings'
			), 	
			array(
				'title'   => __( 'Home Page Featured Section', 'eptima-lite' ),
				'id'      => 'home_feature_settings'
			),
			array(
				'title'   => __( 'Home Page Parallax Section', 'eptima-lite' ),
				'id'      => 'home_parallax_settings'
			),		
			array(
				'title'   => __( 'Blog Settings', 'eptima-lite' ),
				'id'      => 'blog_settings'
			),
			array(      
				'title'   => __( 'Footer Settings', 'eptima-lite' ),
				'id'      => 'footer_section'
			),
		),
		
		'settings'        => array(

		//==================================================================
		// GENERAL SETTINGS SECTION STARTS =================================
		//==================================================================
		
		array(
			'id'          => 'eptima_lite_welcome_speach',
			'label'       => __('Welcome to Eptima Lite', 'eptima-lite'),
			'desc'        => __('<h1>Welcome to Eptima Lite</h1>
			<p>Thank you for using eptima lite. Get started below and go through the left tabs to set up your website.</p>', 'eptima-lite'),
			'std'         => '',
			'type'        => 'textblock',
			'section'     => 'general_default',
			'rows'        => '',
			'post_type'   => '',
			'taxonomy'    => '',
			'class'       => ''
		),
		array(
			'label'       => __( 'Primary Color Scheme', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_primary_color_scheme',
			'type'        => 'colorpicker',
			'desc'        => __('Set primary theme color', 'eptima-lite'),
			'std'         => '#03386f',
			'section'     => 'general_default'
		),
		array(
			'label'       => __( 'Secondry Color Scheme', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_colorpicker',
			'type'        => 'colorpicker',
			'desc'        => __('Set secondry theme color', 'eptima-lite'),
			'std'         => '#bef243',
			'section'     => 'general_default'
		),
		array(
			'label'       => __( 'Upload Favicon', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_favicon',
			'type'        => 'upload',
			'desc'        => __('This creates a custom favicon for your website.', 'eptima-lite'),
			'std'         => '',
			'section'     => 'general_default'
		),
		
		//------ END GENERAL SETTINGS SECTION ------------------------------

			
		//==================================================================
		// HEADER TOP BAR SETTINGS SECTION STARTS ==========================
		//==================================================================
		
		array(
			'id'          => 'head_social_icons',
			'label'       => __('Social Follow Icons', 'eptima-lite'),
			'desc'        => __('<h2><b>Social Follow Icons</b></h2>
			<p>Add your social profile URL( eg: <b>http://facebook.com/username</b> )</p>', 'eptima-lite'),
			'std'         => '',
			'type'        => 'textblock',
			'section'     => 'head_topbar_settings',
		),
	  	array(
			'label'       => __('Facebook Link', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_fbook_link',
			'type'        => 'text',
			'desc'        => __('Enter Facebook Link.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),
		array(
			'label'       => __('Twitter Link', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_twitter_link',
			'type'        => 'text',
			'desc'        => __('Enter Twitter link.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),
		array(
			'label'       => __('Google Plus ID', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_gplus_link',
			'type'        => 'text',
			'desc'        => __('Enter Google plus Id.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),
		array(
			'label'       => __('Linkedin Link', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_linkedin_link',
			'type'        => 'text',
			'desc'        => __('Enter Linkedin link.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),	
		array(
			'label'       => __('Pinterest Link', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_pinterest_link',
			'type'        => 'text',
			'desc'        => __('Enter Pinterest link.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),	
		array(
			'label'       => __('Flickr Link', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_flickr_link',
			'type'        => 'text',
			'desc'        => __('Enter Flickr link.', 'eptima-lite'),
			'std'         => '#',
			'section'     => 'head_topbar_settings'
		),	  	
		
		//------ END SOCIAL LINKS SETTINGS SECTION -------------------------
		
		
		
		//==================================================================
		// HEADER SETTINGS SECTION STARTS ==================================
		//==================================================================
		
		array(
			'label'       => __( 'Change Logo (width:134px and height:29px)', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_logo_img',
			'type'        => 'upload',
			'desc'        => __('This creates a custom logo for your website.', 'eptima-lite'),
			'std'         => '',
			'section'     => 'header_settings'
		),
		array(
			'id'          => $eptima_lite_shortname.'_logo_alt',
			'label'       => __( 'Logo ALT Text', 'eptima-lite'),
			'desc'        => 'Enter logo image alt attribute text.',
			'std'         => 'logo alt text',
			'type'        => 'text',
			'section'     => 'header_settings'
		),	
		array(
			'id'          => $eptima_lite_shortname.'_moblie_menu',
			'label'       => __( 'Mobile Menu Activate Width', 'eptima-lite'),
			'desc'        => __( 'Layout width after which mobile menu will get activated', 'eptima-lite' ),
			'std'         => '1025',
			'type'        => 'numeric-slider',
			'section'     => 'header_settings',
			'rows'        => '',
			'post_type'   => '',
			'taxonomy'    => '',
			'min_max_step'=> '100,1180,1'
		),
		array(
			'label'       => __( 'Home page Image', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_frontslider_stype',
			'type'        => 'upload',
			'desc'        => __('Choose image for home page. Size: Width 1600px and Height 500px.', 'eptima-lite'),
			'std'         => '',
			'section'     => 'header_settings'
		),
		array(
			'label'       => __( 'Inner Page Header Background', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_innerheader_stype',
			'type'        => 'upload',
			'desc'        => __('Choose image for inner page header background.', 'eptima-lite'),
			'std'         => '',
			'section'     => 'header_settings'
		),
		
		//------ END HEADER SETTINGS SECTION -------------------------------

		//==================================================================
		// HOME FEATURED SETTINGS SECTION STARTS ========================s======
		//==================================================================	
		
		array(
			'id'          => $eptima_lite_shortname.'_featured_heading',
			'label'       => __( 'Enter Featured Heading', 'eptima-lite'),
			'desc'        => __('Enter featured heading text.', 'eptima-lite'),
			'std'         => 'Features',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'label'       =>  __( 'Enter Featured Description', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_featured_desc',
			'type'        => 'textarea-simple',
			'desc'        => __('Enter featured description text.', 'eptima-lite'),
			'std'         => 'No more tons of useless features!</br>All of our features created with functionality and design in mind.',
			'section'     => 'home_feature_settings'
		),
		array(
			'id'          => $eptima_lite_shortname.'_featured_title1',
			'label'       => __( 'First Featured Image Title', 'eptima-lite'),
			'desc'        =>__( 'Enter title for first featured box.', 'eptima-lite'),
			'std'         => 'Eptima Theme',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'id'          => $eptima_lite_shortname.'_fb1_first_part_link',
			'label'       => __( 'First Featured Box Link', 'eptima-lite'),
			'desc'        => __('Enter link for first featured box.', 'eptima-lite'),
			'std'         => '#',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'label'       =>  __( 'Enter First Featured Box Description', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_fb1_desc',
			'type'        => 'textarea-simple',
			'desc'        => __('Enter description for first featured box.', 'eptima-lite'),
			'std'         => 'Lorem ipsum is a filter text commonly used to demonstrate the graphic elements of a document or visual presetation.',
			'section'     => 'home_feature_settings'
		),
		array(
				'id'          => $eptima_lite_shortname.'_featured_title2',
				'label'       => __( 'Second Featured Image Title', 'eptima-lite'),
				'desc'        => __('Enter title for second featured box.', 'eptima-lite'),
				'std'         => 'Eptima Theme',
				'type'        => 'text',
				'section'     => 'home_feature_settings'
			),
		array(
			'id'          => $eptima_lite_shortname.'_fb2_second_part_link',
			'label'       => __( 'Second Featured Box Link', 'eptima-lite'),
			'desc'        => __('Enter link for second featured box.', 'eptima-lite'),
			'std'         => '#',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'label'       =>  __( 'Enter Second Featured Box Description', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_fb2_desc',
			'type'        => 'textarea-simple',
			'desc'        => __('Enter description for second featured box.', 'eptima-lite'),
			'std'         => 'Lorem ipsum is a filter text commonly used to demonstrate the graphic elements of a document or visual presetation.',
			'section'     => 'home_feature_settings'
		),
		array(
			'id'          => $eptima_lite_shortname.'_featured_title3',
			'label'       => __( 'Third Featured Image Title', 'eptima-lite'),
			'desc'        => __('Enter title for second featured box.', 'eptima-lite'),
			'std'         => 'Eptima Theme',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'id'          => $eptima_lite_shortname.'_fb3_third_part_link',
			'label'       => __( 'Third Featured Box Link', 'eptima-lite'),
			'desc'        => __('Enter link for third featured box.', 'eptima-lite'),
			'std'         => '#',
			'type'        => 'text',
			'section'     => 'home_feature_settings'
		),
		array(
			'label'       =>  __( 'Enter Third Featured Box Description', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_fb3_desc',
			'type'        => 'textarea-simple',
			'desc'        => __('Enter description for second featured box.', 'eptima-lite'),
			'std'         => 'Lorem ipsum is a filter text commonly used to demonstrate the graphic elements of a document or visual presetation.',
			'section'     => 'home_feature_settings'
		),
		//------ END HOME FEATURED SETTINGS SECTION ---------------------
		
		//==================================================================
		// PARALLAX SETTINGS SECTION STARTS ==================================
		//==================================================================

		array(
			'label'       => __( 'Parallax Section Background Image (size: width * height (1600x * 1000px) )', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_fullparallax_image',
			'type'        => 'upload',
			'desc'        => __('Upload background image for parallax section.','eptima-lite'),
			'std'         => '',
			'section'     => 'home_parallax_settings'
		),
		array(
			'label'       =>  __( 'Parallax Section Content', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_para_content_left',
			'type'        => 'textarea',
			'desc'        => __('Enter content for parallax section', 'eptima-lite'),
			'std'         => 'Phasellus facilisis, nunc in laciniaauctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis vitae velit.volutpat porttitor
a sit amet est.Phasellus facilisis, nunc in lacinia auctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis
vitae velit.volutpat porttitor a sit amet est.Phasellus facilisis, nunc in lacinia auctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis
vitae velit.volutpat porttitor a sit amet est.',
			'section'     => 'home_parallax_settings'
		),
		
		
		//------ END PARALLAX SETTINGS SECTION -------------------------------
			
		//==================================================================
		// BLOG SETTINGS SECTION STARTS ====================================
		//==================================================================	

		array(
			'id'          => $eptima_lite_shortname.'_blogpage_heading',
			'label'       => __( 'Enter Blog Page Title', 'eptima-lite'),
			'desc'        => __('Enter Blog Page Title text.', 'eptima-lite'),
			'std'         => 'Blog',
			'type'        => 'text',
			'section'     => 'blog_settings'
		),
			
		//------ END BLOG SETTINGS SECTION ---------------------------------
		
		//==================================================================
		// FOOTER SETTINGS SECTION STARTS ==================================
		//==================================================================
		
		array(
			'label'       => __('Copyright Text', 'eptima-lite'),
			'id'          => $eptima_lite_shortname.'_copyright',
			'type'        => 'textarea',
			'desc'        => __('You can use HTML for links etc..', 'eptima-lite'),
			'std'         => 'Copyright text here',
			'section'     => 'footer_section'
		),			
	
		//------ END FOOTER SETTINGS SECTION -------------------------------
		
	

		//------ END CUSTOM MESSAGES 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 ); 
  }
  
}

?>