<?php

/**
 * Elementor daltech Subscribe Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.0
 */
class Daltech_Footer_Contact extends \Elementor\Widget_Base
{

    /**
     * Get widget name.
     *
     * Retrieve Subscribe widget name.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget name.
     */
    public function get_name()
    {
        return 'daltech_footer_contact';
    }

    /**
     * Get widget title.
     *
     * Retrieve Subscribe Nav Tab widget title.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget title.
     */
    public function get_title()
    {
        return esc_html__('Footer Contact', 'daltech-core');
    }

    /**
     * Get widget icon.
     *
     * Retrieve Subscribe Nav Tab widget icon.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget icon.
     */
    public function get_icon()
    {
        return 'eicon-code';
    }

    /**
     * Get widget categories.
     *
     * Retrieve the list of categories the Subscribe Nav Tab widget belongs to.
     *
     * @since 1.0.0
     * @access public
     *
     * @return array Widget categories.
     */
    public function get_categories()
    {
        return ['daltech'];
    }

    // Add The Input For User
    protected function register_controls()
    {

        $this->start_controls_section(
            'content_style',
            [
                'label'        => esc_html__('Footer Contact Content', 'daltech-core'),
                'tab'        => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'style',
            [
                'label'     => esc_html__('Style', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::SELECT,
                'default'     => '1',
                'options'     => [
                    '1'      => esc_html__('Style One', 'daltech-core'),
                ],
            ]
        );


        $this->add_control(
            'section_title',
            [
                'label'         => esc_html__('Section Title', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('section title', 'daltech-core'),
                'default'         => esc_html__('Default Section Title', 'daltech-core'),
                'condition' => [
                    'style' => ['1']
                ]
            ]
        );

        $this->add_control(
            'location',
            [
                'label'         => esc_html__('Location', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('Location', 'daltech-core'),
                'default'         => esc_html__('Default Location', 'daltech-core'),
                'condition' => [
                    'style' => ['1']
                ]
            ]
        );

        $this->add_control(
            'section_title_two',
            [
                'label'         => esc_html__('Section Title Two', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('section title two', 'daltech-core'),
                'default'         => esc_html__('Default Section Title Two', 'daltech-core'),
                'condition' => [
                    'style' => ['1']
                ]
            ]
        );

        $this->add_control(
            'time',
            [
                'label'         => esc_html__('Time', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('Time', 'daltech-core'),
                'default'         => esc_html__('Default Time', 'daltech-core'),
                'condition' => [
                    'style' => ['1']
                ]
            ]
        );

        $this->end_controls_section();

        include DALTECH_PLUGIN_WIDGET_STYLE_PATH . 'footer-contact-style.php';
    }

    // Output For User
    protected function render()
    {
        $settings = $this->get_settings_for_display();
        if ($settings['style'] == '1') :
?>
            <!--<< Subscribe Section Start >>-->
            <div class="wow fadeInUp" data-wow-delay=".8s">
                <div class="single-footer-widget">
                    <div class="widget-head">
                        <h5><?php echo wp_kses($settings['section_title'], 'daltech_allowed_tags'); ?></h5>
                    </div>
                    <div class="footer-address-text">
                        <p>
                            <?php echo wp_kses($settings['location'], 'daltech_allowed_tags'); ?>
                        </p>
                        <h5> <?php echo wp_kses($settings['section_title_two'], 'daltech_allowed_tags'); ?></h5>
                        <?php echo wp_kses($settings['time'], 'daltech_allowed_tags'); ?>
                    </div>
                </div>
            </div>
            <!-- End  Subscribe Style One -->
<?php
        endif;
    }
}
