Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : contactform.php
<?php
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}
if (!motiox_is_contactform_activated()) {
    return;
}

use Elementor\Controls_Manager;


class Motiox_Elementor_ContactForm extends Elementor\Widget_Base {

    public function get_name() {
        return 'motiox-contactform';
    }

    public function get_title() {
        return esc_html__('Motiox Contact Form', 'motiox');
    }

    public function get_categories() {
        return array('motiox-addons');
    }

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

    protected function register_controls() {
        $this->start_controls_section(
            'contactform7',
            [
                'label' => esc_html__('General', 'motiox'),
                'tab'   => Controls_Manager::TAB_CONTENT,
            ]
        );
        $cf7               = get_posts('post_type="wpcf7_contact_form"&numberposts=-1');
        $contact_forms[''] = esc_html__('Please select form', 'motiox');
        if ($cf7) {
            foreach ($cf7 as $cform) {
                $contact_forms[$cform->ID] = $cform->post_title;
            }
        } else {
            $contact_forms[0] = esc_html__('No contact forms found', 'motiox');
        }

        $this->add_control(
            'cf_id',
            [
                'label'   => esc_html__('Select contact form', 'motiox'),
                'type'    => Controls_Manager::SELECT,
                'options' => $contact_forms,
                'default' => ''
            ]
        );

        $this->add_control(
            'form_name',
            [
                'label'   => esc_html__('Form name', 'motiox'),
                'type'    => Controls_Manager::TEXT,
                'default' => esc_html__('Contact form', 'motiox'),
            ]
        );

        $this->add_responsive_control(
            'button_align',
            [
                'label'        => esc_html__('Button Alignment', 'motiox'),
                'type'         => Controls_Manager::CHOOSE,
                'options'      => [
                    'left'   => [
                        'title' => esc_html__('Left', 'motiox'),
                        'icon'  => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'motiox'),
                        'icon'  => 'eicon-text-align-center',
                    ],
                    'right'  => [
                        'title' => esc_html__('Right', 'motiox'),
                        'icon'  => 'eicon-text-align-right',
                    ],
                ],
                'default' => '',
                'selectors' => [
                    '{{WRAPPER}} .wpcf7-form .column-12' => 'justify-content: {{VALUE}};',
                ],

            ]
        );

        $this->end_controls_section();
    }

    protected function render() {
        $settings = $this->get_settings_for_display();
        if (!$settings['cf_id']) {
            return;
        }
        $args['id']    = $settings['cf_id'];
        $args['title'] = $settings['form_name'];

        echo motiox_do_shortcode('contact-form-7', $args);
    }
}

$widgets_manager->register(new Motiox_Elementor_ContactForm());
© 2026 GrazzMean-Shell