<?php
$tech_literacy_page_builder = esc_html(__( 'Page Builder', 'tech-literacy' ));
$tech_literacy_page_builder_details = esc_html(__('Theme supports Page Builder. You can drag and drop our widgets with page builder visual editor.', 'tech-literacy' ));
$tech_literacy_page_layout = esc_html(__( 'Page Layout', 'tech-literacy' ));
$tech_literacy_page_layout_details = esc_html(__('Theme offers many different page layouts so you can quickly and easily create your pages with no hassle!', 'tech-literacy' ));
$tech_literacy_unlimited_sidebar = esc_html(__( 'Unlimited Sidebar', 'tech-literacy' ));
$tech_literacy_unlimited_sidebar_details = esc_html(__( 'Theme includes a different sidebar layouts. Unlimited sidebars allow you to create custom sidebars that match the style and layout of pages!', 'tech-literacy' ));
$tech_literacy_custom_widget = esc_html(__( 'Custom Widget', 'tech-literacy' ));
$tech_literacy_custom_widget_details = esc_html(__( 'We offer many custom widgets that are stylized and ready for use. Simply drag & drop into place to activate!', 'tech-literacy' ));
$tech_literacy_portfolio = esc_html(__( 'Multi Portfolio', 'tech-literacy' ));
$tech_literacy_portfolio_details = esc_html(__( 'Theme have a unlimited customization options in portfolio. You can use 2, 3, or 4 Columns with masonry layouts!', 'tech-literacy' ));
$tech_literacy_typography = esc_html(__( 'Typography', 'tech-literacy' )); 
$tech_literacy_typography_details = esc_html(__('Theme loves typography, you can choose from over 500+ Google Fonts and Standard Fonts to customize your site!', 'tech-literacy' ));
$tech_literacy_slider = esc_html(__( 'Awesome Sliders', 'tech-literacy' ));
$tech_literacy_slider_details = esc_html(__('Theme includes Flex and Elastic sliders . You can use flexslider as a image,video and google map anywhere in your site.', 'tech-literacy' ));
$tech_literacy_woocommerce = esc_html(__( 'Woo Commerce', 'tech-literacy' ));
$tech_literacy_woocommerce_details = esc_html(__('Theme has full design/code integration for WooCommerce, your shop will look as good as the rest of your site!', 'tech-literacy' ));
$tech_literacy_retina_ready = esc_html(__( 'Retina Ready', 'tech-literacy' ));
$tech_literacy_retina_ready_details = esc_html(__( 'Theme is Retina Ready. So, Everything looks amazingly sharp and crisp on high resolution retina displays of all sizes!', 'tech-literacy' ));
$tech_literacy_icons = esc_html(__( 'Icons', 'tech-literacy' ));
$tech_literacy_icons_details = esc_html(__( ' Choose from over 2500 icons are fully integrated into the theme. Use them anywhere in your site with select your own size and color.', 'tech-literacy' ));
$tech_literacy_support = esc_html(__( 'Excellent Support', 'tech-literacy' ));
$tech_literacy_support_details = esc_html(__( 'We truly care about our customers and themes performance. We assure you that you will get the best after sale support like never before!', 'tech-literacy' ));
$tech_literacy_responsive_layout = esc_html(__( 'Responsive Layout', 'tech-literacy' ));
$tech_literacy_responsive_layout_details = esc_html( __('Theme is fully responsive and can adapt to any screen size. Resize your browser window to view it!', 'tech-literacy' ));
$tech_literacy_testimonials = esc_html( __( 'Testimonials', 'tech-literacy' ));
$tech_literacy_testimonials_details = esc_html( __( 'Display your clients\' glowing comments about your business on your homepage. Showing a specific number of testimonials with use of testimonial widget. ', 'tech-literacy' ));
$tech_literacy_social_media = esc_html( __( 'Social Media', 'tech-literacy' ));
$tech_literacy_social_media_details = esc_html( __( 'Want your users to stay in touch? No problem, Theme has Social Media icons all throughout the theme!', 'tech-literacy' ));
$tech_literacy_google_map = esc_html( __( 'Google Map', 'tech-literacy' ));
$tech_literacy_google_map_details = esc_html( __('Theme includes Goole Map widget. Find a place on the map and get directions. Or get info like business hours and menus, and see Street View imagery.', 'tech-literacy' ));
$tech_literacy_customization = esc_html( __( 'Customization', 'tech-literacy' ));
$tech_literacy_customization_details = esc_html( __('With advanced theme options, page options & extensive docs, its never been easier to customize a theme!', 'tech-literacy' ));
$tech_literacy_demo_content = esc_html( __( 'Demo content', 'tech-literacy' ));
$tech_literacy_demo_content_details = esc_html( __('Theme includes single click demo content. You can quickly setup the site like our demo and get started easily!', 'tech-literacy' ));
$tech_literacy_improvement = esc_html( __( 'Improvement', 'tech-literacy' ));
$tech_literacy_improvement_details = esc_html( __('We love our theme and customers. We are committed to improve and add new features to Theme!', 'tech-literacy' ));

$tech_literacy_view_demo = esc_html( __( 'View Demo', 'tech-literacy'));
$tech_literacy_upgrade_to_pro = esc_html( __( 'Upgrade To Pro', 'tech-literacy' ));


$tech_literacy_why_upgrade = <<< FEATURES

<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-cog"></i></div>
	<h3>$tech_literacy_page_builder</h3>
	<p>$tech_literacy_page_builder_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-th-large"></i></div>
	<h3>$tech_literacy_page_layout</h3>
	<p>$tech_literacy_page_layout_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-th"></i></div>
	<h3>$tech_literacy_unlimited_sidebar</h3>
	<p>$tech_literacy_unlimited_sidebar_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-code-fork"></i></div>
	<h3>$tech_literacy_custom_widget</h3>
	<p>$tech_literacy_custom_widget_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-list-alt"></i></div>
	<h3>$tech_literacy_portfolio</h3>
	<p>$tech_literacy_portfolio_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-font"></i></div>
	<h3>$tech_literacy_typography</h3>
	<p>$tech_literacy_typography_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-slideshare"></i></div>
	<h3>$tech_literacy_slider</h3>
	<p>$tech_literacy_slider_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-shopping-cart"></i></div>
	<h3>$tech_literacy_woocommerce</h3>
	<p>$tech_literacy_woocommerce_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-magic"></i></div>
	<h3>$tech_literacy_retina_ready</h3>
	<p>$tech_literacy_retina_ready_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-dashboard"></i></div>
	<h3>$tech_literacy_icons</h3>
	<p>$tech_literacy_icons_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-magic"></i></div>
	<h3>$tech_literacy_support</h3>
	<p>$tech_literacy_support_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-desktop"></i></div>
	<h3>$tech_literacy_responsive_layout</h3>
	<p>$tech_literacy_responsive_layout_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-rocket"></i></div>
	<h3>$tech_literacy_testimonials</h3>
	<p>$tech_literacy_testimonials_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-skype"></i></div>
	<h3>$tech_literacy_social_media</h3>
	<p>$tech_literacy_social_media_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-map-marker"></i></div>
	<h3>$tech_literacy_google_map</h3>
	<p>$tech_literacy_google_map_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-edit"></i></div>
	<h3>$tech_literacy_customization</h3>
	<p>$tech_literacy_customization_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-check"></i></div>
	<h3>$tech_literacy_demo_content</h3>
	<p>$tech_literacy_demo_content_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-signal"></i></div>
	<h3>$tech_literacy_improvement</h3>
	<p>$tech_literacy_improvement_details</p>
</div>
FEATURES;

function tech_literacy_theme_page() {
	$title = esc_html(__('Tech Literacy','tech-literacy'));
	add_theme_page( 
		esc_html(__( 'Upgrade To Tech Literacy Pro','tech-literacy')),
		$title.'<i class="fa fa-plane theme-icon"></i>', 
		'edit_theme_options',
		'tech_literacy_upgrade',
		'tech_literacy_display_upgrade'
	);
}

add_action('admin_menu','tech_literacy_theme_page');


function tech_literacy_display_upgrade() {
  $theme_data = wp_get_theme('tech-literacy'); 
    
    // Check for current viewing tab
    $tab = null;
    if ( isset( $_GET['tab'] ) ) {
        $tab = $_GET['tab'];
    } else {
        $tab = null;
    }  
     
    $pro_theme_url = 'https://www.webulousthemes.com/theme/tech-literacy-pro/';
    $doc_url  = 'https://www.webulousthemes.com/tech-literacy-free';
    $support_url = 'https://www.webulousthemes.com/free-support-request/'; 

    $current_action_link =  admin_url( 'themes.php?page=tech_literacy_upgrade&tab=pro_features' ); ?>
    <div class="tech-literacy-wrapper about-wrap">
        <h1><?php printf(esc_html__('Welcome to %1$s - Version %2$s', 'tech-literacy'), $theme_data->Name ,$theme_data->Version ); ?></h1><?php
       	printf( __('<div class="about-text"> Tech Literacy is a free, clean, minimalistic, responsive, mobile-friendly WordPress theme. Tech Literacy suitable for education, literacy websites, online stores, personal portfolio, agencies, start-ups. However, due to its flexibility and easiness it can be used to create any types of sites. this Theme build in customizer it is very easy to use and user friendly. Theme includes lots of features like Drag & Drop page builder. </div>', 'tech-literacy') ); ?>
        <a href="https://www.webulousthemes.com/" target="_blank" class="wp-badge welcome-logo"></a>   
        <p class="upgrade-btn"><a class="upgrade" href="<?php echo esc_url($pro_theme_url); ?>" target="_blank"><?php printf( __( 'Buy %1s Pro - $39', 'tech-literacy'), $theme_data->Name ); ?></a></p>

	   <h2 class="nav-tab-wrapper">
	        <a href="?page=tech_literacy_upgrade" class="nav-tab<?php echo is_null($tab) ? ' nav-tab-active' : null; ?>"><?php echo $theme_data->Name; ?></a>
	        <a href="?page=tech_literacy_upgrade&tab=pro_features" class="nav-tab<?php echo $tab == 'pro_features' ? ' nav-tab-active' : null; ?>"><?php esc_html_e( 'PRO Features', 'tech-literacy' );  ?></a>
            <a href="?page=tech_literacy_upgrade&tab=free_vs_pro" class="nav-tab<?php echo $tab == 'free_vs_pro' ? ' nav-tab-active' : null; ?>"><?php esc_html_e( 'Free VS PRO', 'tech-literacy' ); ?></a>
	        <?php do_action( 'tech_literacy_admin_more_tabs' ); ?>
	    </h2>      

        <?php if ( is_null( $tab ) ) { ?>
            <div class="theme_info info-tab-content">
                <div class="theme_info_column clearfix">
                	<div id="webulous-create-web">
						<a href="https://www.webulousthemes.com/checkout?edd_action=add_to_cart&download_id=23052" target="_blank">
							<div id="webulous-mode-wrap">
								<?php echo sprintf ('<h3>%1$s</h3><p>%2$s</p>',__('New to Creating a Website?','tech-literacy'),__('We will build you a complete website based on the theme you selected. We will populate content, change colors and do any look and feel customisation work you prefer.','tech-literacy') ); ?>
							</div>
							<div class="image-wrap">
								<?php echo sprintf ( '<img src="'. esc_url(get_template_directory_uri()) .'/images/api.png" alt="%1$s" />',__('Image','tech-literacy') ); ?>
							</div>
						</a>
					</div>
                    <div class="theme_info_left">
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Theme Customizer', 'tech-literacy' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('%s supports the Theme Customizer for all theme settings. Click "Customize" to start customize your site.', 'tech-literacy'), $theme_data->Name); ?></p>
                            <p>
                                <a href="<?php echo admin_url('customize.php'); ?>" class="button button-primary"><?php esc_html_e('Start Customize', 'tech-literacy'); ?></a>
                            </p>
                        </div>
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Theme Documentation', 'tech-literacy' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('Need any help to setup and configure %s? Please have a look at our documentations instructions.', 'tech-literacy'), $theme_data->Name); ?></p>
                            <p>
                                <a href="<?php echo esc_url($doc_url); ?>" target="_blank" class="button button-secondary"><?php esc_html_e(' Documentation', 'tech-literacy'); ?></a>
                            </p>
                            <?php do_action( 'tech_literacy_dashboard_theme_links' ); ?>
                        </div>  
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Having Trouble, Need Support?', 'tech-literacy' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('Support for %s WordPress theme is conducted through Webulous free support ticket system.', 'tech-literacy'), $theme_data->Name); ?></p>
                            <p>  
                                <a href="<?php echo esc_url($support_url); ?>" target="_blank" class="button button-secondary"><?php echo sprintf( esc_html('Create a support ticket', 'tech-literacy'), $theme_data->Name); ?></a>
                            </p>
                        </div> 
                       
                    </div>  

                    <div class="theme_info_right">
                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/screenshot.png" alt="Theme Screenshot" />
                    </div>
                </div>
            </div>
        <?php } ?>

 
        <?php if ( $tab == 'pro_features' ) { ?>
            <div class="pro-features-tab info-tab-content"><?php
			    global $tech_literacy_why_upgrade; ?>
				<div class="wrap clearfix">
				    <?php echo $tech_literacy_why_upgrade; ?>
				</div>
			</div><?php   
		} ?>  

       <!-- Free VS PRO tab -->
        <?php if ( $tab == 'free_vs_pro' ) { ?>
            <div class="free-vs-pro-tab info-tab-content">
	            <div id="free_pro">
	                <table class="free-pro-table">
		                <thead>
			                <tr>
			                    <th></th>
			                    <th><?php echo $theme_data->Name; ?> Lite</th>
			                    <th><?php echo $theme_data->Name; ?> PRO</th>
			                </tr>
		                </thead>
		                <tbody>
		                    <tr>
		                        <td><h3><?php _e('Flex Slider', 'tech-literacy'); ?></h3></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                        <td><h3><?php _e('Support', 'tech-literacy'); ?></h3></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                        <td><h3><?php _e('Responsive Design', 'tech-literacy'); ?></h3></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                        <td><h3><?php _e('Custom Logo Option', 'tech-literacy'); ?></h3></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                        <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                         <td><h3><?php _e('Social Links', 'tech-literacy'); ?></h3></td>
		                         <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                         <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                    	 <td><h3><?php _e('Unlimited color option', 'tech-literacy'); ?></h3></td>
		                    	 <td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	 <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                    	 <td><h3><?php _e('Elastic Slider', 'tech-literacy'); ?></h3></td>
		                    	 <td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	 <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	 <td><h3><?php _e('Page Builder Support', 'tech-literacy');?></h3></td>
		                    	 <td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	 <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	 <td><h3><?php _e('Page Templates', 'tech-literacy');?></h3></td>
		                    	 <td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	 <td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                    	<td><h3><?php _e('Google Map', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    <tr>
		                    	<td><h3><?php _e('Demo Content', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	<td><h3><?php _e('Polylang Compatible', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	<td><h3><?php _e('Multiple Portfolio Layouts', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	<td><h3><?php _e('Multiple Blog Layouts', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	<td><h3><?php _e('Page Animation', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                     <tr>
		                    	<td><h3><?php _e('Unlimited Sidebar', 'tech-literacy');?></h3></td>
		                    	<td class="only-pro"><span class="dashicons-before dashicons-no-alt"></span></td>
		                    	<td class="only-lite"><span class="dashicons-before dashicons-yes"></span></td>
		                    </tr>
		                    
		                    <tr class="ti-about-page-text-center">
		                        <td></td>
		                    	<td colspan="2"><a href="<?php echo esc_url($pro_theme_url); ?>" target="_blank" class="button button-primary button-hero"><?php printf( __( 'Buy %1s Pro', 'tech-literacy'), $theme_data->Name ); ?></a></td>
		                    </tr>
		                </tbody>
	                </table>			    
				</div>
			</div><?php 
		} ?>

    </div><?php
}
  
   

	$options = array(
		'capability' => 10,
		'type' => 'theme_mod',
		'panels' => apply_filters( 'tech_literacy_customizer_options', array(
			'tech-literacy' => array(
				'priority'       => 9,
				'title'          => __('Theme Options', 'tech-literacy'),
				'description'    => __('Theme Options', 'tech-literacy'),
				'sections' => array(
					'general' => array(
						'title' => __('General', 'tech-literacy'),
						'description' => __('General settings that affects overall site', 'tech-literacy'),
						'fields' => array(
							'breadcrumb' => array(
								'type' => 'checkbox',
								'label' => __('Enable Breadcrumb', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'breadcrumb_char' => array(
								'type' => 'select',
								'label' => __('Select Breadcrumb Character', 'tech-literacy'),
								'choices' => array(
									'1' => '&raquo;',
									'2' => '&#47;',
									'3' => '&gt;'
								),
								'sanitize_callback' => 'tech_literacy_breadcrumb_char_choices',
								'default' => '1',
							),
							 'numeric_pagination' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Numeric Page Navigation', 'tech-literacy'),
                                'description' => __('Check to display numeric page navigation, instead of Previous Posts / Next Posts links.', 'tech-literacy'),
                                'default' => 1, 
                                'sanitize_callback' => 'tech_literacy_boolean', 
                            ),
                            'sidebar_position' => array(
                                'type' => 'radio',
                                'label' => __('Website Layout Options', 'tech-literacy'),
                                'description' => __('Select main content and sidebar alignment.', 'tech-literacy'),
                                'choices' => array(
                                    'left' => __('Sidebar Left', 'tech-literacy'),
                                    'right' => __('Sidebar Right', 'tech-literacy'),
                                    'fullwidth' => __('Full Width', 'tech-literacy'),
                                    'no-sidebar' => __('No Sidebar', 'tech-literacy'),
                                ),
                                'default' => 'right',  
                                'sanitize_callback' => 'sanitize_text_field', 
                            ),
						),
					),
					'header' => array(
						'title' => __('Header', 'tech-literacy'),
						'description' => __('Header options', 'tech-literacy'),
						'fields' => array(
							'logo_title' => array(
								'type' => 'checkbox',
								'label' => __('Logo as Title', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'tagline' => array(
								'type' => 'checkbox',
								'label' => __('Show site Tagline', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
						),
					),
					'footer' => array(
						'title' => __('Footer', 'tech-literacy'),
						'description' => __('Footer related options', 'tech-literacy'),
						'fields' => array(
							'footer_widgets' => array(
								'type' => 'checkbox',
								'label' => __('Footer Widget Area', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'scroll_to_top' => array(
								'type' => 'checkbox',
								'label' => __('Enable Scroll To Top', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'copyright' => array(
                                'type' => 'textarea',
                                'label' => __('Footer Copyright Text (Validated that it\'s HTML Allowed)', 'tech-literacy'),
                                'sanitize_callback' => 'tech_literacy_footer_copyright',
							),
						),
					),
					'search-section' => array (
						'title' => __('Search Section','tech-literacy'),
						'description' => __('Search Section Related options','tech-literacy'),
						'fields' => array(
							'search_field_status' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Home Page Search Section', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'search_heading' => array(
								'type' => 'text',
								'label' => __('Search Heading', 'tech-literacy'),
								'sanitize_callback' => 'tech_literacy_footer_copyright',
								'default' => __('How We Can Help You Today?', 'tech-literacy'),
							),
							'search_placeholder' => array(
								'type' => 'text',
								'label' => __('Search Placeholder Text', 'tech-literacy'),
								'sanitize_callback' => 'tech_literacy_footer_copyright',
								'default' => __('Have a question? Search here', 'tech-literacy'),
							),
							'search_field_status_pages' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Other Pages Search Section', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'search_box_background_color' => array(   
								'type' => 'color',
								'label' => __('Search Section Background Color', 'tech-literacy'),
								'default' => '#27323d',
								'sanitize_callback' => 'sanitize_hex_color',
							),
							'search_field_background_image' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Search Section Background Image', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'search_box_background_image' => array(   
								'type' => 'image',
								'label' => __('Search Section Background Image', 'tech-literacy'),
							),
							'search_section_bg_size' => array (
								'type' => 'select',
								'label'    => __( 'Search Section Background Size', 'tech-literacy' ),
								'choices' => array(
							        'cover'   => 'Cover', 
							        'contain' => 'Contain', 
							        'auto'    => 'Auto', 
							        'inherit' => 'Inherit', 
							    ),
							    'default' => 'cover',
							),
							'search_section_bg_repeat' => array (
								'type' => 'select',
								'label'    => __( 'Search Section Background Repeat', 'tech-literacy' ),
								'choices' => array(
							        'no-repeat' => 'No Repeat',
							        'repeat' => 'Repeat',
							        'repeat-x' => 'Repeat Horizontally',
							        'repeat-y' => 'Repeat Vertically', 
							    ),
							    'default' => 'repeat',
							),
							'search_section_bg_position' => array (
								'type' => 'select',
								'label'    => __( 'Search Section Background position', 'tech-literacy' ),
								'choices' => array(
							        'center top' => 'Center Top',
       								'center center' => 'Center Center',
							        'center bottom' => 'Center Bottom',
							        'left top' => 'Left Top',
							        'left center' => 'Left Center',
							        'left bottom' => 'Left Bottom',
							        'right top' => 'Right Top',
							        'right center' => 'Right Center',
							        'right bottom' => 'Right Bottom',	
							    ),
							    'default' => 'center center',
							),
							'search_section_bg_attachment' => array (
								'type' => 'select',
								'label'    => __( 'Search Section Background attachment', 'tech-literacy' ),
								'choices' => array(
							        'scroll' =>'Scroll',
        							'fixed' =>'Fixed',
							    ),
							    'default' => 'fixed',
							),
						),	
					),
					'home' => array(
						'title' => __('Home', 'tech-literacy'),
						'description' => __('Home Page options', 'tech-literacy'),
						'fields' => array(
							'service_field' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Home Page Service Section', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'service_section_icon_1' => array(
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #1', 'tech-literacy'),
								'sanitize_callback' => 'sanitize_text_field',
							),
							'service_1' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #1', 'tech-literacy'),
								'sanitize_callback' => 'absint',
							),
							'service_color_1' => array( 
								'type' => 'color',
								'label' => __('Service #1 Color', 'tech-literacy'),
								'default' => '#5daae0',
								'sanitize_callback' => 'sanitize_hex_color',
							),
							'service_section_icon_2' => array(
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #2', 'tech-literacy'),
								'sanitize_callback' => 'sanitize_text_field',
							),
							'service_2' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #2', 'tech-literacy'),
								'sanitize_callback' => 'absint',
							),
                            'service_color_2' => array( 
								'type' => 'color',
								'label' => __('Service #2 Color', 'tech-literacy'),
								'default' => '#ea4640',
								'sanitize_callback' => 'sanitize_hex_color',
							),
							'service_section_icon_3' => array( 
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #3', 'tech-literacy'),
								'sanitize_callback' => 'sanitize_text_field',
							),
							'service_3' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #3', 'tech-literacy'),
								'sanitize_callback' => 'absint',
							),
							'service_color_3' => array( 
								'type' => 'color',
								'label' => __('Service #3 Color', 'tech-literacy'),
								'default' => '#00ba71',
								'sanitize_callback' => 'sanitize_hex_color',
							),
							'enable_recent_post_service' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Home Page Recent Post Section', 'tech-literacy'),
                                'default' => 1,
                                'sanitize_callback' => 'tech_literacy_boolean',  
                            ), 
							'recent_posts_count' => array(
								'type' => 'text',
								'label' => __('No. of Recent Posts', 'tech-literacy'),
								'sanitize_callback' => 'absint',
								'default' => 3,  
							), 
							'recent_posts_exclude' => array(
								'type' => 'text',
								'label' => __('Exclude the Posts from Home Page', 'tech-literacy'),
								'description' => __('Post IDs, separated by commas.','tech-literacy'),
								'sanitize_callback' => 'sanitize_text_field', 
							), 
							'enable_home_default_content' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Home Page Default Content', 'tech-literacy'),
                                'default' => 0,  
                                'sanitize_callback' => 'tech_literacy_boolean',
                            ),
						),
					),
					'blog' => array(
						'title' => __('Blog', 'tech-literacy'),
						'description' => __('Blog Related Posts options', 'tech-literacy'),
						'fields' => array(
							'featured_image' => array(  
								'type' => 'checkbox',
								'label' => __('Enable Featured Image', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
                           'featured_image_size' => array(
                                'type' => 'radio',
                                'label' => __('Choose the featured image display type for Blog Page ', 'tech-literacy'),
                                'choices' => array(
                                    '1' => __('Large Featured Image', 'tech-literacy'),
                                    '2' => __('Small Featured Image', 'tech-literacy'),        
                                ),
                                'default' => '1', 
                                'sanitize_callback' => 'absint',
                            ),
						),
					),
					'single_blog' => array(
						'title' => __('Single Blog', 'tech-literacy'),
						'description' => __('Single Blog page Related Posts options', 'tech-literacy'),
						'fields' => array(
							'single_featured_image' => array(
								'type' => 'checkbox',
								'label' => __('Enable Single Post Featured Image', 'tech-literacy'),
								'default' => 1,
								'sanitize_callback' => 'tech_literacy_boolean',
							),
							'single_featured_image_size' => array(
								'type' => 'radio',
								'label' => __('Choose the featured image display type for Single Page ', 'tech-literacy'),
								'choices' => array(
									'1' => __('Large Featured Image', 'tech-literacy'),
									'2' => __('Small Featured Image', 'tech-literacy'),       
								),
								'default' => '1', 
								'sanitize_callback' => 'absint',  
							),
							'social_sharing_box' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Social Sharing Box below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'facebook_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Facebook Sharing option below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'twitter_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Twitter Sharing option below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'linkedin_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Linkedin Sharing option below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'google-plus_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Google Plus Sharing option below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'email_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Email Sharing option below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'author_bio_box' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Author Bio Box below single post', 'tech-literacy'),
								'default' => 0,
								'sanitize_callback' => 'tech_literacy_boolean',    
							),
							'related_posts' => array(
								'type' => 'checkbox',
								'label' => __('Show Related posts', 'tech-literacy'),
								'default' => 0, 
								'sanitize_callback' => 'tech_literacy_boolean', 
							),
							'related_posts_hierarchy' => array(
								'type' => 'radio',
								'label' => __('Related Posts Must Be Shown As:', 'tech-literacy'),
								'choices' => array(
									'1' => __('Related Posts By Tags', 'tech-literacy'),
									'2' => __('Related Posts By Categories', 'tech-literacy'),      
								),
								'default' => '1', 
								'sanitize_callback' => 'absint',    
							),
						),
					),
				)
			),
		) 
	)
);

function tech_literacy_boolean($value) {
	if(is_bool($value)) {
		return $value;
	} else {
		return false;
	}
}

function tech_literacy_breadcrumb_char_choices($value='') {
	$choices = array('1','2','3');

	if( in_array($value, $choices)) {
		return $value;
	} else {
		return '1';
	}
}

if ( ! function_exists( 'tech_literacy_footer_copyright' ) ) {

    function tech_literacy_footer_copyright($string) {
        $allowed_tags = array(    
			'a' => array(
				'href' => array(),
				'title' => array(),
				'target' => array(),
			),
			'img' => array(
				'src' => array(),  
				'alt' => array(),
			),
			'p' => array(),
			'br' => array(),
			'em' => array(),
			'strong' => array(),
        );
        return wp_kses( $string,$allowed_tags);

    }
}

