<?php
/*
 * Theme Options
 * @package Meditest
 * @since 1.0.0
 * */

if (!defined('ABSPATH')) {
    exit(); // exit if access directly
}


if (class_exists('CSF')) {

    //
    // Set a unique slug-like ID
    $prefix = 'meditest';

    //
    // Create options
    CSF::createOptions($prefix . '_theme_options', array(
        'framework_title' => esc_html__('Meditest Theme Options', 'meditest'),
        'menu_title' => esc_html__('Meditest Option', 'meditest'),
        'menu_slug' => 'meditest-theme-option',
        'menu_type' => 'menu',
        'enqueue_webfont' => true,
        'menu_parent' => 'meditest-admin-menu',
        'menu_capability' => 'manage_options',
        'menu_icon' => 'dashicons-welcome-widgets-menus',
        'menu_position' => null,
        'menu_hidden' => false,
        'menu_position' => '3',
        'show_bar_menu' => true,
        // menu extras
        'show_bar_menu' => true,
        'show_sub_menu' => true,
        'show_in_network' => true,
        'show_in_customizer' => false,

        'show_search' => true,
        'show_reset_all' => true,
        'show_reset_section' => true,
        'show_footer' => true,
        'show_all_options' => true,
        'show_form_warning' => true,
        'sticky_header' => true,
        'save_defaults' => true,
        'ajax_save' => true,

        // admin bar menu settings
        'admin_bar_menu_icon' => 'dashicons-list-view',
        'admin_bar_menu_priority' => 80,

        // footer
        'footer_text' => '',
        'footer_after' => '',
        'footer_credit' => 'Exclusive Options by Itindeed',

        // database model
        'database' => '', // options, transient, theme_mod, network
        'transient_time' => 0,

        // contextual help
        'contextual_help' => array(),
        'contextual_help_sidebar' => '',

        // typography options
        'enqueue_webfont' => true,
        'async_webfont' => false,

        // others
        'output_css' => true,

        // theme and wrapper classname
        'theme' => 'dark',
        'class' => '',

        // external default values
        'defaults' => array(),

    ));

    //
    // Create a section
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('General', 'meditest'),
        'icon' => 'fa fa-wrench',
        'fields' => array(

            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Site Logo', 'meditest') . '</h3>',
            ),

            array(
                'id' => 'theme_logo',
                'title' => esc_html__('Main Logo', 'meditest'),
                'type' => 'media',
                'library' => 'image',
                'desc' => esc_html__('Upload Your Static Logo Image on Header Static', 'meditest')
            ),


            array(
                'id' => 'logo_width',
                'type' => 'slider',
                'title' => esc_html__('Set Logo Width', 'meditest'),
                'min' => 0,
                'max' => 300,
                'step' => 1,
                'unit' => 'px',
                'default' => 142,
                'desc' => esc_html__('Set Logo Width in px. Default Width 142px.', 'meditest'),
                'output' => '.logo.theme-logo img',
                'output_mode' => 'width',
            ),


            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Preloader', 'meditest') . '</h3>'
            ),


            array(
                'id' => 'preloader_enable',
                'title' => esc_html__('Enable Preloader', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable or Disable Preloader', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'preloader_letter',
                'type' => 'repeater',
                'title' => esc_html__('Set Preloader Letters', 'meditest'),
                'dependency' => array('preloader_enable', '==', 'true'),
                'fields' => array(

                    array(
                        'id' => 'ptext',
                        'type' => 'text',
                        'title' => esc_html__('Insert Preloader Letter', 'meditest'),
                        'default' => esc_html__('F', 'meditest'),
                    ),

                ),
            ),

            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Back Top Options', 'meditest') . '</h3>'
            ),


            array(
                'id' => 'back_top_enable',
                'title' => esc_html__('Scroll Top Button', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable or Disable scroll button', 'meditest'),
                'default' => true,
            ),

        )
    ));

    /*-------------------------------------------------------
       ** Entire Site Header  Options
     --------------------------------------------------------*/

    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Header', 'meditest'),
        'id' => 'header_options',
        'icon' => 'fa fa-header',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Header Layout', 'meditest') . '</h3>'
            ),

            // nav select
            array(
                'id' => 'nav_menu',
                'type' => 'image_select',
                'title' => esc_html__('Select Header Navigation Style', 'meditest'),
                'options' => array(
                    'nav-style-one' => MEDITEST_IMG . '/admin/header-style/style1.png',
                    'nav-style-two' => MEDITEST_IMG . '/admin/header-style/style2.png',
                    'nav-style-three' => MEDITEST_IMG . '/admin/header-style/style3.png',
                ),

                'default' => 'nav-style-one'
            ),
            array(
                'id'      => 'btn-color',
                'type'    => 'background',
                'title'   => 'Header Button Color',
                'output' => '.search-form-main form button.hsearch-button, .header-shop-signin-button a, .mini-cart-icon-wrap .mini-cart-count ',
            ),
            array(
                'id'      => 'btn-hover-color',
                'type'    => 'background',
                'title'   => 'Header Button Hover Color',
                'output' => '.search-form-main form button.hsearch-button:hover, .header-shop-signin-button a:hover, .mini-cart-icon-wrap .mini-cart-count:hover ',
            ),
            array(
                'id' => 'theme_header_sticky',
                'title' => esc_html__('Sticky Header', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable Sticky Header', 'meditest'),
                'default' => true,
            ),


            array(
                'id' => 'search_bar_enable',
                'title' => esc_html__('Search Bar Display In Header', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable or Disable Search Bar', 'meditest'),
                'default' => true,
            ),


            array(
                'id' => 'header_button_enable',
                'title' => esc_html__('Display Header Menubar Button', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable or Disable Navbar Button', 'meditest'),
                'default' => false,
            ),


            array(
                'id' => 'header_button_ele',
                'type' => 'fieldset',
                'title' => esc_html__('Contact / Action Button', 'meditest'),
                'subtitle' => esc_html__('This Button Display for Header Style One', 'meditest'),
                'dependency' => array('header_button_enable', '==', 'true'),
                'fields' => array(
                    array(
                        'id' => 'btntexts',
                        'type' => 'text',
                        'title' => esc_html__('Button Text', 'meditest'),
                    ),
                    array(
                        'id' => 'btnlink',
                        'type' => 'text',
                        'title' => esc_html__('Button Link', 'meditest'),
                    ),

                ),
            ),

            array(
                'id' => 'header_button_shop_signin',
                'type' => 'fieldset',
                'title' => esc_html__('Shop Sign In Button', 'meditest'),
                'subtitle' => esc_html__('This Button Display for Header Style Two', 'meditest'),
                'dependency' => array('header_button_enable', '==', 'true'),
                'fields' => array(
                    array(
                        'id' => 'signinbtntexts',
                        'type' => 'text',
                        'title' => esc_html__('Button Text', 'meditest'),
                    ),
                    array(
                        'id' => 'signinbtnlink',
                        'type' => 'text',
                        'title' => esc_html__('Button Link', 'meditest'),
                    ),

                ),
            ),

            array(
                'id' => 'header_button_appointment',
                'type' => 'fieldset',
                'title' => esc_html__('Appointment Button', 'meditest'),
                'subtitle' => esc_html__('This Button Display for Header Style Three', 'meditest'),
                'dependency' => array('header_button_enable', '==', 'true'),
                'fields' => array(
                    array(
                        'id' => 'appointbtntexts',
                        'type' => 'text',
                        'title' => esc_html__('Button Text', 'meditest'),
                    ),
                    array(
                        'id' => 'appointbtnlink',
                        'type' => 'text',
                        'title' => esc_html__('Button Link', 'meditest'),
                    ),

                ),
            ),

        )
    ));


    /*-------------------------------------
       ** Typography Options
       -------------------------------------*/
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Typography', 'meditest'),
        'id' => 'typography_options',
        'icon' => 'fa fa-font',
        'fields' => array(

            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Body Font', 'meditest') . '</h3>'
            ),

            array(
                'id' => 'body-typography',
                'type' => 'typography',
                'output' => 'body',
                'default' => array(
                    'color' => '#5F5F5F',
                    'font-family' => 'Inter',
                    'font-weight' => '400',
                    'font-size' => '16',
                    'line-height' => '24',
                    'letter-spacing' => false,
                    'subset' => 'latin-ext',
                    'type' => 'google',
                    'unit' => 'px',
                ),

            ),

            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Heading Font', 'meditest') . '</h3>'
            ),

            array(
                'id' => 'heading-typo',
                'type' => 'typography',

                'output' => 'h1,h2,h3,h4,h5,h6',
                'default' => array(
                    'color' => '#000000',
                    'font-family' => 'Inter',
                    'font-weight' => '600',
                    'subset' => 'latin-ext',
                    'type' => 'google',
                ),
                'extra-styles' => array(
                    '300',
                    '400',
                    '700',
                    '900'
                ),
            ),


        )
    ));


    /*-------------------------------------------------------
       ** Pages and Template
     --------------------------------------------------------*/

    // blog optoins
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Blog', 'meditest'),
        'id' => 'blog_page',
        'icon' => 'fa fa-bookmark',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Blog Options', 'meditest') . '</h3>'
            ),

            array(
                'id' => 'blog_title',
                'type' => 'text',
                'title' => esc_html__('Blog Page Title', 'meditest'),
                'default' => esc_html__('Blog Page', 'meditest'),
                'desc' => esc_html__('Type Blog Page Title', 'meditest'),
            ),

            array(
                'id' => 'page-spacing-blog',
                'type' => 'spacing',
                'title' => esc_html__('Blog Page Spacing', 'meditest'),
                'output' => '.main-container.blog-spacing',
                'output_mode' => 'padding', // or margin, relative
                'default' => array(
                    'top' => '80',
                    'right' => '0',
                    'bottom' => '80',
                    'left' => '0',
                    'unit' => 'px',
                ),
            ),

            array(
                'id' => 'blog_breadcrumb_enable',
                'title' => esc_html__('Breadcrumb', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable Breadcrumb', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'breadcrumb_background',
                'type' => 'background',
                'title' => 'Background',
                'dependency' => array('blog_breadcrumb_enable', '==', 'true'),
                'background_gradient' => true,
                'background_origin' => true,
                'background_clip' => true,
                'background_blend_mode' => true,
                'default' => array(
                    'background-gradient-direction' => 'to bottom',
                    'background-size' => 'cover',
                    'background-position' => 'center center',
                    'background-repeat' => 'no-repeat',
                ),
                'output' => '.theme-breadcrumb__Wrapper.theme-breacrumb-area',
            ),

            array(
                'id' => 'meditest_blog_layout',
                'type' => 'image_select',
                'title' => esc_html__('Select Blog Layout', 'meditest'),
                'options' => array(
                    'catt-one' => MEDITEST_IMG . '/admin/page/style1.png',
                    'catt-two' => MEDITEST_IMG . '/admin/page/style2.png',
                ),
                'default' => 'catt-one'
            ),


        )
    ));


    // category

    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Category', 'meditest'),
        'id' => 'cat_page',
        'icon' => 'fa fa-list-ul',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Theme Category Options. You can Customize Each Catgeory by Editing Individually.', 'meditest') . '</h3>'
            ),
            array(
                'id' => 'meditest_cat_layout',
                'type' => 'image_select',
                'title' => esc_html__('Select Category Layout', 'meditest'),
                'options' => array(
                    'catt-one' => MEDITEST_IMG . '/admin/page/style1.png',
                    'catt-two' => MEDITEST_IMG . '/admin/page/style2.png',
                ),
                'default' => 'catt-one'
            ),

            array(
                'id' => 'page-spacing-category',
                'type' => 'spacing',
                'title' => esc_html__('Category Page Spacing', 'meditest'),
                'output' => '.main-container.cat-page-spacing',
                'output_mode' => 'padding', // or margin, relative
                'default' => array(
                    'top' => '80',
                    'right' => '0',
                    'bottom' => '80',
                    'left' => '0',
                    'unit' => 'px',
                ),
            ),


        )
    ));


    // blog single optoins
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Single', 'meditest'),
        'id' => 'single_page',
        'icon' => 'fa fa-pencil-square-o',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Blog Single Page Option', 'meditest') . '</h3>'
            ),

            array(
                'id' => 'meditest_single_blog_layout',
                'type' => 'image_select',
                'title' => esc_html__('Select Single Blog Style', 'meditest'),
                'options' => array(
                    'single-one' => MEDITEST_IMG . '/admin/page/blog-1.png',
                    'single-two' => MEDITEST_IMG . '/admin/page/blog-2.png',
                ),
                'default' => 'single-two'
            ),

            array(
                'id' => 'page-spacing-single',
                'type' => 'spacing',
                'title' => esc_html__('Single Blog Spacing', 'meditest'),
                'output' => '.single-one-bwrap',
                'output_mode' => 'padding', // or margin, relative
                'default' => array(
                    'top' => '40',
                    'right' => '0',
                    'bottom' => '80',
                    'left' => '0',
                    'unit' => 'px',
                ),
            ),

            array(
                'id' => 'blog_prev_title',
                'type' => 'text',
                'title' => esc_html__('Previous Post Text', 'meditest'),
                'default' => esc_html__('Previous Post', 'meditest'),
                'desc' => esc_html__('Type Previous Post Link Title', 'meditest'),
            ),

            array(
                'id' => 'blog_next_title',
                'type' => 'text',
                'title' => esc_html__('Next Post Text', 'meditest'),
                'default' => esc_html__('Next Post', 'meditest'),
                'desc' => esc_html__('Type Next Post Link Title', 'meditest'),
            ),

            array(
                'id' => 'blog_single_cat',
                'title' => esc_html__('Show Catgeory', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Show Category Name', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'blog_single_author',
                'title' => esc_html__('Show Author', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Single Post Author', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'blog_nav',
                'title' => esc_html__('Show Navigation', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Post Navigation', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'blog_tags',
                'title' => esc_html__('Show Tags', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Show Post Tags', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'blog_related',
                'title' => esc_html__('Show Related Posts', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Related Posts', 'meditest'),
                'default' => true,
            ),

            array(
                'id' => 'blog_read_time',
                'title' => esc_html__('Show Post Read Time', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Post read Time', 'meditest'),
                'default' => false,
            ),


        )
    ));


    /*-------------------------------------------------------
         ** Woocommerce  Options
      --------------------------------------------------------*/

    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Shop', 'meditest'),
        'id' => 'woo_page',
        'icon' => 'fa fa-pencil-square-o',
        'fields' => array(

            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Shop Layout', 'meditest') . '</h3>'
            ),


            array(
                'id' => 'shop_layout',
                'type' => 'image_select',
                'title' => esc_html__('Shop Layout', 'meditest'),
                'options' => array(

                    'right-sidebar' => MEDITEST_IMG . '/admin/header-style/R.png',
                    'left-sidebar' => MEDITEST_IMG . '/admin/header-style/L.png',
                    'no-sidebar' => MEDITEST_IMG . '/admin/header-style/D.png',
                ),

                'default' => 'right-sidebar'
            ),


        )
    ));

// Create a sub-tab Shop Layout
    CSF::createSection($prefix . '_theme_options', array(
        'parent' => 'woo_page', // The slug id of the parent section
        'title' => 'Shop Style',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Shop Layout', 'meditest') . '</h3>'
            ),
            array(
                'id' => 'shop_layout',
                'type' => 'image_select',
                'title' => esc_html__('Shop Layout', 'meditest'),
                'options' => array(

                    'right-sidebar' => MEDITEST_IMG . '/admin/header-style/R.png',
                    'left-sidebar' => MEDITEST_IMG . '/admin/header-style/L.png',
                    'no-sidebar' => MEDITEST_IMG . '/admin/header-style/D.png',
                ),
                'default' => 'right-sidebar'
            ),
        )
    ));
    CSF::createSection($prefix . '_theme_options', array(
        'parent' => 'woo_page', // The slug id of the parent section
        'title' => 'Login/Ragistation Style',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Login/Ragistation', 'meditest') . '</h3>'
            ),
            array(
                'id' => 'shop_login_ragistation',
                'type' => 'media',
                'title' => esc_html__('Login/Ragistation Image', 'meditest'),
                'library' => 'image',
            ),
            array(
                'id' => 'shop_login_ragistation_bg',
                'type' => 'media',
                'title' => esc_html__('Login/Ragistation Bg Image', 'meditest'),
                'library' => 'image',
            ),
            array(
                'id' => 'register_page_link',
                'type' => 'select',
                'chosen' => true,
                'title' => 'Register Page For Login Page/Shortcode',
                'desc' => 'use this shortcode for login [meditest_woo_login]. Select Page for Register Link',
                'placeholder' => 'Select a page',
                'options' => 'pages',
                'query_args' => array(
                    'posts_per_page' => -1 // for get all pages (also it's same for posts).
                )
            ),
        )
    ));
    /*-------------------------------------------------------
         ** Footer  Options
    --------------------------------------------------------*/
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Footer', 'meditest'),
        'id' => 'footer_options',
        'icon' => 'fa fa-copyright',
        'fields' => array(
            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Footer Options', 'meditest') . '</h3>'
            ),


            array(
                'id' => 'select_footer_blocks',
                'type' => 'select',
                'title' => esc_html__('Select Global Footer', 'meditest'),
                'placeholder' => 'Select a Footer',
                'options' => 'posts',
                'query_args' => array(
                    'post_type' => 'meditest_footer',
                ),
                'desc' => esc_html__('Before select the custom menu need build footer from admin menu using "Meditest Fotter Builder" by Elementor', 'meditest'),
            ),


            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Footer Logo', 'meditest') . '</h3>',
            ),

            array(
                'id' => 'theme_logo_footer',
                'title' => esc_html__('Footer Logo', 'meditest'),
                'type' => 'media',
                'library' => 'image',
                'desc' => esc_html__('Upload Your Footer Logo Image', 'meditest')
            ),

            array(
                'id' => 'footer_social_enable',
                'title' => esc_html__('Do You want to Show Footer Social Icons', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('Enable or Disable Social Bar', 'meditest'),
                'default' => false,
            ),

            array(
                'id' => 'fsocial-icon',
                'type' => 'repeater',
                'title' => esc_html__('Repeater', 'meditest'),
                'dependency' => array(
                    'footer_social_enable', '==', 'true'
                ),
                'fields' => array(
                    array(
                        'id' => 'icon',
                        'type' => 'icon',
                        'title' => esc_html__('Pick Up Your Social Icon', 'meditest'),
                    ),
                    array(
                        'id' => 'link',
                        'type' => 'text',
                        'title' => esc_html__('Inter Social Url', 'meditest'),
                    ),

                ),
            ),


            array(
                'id' => 'footer_nav',
                'title' => esc_html__('Footer Right Menu', 'meditest'),
                'type' => 'switcher',
                'desc' => esc_html__('You can set Yes or No to show Footer menu', 'meditest'),
                'default' => false,
            ),


            array(
                'type' => 'subheading',
                'content' => '<h3>' . esc_html__('Footer Copyright Area Options', 'meditest') . '</h3>'
            ),

            array(
                'id' => 'copyright_text',
                'title' => esc_html__('Copyright Area Text', 'meditest'),
                'type' => 'textarea',
                'desc' => esc_html__('Footer Copyright Text', 'meditest'),
            ),


        )
    ));


    // Backup section
    CSF::createSection($prefix . '_theme_options', array(
        'title' => esc_html__('Backup', 'meditest'),
        'id' => 'backup_options',
        'icon' => 'fa fa-window-restore',
        'fields' => array(
            array(
                'type' => 'backup',
            ),
        )
    ));
}

