Your IP : 216.73.216.0


Current Path : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/
Upload File :
Current File : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/ContactForm.php

<?php

namespace Layerdrops\Zeinet\Widgets;


class ContactForm extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'zeinet-contact-form';
    }

    public function get_title()
    {
        return __('Contact Form', 'zeinet-addon');
    }

    public function get_icon()
    {
        return 'eicon-cogs';
    }

    public function get_categories()
    {
        return ['zeinet-category'];
    }

    protected function register_controls()
    {

        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'zeinet-addon'),
                ]
            ]
        );

        $this->end_controls_section();


        $this->start_controls_section(
            'content_section',
            [
                'label' => __('Content', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'sec_title',
            [
                'label' => __('Section Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'zeinet-addon'),
                'default' => __('Contact for Services', 'zeinet-addon')
            ]
        );

        $this->add_control(
            'sec_sub_title',
            [
                'label' => __('Sub Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Sub Title', 'zeinet-addon'),
                'default' => __('Get a Free Estimate ', 'zeinet-addon')
            ]
        );

        $this->add_control(
            'summary',
            [
                'label' => __('Summary', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add summary', 'zeinet-addon'),
                'default' => __('Default Text ', 'zeinet-addon')
            ]
        );


        $layout_one_item = new \Elementor\Repeater();

        $layout_one_item->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' =>  __('Have any question?', 'zeinet_allowed_tags')
            ]
        );

        $layout_one_item->add_control(
            'content',
            [
                'label' => __('Content Info', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' =>  wp_kses(__('<a href="tel:8898006802">Free +88 (9800) 6802</a>'), 'zeinet_allowed_tags')
            ]
        );


        $layout_one_item->add_control(
            'icon',
            [
                'label' => __('Icon', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-phone-call',
                    'library' => 'custom-icon',
                ],
            ]
        );

        $this->add_control(
            'contact_info_items',
            [
                'label' => __('Contact Info Items', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_one_item->get_controls(),
                'prevent_empty' => false,
            ]
        );

        $this->add_control(
            'contact_title',
            [
                'label' => __('Contact Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Add Contact Title', 'zeinet-addon'),
                'default' => __('Default Title ', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $this->add_control(
            'contact_sub_title',
            [
                'label' => __('Contact Sub Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Add Contact Title', 'zeinet-addon'),
                'default' => __('Default Sub Title ', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $this->add_control(
            'select_wpcf7_form',
            [
                'label'       => esc_html__('Select your contact form 7', 'zeinet-addon'),
                'label_block' => true,
                'type'        => \Elementor\Controls_Manager::SELECT,
                'options'     => zeinet_post_query('wpcf7_contact_form'),
            ]
        );

        $this->add_control(
            'contact_form_shape',
            [
                'label' => __('Shape', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->end_controls_section();

        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Style Options', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one']);
        zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one']);
        zeinet_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .contact-page__text', ['layout_one']);

        zeinet_typo_and_color_options($this, 'Contact Info Title', '{{WRAPPER}} .content p', ['layout_one']);
        zeinet_typo_and_color_options($this, 'Contact Info Content', '{{WRAPPER}} .contact-page__contact-list li .content h4', ['layout_one']);

        $this->end_controls_section();
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include zeinet_get_template('contact-form-one.php');
    }
}