<?php

$this->start_controls_section(
    'logo_section',
    [
        'label' => __('Site Logo', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'light_logo',
    [
        'label' => __('Light Logo', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
    ]
);

$this->add_control(
    'logo_dimension',
    [
        'label' => __('Logo Dimension', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::IMAGE_DIMENSIONS,
        'description' => __('Set Custom Logo Size.', 'ostech-addon'),
        'default' => [
            'width' => '136',
            'height' => '45',
        ],
    ]
);


$this->end_controls_section();

$this->start_controls_section(
    'nav_section',
    [
        'label' => __('Navigation', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'nav_menu',
    [
        'label' => __('Select Nav Menu', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SELECT2,
        'options' => ostech_get_nav_menu(),
        'label_block' => true,
    ]
);

$this->add_control(
    'onepage_menu',
    [
        'label' => esc_html__('Onepage Menu', 'textdomain'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => esc_html__('Show', 'textdomain'),
        'label_off' => esc_html__('Hide', 'textdomain'),
        'return_value' => 'yes',
        'default' => 'no',
    ]
);

$this->end_controls_section();

//top bar
$this->start_controls_section(
    'topbar_section',
    [
        'label' => __('Topbar', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        'condition' => [
            'layout_type' => ['layout_two', 'layout_three']
        ]
    ]
);

$topbar_infos = new \Elementor\Repeater();

$topbar_infos->add_control(
    'topbar_icon',
    [
        'label' => __('Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fas fa-map-marker-alt',
            'library' => 'custom',
        ],
        'label_block' => true,
    ]
);

$topbar_infos->add_control(
    'topbar_info_text',
    [
        'label' => __('Topbar Right Info Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('30 Commercial Road Fratton, Australia ', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'topbar_infos',
    [
        'label' => __('Topbar Info', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $topbar_infos->get_controls(),
        'title_field' => '{{{ topbar_info_text }}}',
        'prevent_empty' => false,
    ]
);

$this->add_control(
    'topbar_call_icon',
    [
        'label' => __('Call Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'icon-telephone',
            'library' => 'custom',
        ],
        'label_block' => true,
        'condition' => [
            'layout_type!' => ['layout_three']
        ]
    ]
);

$this->add_control(
    'topbar_call_number',
    [
        'label' => __('Call Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '1',
        'default' => __('+92 3800 8060', 'ostech-addon'),
        'label_block' => true,
        'condition' => [
            'layout_type!' => ['layout_three']
        ]
    ]
);

$this->add_control(
    'header_topbar_navmenu_divider',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);


$social_icons = new \Elementor\Repeater();

$social_icons->add_control(
    'social_icon',
    [
        'label' => __('Select Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fab fa-facebook-f',
            'library' => 'brand',
        ],
        'label_block' => true,
    ]
);

$social_icons->add_control(
    'social_url',
    [
        'label' => __('Add Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => false,
    ]
);

$this->add_control(
    'social_icons',
    [
        'label' => __('Social Icons', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $social_icons->get_controls(),
        'prevent_empty' => false,
        'condition' => [
            'layout_type' => ['layout_two', 'layout_three']
        ],
        'default' => [
            [
                'social_url' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
            ],
        ],
    ]
);

$this->add_control(
    'topbar_date',
    [
        'label' => __('Date', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '1',
        'default' => __('Mon to Sat: 9:00am – 6:00pm Sun: Closed', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->end_controls_section();

//other
$this->start_controls_section(
    'others_section',
    [
        'label' => __('Others', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'search_enable',
    [
        'label' => __('Enable Search?', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Yes', 'ostech-addon'),
        'label_off' => __('No', 'ostech-addon'),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_control(
    'cart_enable',
    [
        'label' => __('Enable Cart?', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Yes', 'ostech-addon'),
        'label_off' => __('No', 'ostech-addon'),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_control(
    'header_call_icon',
    [
        'label' => __('Call Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fas fa-map-marker-alt',
            'library' => 'custom',
        ],
        'label_block' => true,
    ]
);
$this->add_control(
    'header_call_text',
    [
        'label' => __('Call Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '1',
        'default' => __('Call to Anytime', 'ostech-addon'),
        'label_block' => true,
    ]
);
$this->add_control(
    'header_call_number',
    [
        'label' => __('Call Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '1',
        'default' => __('+92 3800 8060', 'ostech-addon'),
        'label_block' => true,
    ]
);
$this->add_control(
    'button_label',
    [
        'label' => __('Button Label', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '1',
        'default' => __('Button Label', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'button_url',
    [
        'label' => __('Button Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => true,
    ]
);

$this->end_controls_section();


//other
$this->start_controls_section(
    'sidebar_section',
    [
        'label' => __('Sidebar Section', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        'condition' => [
            'layout_type' => ['layout_five']
        ]
    ]
);

$this->add_control(
    'sidebar_enable',
    [
        'label' => __('Enable Sidebar?', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Yes', 'ostech-addon'),
        'label_off' => __('No', 'ostech-addon'),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_control(
    'sidebar_logo',
    [
        'label' => __('Light Logo', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
    ]
);

$this->add_control(
    'sidebar_logo_dimension',
    [
        'label' => __('Logo Dimension', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::IMAGE_DIMENSIONS,
        'description' => __('Set Custom Logo Size.', 'ostech-addon'),
        'default' => [
            'width' => '181',
            'height' => '54',
        ],
    ]
);

$this->add_control(
    'sidebar_summary',
    [
        'label' => __('Sidebar Summary', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('Default Summary', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'sidebar_info_heading',
    [
        'label' => __('Info Heading', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('Default info heading', 'ostech-addon'),
        'label_block' => true,
    ]
);

$sidebar_infos = new \Elementor\Repeater();

$sidebar_infos->add_control(
    'sidebar_icon',
    [
        'label' => __('Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fas fa-map-marker-alt',
            'library' => 'custom',
        ],
        'label_block' => true,
    ]
);

$sidebar_infos->add_control(
    'sidebar_info_text',
    [
        'label' => __('Sidebar Right Info Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('30 Commercial Road Fratton, Australia ', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'sidebar_infos',
    [
        'label' => __('Sidebar Info', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $sidebar_infos->get_controls(),
        'title_field' => '{{{ sidebar_info_text }}}',
        'prevent_empty' => false,
    ]
);

$this->add_control(
    'sidebar_navmenu_divider',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);


$sidebar_social_icons = new \Elementor\Repeater();

$sidebar_social_icons->add_control(
    'social_icon',
    [
        'label' => __('Select Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fab fa-facebook-f',
            'library' => 'brand',
        ],
        'label_block' => true,
    ]
);

$sidebar_social_icons->add_control(
    'social_url',
    [
        'label' => __('Add Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => false,
    ]
);

$this->add_control(
    'sidebar_social_icons',
    [
        'label' => __('Social Icons', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $social_icons->get_controls(),
        'prevent_empty' => false,
        'default' => [
            [
                'social_url' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
            ],
        ],
    ]
);


$this->add_control(
    'sidebar_subscribe_heading',
    [
        'label' => __('Subscribe Heading', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Default subscribe heading', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'mailchimp_url',
    [
        'label' => __('Add Mailchimp URL', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => '#',
        'label_block' => true
    ]
);

$this->add_control(
    'mc_input_placeholder',
    [
        'label' => __('Input Placeholder Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Email address', 'ostech-addon'),
        'label_block' => true
    ]
);

$this->end_controls_section();

$this->start_controls_section(
    'mobile_menu_section',
    [
        'label' => __('Mobile Drawer', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);


$this->add_control(
    'mobile_menu_logo',
    [
        'label' => __('Mobile Drawer Logo', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
    ]
);

$this->add_control(
    'mobile_email',
    [
        'label' => __('Email', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Add Email', 'ostech-addon'),
        'label_block' => true,
    ]
);

$this->add_control(
    'mobile_phone',
    [
        'label' => __('Phone', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Phone Number', 'ostech-addon'),
        'label_block' => true,
    ]
);

$mobile_menu_social_icons = new \Elementor\Repeater();

$mobile_menu_social_icons->add_control(
    'social_icon',
    [
        'label' => __('Select Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SELECT2,
        'options' => ostech_get_fa_icons(),
        'default' => 'fa-facebook-f',
        'label_block' => true,
    ]
);

$mobile_menu_social_icons->add_control(
    'social_url',
    [
        'label' => __('Add Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => false,
    ]
);

$this->add_control(
    'mobile_menu_social_icons',
    [
        'label' => __('Social Icons', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $mobile_menu_social_icons->get_controls(),
        'prevent_empty' => false,
        'default' => [
            [
                'social_icon' => 'fa-facebook-f',
                'social_url' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
            ],
        ],
        'title_field' => '{{{ social_icon }}}',
    ]
);

$this->end_controls_section();
