%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/fusion-builder/shortcodes/form/
Upload File :
Create Path :
Current File : /dom645759/wp-content/plugins/fusion-builder/shortcodes/form/recaptcha.php

<?php
/**
 * Add an element to fusion-builder.
 *
 * @package fusion-builder
 * @since 3.1
 */

if ( fusion_is_element_enabled( 'fusion_form_recaptcha' ) ) {

	if ( ! class_exists( 'FusionForm_Recaptcha' ) ) {
		/**
		 * Shortcode class.
		 *
		 * @since 3.1
		 */
		class FusionForm_Recaptcha extends Fusion_Form_Component {

			/**
			 * Array of forms that use reCAPTCHA.
			 *
			 * @static
			 * @access private
			 * @since 3.11.12
			 * @var array
			 */
			private static $forms = [];

			/**
			 * Constructor.
			 *
			 * @access public
			 * @since 3.1
			 */
			public function __construct() {
				add_filter( 'fusion_attr_recaptcha-shortcode', [ $this, 'attr' ] );

				parent::__construct( 'fusion_form_recaptcha' );
			}

			/**
			 * Gets the default values.
			 *
			 * @static
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public static function get_element_defaults() {
				$fusion_settings = awb_get_fusion_settings();
				return [
					'color_theme'    => $fusion_settings->get( 'recaptcha_color_scheme' ),
					'badge_position' => $fusion_settings->get( 'recaptcha_badge_position' ),
					'tab_index'      => '',
					'class'          => '',
					'id'             => '',
				];
			}

			/**
			 * Render form field html.
			 *
			 * @access public
			 * @since 3.1
			 * @param string $content The content.
			 * @return string
			 */
			public function render_input_field( $content ) {
				self::$forms[ $this->params['form_number'] ] = isset( self::$forms[ $this->params['form_number'] ] ) ? self::$forms[ $this->params['form_number'] ] + 1 : 1;
				$counter                                     = 1 < self::$forms[ $this->params['form_number'] ] ? $this->params['form_number'] . '-' . self::$forms[ $this->params['form_number'] ] : $this->params['form_number'];

				$params = [
					'color_theme'    => $this->args['color_theme'],
					'badge_position' => $this->args['badge_position'],
					'tab_index'      => $this->args['tab_index'],
					'counter'        => $counter,
					'element'        => 'form',
					'wrapper_class'  => 'fusion-form-recaptcha-wrapper',
				];

				ob_start();
				?>
				<div <?php echo FusionBuilder::attributes( 'recaptcha-shortcode' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> >
					<?php class_exists( 'AWB_Google_Recaptcha' ) ? AWB_Google_Recaptcha::get_instance()->render_field( $params ) : ''; ?>
				</div>
				<?php
				$recaptcha_content = ob_get_clean();
				return $recaptcha_content;
			}

			/**
			 * Builds the attributes array.
			 *
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public function attr() {

				$attr = [
					'class' => 'form-creator-recaptcha',
				];

				if ( $this->args['class'] ) {
					$attr['class'] .= ' ' . $this->args['class'];
				}

				if ( $this->args['id'] ) {
					$attr['id'] = $this->args['id'];
				}

				return $attr;
			}

			/**
			 * Used to set any other variables for use on front-end editor template.
			 *
			 * @static
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public static function get_element_extras() {
				$fusion_settings = awb_get_fusion_settings();
				$extras          = [
					'recaptcha_public'         => $fusion_settings->get( 'recaptcha_public' ),
					'recaptcha_private'        => $fusion_settings->get( 'recaptcha_private' ),
					'recaptcha_version'        => $fusion_settings->get( 'recaptcha_version' ),
					'recaptcha_badge_position' => $fusion_settings->get( 'recaptcha_badge_position' ),
				];

				// The extras go to the builder, which only needs to know whether the secret key is set.
				return function_exists( 'awb_mask_private_options' ) ? awb_mask_private_options( $extras ) : $extras;
			}

			/**
			 * Maps settings to extra variables.
			 *
			 * @static
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public static function settings_to_extras() {

				return [
					'recaptcha_public'         => 'recaptcha_public',
					'recaptcha_private'        => 'recaptcha_private',
					'recaptcha_version'        => 'recaptcha_version',
					'recaptcha_badge_position' => 'recaptcha_badge_position',
				];
			}

			/**
			 * Maps settings to param variables.
			 *
			 * @static
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public static function settings_to_params() {
				return [
					'recaptcha_color_scheme'   => 'color_theme',
					'recaptcha_badge_position' => 'badge_position',
				];
			}
		}
	}

	new FusionForm_Recaptcha();
}

/**
 * Map shortcode to Fusion Builder
 *
 * @since 3.1
 */
function fusion_form_recaptcha() {
	$info = [];
	if ( ! fusion_library()->get_option( 'recaptcha_public' ) || ! fusion_library()->get_option( 'recaptcha_private' ) ) {
		if ( ( function_exists( 'fusion_is_preview_frame' ) && fusion_is_preview_frame() ) || ( function_exists( 'fusion_is_builder_frame' ) && fusion_is_builder_frame() ) ) {
			$to_link = '<span class="fusion-panel-shortcut" data-fusion-option="recaptcha_section" data-fusion-option-open-parent="true">' . esc_html__( 'reCaptcha Section', 'fusion-builder' ) . '</span>';
		} else {
			$to_link = '<a href="' . esc_url( awb_get_fusion_settings()->get_setting_link( 'recaptcha_version' ) ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'reCaptcha Section', 'fusion-builder' ) . '</a>';
		}
		
		$info = [
			'heading'     => esc_attr__( 'Set Up Needed Keys In Global Options', 'fusion-builder' ),
			'description' =>  sprintf( esc_html__( 'Please make sure to set up the needed keys in %s of Global Options.', 'fusion-builder' ), $to_link ),
			'param_name'  => 'recaptcha_important_note_info',
			'type'        => 'custom',
		];
	}

	fusion_builder_map(
		fusion_builder_frontend_data(
			'FusionForm_Recaptcha',
			[
				'name'           => esc_attr__( 'reCAPTCHA Field', 'fusion-builder' ),
				'shortcode'      => 'fusion_form_recaptcha',
				'help_url'       => 'https://classic.avada.com/documentation/recaptcha-field-element/',
				'icon'           => 'fusiona-af-recaptcha',
				'form_component' => true,
				'preview'        => FUSION_BUILDER_PLUGIN_DIR . 'inc/templates/previews/fusion-form-element-preview.php',
				'preview_id'     => 'fusion-builder-block-module-form-element-preview-template',
				'params'         => [
					$info,
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'reCAPTCHA Color Scheme', 'fusion-builder' ),
						'description' => esc_attr__( 'Choose the reCAPTCHA color scheme.', 'fusion-builder' ),
						'param_name'  => 'color_theme',
						'default'     => '',
						'value'       => [
							''      => esc_attr__( 'Default', 'fusion-builder' ),
							'light' => esc_attr__( 'Light', 'fusion-builder' ),
							'dark'  => esc_attr__( 'Dark', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'reCAPTCHA Badge Position', 'fusion-builder' ),
						'description' => esc_attr__( 'Choose where the reCAPTCHA badge should be displayed.', 'fusion-builder' ),
						'param_name'  => 'badge_position',
						'default'     => '',
						'value'       => [
							''            => esc_attr__( 'Default', 'fusion-builder' ),
							'inline'      => esc_attr__( 'Inline', 'fusion-builder' ),
							'bottomleft'  => esc_attr__( 'Bottom Left', 'fusion-builder' ),
							'bottomright' => esc_attr__( 'Bottom Right', 'fusion-builder' ),
							'hide'        => esc_attr__( 'Hide', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Tab Index', 'fusion-builder' ),
						'param_name'  => 'tab_index',
						'value'       => '',
						'description' => esc_attr__( 'Tab index for the form field.', 'fusion-builder' ),
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'CSS Class', 'fusion-builder' ),
						'param_name'  => 'class',
						'value'       => '',
						'description' => esc_attr__( 'Add a class for the form field.', 'fusion-builder' ),
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'CSS ID', 'fusion-builder' ),
						'param_name'  => 'id',
						'value'       => '',
						'description' => esc_attr__( 'Add an ID for the form field.', 'fusion-builder' ),
					],
				],
			]
		)
	);
}
add_action( 'fusion_builder_before_init', 'fusion_form_recaptcha' );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap606.xml 2026-12-01 https://louisvillegop.com/sitemap59.xml 2026-12-01 https://louisvillegop.com/sitemap306.xml 2026-12-01 https://louisvillegop.com/sitemap705.xml 2026-12-01 https://louisvillegop.com/sitemap620.xml 2026-12-01 https://louisvillegop.com/sitemap892.xml 2026-12-01 https://louisvillegop.com/sitemap316.xml 2026-12-01 https://louisvillegop.com/sitemap103.xml 2026-12-01 https://louisvillegop.com/sitemap945.xml 2026-12-01 https://louisvillegop.com/sitemap328.xml 2026-12-01 https://louisvillegop.com/sitemap88.xml 2026-12-01 https://louisvillegop.com/sitemap79.xml 2026-12-01 https://louisvillegop.com/sitemap186.xml 2026-12-01 https://louisvillegop.com/sitemap284.xml 2026-12-01 https://louisvillegop.com/sitemap317.xml 2026-12-01 https://louisvillegop.com/sitemap435.xml 2026-12-01 https://louisvillegop.com/sitemap703.xml 2026-12-01 https://louisvillegop.com/sitemap508.xml 2026-12-01 https://louisvillegop.com/sitemap564.xml 2026-12-01 https://louisvillegop.com/sitemap712.xml 2026-12-01 https://louisvillegop.com/sitemap863.xml 2026-12-01 https://louisvillegop.com/sitemap277.xml 2026-12-01 https://louisvillegop.com/sitemap533.xml 2026-12-01 https://louisvillegop.com/sitemap586.xml 2026-12-01 https://louisvillegop.com/sitemap813.xml 2026-12-01 https://louisvillegop.com/sitemap976.xml 2026-12-01 https://louisvillegop.com/sitemap599.xml 2026-12-01 https://louisvillegop.com/sitemap105.xml 2026-12-01 https://louisvillegop.com/sitemap431.xml 2026-12-01 https://louisvillegop.com/sitemap390.xml 2026-12-01 https://louisvillegop.com/sitemap629.xml 2026-12-01 https://louisvillegop.com/sitemap991.xml 2026-12-01 https://louisvillegop.com/sitemap862.xml 2026-12-01 https://louisvillegop.com/sitemap645.xml 2026-12-01 https://louisvillegop.com/sitemap724.xml 2026-12-01 https://louisvillegop.com/sitemap513.xml 2026-12-01 https://louisvillegop.com/sitemap680.xml 2026-12-01 https://louisvillegop.com/sitemap48.xml 2026-12-01 https://louisvillegop.com/sitemap424.xml 2026-12-01 https://louisvillegop.com/sitemap845.xml 2026-12-01 https://louisvillegop.com/sitemap929.xml 2026-12-01 https://louisvillegop.com/sitemap406.xml 2026-12-01 https://louisvillegop.com/sitemap129.xml 2026-12-01 https://louisvillegop.com/sitemap67.xml 2026-12-01 https://louisvillegop.com/sitemap12.xml 2026-12-01 https://louisvillegop.com/sitemap908.xml 2026-12-01 https://louisvillegop.com/sitemap547.xml 2026-12-01 https://louisvillegop.com/sitemap702.xml 2026-12-01 https://louisvillegop.com/sitemap556.xml 2026-12-01 https://louisvillegop.com/sitemap140.xml 2026-12-01 https://louisvillegop.com/sitemap800.xml 2026-12-01 https://louisvillegop.com/sitemap269.xml 2026-12-01 https://louisvillegop.com/sitemap978.xml 2026-12-01 https://louisvillegop.com/sitemap729.xml 2026-12-01 https://louisvillegop.com/sitemap664.xml 2026-12-01 https://louisvillegop.com/sitemap139.xml 2026-12-01 https://louisvillegop.com/sitemap854.xml 2026-12-01 https://louisvillegop.com/sitemap524.xml 2026-12-01 https://louisvillegop.com/sitemap554.xml 2026-12-01 https://louisvillegop.com/sitemap511.xml 2026-12-01 https://louisvillegop.com/sitemap652.xml 2026-12-01 https://louisvillegop.com/sitemap838.xml 2026-12-01 https://louisvillegop.com/sitemap115.xml 2026-12-01 https://louisvillegop.com/sitemap158.xml 2026-12-01 https://louisvillegop.com/sitemap731.xml 2026-12-01 https://louisvillegop.com/sitemap644.xml 2026-12-01 https://louisvillegop.com/sitemap885.xml 2026-12-01 https://louisvillegop.com/sitemap468.xml 2026-12-01 https://louisvillegop.com/sitemap585.xml 2026-12-01 https://louisvillegop.com/sitemap602.xml 2026-12-01