D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
lendeasy.site
/
wp-content
/
plugins
/
rosano-plugin
/
elementor
/
Filename :
form.php
back
Copy
<?php namespace ROSANOPLUGIN\Element; use Elementor\Controls_Manager; use Elementor\Controls_Stack; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Repeater; use Elementor\Widget_Base; use Elementor\Utils; use Elementor\Group_Control_Text_Shadow; use \Elementor\Group_Control_Box_Shadow; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Text_Stroke; use Elementor\Plugin; /** * Elementor button widget. * Elementor widget that displays a button with the ability to control every * aspect of the button design. * * @since 1.0.0 */ class Form extends Widget_Base { /** * Get widget name. * Retrieve button widget name. * * @since 1.0.0 * @access public * @return string Widget name. */ public function get_name() { return 'rosano_form'; } /** * Get widget title. * Retrieve button widget title. * * @since 1.0.0 * @access public * @return string Widget title. */ public function get_title() { return esc_html__( 'Rosano Form', 'rosano' ); } /** * Get widget icon. * Retrieve button widget icon. * * @since 1.0.0 * @access public * @return string Widget icon. */ public function get_icon() { return 'eicon-form-horizontal'; } /** * Get widget categories. * Retrieve the list of categories the button widget belongs to. * Used to determine where to display the widget in the editor. * * @since 2.0.0 * @access public * @return array Widget categories. */ public function get_categories() { return [ 'rosano' ]; } /** * Register button widget controls. * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function register_controls() { $this->start_controls_section( 'form', [ 'label' => esc_html__( 'Form', 'rosano' ), ] ); $this->add_control( 'form_style', [ 'label' => esc_html__( 'Choose Button Style', 'rosano' ), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => '1', 'options' => array( '1' => esc_html__( 'Style One ', 'rosano'), '2' => esc_html__( 'Style Two', 'rosano' ), '3' => esc_html__( 'Style Three', 'rosano' ), ), ] ); $this->add_control( 'feature_image', [ 'label' => esc_html__( 'Form Image', 'rosano' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'form_style' => ['1', '3'], ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'town_form_title', [ 'label' => __( ' Form Title', 'rosano' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'form_style' => ['2', '3'], ], 'placeholder' => __( 'Enter your Form Title', 'rosano' ), ] ); $this->add_control( 'cf7_shortocde_v3', [ 'label' => esc_html__('Select Contact Form 7', 'rosano'), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'condition' => [ 'form_style' => ['1', '2', '3'], ], 'options' => get_contact_form_7_list(), ] ); $this->end_controls_section(); /************************************************************************ Tab Style Start *************************************************************************/ //Title Style $this->start_controls_section( 'title_style', [ 'label' => esc_html__( 'Title', 'rosano' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'form_style' => ['2', '3'], ], ] ); $this->add_responsive_control( 'title__margin', [ 'label' => esc_html__( 'Margin', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .faq-form-box .top-title h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .call-back-form .title h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'title_padding', [ 'label' => esc_html__( 'Padding', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .faq-form-box .top-title h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .call-back-form .title h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Title Color', 'rosano' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .faq-form-box .top-title h2' => 'color: {{VALUE}};', '{{WRAPPER}} .call-back-form .title h2' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __('Typography', 'rosano'), 'selector' => '{{WRAPPER}} .faq-form-box .top-title h2, .call-back-form .title h2', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'title_title_shadow', 'selector' => '{{WRAPPER}} .faq-form-box .top-title h2, .call-back-form .title h2', ] ); $this->end_controls_section(); /**Form Style**/ $this->start_controls_section( 'form_style25', [ 'label' => esc_html__('Form Style Setting', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'rosano_tabs_form' ); $this->start_controls_tab( 'rosano_tab_form_normal', [ 'label' => __( 'Normal', 'rosano' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'form_bgtype', 'label' => __( 'Background', 'rosano' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .te-contact-form input, {{WRAPPER}} .te-contact-form textarea', ] ); $this->add_responsive_control( 'form_width_size', [ 'label' => __( 'Width', 'rosano' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .te-contact-form textarea' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'form_height_size', [ 'label' => __( 'Height', 'rosano' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .te-contact-form textarea' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'form_spacing', [ 'label' => __( 'Spacing', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .te-contact-form textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'form_padding', [ 'label' => __( 'Padding', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .te-contact-form textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'frontend_available' => true, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'form_border_type', 'selector' => '{{WRAPPER}} .te-contact-form input, {{WRAPPER}} .te-contact-form textarea', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'form_border_box_shadow', 'selector' => '{{WRAPPER}} .te-contact-form input, {{WRAPPER}} .te-contact-form textarea', 'separator' => 'before', ] ); $this->add_control( 'form_border_radius', [ 'label' => esc_html__('Border Radius', 'rosano'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .te-contact-form textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'form_title_typography', 'label' => __('Text Typography', 'rosano'), 'selector' => '{{WRAPPER}} .te-contact-form input, {{WRAPPER}} .te-contact-form textarea', 'separator' => 'before', ] ); $this->add_control( 'form_title_color', [ 'label' => __('Text Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .te-contact-form input' => 'color: {{VALUE}}', '{{WRAPPER}} .te-contact-form textarea' => 'color: {{VALUE}}', ], 'separator' => 'before', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /**Button Style**/ $this->start_controls_section( 'button_style', [ 'label' => esc_html__('Button Style Setting', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'rosano_tabs_btn' ); $this->start_controls_tab( 'rosano_tab_btn_normal', [ 'label' => __( 'Normal', 'rosano' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_bgtype', 'label' => __( 'Button Background', 'rosano' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .btn-one:after, {{WRAPPER}} .theme-btn-two', ] ); $this->add_responsive_control( 'btn_width_size', [ 'label' => __( 'Width', 'rosano' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .btn-one' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .theme-btn-two' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_height_size', [ 'label' => __( 'Height', 'rosano' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .btn-one' => 'height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .theme-btn-two' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_margin', [ 'label' => __( 'Margin', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .btn-one' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .theme-btn-two' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'btn_padding', [ 'label' => __( 'Padding', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .btn-one' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .theme-btn-two' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'frontend_available' => true, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'btn_border_type', 'selector' => '{{WRAPPER}} .btn-one, {{WRAPPER}} .theme-btn-two', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'border_box_shadow', 'selector' => '{{WRAPPER}} .btn-one, {{WRAPPER}} .theme-btn-two', 'separator' => 'before', ] ); $this->add_control( 'btn_border_radius', [ 'label' => esc_html__('Border Radius', 'rosano'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .btn-one' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_title_typography', 'label' => __('Button Text Typography', 'rosano'), 'selector' => '{{WRAPPER}} .btn-one', 'separator' => 'before', ] ); $this->add_control( 'btn_title_color', [ 'label' => __('Button Text Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .btn-one' => 'color: {{VALUE}}!important', ], 'separator' => 'before', ] ); $this->add_control( 'btn_title_icon_color', [ 'label' => esc_html__( 'Icon Color', 'rosano' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .btn-one i' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'btn_title_bg_icon_color', [ 'label' => esc_html__( 'Icon Background Color', 'rosano' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .btn-one i' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'rosano_tab_btn_hover', [ 'label' => __( 'Hover', 'rosano' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_hover_bg_bgtype', 'label' => __( 'Button Hover Background', 'rosano' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .btn-one:before', ] ); $this->add_control( 'btn_title_hover_color', [ 'label' => __('Button Text Hover Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .btn-one:hover' => 'color: {{VALUE}}!important', ], 'separator' => 'before', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Render button widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); $form_style = $settings[ 'form_style' ]; ?> <?php if($form_style == '3'): ?> <!--Start Call Back Form Style1--> <section class="call-back-form-style1"> <?php if($settings['feature_image']['id']){ ?> <div class="call-back-form-style1__bg jarallax" data-jarallax data-speed="0.1" data-imgPosition="0% 0%" style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>);"> </div> <?php } ?> <div class="container"> <div class="call-back-form te-contact-form"> <?php if($settings['town_form_title']) { ?> <div class="title"> <h2><?php echo wp_kses($settings['town_form_title'], true); ?></h2> </div> <?php } ?> <div id="call-back-form" class="default-form2 te-contact-form"> <?php echo do_shortcode('[contact-form-7 id="'.esc_attr($settings['cf7_shortocde_v3']).'"]'); ?> </div> </div> </div> </section> <!--End Call Back Form Style1--> <?php elseif($form_style == '2'): ?> <!--Start Faq Form Area--> <section class="faq-form-area p-0 m-0"> <div class="container"> <div class="row"> <div class="col-xl-12"> <div class="faq-form-box"> <?php if($settings['town_form_title']) { ?> <div class="top-title"> <h2><?php echo wp_kses($settings['town_form_title'], true); ?></h2> </div> <?php }; ?> <div id="faq-form" class="default-form1 te-contact-form"> <?php echo do_shortcode('[contact-form-7 id="'.esc_attr($settings['cf7_shortocde_v3']).'"]'); ?> </div> </div> </div> </div> </div> </section> <!--End Faq Form Area--> <?php else : ?> <!--Start Main Contact Form Area--> <section id="contact" class="main-contact-form-area p-0 m-0"> <div class="container"> <div class="row"> <?php if($settings['feature_image']['id']){ ?> <div class="col-xl-4"> <div class="main-contact-form-img-box"> <img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php esc_attr_e('Awesome Image', 'rosano'); ?>"> </div> </div> <?php } ?> <div class="col-xl-8"> <div class="te-contact-form contact-form"> <div id="contact-form" class="default-form2"> <?php echo do_shortcode('[contact-form-7 id="'.esc_attr($settings['cf7_shortocde_v3']).'"]'); ?> </div> </div> </div> </div> </div> </section> <!--End Main Contact Form Area--> <?php endif; } }