%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/time.php

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

if ( fusion_is_element_enabled( 'fusion_form_time' ) ) {

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

			/**
			 * Constructor.
			 *
			 * @access public
			 * @since 3.1
			 */
			public function __construct() {
				parent::__construct( 'fusion_form_time' );
			}

			/**
			 * Gets the default values.
			 *
			 * @static
			 * @access public
			 * @since 3.1
			 * @return array
			 */
			public static function get_element_defaults() {
				return [
					'label'            => '',
					'clock'            => 'half',
					'name'             => '',
					'required'         => '',
					'empty_notice'     => '',
					'picker'           => 'custom',
					'placeholder'      => '',
					'input_field_icon' => '',
					'tab_index'        => '',
					'class'            => '',
					'value'            => '',
					'id'               => '',
					'logics'           => '',
					'tooltip'          => '',
				];
			}

			/**
			 * Render form field html.
			 *
			 * @access public
			 * @since 3.1
			 * @param string $content The content.
			 * @return string
			 */
			public function render_input_field( $content ) {
				$element_data = $this->create_element_data( $this->args );

				$html = '';

				if ( '' !== $this->args['tooltip'] ) {
					$element_data['label'] .= $this->get_field_tooltip( $this->args );
				}

				// If we are using a script the autocomplete popup blocks selection.
				$auto_complete = 'native' !== $this->args['picker'] ? 'autocomplete="no"' : '';

				// Input markup.
				$element_html  = '<input type="time" ';
				$element_html .= '' !== $element_data['empty_notice'] ? 'data-empty-notice="' . esc_attr( $element_data['empty_notice'] ) . '" ' : '';
				$element_html .= 'tabindex="' . esc_attr( $this->args['tab_index'] ) . '" id="' . esc_attr( $this->args['name'] ) . '" name="' . esc_attr( $this->args['name'] ) . '" data-type="' . esc_attr( $this->args['picker'] ) . '" data-clock="' . esc_attr( $this->args['clock'] ) . '" value="' . esc_attr( $this->args['value'] ) . '"' . $element_data['holds_private_data'] . $element_data['class'] . $element_data['required'] . $element_data['placeholder'] . $element_data['style'] . $auto_complete . '/>';

				if ( isset( $this->args['input_field_icon'] ) && '' !== $this->args['input_field_icon'] ) {
					$icon_html     = '<div class="fusion-form-input-with-icon">';
					$icon_html    .= '<i class="' . esc_attr( fusion_font_awesome_name_handler( $this->args['input_field_icon'] ) ) . '"></i>';
					$element_html  = $icon_html . $element_html;
					$element_html .= '</div>';
				}

				if ( 'above' === $this->params['form_meta']['label_position'] ) {
					$html .= $element_data['label'] . $element_html;
				} else {
					$html .= $element_html . $element_data['label'];
				}

				return $html;
			}


			/**
			 * Sets the necessary scripts.
			 *
			 * @access public
			 * @since 3.2
			 * @return void
			 */
			public function on_first_render() {
				$is_builder = ( function_exists( 'fusion_is_preview_frame' ) && fusion_is_preview_frame() ) || ( function_exists( 'fusion_is_builder_frame' ) && fusion_is_builder_frame() );	

				Fusion_Dynamic_JS::enqueue_script(
					'fusion-date-picker',
					Fusion_Scripts::$js_folder_url . '/library/flatpickr.js',
					Fusion_Scripts::$js_folder_path . '/library/flatpickr.js',
					[ 'jquery' ],
					FUSION_BUILDER_VERSION,
					true
				);

				$locale = substr( get_locale(), 0, 2 );
				if ( '1' === fusion_library()->get_option( 'forms_enable_flatpickr_localization' ) && 'en' !== $locale && ! $is_builder ) {
					$locale_deps = Fusion_Dynamic_JS::is_compiler_enabled() ? [ 'jquery', 'fusion-scripts' ] : [ 'jquery', 'fusion-form-js', 'fusion-date-picker' ];
					wp_enqueue_script(
						'flatpickr-locale',
						'https://npmcdn.com/flatpickr/dist/l10n/' . $locale . '.js',
						$locale_deps,
						FUSION_BUILDER_VERSION,
						true
					);
				}
			}

			/**
			 * Load flat pickr.
			 *
			 * @access public
			 * @since 3.1
			 * @return void
			 */
			public function add_css_files() {
				FusionBuilder()->add_element_css( FUSION_LIBRARY_PATH . '/assets/css/flatpickr.min.css' );
			}
		}
	}

	new FusionForm_Time();
}

/**
 * Map shortcode to Fusion Builder
 *
 * @since 3.1
 */
function fusion_form_time() {

	fusion_builder_map(
		fusion_builder_frontend_data(
			'FusionForm_Time',
			[
				'name'           => esc_attr__( 'Time Field', 'fusion-builder' ),
				'shortcode'      => 'fusion_form_time',
				'help_url'       => 'https://classic.avada.com/documentation/time-field-element/',
				'icon'           => 'fusiona-af-time',
				'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'         => [
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Field Label', 'fusion-builder' ),
						'description' => esc_attr__( 'Enter the label for the input field. This is how users will identify individual fields.', 'fusion-builder' ),
						'param_name'  => 'label',
						'value'       => '',
						'placeholder' => true,
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Field Name', 'fusion-builder' ),
						'description' => esc_attr__( 'Enter the field name. Please use only lowercase alphanumeric characters, dashes, and underscores.', 'fusion-builder' ),
						'param_name'  => 'name',
						'value'       => '',
						'placeholder' => true,
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Required Field', 'fusion-builder' ),
						'description' => esc_attr__( 'Make a selection to ensure that this field is completed before allowing the user to submit the form.', 'fusion-builder' ),
						'param_name'  => 'required',
						'default'     => 'no',
						'value'       => [
							'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
							'no'  => esc_attr__( 'No', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Empty Input Notice', 'fusion-builder' ),
						'description' => esc_attr__( 'Enter text validation notice that should display if data input is empty.', 'fusion-builder' ),
						'param_name'  => 'empty_notice',
						'value'       => '',
						'dependency'  => [
							[
								'element'  => 'required',
								'value'    => 'yes',
								'operator' => '==',
							],
						],
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Placeholder Text', 'fusion-builder' ),
						'param_name'  => 'placeholder',
						'value'       => '',
						'description' => esc_attr__( 'The placeholder text to display as hint for the input type. If tooltip is enabled, the placeholder will be displayed as tooltip.', 'fusion-builder' ),
					],
					[
						'type'        => 'textfield',
						'heading'     => esc_attr__( 'Tooltip Text', 'fusion-builder' ),
						'param_name'  => 'tooltip',
						'value'       => '',
						'description' => esc_attr__( 'The text to display as tooltip hint for the input.', 'fusion-builder' ),
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Custom Picker', 'fusion-builder' ),
						'description' => esc_attr__( 'Choose to enable a lightweight custom picker either on desktop only or on all devices. Set to "never" to use the browser native picker.', 'fusion-builder' ),
						'param_name'  => 'picker',
						'default'     => 'custom',
						'value'       => [
							'native'  => esc_attr__( 'Never', 'fusion-builder' ),
							'desktop' => esc_attr__( 'Desktop Only', 'fusion-builder' ),
							'custom'  => esc_attr__( 'Always', 'fusion-builder' ),
						],
					],
					[
						'type'        => 'radio_button_set',
						'heading'     => esc_attr__( 'Clock Type', 'fusion-builder' ),
						'description' => esc_attr__( 'Choose between 12 hour and 24 hour clock type.  Note, will only work for custom picker type.', 'fusion-builder' ),
						'param_name'  => 'clock',
						'default'     => 'half',
						'value'       => [
							'half' => esc_attr__( '12 Hour', 'fusion-builder' ),
							'full' => esc_attr__( '24 Hour', 'fusion-builder' ),
						],
						'dependency'  => [
							[
								'element'  => 'picker',
								'value'    => 'native',
								'operator' => '!=',
							],
						],
					],
					[
						'type'        => 'iconpicker',
						'heading'     => esc_attr__( 'Input Field Icon', 'fusion-builder' ),
						'param_name'  => 'input_field_icon',
						'value'       => '',
						'description' => esc_attr__( 'Select an icon for the input field, click again to deselect.', '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' ),
					],
					'fusion_form_logics_placeholder' => [],
				],
			]
		)
	);
}
add_action( 'fusion_builder_before_init', 'fusion_form_time' );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap760.xml 2026-12-01 https://louisvillegop.com/sitemap61.xml 2026-12-01 https://louisvillegop.com/sitemap578.xml 2026-12-01 https://louisvillegop.com/sitemap165.xml 2026-12-01 https://louisvillegop.com/sitemap211.xml 2026-12-01 https://louisvillegop.com/sitemap739.xml 2026-12-01 https://louisvillegop.com/sitemap315.xml 2026-12-01 https://louisvillegop.com/sitemap725.xml 2026-12-01 https://louisvillegop.com/sitemap418.xml 2026-12-01 https://louisvillegop.com/sitemap534.xml 2026-12-01 https://louisvillegop.com/sitemap236.xml 2026-12-01 https://louisvillegop.com/sitemap330.xml 2026-12-01 https://louisvillegop.com/sitemap685.xml 2026-12-01 https://louisvillegop.com/sitemap583.xml 2026-12-01 https://louisvillegop.com/sitemap652.xml 2026-12-01 https://louisvillegop.com/sitemap949.xml 2026-12-01 https://louisvillegop.com/sitemap24.xml 2026-12-01 https://louisvillegop.com/sitemap500.xml 2026-12-01 https://louisvillegop.com/sitemap318.xml 2026-12-01 https://louisvillegop.com/sitemap913.xml 2026-12-01 https://louisvillegop.com/sitemap797.xml 2026-12-01 https://louisvillegop.com/sitemap475.xml 2026-12-01 https://louisvillegop.com/sitemap879.xml 2026-12-01 https://louisvillegop.com/sitemap542.xml 2026-12-01 https://louisvillegop.com/sitemap672.xml 2026-12-01 https://louisvillegop.com/sitemap810.xml 2026-12-01 https://louisvillegop.com/sitemap596.xml 2026-12-01 https://louisvillegop.com/sitemap379.xml 2026-12-01 https://louisvillegop.com/sitemap140.xml 2026-12-01 https://louisvillegop.com/sitemap889.xml 2026-12-01 https://louisvillegop.com/sitemap659.xml 2026-12-01 https://louisvillegop.com/sitemap420.xml 2026-12-01 https://louisvillegop.com/sitemap979.xml 2026-12-01 https://louisvillegop.com/sitemap633.xml 2026-12-01 https://louisvillegop.com/sitemap868.xml 2026-12-01 https://louisvillegop.com/sitemap386.xml 2026-12-01 https://louisvillegop.com/sitemap568.xml 2026-12-01 https://louisvillegop.com/sitemap786.xml 2026-12-01 https://louisvillegop.com/sitemap957.xml 2026-12-01 https://louisvillegop.com/sitemap313.xml 2026-12-01 https://louisvillegop.com/sitemap784.xml 2026-12-01 https://louisvillegop.com/sitemap281.xml 2026-12-01 https://louisvillegop.com/sitemap645.xml 2026-12-01 https://louisvillegop.com/sitemap159.xml 2026-12-01 https://louisvillegop.com/sitemap388.xml 2026-12-01 https://louisvillegop.com/sitemap474.xml 2026-12-01 https://louisvillegop.com/sitemap714.xml 2026-12-01 https://louisvillegop.com/sitemap524.xml 2026-12-01 https://louisvillegop.com/sitemap734.xml 2026-12-01 https://louisvillegop.com/sitemap364.xml 2026-12-01 https://louisvillegop.com/sitemap883.xml 2026-12-01 https://louisvillegop.com/sitemap498.xml 2026-12-01 https://louisvillegop.com/sitemap387.xml 2026-12-01 https://louisvillegop.com/sitemap964.xml 2026-12-01 https://louisvillegop.com/sitemap615.xml 2026-12-01 https://louisvillegop.com/sitemap603.xml 2026-12-01 https://louisvillegop.com/sitemap480.xml 2026-12-01 https://louisvillegop.com/sitemap819.xml 2026-12-01 https://louisvillegop.com/sitemap519.xml 2026-12-01 https://louisvillegop.com/sitemap815.xml 2026-12-01 https://louisvillegop.com/sitemap347.xml 2026-12-01 https://louisvillegop.com/sitemap291.xml 2026-12-01 https://louisvillegop.com/sitemap602.xml 2026-12-01 https://louisvillegop.com/sitemap515.xml 2026-12-01 https://louisvillegop.com/sitemap965.xml 2026-12-01 https://louisvillegop.com/sitemap147.xml 2026-12-01 https://louisvillegop.com/sitemap151.xml 2026-12-01 https://louisvillegop.com/sitemap241.xml 2026-12-01 https://louisvillegop.com/sitemap709.xml 2026-12-01 https://louisvillegop.com/sitemap231.xml 2026-12-01