<?php      
$fin_relief_page_builder = esc_html(__( 'Page Builder', 'finrelief' ));
$fin_relief_page_builder_details = esc_html(__('Theme supports Page Builder. You can drag and drop our widgets with page builder visual editor.', 'finrelief' ));
$fin_relief_page_layout = esc_html(__( 'Page Layout', 'finrelief' ));
$fin_relief_page_layout_details = esc_html(__('Theme offers many different page layouts so you can quickly and easily create your pages with no hassle!', 'finrelief' ));
$fin_relief_unlimited_sidebar = esc_html(__( 'Unlimited Sidebar', 'finrelief' ));
$fin_relief_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!', 'finrelief' ));
$fin_relief_custom_widget = esc_html(__( 'Custom Widget', 'finrelief' ));
$fin_relief_custom_widget_details = esc_html(__( 'We offer many custom widgets that are stylized and ready for use. Simply drag & drop into place to activate!', 'finrelief' ));
$fin_relief_portfolio = esc_html(__( 'Multi Portfolio', 'finrelief' ));
$fin_relief_portfolio_details = esc_html(__( 'Theme have a unlimited customization options in portfolio. You can use 2, 3, or 4 Columns with masonry layouts!', 'finrelief' ));
$fin_relief_typography = esc_html(__( 'Typography', 'finrelief' ));
$fin_relief_typography_details = esc_html(__('Theme loves typography, you can choose from over 500+ Google Fonts and Standard Fonts to customize your site!', 'finrelief' ));
$fin_relief_slider = esc_html(__( 'Awesome Sliders', 'finrelief' ));
$fin_relief_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.', 'finrelief' ));
$fin_relief_woocommerce = esc_html(__( 'Woo Commerce', 'finrelief' ));
$fin_relief_woocommerce_details = esc_html(__('Theme has full design/code integration for WooCommerce, your shop will look as good as the rest of your site!', 'finrelief' ));
$fin_relief_retina_ready = esc_html(__( 'Retina Ready', 'finrelief' ));
$fin_relief_retina_ready_details = esc_html(__( 'Theme is Retina Ready. So, Everything looks amazingly sharp and crisp on high resolution retina displays of all sizes!', 'finrelief' ));
$fin_relief_icons = esc_html(__( 'Icons', 'finrelief' ));
$fin_relief_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.', 'finrelief' ));
$fin_relief_support = esc_html(__( 'Excellent Support', 'finrelief' ));
$fin_relief_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!', 'finrelief' ));
$fin_relief_responsive_layout = esc_html(__( 'Responsive Layout', 'finrelief' ));
$fin_relief_responsive_layout_details = esc_html( __('Theme is fully responsive and can adapt to any screen size. Resize your browser window to view it!', 'finrelief' ));
$fin_relief_testimonials = esc_html( __( 'Testimonials', 'finrelief' ));
$fin_relief_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. ', 'finrelief' ));
$fin_relief_social_media = esc_html( __( 'Social Media', 'finrelief' ));
$fin_relief_social_media_details = esc_html( __( 'Want your users to stay in touch? No problem, Theme has Social Media icons all throughout the theme!', 'finrelief' ));
$fin_relief_google_map = esc_html( __( 'Google Map', 'finrelief' ));
$fin_relief_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.', 'finrelief' ));
$fin_relief_customization = esc_html( __( 'Customization', 'finrelief' ));
$fin_relief_customization_details = esc_html( __('With advanced theme options, page options & extensive docs, its never been easier to customize a theme!', 'finrelief' ));
$fin_relief_demo_content = esc_html( __( 'Demo content', 'finrelief' ));
$fin_relief_demo_content_details = esc_html( __('Theme includes single click demo content. You can quickly setup the site like our demo and get started easily!', 'finrelief' ));
$fin_relief_improvement = esc_html( __( 'Improvement', 'finrelief' ));
$fin_relief_improvement_details = esc_html( __('We love our theme and customers. We are committed to improve and add new features to Theme!', 'finrelief' ));

$fin_relief_view_demo = esc_html( __( 'View Demo', 'finrelief'));
$fin_relief_upgrade_to_pro = esc_html( __( 'Upgrade To Pro', 'finrelief' ));


$fin_relief_why_upgrade = <<< FEATURES

<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-cog"></i></div>
	<h3>$fin_relief_page_builder</h3>
	<p>$fin_relief_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>$fin_relief_page_layout</h3>
	<p>$fin_relief_page_layout_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-th"></i></div>
	<h3>$fin_relief_unlimited_sidebar</h3>
	<p>$fin_relief_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>$fin_relief_custom_widget</h3>
	<p>$fin_relief_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>$fin_relief_portfolio</h3>
	<p>$fin_relief_portfolio_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-font"></i></div>
	<h3>$fin_relief_typography</h3>
	<p>$fin_relief_typography_details</p>
</div>
<div class="one-third column clear">
	<div class="icon-wrap"><i class="fa  fa-5x fa-slideshare"></i></div>
	<h3>$fin_relief_slider</h3>
	<p>$fin_relief_slider_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-shopping-cart"></i></div>
	<h3>$fin_relief_woocommerce</h3>
	<p>$fin_relief_woocommerce_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-magic"></i></div>
	<h3>$fin_relief_retina_ready</h3>
	<p>$fin_relief_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>$fin_relief_icons</h3>
	<p>$fin_relief_icons_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-magic"></i></div>
	<h3>$fin_relief_support</h3>
	<p>$fin_relief_support_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-desktop"></i></div>
	<h3>$fin_relief_responsive_layout</h3>
	<p>$fin_relief_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>$fin_relief_testimonials</h3>
	<p>$fin_relief_testimonials_details</p>
</div>
<div class="one-third column"> 
	<div class="icon-wrap"><i class="fa  fa-5x fa-skype"></i></div>
	<h3>$fin_relief_social_media</h3>
	<p>$fin_relief_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>$fin_relief_google_map</h3>
	<p>$fin_relief_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>$fin_relief_customization</h3>
	<p>$fin_relief_customization_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-check"></i></div>
	<h3>$fin_relief_demo_content</h3>
	<p>$fin_relief_demo_content_details</p>
</div>
<div class="one-third column">
	<div class="icon-wrap"><i class="fa  fa-5x fa-signal"></i></div>
	<h3>$fin_relief_improvement</h3>
	<p>$fin_relief_improvement_details</p>
</div>
FEATURES;

function fin_relief_theme_page() { 
	$title = esc_html(__('FinRelief Theme','finrelief'));  
	add_theme_page( 
		esc_html(__( 'Upgrade To FinRelief Pro','finrelief')),
		$title.'<i class="fa fa-plane theme-icon"></i>', 
		'edit_theme_options',
		'fin_relief_upgrade',
		'fin_relief_display_upgrade'
	);
}

add_action('admin_menu','fin_relief_theme_page');


function fin_relief_display_upgrade() {
  $theme_data = wp_get_theme('finrelief'); 
    
    // 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/finrelief-pro/';
    $doc_url  = 'https://www.webulousthemes.com/finrelief-free';
    $support_url = 'https://www.webulousthemes.com/free-support-request/';   
    
    $current_action_link =  admin_url( 'themes.php?page=fin_relief_upgrade&tab=pro_features' ); ?>
    <div class="finrelief-wrapper about-wrap">
        <h1><?php printf( esc_html__('Welcome to %1$s - Version %2$s', 'finrelief'), $theme_data->Name ,$theme_data->Version ); ?></h1><?php
       	printf( __('<div class="about-text"> FinRelief is an elegant WordPress Theme for Charity and Nonprofit organizations. To Promote the events, to Showcase all kinds of documents and much more. The theme is very versatile and can also be easily used by various types of corporations, business and any kind of sites. core feature of WordPress  Has 4 Footer Widget Areas and lot more of customizer options.</div>', 'finrelief') ); ?>
        <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', 'finrelief'), $theme_data->Name ); ?></a></p>

	   <h2 class="nav-tab-wrapper">
	        <a href="?page=fin_relief_upgrade" class="nav-tab<?php echo is_null($tab) ? ' nav-tab-active' : null; ?>"><?php echo $theme_data->Name; ?></a>
			<a href="?page=fin_relief_upgrade&tab=pro_features" class="nav-tab<?php echo $tab == 'pro_features' ? ' nav-tab-active' : null; ?>"><?php esc_html_e( 'PRO Features', 'finrelief' );  ?></a>
            <a href="?page=fin_relief_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', 'finrelief' ); ?></a>
	        <?php do_action( 'fin_relief_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?','finrelief'),__('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.','finrelief') ); ?>
							</div>
							<div class="image-wrap">
								<?php echo sprintf ( '<img src="'. get_template_directory_uri() .'/images/api.png" alt="%1$s" />',__('Image','finrelief') ); ?>
							</div>
						</a>
                    </div>
                    <div class="theme_info_left">
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Theme Customizer', 'finrelief' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('%s supports the Theme Customizer for all theme settings. Click "Customize" to start customize your site.', 'finrelief'), $theme_data->Name); ?></p>
                            <p>
                                <a href="<?php echo admin_url('customize.php'); ?>" class="button button-primary"><?php esc_html_e('Start Customize', 'finrelief'); ?></a>
                            </p>
                        </div>
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Theme Documentation', 'finrelief' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('Need any help to setup and configure %s? Please have a look at our documentations instructions.', 'finrelief'), $theme_data->Name); ?></p>
                            <p>
                                <a href="<?php echo esc_url($doc_url); ?>" target="_blank" class="button button-secondary"><?php esc_html_e(' Documentation', 'finrelief'); ?></a>
                            </p>
                            <?php do_action( 'fin_relief_dashboard_theme_links' ); ?>
                        </div>  
                        <div class="theme_link">
                            <h3><?php esc_html_e( 'Having Trouble, Need Support?', 'finrelief' ); ?></h3>
                            <p class="about"><?php printf(esc_html__('Support for %s WordPress theme is conducted through Webulous free support ticket system.', 'finrelief'), $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', 'finrelief'), $theme_data->Name); ?></a>
                            </p>
                        </div> 
                       
                    </div>  

                    <div class="theme_info_right">
                        <?php echo sprintf ( '<img src="'. get_template_directory_uri() .'/screenshot.png" alt="%1$s" />',__('Theme screenshot','finrelief') ); ?>
                    </div>
                </div>
            </div>
        <?php } ?>

        <?php if ( $tab == 'pro_features' ) { ?>
            <div class="pro-features-tab info-tab-content"><?php
			    global $fin_relief_why_upgrade; ?>
				<div class="wrap clearfix">
				    <?php echo $fin_relief_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 esc_html($theme_data->Name); ?> Lite</th>
			                    <th><?php echo esc_html($theme_data->Name); ?> PRO</th>
			                </tr>
		                </thead>
		                <tbody>
		                    <tr>
		                        <td><h3><?php _e('Flex Slider', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief'); ?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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', 'finrelief');?></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 - $39', 'finrelief'), $theme_data->Name ); ?></a></td>
		                    </tr>
		                </tbody>
	                </table>			    
				</div>
			</div><?php 
		} ?>

    </div><?php
}
   

	$options = array(
		'capability' => 10,
		'type' => 'theme_mod',
		'panels' => apply_filters( 'fin_relief_customizer_options', array(
			'finrelief' => array(
				'priority'       => 9,
				'title'          => __('Theme Options', 'finrelief'),
				'description'    => __('Theme Options', 'finrelief'),
				'sections' => array(
					'general' => array(
						'title' => __('General', 'finrelief'),
						'description' => __('General settings that affects overall site', 'finrelief'),
						'fields' => array(
							'breadcrumb' => array(
								'type' => 'checkbox',
								'label' => __('Enable Breadcrumb', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'breadcrumb_char' => array(
								'type' => 'select',
								'label' => __('Select Breadcrumb Character', 'finrelief'),
								'choices' => array(
									'1' => '&raquo;',
									'2' => '&#47;',
									'3' => '&gt;'
								),
								'sanitize_callback' => 'fin_relief_breadcrumb_char_choices',
								'default' => '1',
							),
							 'numeric_pagination' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Numeric Page Navigation', 'finrelief'),
                                'description' => __('Check to display numeric page navigation, instead of Previous Posts / Next Posts links.', 'finrelief'),
                                'default' => 1, 
                                'sanitize_callback' => 'fin_relief_boolean', 
                            ),
                            'sidebar_position' => array(
                                'type' => 'radio',
                                'label' => __('Website Layout Options', 'finrelief'),
                                'description' => __('Select main content and sidebar alignment.', 'finrelief'),
                                'choices' => array(
                                    'left' => __('Sidebar Left', 'finrelief'),
                                    'right' => __('Sidebar Right', 'finrelief'),
                                    'fullwidth' => __('Full Width', 'finrelief'),
                                    'no-sidebar' => __('No Sidebar', 'finrelief'),
                                ),
                                'default' => 'right',  
                                'sanitize_callback' => 'sanitize_text_field', 
                            ),
						),
					),
					'header' => array(
						'title' => __('Header', 'finrelief'),
						'description' => __('Header options', 'finrelief'),
						'fields' => array(
							'logo_title' => array(
								'type' => 'checkbox',
								'label' => __('Logo as Title', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'tagline' => array(
								'type' => 'checkbox',
								'label' => __('Show site Tagline', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'header_search' => array(
                                'type' => 'checkbox',
                                'label' => __('Show Search box in Navigation', 'finrelief'),
                                'default' => 1,
                                'sanitize_callback' => 'fin_relief_boolean', 
                            ),
						),
					),
					'footer' => array(
						'title' => __('Footer', 'finrelief'),
						'description' => __('Footer related options', 'finrelief'),
						'fields' => array(
							'footer_widgets' => array(
								'type' => 'checkbox',
								'label' => __('Footer Widget Area', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'scroll_to_top' => array(
								'type' => 'checkbox',
								'label' => __('Enable Scroll To Top', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'copyright' => array(
                                'type' => 'textarea',
                                'label' => __('Footer Copyright Text (Validated that it\'s HTML Allowed)', 'finrelief'),
                                'description' => __('HTML Allowed. <b>This field is even HTML validated! </b>', 'finrelief'),
                                'sanitize_callback' => 'fin_relief_footer_copyright',
                            ),
						),
					),
					'home' => array(
						'title' => __('Home', 'finrelief'),
						'description' => __('Home Page options', 'finrelief'),
						'fields' => array(
							'slider_field' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Home Page Slider Section', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'slider_cat' => array(
								'type' => 'category',
								'label' => __('Slider Posts Category', 'finrelief'),
								'sanitize_callback' => 'absint',
							),
							'slider_count' => array(
								'type' => 'text',
								'label' => __('No. of Sliders', 'finrelief'),
								'sanitize_callback' => 'absint',
								'default' => 3,
							),
							'service_field' => array(   
								'type' => 'checkbox',
								'label' => __('Enable Home Page Service Section', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'service_section_icon_1' => array(  
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #1', 'finrelief'),
								'sanitize_callback' => 'sanitize_text_field',
							),  
							'service_1' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #1', 'finrelief'),
								'sanitize_callback' => 'absint',
							), 
							'service_section_icon_2' => array(
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #2', 'finrelief'),
								'sanitize_callback' => 'sanitize_text_field',
							),
							'service_2' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #2', 'finrelief'),
								'sanitize_callback' => 'absint',
							),
							'service_section_icon_3' => array( 
								'type' => 'icons-picker',
								'label' => __('Choose Service Section Icons #3', 'finrelief'),
								'sanitize_callback' => 'sanitize_text_field',
							),
							'service_3' => array(
								'type' => 'dropdown-pages',
								'label' => __('Service Section #3', 'finrelief'),
								'sanitize_callback' => 'absint',
							), 
							'enable_recent_post_service' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Home Page Recent Post Section', 'finrelief'),
                                'default' => 1,
                                'sanitize_callback' => 'fin_relief_boolean',  
                            ), 
							'recent_posts_count' => array(
								'type' => 'text',
								'label' => __('No. of Recent Posts', 'finrelief'),
								'sanitize_callback' => 'absint',
								'default' => 2,  
							), 
							'recent_posts_exclude' => array(
								'type' => 'text',
								'label' => __('Exclude the Posts from Home Page.', 'finrelief'),
								'description' => __('Post IDs, separated by commas.','finrelief'),
								'sanitize_callback' => 'sanitize_text_field', 
							),
							'enable_home_default_content' => array(
                                'type' => 'checkbox',
                                'label' => __('Enable Home Page Default Content', 'finrelief'),
                                'default' => 0,  
                                'sanitize_callback' => 'fin_relief_boolean',
                            ),
						),
					),
					'blog' => array(
						'title' => __('Blog', 'finrelief'),
						'description' => __('Blog Related Posts options', 'finrelief'),
						'fields' => array(
							'featured_image' => array(  
								'type' => 'checkbox',
								'label' => __('Enable Featured Image', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
                           'featured_image_size' => array(
                                'type' => 'radio',
                                'label' => __('Choose the featured image display type for Blog Page ', 'finrelief'),
                                'choices' => array(
                                    '1' => __('Large Featured Image', 'finrelief'),
                                    '2' => __('Small Featured Image', 'finrelief'),        
                                ),
                                'default' => '1', 
                                'sanitize_callback' => 'absint',
                            ),
						),
					),
					'single_blog' => array(
						'title' => __('Single Blog', 'finrelief'),
						'description' => __('Single Blog page Related Posts options', 'finrelief'),
						'fields' => array(
							'single_featured_image' => array(
								'type' => 'checkbox',
								'label' => __('Enable Single Post Featured Image', 'finrelief'),
								'default' => 1,
								'sanitize_callback' => 'fin_relief_boolean',
							),
							'single_featured_image_size' => array(
								'type' => 'radio',
								'label' => __('Choose the featured image display type for Single Page ', 'finrelief'),
								'choices' => array(
									'1' => __('Large Featured Image', 'finrelief'),
									'2' => __('Small Featured Image', 'finrelief'),       
								),
								'default' => '1', 
								'sanitize_callback' => 'absint',  
							),
							'social_sharing_box' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Social Sharing Box below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'facebook_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Facebook Sharing option below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'twitter_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Twitter Sharing option below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'linkedin_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Linkedin Sharing option below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'google-plus_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Google Plus Sharing option below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'email_sb' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Email Sharing option below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'author_bio_box' => array(
								'type' => 'checkbox',
								'label' => __(' Enable Author Bio Box below single post', 'finrelief'),
								'default' => 0,
								'sanitize_callback' => 'fin_relief_boolean',    
							),
							'related_posts' => array(
								'type' => 'checkbox',
								'label' => __('Show Related posts', 'finrelief'),
								'default' => 0, 
								'sanitize_callback' => 'fin_relief_boolean', 
							),
							'related_posts_hierarchy' => array(
								'type' => 'radio',
								'label' => __('Related Posts Must Be Shown As:', 'finrelief'),
								'choices' => array(
									'1' => __('Related Posts By Tags', 'finrelief'),
									'2' => __('Related Posts By Categories', 'finrelief'),      
								),
								'default' => '1', 
								'sanitize_callback' => 'absint',    
							),
						),
					),

				)
			),
		) 
	)
	);

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

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

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

if ( ! function_exists( 'fin_relief_footer_copyright' ) ) {

    function fin_relief_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);

    }
}

