%PDF- %PDF-
Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/ |
Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/ContactForm.php |
<?php namespace Layerdrops\Insur\Widgets; class ContactForm extends \Elementor\Widget_Base { public function get_name() { return 'insur-contact-form'; } public function get_title() { return __('Contact Form', 'insur-addon'); } public function get_icon() { return 'eicon-cogs'; } public function get_categories() { return ['insur-category']; } protected function register_controls() { $this->start_controls_section( 'layout_section', [ 'label' => __('Layout', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'layout_type', [ 'label' => __('Select Layout', 'insur-addon'), 'type' => \Elementor\Controls_Manager::SELECT2, 'default' => 'layout_one', 'options' => [ 'layout_one' => __('Layout One', 'insur-addon'), 'layout_two' => __('Layout Two', 'insur-addon'), 'layout_three' => __('Layout Three', 'insur-addon'), 'layout_four' => __('Layout Four', 'insur-addon'), 'layout_five' => __('Layout Five', 'insur-addon'), ] ] ); $this->end_controls_section(); $this->start_controls_section( 'content_section', [ 'label' => __('Content', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => 'layout_one' ] ] ); $this->add_control( 'layout_one_title', [ 'label' => __('Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Title', 'insur-addon'), 'default' => __('Contact for Services', 'insur-addon') ] ); $this->add_control( 'layout_one_sub_title', [ 'label' => __('Sub Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Sub Title', 'insur-addon'), 'default' => __('Get a Free Estimate ', 'insur-addon') ] ); $this->add_control( 'sub_title_left_shape', [ 'label' => __('Sub Title Left Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'sub_title_right_shape', [ 'label' => __('Sub Title Right Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $tab = new \Elementor\Repeater(); $tab->add_control( 'title', [ 'label' => __('Tab Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __('Our Values', 'insur-addon'), 'label_block' => true, ] ); $tab->add_control( 'select_wpcf7_form', [ 'label' => esc_html__('Select your contact form 7', 'insur-addon'), 'label_block' => true, 'type' => \Elementor\Controls_Manager::SELECT, 'options' => insur_post_query('wpcf7_contact_form'), ] ); $tab->add_control( 'active_status', [ 'label' => __('Is active?', 'insur-addon'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'insur-addon'), 'label_off' => __('No', 'insur-addon'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'tab', [ 'label' => __('Tab Items', 'insur-addon'), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $tab->get_controls(), 'prevent_empty' => false, 'title_field' => '{{{ title }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'layout_two_content_section', [ 'label' => __('Content', 'insur-addon'), 'layout_two_tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => 'layout_two' ] ] ); $this->add_control( 'layout_two_title', [ 'label' => __('Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Title', 'insur-addon'), 'default' => __('Contact for Services', 'insur-addon') ] ); $this->add_control( 'layout_two_sub_title', [ 'label' => __('Sub Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Sub Title', 'insur-addon'), 'default' => __('Get a Free Estimate ', 'insur-addon') ] ); $this->add_control( 'layout_two_sub_title_left_shape', [ 'label' => __('Sub Title Left Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_two_sub_title_right_shape', [ 'label' => __('Sub Title Right Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $layout_two_tab = new \Elementor\Repeater(); $layout_two_tab->add_control( 'tab_title', [ 'label' => __('Tab Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => wp_kses(__('Home <br> insurance', 'insur-addon'), 'insur_allowed_tags'), 'label_block' => true, ] ); $layout_two_tab->add_control( 'icon_image', [ 'label' => __('Tab Icon Image', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $layout_two_tab->add_control( 'select_wpcf7_form', [ 'label' => esc_html__('Select your contact form 7', 'insur-addon'), 'label_block' => true, 'type' => \Elementor\Controls_Manager::SELECT, 'options' => insur_post_query('wpcf7_contact_form'), ] ); $layout_two_tab->add_control( 'active_status', [ 'label' => __('Is active?', 'insur-addon'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'insur-addon'), 'label_off' => __('No', 'insur-addon'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'layout_two_tab', [ 'label' => __('Tab Items', 'insur-addon'), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $layout_two_tab->get_controls(), 'prevent_empty' => false, 'title_field' => '{{{ tab_title }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'image_section', [ 'label' => __('Image', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => ['layout_one', 'layout_two'] ] ] ); $this->add_control( 'image', [ 'label' => __('Image', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'image_caption', [ 'label' => __('Image Caption', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __('Aleesha Rose', 'insur-addon'), 'label_block' => true, 'condition' => [ 'layout_type' => 'layout_one' ], ] ); $this->add_control( 'bg_shape', [ 'label' => __('Background Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'top_right_shape', [ 'label' => __('Top Right Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], 'condition' => [ 'layout_type' => 'layout_two' ], ] ); $this->add_control( 'shape_two', [ 'label' => __('Shape Two', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], 'condition' => [ 'layout_type' => 'layout_two' ], ] ); $this->add_control( 'bottom_shape', [ 'label' => __('Bottom Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], 'condition' => [ 'layout_type' => 'layout_one' ], ] ); $this->end_controls_section(); $this->start_controls_section( 'layout_three_content_section', [ 'label' => __('Content', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => 'layout_three' ] ] ); $this->add_control( 'layout_three_title', [ 'label' => __('Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Title', 'insur-addon'), 'default' => __('Feel Free to Write us', 'insur-addon') ] ); $this->add_control( 'layout_three_sub_title', [ 'label' => __('Sub Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Sub Title', 'insur-addon'), 'default' => __('Contact Now ', 'insur-addon') ] ); $this->add_control( 'layout_three_sub_title_left_shape', [ 'label' => __('Sub Title Left Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_three_sub_title_right_shape', [ 'label' => __('Sub Title Right Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_three_select_wpcf7_form', [ 'label' => esc_html__('Select your contact form 7', 'insur-addon'), 'label_block' => true, 'type' => \Elementor\Controls_Manager::SELECT, 'options' => insur_post_query('wpcf7_contact_form'), ] ); $this->add_control( 'layout_three_shape_one', [ 'label' => __('Shape One', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_three_shape_two', [ 'label' => __('Shape Two', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->end_controls_section(); $this->start_controls_section( 'layout_four_content_section', [ 'label' => __('Content', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => ['layout_four', 'layout_five'] ] ] ); $this->add_control( 'layout_four_title', [ 'label' => __('Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Title', 'insur-addon'), 'default' => __('Feel free to get in touch with experts', 'insur-addon') ] ); $this->add_control( 'layout_four_sub_title', [ 'label' => __('Sub Title', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Sub Title', 'insur-addon'), 'default' => __('CONTACT US', 'insur-addon') ] ); $this->add_control( 'layout_four_sub_title_left_shape', [ 'label' => __('Sub Title Left Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_four_sub_title_right_shape', [ 'label' => __('Sub Title Right Shape', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], ] ); $this->add_control( 'layout_four_call_text', [ 'label' => __('Call Text', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __('Add Call Text', 'insur-addon'), 'default' => __('+92 (003) 68-090', 'insur-addon'), 'label_block' => true ] ); $this->add_control( 'layout_four_call_url', [ 'label' => __('Call Url', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __('Add Call Url', 'insur-addon'), 'label_block' => true, 'default' => '#' ] ); $this->add_control( 'layout_four_email_address', [ 'label' => __('Email Address', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __('Add Email Address', 'insur-addon'), 'default' => 'needhelp@company.com', 'label_block' => true ] ); $this->add_control( 'layout_four_call_icon', [ 'label' => __('Call Icon', 'insur-addon'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-phone', 'library' => 'font-awesome', ], ] ); $this->add_control( 'layout_four_bottom_text', [ 'label' => __('Bottom Text', 'insur-addon'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'placeholder' => __('Add Bottom Text', 'insur-addon'), 'default' => wp_kses(__('30 Commecial Broklyn Road <br> Fratton, Australia', 'insur-addon'), 'insur_allowed_tags'), 'label_block' => true ] ); $this->add_control( 'layout_four_select_wpcf7_form', [ 'label' => esc_html__('Select your contact form 7', 'insur-addon'), 'label_block' => true, 'type' => \Elementor\Controls_Manager::SELECT, 'options' => insur_post_query('wpcf7_contact_form'), ] ); $this->add_control( 'layout_four_shape_one', [ 'label' => __('Shape One', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], 'condition' => [ 'layout_type' => 'layout_four' ] ] ); $this->add_control( 'layout_four_shape_two', [ 'label' => __('Shape Two', 'insur-addon'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [], 'condition' => [ 'layout_type' => 'layout_four' ] ] ); $this->end_controls_section(); //General style $this->start_controls_section( 'general_style', [ 'label' => esc_html__('Style Options', 'insur-addon'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); insur_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']); insur_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-sub-title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']); insur_typo_and_color_options($this, 'Tab Active Button Title', '{{WRAPPER}} .get-insurance__tab-box .tab-buttons .tab-btn.active-btn span', ['layout_one']); insur_typo_and_color_options($this, 'Tab Active Button Background', '{{WRAPPER}} .get-insurance__tab-box .tab-buttons .tab-btn span:before', ['layout_one'], 'background-color', false); insur_typo_and_color_options($this, 'Tab Button Title', '{{WRAPPER}} .get-insurance__tab-box .tab-buttons .tab-btn span', ['layout_one']); insur_typo_and_color_options($this, 'Tab Title', '{{WRAPPER}} .get-insuracne-two__tab-text', ['layout_two']); insur_typo_and_color_options($this, 'Call Number', '{{WRAPPER}} .contact-page__call-number', ['layout_four', 'layout_five']); insur_typo_and_color_options($this, 'Email Address', '{{WRAPPER}} .contact-page__email', ['layout_four', 'layout_five']); insur_typo_and_color_options($this, 'Bottom Text', '{{WRAPPER}} .contact-page__location-text', ['layout_four', 'layout_five']); insur_typo_and_color_options($this, 'Image Caption', '{{WRAPPER}} .get-insurance__author p', ['layout_one']); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); include insur_get_template('contact-form-one.php'); include insur_get_template('contact-form-two.php'); include insur_get_template('contact-form-three.php'); include insur_get_template('contact-form-four.php'); include insur_get_template('contact-form-five.php'); } }