<?php



/**
 * Theme Options and Settings
 *
 * @file           theme-customizer.php
 * @package        Encounters Lite 
 * @author         Andre Jutras 
 * @copyright      2013 Styledthemes.com
 * @license        license.txt
 * @version        Release: 1.0
 */
 

 /**
 * Adds the Customize page to the WordPress admin area in the Appearance menu group
 */
function encounters_customizer_menu() {
    add_theme_page( __( 'Customize Encounters', 'encounters' ), __( 'Theme Options', 'encounters' ), 'edit_theme_options', 'customize.php' );
}
add_action( 'admin_menu', 'encounters_customizer_menu' );
 
/**
 * Lets create a customizable theme and begin with some pre-setup
 */ 
 
	add_action('customize_register', 'theme_customize');
	function theme_customize($wp_customize) {

// Lets remove the default background colour so we can move it with a new setting
	$wp_customize->remove_setting( 'background_color');
	$wp_customize->remove_control( 'background_color');

/**
 * Lets add a logo to our Title and Tagline group
 */
// Setting group for uploading logo
    $wp_customize->add_setting('my_logo', array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'type'           => 'option',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'my_logo', array(
        'label'    => __('Your Logo', 'encounters'),
        'section'  => 'title_tagline',
        'settings' => 'my_logo',
    )));	
/**
 * Lets add a section tab called BASIC SETTINGS
 */
 
	$wp_customize->add_section( 'basic_settings', array(
		'title'          => __( 'Basic Settings', 'encounters' ),
		'priority'       => 25,
	) );

/**
 * Options for the Basic Settings section
 */

// Setting for blog layout
	$wp_customize->add_setting( 'blog_sidebar', array(
		'default' => 'rightcolumn',
	) );
// Control for blog layout	
	$wp_customize->add_control( 'blog_sidebar', array(
    'label'   => __( 'Blog Sidebar Column', 'encounters' ),
    'section' => 'basic_settings',
    'type'    => 'radio',
        'choices' => array(
            'rightcolumn' => __( 'Right Column', 'encounters' ),
            'leftcolumn' => __( 'Left Column', 'encounters' ),
			'fullwidth' => __( 'Full Width', 'encounters' ),
        ),
    ));

// Setting for archive layout
	$wp_customize->add_setting( 'archive_sidebar', array(
		'default' => 'rightcolumn',
	) );
// Control for archive layout	
	$wp_customize->add_control( 'archive_sidebar', array(
    'label'   => __( 'Archive Sidebar Column', 'encounters' ),
    'section' => 'basic_settings',
    'type'    => 'radio',
        'choices' => array(
            'rightcolumn' => __( 'Right Column', 'encounters' ),
            'leftcolumn' => __( 'Left Column', 'encounters' ),
			'fullwidth' => __( 'Full Width', 'encounters' ),
        ),
    ));

// Setting for author layout
	$wp_customize->add_setting( 'author_sidebar', array(
		'default' => 'rightcolumn',
	) );
// Control for author layout	
	$wp_customize->add_control( 'author_sidebar', array(
    'label'   => __( 'Author Sidebar Column', 'encounters' ),
    'section' => 'basic_settings',
    'type'    => 'radio',
        'choices' => array(
            'rightcolumn' => __( 'Right Column', 'encounters' ),
            'leftcolumn' => __( 'Left Column', 'encounters' ),
			'fullwidth' => __( 'Full Width', 'encounters' ),
        ),
    ));
	
// Setting for blog intro image
	$wp_customize->add_setting( 'intro_image', array(
		'default' => 'small',
	) );
// Control for blog intro image	
	$wp_customize->add_control( 'intro_image', array(
    'label'   => __( 'Intro Image', 'encounters' ),
    'section' => 'basic_settings',
    'type'    => 'radio',
        'choices' => array(
            'big' => __( 'Big Image', 'encounters' ),
            'small' => __( 'Small Image', 'encounters' ),
        ),
    ));

// copyright
$wp_customize->add_setting('site_copyright', array(
        'default'        => 'Your Name',
 
    ));
 
    $wp_customize->add_control('site_copyright', array(
        'label'      => __('Copyright Title', 'encounters'),
        'section'    => 'basic_settings',
        'settings'   => 'site_copyright',
    ));

	
/**
 * Options for the Colour Settings section
 */		

// Page top border
	$wp_customize->add_setting( 'background_color', array(
		'default'        => '#000000',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
		'label'   => __( 'Background Colour', 'encounters' ),
		'section' => 'background_image',
		'settings'   => 'background_color',
	) ) );
	
// Page top border
	$wp_customize->add_setting( 'topborder', array(
		'default'        => '#000000',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topborder', array(
		'label'   => __( 'Top Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'topborder',
	) ) ); 

// Header Bottom border
	$wp_customize->add_setting( 'headerborder', array(
		'default'        => '#d9dee1',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'headerborder', array(
		'label'   => __( 'Header Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'headerborder',
	) ) );	
// Header Background
	$wp_customize->add_setting( 'headerbg', array(
		'default'        => '#131313',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'headerbg', array(
		'label'   => __( 'Header Background', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'headerbg',
	) ) );
// Content background
	$wp_customize->add_setting( 'contentbg', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'contentbg', array(
		'label'   => __( 'Content Background', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'contentbg',
	) ) );	
	
// Content bottom border
	$wp_customize->add_setting( 'contentborder', array(
		'default'        => '#bf7b7b',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'contentborder', array(
		'label'   => __( 'Content Bottom Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'contentborder',
	) ) );	
// Headings colour
	$wp_customize->add_setting( 'headings', array(
		'default'        => '#b36464',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'headings', array(
		'label'   => __( 'Headings &amp; Titles', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'headings',
	) ) );	
// Content text colour
	$wp_customize->add_setting( 'contenttext', array(
		'default'        => '#787b7f',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'contenttext', array(
		'label'   => __( 'Content Text Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'contenttext',
	) ) );	
// Content link colour
	$wp_customize->add_setting( 'links', array(
		'default'        => '#bf7b7b',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'links', array(
		'label'   => __( 'Content Link Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'links',
	) ) );
// Content link hover colour
	$wp_customize->add_setting( 'linkshover', array(
		'default'        => '#656565',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'linkshover', array(
		'label'   => __( 'Content Link Hover Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'linkshover',
	) ) );
// Bottom area background
	$wp_customize->add_setting( 'bottombg', array(
		'default'        => '#363a3d',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottombg', array(
		'label'   => __( 'Bottom Background', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottombg',
		'priority' => '23'
	) ) );	
// Bottom area border
	$wp_customize->add_setting( 'bottomborder', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomborder', array(
		'label'   => __( 'Bottom Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomborder',
		'priority' => '24'
	) ) );	
// Bottom area text colour
	$wp_customize->add_setting( 'bottomtext', array(
		'default'        => '#dde0e1',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomtext', array(
		'label'   => __( 'Bottom Text Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomtext',
		'priority' => '21'
	) ) );	
// Bottom area heading colour
	$wp_customize->add_setting( 'bottomheading', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomheading', array(
		'label'   => __( 'Bottom Heading Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomheading',
		'priority' => '22'
	) ) );



// Bottom area links
	$wp_customize->add_setting( 'bottomlinks', array(
		'default'        => '#f0a6a6',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomlinks', array(
		'label'   => __( 'Bottom Link Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomlinks',
		'priority' => '22'
	) ) );
// Bottom area link hover
	$wp_customize->add_setting( 'bottomlinkshover', array(
		'default'        => '#dde0e1',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomlinkshover', array(
		'label'   => __( 'Bottom Link Hover', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomlinkshover',
		'priority' => '23'
	) ) );
// Bottom area list border
	$wp_customize->add_setting( 'bottomlistborder', array(
		'default'        => '#656f74',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bottomlistborder', array(
		'label'   => __( 'Bottom List Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'bottomlistborder',
		'priority' => '25'
	) ) );



	
// Footer background colour
	$wp_customize->add_setting( 'footerbg', array(
		'default'        => '#1f2022',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footerbg', array(
		'label'   => __( 'Footer Background', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'footerbg',
		'priority' => '26'
	) ) );	
	
// Footer bottom border
	$wp_customize->add_setting( 'footerborder', array(
		'default'        => '#2a2c2e',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footerborder', array(
		'label'   => __( 'Footer Bottom Border', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'footerborder',
		'priority' => '27'
	) ) );	
// Footer text
	$wp_customize->add_setting( 'footertext', array(
		'default'        => '#656565',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footertext', array(
		'label'   => __( 'Footer Text', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'footertext',
		'priority' => '30'
	) ) );
// Footer Links
	$wp_customize->add_setting( 'footerlinks', array(
		'default'        => '#bf7b7b',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footerlinks', array(
		'label'   => __( 'Footer Links', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'footerlinks',
		'priority' => '29'
	) ) );
// Footer Links on hover
	$wp_customize->add_setting( 'footerlinkshover', array(
		'default'        => '#656565',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footerlinkshover', array(
		'label'   => __( 'Footer Link Hover', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'footerlinkshover',
		'priority' => '28'
	) ) );	
	
// Socialbar background colour
	$wp_customize->add_setting( 'socialbg', array(
		'default'        => '#0f1011',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'socialbg', array(
		'label'   => __( 'Social Bar Background', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'socialbg',
		'priority' => '31'
	) ) );		
	
	
	


	
// Blog date box
	$wp_customize->add_setting( 'datebox', array(
		'default'        => '#93969f',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'datebox', array(
		'label'   => __( 'Blog Date Box', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'datebox',
		'priority' => '20'
	) ) );	
// Blog date colour
	$wp_customize->add_setting( 'datecolour', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'datecolour', array(
		'label'   => __( 'Blog Date Colour', 'encounters' ),
		'section' => 'colors',
		'settings'   => 'datecolour',
		'priority' => '19'
	) ) );	
	
	
/**
 * Lets add a section tab called Social Networking
 */
 
	$wp_customize->add_section( 'social_networking', array(
		'title'          => __( 'Social Networking', 'encounters' ),
		'priority'       => 40,
	) );

// Setting for hiding the social bar
	$wp_customize->add_setting( 'hide_social', array(
		'default' => '',
	) );
// Control for hiding the social bar
	$wp_customize->add_control( 'hide_social', array(
		'settings' => 'hide_social',
		'label' => __( 'Social Bar', 'encounters' ),
		'section' => 'social_networking',
		'type' => 'checkbox',
		'priority' => 1,
	) );
	
// Setting group for Twitter
	$wp_customize->add_setting( 'twitter_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'twitter_uid', array(
		'settings' => 'twitter_uid',
		'label'    => __( 'Twitter', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	
	
// Setting group for Facebook
	$wp_customize->add_setting( 'facebook_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'facebook_uid', array(
		'settings' => 'facebook_uid',
		'label'    => __( 'Facebook', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	
	
// Setting group for Google+
	$wp_customize->add_setting( 'google_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'google_uid', array(
		'settings' => 'google_uid',
		'label'    => __( 'Google+', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	
	
// Setting group for Linkedin
	$wp_customize->add_setting( 'linkedin_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'linkedin_uid', array(
		'settings' => 'linkedin_uid',
		'label'    => __( 'Linkedin', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	
	
// Setting group for Pinterest
	$wp_customize->add_setting( 'pinterest_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'pinterest_uid', array(
		'settings' => 'pinterest_uid',
		'label'    => __( 'Pinterest', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	


// Setting group for Youtube
	$wp_customize->add_setting( 'youtube_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'youtube_uid', array(
		'settings' => 'youtube_uid',
		'label'    => __( 'Youtube', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );

// Setting group for Flickr
	$wp_customize->add_setting( 'flickr_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'flickr_uid', array(
		'settings' => 'flickr_uid',
		'label'    => __( 'Flickr', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );
	
// Setting group for RSS
	$wp_customize->add_setting( 'rss_uid', array(
		'default'        => '',
	) );

	$wp_customize->add_control( 'rss_uid', array(
		'settings' => 'rss_uid',
		'label'    => __( 'RSS', 'encounters' ),
		'section'  => 'social_networking',
		'type'     => 'text',
	) );	
	
/**
 * Lets add more to our HEADER IMAGE tab
 */	
 
// Showcase outer container background
	$wp_customize->add_setting( 'showcasebg1', array(
		'default'        => '#bf7b7b',		
	) );	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'showcasebg1', array(
		'label'   => __( 'Showcase Outer Background', 'encounters' ),
		'section' => 'header_image',
		'settings'   => 'showcasebg1',
		'priority' => 20,
	) ) );

// Showcase inner container background
	$wp_customize->add_setting( 'showcasebg2', array(
		'default'        => '#8a4f4b',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'showcasebg2', array(
		'label'   => __( 'Showcase Inner Background', 'encounters' ),
		'section' => 'header_image',
		'settings'   => 'showcasebg2',
		'priority' => 21,
	) ) );

// Showcase Padding
	$wp_customize->add_setting( 'showcasepad', array(
		'default'        => '15px 70px',
	) );

	$wp_customize->add_control( 'showcasepad', array(
		'settings' => 'showcasepad',
		'label'    => __( 'Showcase Padding', 'encounters' ),
		'section'  => 'header_image',
		'type'     => 'text',
		'priority' => 25,
	) );	

/**
 * Lets add more to our Navigation tab
 */	

// Setting group for menu top margin
	$wp_customize->add_setting( 'menumargin', array(
		'default'        => '20px',
	) );
	$wp_customize->add_control( 'menumargin', array(
		'settings' => 'menumargin',
		'label'    => __( 'Main Menu Top Margin', 'encounters' ),
		'section'  => 'nav',
		'type'     => 'text',
	) );
// Menu links
	$wp_customize->add_setting( 'menulink', array(
		'default'        => '#e4e6eb',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menulink', array(
		'label'   => __( 'Main Menu Link', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'menulink',
		'priority' => 30,
	) ) );
// Menu link hover and active
	$wp_customize->add_setting( 'menulinkhover', array(
		'default'        => '#bd7d78',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menulinkhover', array(
		'label'   => __( 'Main Menu Link Hover', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'menulinkhover',
		'priority' => 32,		
	) ) );
// SubMenu background
	$wp_customize->add_setting( 'submenubg', array(
		'default'        => '#a45f5c',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'submenubg', array(
		'label'   => __( 'Submenu Background', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'submenubg',
		'priority' => 33,		
	) ) );		
// SubMenu background on hover
	$wp_customize->add_setting( 'submenubghover', array(
		'default'        => '#bf7b7b',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'submenubghover', array(
		'label'   => __( 'Submenu Background Hover', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'submenubghover',
		'priority' => 34,		
	) ) );
// SubMenu links on hover
	$wp_customize->add_setting( 'submenulinkhover', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'submenulinkhover', array(
		'label'   => __( 'Submenu Link Hover', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'submenulinkhover',
		'priority' => 36,		
	) ) );
// Main menu active state from submenu
	$wp_customize->add_setting( 'mainmenuactive', array(
		'default'        => '#bd7d78',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mainmenuactive', array(
		'label'   => __( 'Main Menu Submenu Active', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'mainmenuactive',
		'priority' => 38,		
	) ) );
// Active submenu link
	$wp_customize->add_setting( 'submenuactive', array(
		'default'        => '#ffffff',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'submenuactive', array(
		'label'   => __( 'Submenu Active Link', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'submenuactive',
		'priority' => 40,		
	) ) );
// Active submenu background
	$wp_customize->add_setting( 'submenuactivebg', array(
		'default'        => '#bd7d78',
	) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'submenuactivebg', array(
		'label'   => __( 'Submenu Active Background', 'encounters' ),
		'section' => 'nav',
		'settings'   => 'submenuactivebg',
		'priority' => 41,		
	) ) );



	
// lets close everything	
}