<?php
function wpctp_social_networks(){
	return array(
		'facebook'	=> array(
			'label'    	=> __( 'Facebook', 'wpctp' ),
			'default' 	=> 1
		),
		'twitter'	=> array(
			'label'    	=> __( 'Twitter', 'wpctp' ),
			'default' 	=> 1
		),
		'linkedin'	=> array(
			'label'    	=> __( 'Linkedin', 'wpctp' ),
			'default' 	=> 1
		),
		'google'	=> array(
			'label'    	=> __( 'Google+', 'wpctp' ),
			'default' 	=> 1
		),
//		'dribbble'	=> array(
//			'label'    	=> __( 'Dribbble', 'wpctp' ),
//			'default' 	=> 0
//		),
		'youtube'	=> array(
			'label'    	=> __( 'YouTube', 'wpctp' ),
			'default' 	=> 0
		),
		'rss'	=> array(
			'label'    	=> __( 'Rss', 'wpctp' ),
			'default' 	=> 0
		),
		'delicious'	=> array(
			'label'    	=> __( 'Delicious', 'wpctp' ),
			'default' 	=> 0
		),
		'flickr'	=> array(
			'label'    	=> __( 'Flickr', 'wpctp' ),
			'default' 	=> 0
		),
//		'forrst'	=> array(
//			label'    	=> __( 'Forrst', 'wpctp' ),
//			default' 	=> '',
//			type'     	=> 'url'
//		),
		'lastfm'	=> array(
			'label'    	=> __( 'Lastfm', 'wpctp' ),
			'default' 	=> 0
		),
		'vimeo'	=> array(
			'label'    	=> __( 'Vimeo', 'wpctp' ),
			'default' 	=> 0
		),
//		'tumbler'	=> array(
//			'label'    	=> __( 'Tumblr', 'wpctp' ),
//			'default' 	=> 0
//		),
		'pinterest'	=> array(
			'label'    	=> __( 'Pinterest', 'wpctp' ),
			'default' 	=> 0
		),
//		'devian'	=> array(
//			label'    	=> __( 'Deviantart', 'wpctp' ),
//			default' 	=> '',
//			type'     	=> 'url'
//		),
		'skype'	=> array(
			'label'    	=> __( 'Skype', 'wpctp' ),
			'default' 	=> 0
		),
		'github'	=> array(
			'label'    	=> __( 'Github', 'wpctp' ),
			'default' 	=> 0
		),
		'instagram'	=> array(
			'label'    	=> __( 'Instagram', 'wpctp' ),
			'default' 	=> 0
		),
		'stumbleupon'	=> array(
			'label'    	=> __( 'Stumbleupon', 'wpctp' ),
			'default' 	=> 0
		),
		'behance'	=> array(
			'label'    	=> __( 'Behance', 'wpctp' ),
			'default' 	=> 0
		),
		'mail'	=> array(
			'label'    	=> __( 'Mail', 'wpctp' ),
			'default' 	=> 0
		),
//		'website'	=> array(
//			label'    	=> __( 'Website', 'wpctp' ),
//			'default' 	=> 0,
//			type'     	=> 'url'
//		),
//		px-500'	=> array(
//			label'    	=> __( '500px', 'wpctp' ),
//			'default' 	=> 0,
//			type'     	=> 'url'
//		),
//		tripedvisor'	=> array(
//			label'    	=> __( 'TripAdvisor', 'wpctp' ),
//			'default' 	=> 0,
//			type'     	=> 'url'
//		),
		'vk'	=> array(
			'label'    	=> __( 'VK', 'wpctp' ),
			'default' 	=> 0
		),
		'foursquare'	=> array(
			'label'    	=> __( 'Foursquare', 'wpctp' ),
			'default' 	=> 0
		),
		'xing'	=> array(
			'label'    	=> __( 'XING', 'wpctp' ),
			'default' 	=> 0
		),
		'weibo'	=> array(
			'label'    	=> __( 'Weibo', 'wpctp' ),
			'default' 	=> 0
		),
		'odnoklassniki'	=> array(
			'label'    	=> __( 'Odnoklassniki', 'wpctp' ),
			'default' 	=> 0
		),
//		'research-gate'	=> array(
//			'label'    	=> __( 'ResearchGate', 'wpctp' ),
//			'default' 	=> 0
//		),
		'yelp'	=> array(
			'label'    	=> __( 'Yelp', 'wpctp' ),
			'default' 	=> 0
		),
//		'blogger'	=> array(
//			'label'    	=> __( 'Blogger', 'wpctp' ),
//			'default' 	=> 0
//		),
		'soundcloud'	=> array(
			'label'    	=> __( 'SoundCloud', 'wpctp' ),
			'default' 	=> 0
		),
	);
}
function wpctp_get_networks( $extention = 'network', $type = 'checkbox' ){
	$args = array();
	foreach( wpctp_social_networks() as $id => $network ){
		$args["{$extention}_{$id}"]	= array();
		if( ! empty( $network['label'] ) ){
			$args["{$extention}_{$id}"]['label'] = $network['label'];
		}
		if( isset( $network['default'] ) ){
			$args["{$extention}_{$id}"]['default'] = $network['default'];
		}
		if( ! empty( $network['default'] ) && ( $type == 'url' ) ){
			$args["{$extention}_{$id}"]['default'] = wpctp_network_url( $id );
		}
		if( empty( $network['default'] ) && ( $type == 'url' ) ){
			$args["{$extention}_{$id}"]['default'] = '';
		}
		$args["{$extention}_{$id}"]['type'] = $type;
	}
	return $args;
}
function wpctp_network_url( $network ){
	$args = array(
		'facebook'	=> 'https://facebook.com/',
		'twitter'	=> 'https://twitter.com/',
		'linkedin'	=> 'http://linkedin.com/',
		'google'	=> 'http://google.com/',
	);
	if( isset( $args[$network] ) ){
		return $args[$network];
	}
	return;
}
function wpctp_default_args( $section = false ){
	$default_settings = array(
		'general' => array(
			'title'		=> __( 'General Options', 'wpctp' ),
			'priority' 	=> 5,
			'sub_tab' 	=> array(
				'site_option' => array(
					'title'		=> __( 'Site Options', 'wpctp' ),
					'priority'	=> 5,
					'fields' 	=> array(
						'site_options'	=> array(
							'default' 	=> 1,
							'type'     	=> 'hidden'
						),
						'page_layout'	=> array(
							'label'    	=> __( 'Select Page Layout', 'wpctp' ),
							'default' 	=> 'fullwidth',
							'type'     	=> 'image-choices',
							'choices'  	=> array(
								'boxed'	=> array(
									'label'		=> __( 'Boxed', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/boxed.jpg',
								),
								'fullwidth'	=> array(
									'label'		=> __( 'Fullwidth', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/wide.jpg',
								),
							),
						),
						'site_layout'	=> array(
							'label'    => __( 'Select Default Content Layout', 'wpctp' ),
							'default' => 'full-width-content',
							'type'     => 'select',
							'choices'  => array(
								'full-width-content'	=> __( 'Full Width Content', 'wpctp' ),
								'sidebar-content'	=> __( 'Sidebar Content', 'wpctp' ),
								'content-sidebar'	=> __( 'Content Sidebar', 'wpctp' )
							),
						),
						'content_width'	=> array(
							'label'    	=> __( 'Content Width', 'wpctp' ),
							'default' 	=> 1140,
							'type'     	=> 'number'
						),
					),
				),
				'social_networks' => array(
					'title'		=> __( 'Social Network URL', 'wpctp' ),
					'priority'	=> 10,
					'fields' 	=> wpctp_get_networks( 'network', 'url' ),
				),
				'font_family_option' => array(
					'title'		=> __( 'Font Family Options', 'wpctp' ),
					'priority'	=> 15,
					'fields' 	=> array(
						'body_font_family'	=> array(
							'label'    	=> __( 'Body Font Family', 'wpctp' ),
							'default' 	=> '',
							'type'     	=> 'googlefont'
						),
						'headings_font_family'	=> array(
							'label'    		=> __( 'Headings Font Family', 'wpctp' ),
							'default' 	=> '',
							'description'	=>	__( 'Select a custom font family for your headings (h1, h2, h3, h4, h5, h6). Default is base on the body font family.', 'wpctp' ),
							'type'     		=> 'googlefont'
						)
					),
			 	),
				'font_size_option' => array(
					'title'		=> __( 'Font Size Options', 'wpctp' ),
					'priority'	=> 20,
					'fields' 	=> array(
						'body_font_size'	=> array(
							'label'    	=> __( 'Body Font Size', 'wpctp' ),
							'default' 	=> 14,
							'type'     	=> 'number'
						),
						'h1_font_size'	=> array(
							'label'    	=> __( 'H1 Font Size', 'wpctp' ),
							'default' 	=> 40,
							'type'     	=> 'number'
						),
						'h2_font_size'	=> array(
							'label'    	=> __( 'H2 Font Size', 'wpctp' ),
							'default' 	=> 29,
							'type'     	=> 'number'
						),
						'h3_font_size'	=> array(
							'label'    	=> __( 'H3 Font Size', 'wpctp' ),
							'default' 	=> 19,
							'type'     	=> 'number'
						),
						'h4_font_size'	=> array(
							'label'    	=> __( 'H4 Font Size', 'wpctp' ),
							'default' 	=> 17,
							'type'     	=> 'number'
						),
						'h5_font_size'	=> array(
							'label'    	=> __( 'H5 Font Size', 'wpctp' ),
							'default' 	=> 16,
							'type'     	=> 'number'
						),
						'h6_font_size'	=> array(
							'label'    	=> __( 'H6 Font Size', 'wpctp' ),
							'default' 	=> 14,
							'type'     	=> 'number'
						),
				 	),
				),
			),
		),
		'header' => array(
			'title'		=> __( 'Header Options', 'wpctp' ),
			'priority' 	=> 10,
			'sub_tab' 	=> array(
				'header_top'	=> array(
					'title'		=> __( 'Header Top Section', 'wpctp' ),
					'fields' 	=> array(
						'email'	=> array(
							'label'    	=> __( 'Email Address', 'wpctp' ),
							'type'     	=> 'text',
							'default' 	=> 'info@wpcargo.com'
						),
						'phone'	=> array(
							'label'    	=> __( 'Mobile/Phone Number', 'wpctp' ),
							'type'     	=> 'text',
							'default' 	=> '+874 8372 374'
						),
						'login'	=> array(
							'label'    	=> __( 'Login and Logout link', 'wpctp' ),
							'type'     	=> 'checkbox',
							'default' 	=> 1
						),
						'myaccount'	=> array(
							'label'    	=> __( 'My Account', 'wpctp' ),
							'type'     	=> 'checkbox',
							'default' 	=> 1
						),
					),
				),
				'header_top_social_networks'	=> array(
					'title'			=> __( 'Header Top Social Networks', 'wpctp' ),
					'description'	=> __( 'Check the social network you want to display in the bottom of your Header Top section. To add the URL of every social network, just goto General Options tab.', 'wpctp' ),
					'fields' 	=> wpctp_get_networks( 'htn' ),
				),
				'header'	=> array(
					'title'		=> __( 'Header Section', 'wpctp' ),
					'fields' 	=> array(
						'header_layout'	=> array(
							'label'    	=> __( 'Header Layout', 'wpctp' ),
							'default' 	=> 'layout-1',
							'type'     	=> 'image-choices',
							'choices'	=> array(
								'layout-1'	=> array(
									'label'		=> __( 'Layout 1', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/header-layout-1.jpg',
								),
								'layout-2'	=> array(
									'label'		=> __( 'Layout 2', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/header-layout-2.jpg',
								),
								'layout-3'	=> array(
									'label'		=> __( 'Layout 3', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/header-layout-3.jpg',
								)
							)
						),
						'logo'	=> array(
							'label'    	=> __( 'Upload Logo', 'wpctp' ),
							'default' 	=> WPCTP_IMAGES_URL . '/wpctp.png',
							'type'     	=> 'image'
						),
						'transparent_logo'	=> array(
							'label'    	=> __( 'Upload logo for transparent header', 'wpctp' ),
							'default' 	=> WPCTP_IMAGES_URL . '/wpctp-transparent.png',
							'type'     	=> 'image'
						),
						'sticky_logo'	=> array(
							'label'    	=> __( 'Upload logo for sticky header', 'wpctp' ),
							'default' 	=> WPCTP_IMAGES_URL . '/wpctp.png',
							'type'     	=> 'image'
						),
						'menu_font_family'	=> array(
							'label'    		=> __( 'Menu Font Family', 'wpctp' ),
							'description'	=>	__( 'Select a custom font family for your menu. Default is base on the body font family.', 'wpctp' ),
							'type'     		=> 'googlefont'
						),
						'menu_font_size'	=> array(
							'label'    	=> __( 'Menu Font Size', 'wpctp' ),
							'default' 	=> 14,
							'type'     	=> 'number'
						),
						'header_address'	=> array(
							'label'    	=> __( 'Address', 'wpctp' ),
							'type'     	=> 'text',
							'default' 	=> 'Stoneman Ave, Alhambra, CA, 91801'
						),
						'track_button'	=> array(
							'label'    	=> __( 'Track Button', 'wpctp' ),
							'type'     	=> 'checkbox',
							'default' 	=> 1
						),
					),
				)
			),
		),
		'footer' => array(
			'title'		=> __( 'Footer Options', 'wpctp' ),
			'priority' 	=> 15,
			'sub_tab' 	=> array(
				'footer_widgets' => array(
					'title'		=> __( 'Footer Widgets Section', 'wpctp' ),
					'fields' 	=> array(
						'fw_bc_color'	=> array(
							'label'    	=> __( 'Footer Widgets Background Color', 'wpctp' ),
							'default' 	=> '#01BA7C',
							'type'     	=> 'color'
						),
						'fw_color'	=> array(
							'label'    	=> __( 'Footer text Color', 'wpctp' ),
							'default' 	=> '#fff',
							'type'     	=> 'color'
						),
						'fw_widget_title_color'	=> array(
							'label'    	=> __( 'Footer Widget Title Color', 'wpctp' ),
							'default' 	=> '#fff',
							'type'     	=> 'color'
						),
						'fw_widget_title_border_color'	=> array(
							'label'    	=> __( 'Footer Widget Title Border Color', 'wpctp' ),
							'default' 	=> '#fff',
							'type'     	=> 'color'
						),
						'footer_widgets_column'	=> array(
							'label'    	=> __( 'Footer Widgets Column', 'wpctp' ),
							'default' 	=> 4,
							'type'     	=> 'number',
							'input_attrs' => array(
								'min' => 1,
								'max' => 6
							)
						),
						'fw_title_font_size'	=> array(
							'label'    	=> __( 'Widget Title Font Size', 'wpctp' ),
							'default' 	=> 17,
							'type'     	=> 'number'
						),
						'fw_font_size'	=> array(
							'label'    	=> __( 'Footer Widgets Font Size', 'wpctp' ),
							'default' 	=> 12,
							'type'     	=> 'number'
						),
					),
				),
				'footer' => array(
					'title'		=> __( 'Footer Bottom Section', 'wpctp' ),
					'fields' 	=> array(
						'footer_bottom_layout'	=> array(
							'label'    	=> __( 'Footer Bottom Layout', 'wpctp' ),
							'default' 	=> 'layout-1',
							'type'     	=> 'image-choices',
							'choices'	=> array(
								'layout-1'	=> array(
									'label'		=> __( 'Layout 1', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/footer-layout-1.jpg',
								),
								'layout-2'	=> array(
									'label'		=> __( 'Layout 2', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/footer-layout-2.jpg',
								),
								'layout-3'	=> array(
									'label'		=> __( 'Layout 3', 'wpctp' ),
									'image_url'	=> WPCTP_IMAGES_URL . '/footer-layout-3.jpg',
								)
							)
						),
						'footer_bc_color'	=> array(
							'label'    	=> __( 'Footer Background Color', 'wpctp' ),
							'default' 	=> '#01BA7C',
							'type'     	=> 'color'
						),
						'footer_color'	=> array(
							'label'    	=> __( 'Footer text Color', 'wpctp' ),
							'default' 	=> '#fff',
							'type'     	=> 'color'
						),
						'footer_border_color_1'	=> array(
							'label'    	=> __( 'Footer Border Color 1', 'wpctp' ),
							'default' 	=> '#00e095',
							'type'     	=> 'color'
						),
						'footer_border_color_2'	=> array(
							'label'    	=> __( 'Footer Border Color 2', 'wpctp' ),
							'default' 	=> '#009664',
							'type'     	=> 'color'
						),
						'footer_font_size'	=> array(
							'label'    	=> __( 'Footer Font Size', 'wpctp' ),
							'default' 	=> 12,
							'type'     	=> 'number'
						),
						'footer_left'	=> array(
							'label'    	=> __( 'Footer Left', 'wpctp' ),
							'default' 	=> sprintf( '© %s - All Rights Reserved', date( 'Y' ) ),
							'type'     	=> 'textarea'
						),
						'footer_right_text'	=> array(
							'label'    	=> __( 'Footer Right Text', 'wpctp' ),
							'default' 	=> sprintf( 'Design by %s and powered by WordPress', WPCTP_NAME ),
							'type'     	=> 'textarea'
						),
						'footer_address'	=> array(
							'label'    	=> __( 'Address', 'wpctp' ),
							'type'     	=> 'text',
							'default' 	=> 'Stoneman Ave, Alhambra, CA, 91801'
						),
					),
				),
				'footer_social_networks' => array(
					'title'			=> __( 'Footer Social Networks', 'wpctp' ),
					'description'	=> __( 'Check the social network you want to display in the bottom of your Footer section (footer right). To add the URL of every social network, just goto General Options tab.', 'wpctp' ),
					'priority' 		=> 15,
					'fields' 	=> wpctp_get_networks( 'ftn' ),
				)
			),
		),
	);
	
	if( $section ){
		$default_settings = $default_settings[$section];
	}
	
	return apply_filters( 'wpctp_default_args', $default_settings );
}