start_controls_section(
'content_section',
[
'label' => esc_html__( 'Content', 'metform' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'mf_recaptcha_notice_info',
[
'label' => esc_html__( 'reCAPTCHA configure: ', 'metform' ),
'type' => Controls_Manager::RAW_HTML,
'raw' => \MetForm\Utils\Util::kses( 'Turn on recaptcha from form setting.
Then you have to must configure recaptcha site and secret key from MetForm -> Settings from here.
See Documentation.', 'metform-pro' ),
'content_classes' => 'mf-input-map-api-notice',
]
);
$this->add_control(
'mf_recaptcha_class_name',
[
'label' => esc_html__( 'Add Extra Class Name : ', 'metform' ),
'type' => Controls_Manager::TEXT,
]
);
$this->end_controls_section();
$this->start_controls_section(
'style_section',
[
'label' => esc_html__( 'Label', 'metform' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'mf_input_warning_text_color',
[
'label' => esc_html__( 'Warning Text Color:', 'metform' ),
'type' => Controls_Manager::COLOR,
'global' => [
'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
],
'default' => '#f00',
'selectors' => [
'{{WRAPPER}} .mf-error-message' => 'color: {{VALUE}}'
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'mf_input_warning_text_typography',
'label' => esc_html__( 'Warning Text Typography', 'metform' ),
'global' => [
'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
],
'selector' => '{{WRAPPER}} .mf-error-message',
]
);
$this->end_controls_section();
$this->insert_pro_message();
}
protected function render($instance = []){
$settings = $this->get_settings_for_display();
extract($settings);
$render_on_editor = false;
$is_edit_mode = 'metform-form' === get_post_type() && \Elementor\Plugin::$instance->editor->is_edit_mode();
$configData = [
'message' => $errorMessage = isset($mf_input_validation_warning_message) ? !empty($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : __("reCAPTCHA is required.", 'metform') : __("reCAPTCHA is required.", 'metform'),
'required' => true,
];
$recaptcha_setting = \MetForm\Core\Admin\Base::instance()->get_settings_option();
$recaptcha_key_v2 = isset($recaptcha_setting['mf_recaptcha_site_key']) ? $recaptcha_setting['mf_recaptcha_site_key'] : '' ;
$recaptcha_key_v3 = isset($recaptcha_setting['mf_recaptcha_site_key_v3']) ? $recaptcha_setting['mf_recaptcha_site_key_v3'] : '';
$mf_recaptcha_type = ((isset($recaptcha_setting['mf_recaptcha_version']) && ($recaptcha_setting['mf_recaptcha_version'] != '')) ? $recaptcha_setting['mf_recaptcha_version'] : 'recaptcha-v2');
?>