$name = esc_attr($control_name); $label = esc_html($control_label); if ($captcha_type == '2') { if (is_ssl()) { $protocol_to_be_used = 'https://'; } else { $protocol_to_be_used = 'http://'; } dhvc_form_add_js_declaration("\r\n\tvar dhreCatptcha_onloadCallback = function () {\r\n\t grecaptcha.render( {$name}, {\r\n\t 'sitekey': '" . dhvc_form_get_option('recaptcha_public_key') . "',\r\n\t 'theme': 'light'\r\n\t } );\r\n\t};\r\n\t"); wp_register_script('dhvc-form-recaptcha2', "{$protocol_to_be_used}www.google.com/recaptcha/api.js?onload=dhreCatptcha_onloadCallback&render=explicit&hl=en", null, '1.0.0', false); wp_enqueue_script('dhvc-form-recaptcha2'); } else { wp_enqueue_script('dhvc-form-recaptcha'); dhvc_form_add_js_declaration(' jQuery( document ).ready(function(){ Recaptcha.create("' . dhvc_form_get_option('recaptcha_public_key') . '", "' . $name . '", {theme: "' . $theme . '",lang : \'' . $language . '\',tabindex: 0}); }); '); } $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $this->settings['base'] . ' ' . $el_class, $this->settings['base'], $atts); $output .= '<div class="dhvc-form-group dhvc-form-' . $name . '-box ' . $css_class . '">' . "\n"; if (!empty($label)) { $output .= '<label for="' . $name . '">' . $label . (!empty($required) ? ' <span class="required">*</span>' : '') . '</label>' . "\n"; } if ($captcha_type == '2') { $site_key = dhvc_form_get_option('recaptcha_public_key'); $secret_key = dhvc_form_get_option('recaptcha_private_key'); if (!empty($site_key) && !empty($secret_key)) { $output .= '<div type="recaptcha" class="dhvc-form-group-recaptcha dhvc-form-recaptcha2" id="' . $name . '"></div>'; } else {
<?php $output = $css_class = ''; extract(shortcode_atts(array('control_label' => '', 'control_name' => '', 'default_value' => '', 'placeholder' => '', 'help_text' => '', 'required' => '', 'readonly' => '', 'attributes' => '', 'el_class' => ''), $atts)); $name = esc_attr($control_name); $default_value = esc_attr($default_value); global $dhvc_form; $default_value = apply_filters('dhvc_form_color_default_value', $default_value, $dhvc_form, $name); $label = esc_html($control_label); wp_enqueue_script('dhvc-form-minicolor'); wp_enqueue_style('dhvc-form-minicolor'); dhvc_form_add_js_declaration(' jQuery(document).ready( function() { jQuery("#dhvc_form_control_' . $name . '").minicolors({ theme: \'bootstrap\' }); }); '); $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $this->settings['base'] . ' ' . $el_class, $this->settings['base'], $atts); $output .= '<div class="dhvc-form-group dhvc-form-' . $name . '-box ' . $css_class . '">' . "\n"; if (!empty($label)) { $output .= '<label class="dhvc-form-label" for="dhvc_form_control_' . $name . '">' . $label . (!empty($required) ? ' <span class="required">*</span>' : '') . '</label>' . "\n"; } $output .= '<div class="dhvc-form-input">' . "\n"; $output .= '<input type="text" id="dhvc_form_control_' . $name . '" name="' . $name . '" value="' . $default_value . '" ' . (!empty($maxlength) ? ' maxlength="' . $maxlength . '"' : '') . ' class="dhvc-form-control dhvc-form-control-' . $name . ' dhvc-form-value' . (!empty($required) ? ' dhvc-form-required-entry' : '') . '" ' . (!empty($required) ? ' required aria-required="true"' : '') . ' ' . (!empty($readonly) ? ' readonly' : '') . ' placeholder="' . $placeholder . '" ' . $attributes . '>' . "\n"; $output .= '</div>'; if (!empty($help_text)) { $output .= '<span class="dhvc-form-help">' . $help_text . '</span>' . "\n"; } $output .= '</div>' . "\n";