web/wp-content/plugins/caldera-forms/processors/classes/ui.php
/**
	 * Create the input for proccesor config field.
	 *
	 * @since 1.3.0
	 *
	 * @param string $type The type of input. This is NOT The input type. Options are simple|checkbox|advanced|dropdown
	 * @param array $args Field args
	 * @param string $id ID attribute
	 * @param string $classes Class attribute.
	 * @param bool|string $required If is required or not
	 * @param bool $has_desc Does this input have a description?
	 *
	 * @return string HTML markup for input
	 */
Create the input for proccesor config field.

@param string $type The type of input. This is NOT The input type.

@return string HTML markup for input
Create the input for proccesor config field . @param string $type The type of input . This is NOT The input type . @return string HTML markup for input
public static function input( $type, $args, $id, $classes, $required, $has_desc ) {
		$field_html = apply_filters( 'caldera_forms_processor_ui_input_pre_html', null, $type, $args, $id, $classes, $required, $has_desc );
		if( is_string( $field_html ) ){
			return $field_html;
		}
		$field = '';
		$aria = sprintf( 'aria-labelledby="%s"', self::label_id( $id ) );
		if( $has_desc ){
			$aria .= sprintf( ' aria-describedby="%s"', self::description_id( $id ) );
		}
		switch( $type ) {
			case 'checkbox' == $type :
				$field = sprintf( '<input type="%1s" class="%2s" id="%3s" name="{{_name}}[%4s]"  %s >',
					$args[ 'type' ],
					$classes,
					esc_attr( $id ),
					esc_attr( $id ),
					sprintf( '{{#if %s}}checked{{/if}}', esc_attr( $id ) ),
					$aria
				);
				break;
			case 'advanced' :
				if ( $required ) {
					$required = "true";
				}else{
					$required = "false";
				}
				if ( is_string( $args[ 'allow_types' ] ) ) {
					$allow_types = $args[ 'allow_types' ] ;
				}elseif ( is_array( $args[ 'allow_types' ] ) ){
					$allow_types = implode( ',', $args[ 'allow_types' ] );
				}else{
					$allow_types = 'all';
				}
				if ( is_string( $args[ 'exclude' ] ) ) {
					$excludes = $args[ 'exclude' ] ;
				}elseif ( is_array( $args[ 'exclude' ] ) ){
					$excludes = implode( ',', $args[ 'exclude' ] );
				}else{
					$excludes = 'all';
				}
				$field = sprintf( '{{{_field slug="%1s" type="%2s" exclude="%3s" required="%4s"}}}',
					esc_attr( $id ),
					$allow_types,
					$excludes,
					$required
				);
			break;
			case 'dropdown' :
				if ( isset( $args[ 'options' ] ) ){
					foreach( $args[ 'options' ] as $value => $label ) {
						$options[] = sprintf( '<option value="%1s" {{#is %2s value="%3s"}}selected{{/is}}>%4s</option>',
							esc_attr( $value ),
							esc_attr( $id ),
							esc_attr( $value ),
							esc_html( $label )
						);
					}
					$field = sprintf( '<select class="%s" id="%s" name="{{_name}}[%s]" %s>%s,</select>',
						$classes,
						esc_attr( $id ),
						esc_attr( $id ),
						$aria,
						implode( "/n", $options )
					);
				}
				break;
			case 'hidden' :
				$field = sprintf( '<input type="hidden" class="%s" id="%s" name="{{_name}}[%s]" value="%s">',
					$classes,
					esc_attr( $id ),
					esc_attr( $id ),
					'{{' . esc_attr( $id ) . '}}'
				);
				break;
			default :
				$field = sprintf( '<input type="%1s" class="%2s" id="%3s" name="{{_name}}[%4s]" value="%5s" %6s>',
					$args[ 'type' ],
					$classes,
					esc_attr( $id ),
					esc_attr( $id ),
					'{{' . esc_attr( $id ) . '}}',
					$required
				);
			break;
		}
		return apply_filters( 'caldera_forms_processor_ui_input_html', $field, $type, $id, $args );
	}
public static function input ( $ type , $ args , $ id , $ classes , $ required , $ has_desc ) { $ field_html = apply_filters ( 'caldera_forms_processor_ui_input_pre_html' , null , $ type , $ args , $ id , $ classes , $ required , $ has_desc ) ; if ( is_string ( $ field_html ) ) { return $ field_html ; } $ field = '' ; $ aria = sprintf ( 'aria-labelledby="%s"' , self :: label_id ( $ id ) ) ; if ( $ has_desc ) { $ aria .= sprintf ( ' aria-describedby="%s"' , self :: description_id ( $ id ) ) ; } switch ( $ type ) { case 'checkbox' == $ type : $ field = sprintf ( '<input type="%1s" class="%2s" id="%3s" name="{{_name}}[%4s]"  %s >' , $ args [ 'type' ] , $ classes , esc_attr ( $ id ) , esc_attr ( $ id ) , sprintf ( '{{#if %s}}checked{{/if}}' , esc_attr ( $ id ) ) , $ aria ) ; break ; case 'advanced' : if ( $ required ) { $ required = " true " ; } else { $ required = " false " ; } if ( is_string ( $ args [ 'allow_types' ] ) ) { $ allow_types = $ args [ 'allow_types' ] ; } elseif ( is_array ( $ args [ 'allow_types' ] ) ) { $ allow_types = implode ( ',' , $ args [ 'allow_types' ] ) ; } else { $ allow_types = 'all' ; } if ( is_string ( $ args [ 'exclude' ] ) ) { $ excludes = $ args [ 'exclude' ] ; } elseif ( is_array ( $ args [ 'exclude' ] ) ) { $ excludes = implode ( ',' , $ args [ 'exclude' ] ) ; } else { $ excludes = 'all' ; } $ field = sprintf ( '{{{_field slug="%1s" type="%2s" exclude="%3s" required="%4s"}}}' , esc_attr ( $ id ) , $ allow_types , $ excludes , $ required ) ; break ; case 'dropdown' : if ( isset ( $ args [ 'options' ] ) ) { foreach ( $ args [ 'options' ] as $ value => $ label ) { $ options [ ] = sprintf ( '<option value="%1s" {{#is %2s value="%3s"}}selected{{/is}}>%4s</option>' , esc_attr ( $ value ) , esc_attr ( $ id ) , esc_attr ( $ value ) , esc_html ( $ label ) ) ; } $ field = sprintf ( '<select class="%s" id="%s" name="{{_name}}[%s]" %s>%s,</select>' , $ classes , esc_attr ( $ id ) , esc_attr ( $ id ) , $ aria , implode ( " /n " , $ options ) ) ; } break ; case 'hidden' : $ field = sprintf ( '<input type="hidden" class="%s" id="%s" name="{{_name}}[%s]" value="%s">' , $ classes , esc_attr ( $ id ) , esc_attr ( $ id ) , '{{' . esc_attr ( $ id ) . '}}' ) ; break ; default : $ field = sprintf ( '<input type="%1s" class="%2s" id="%3s" name="{{_name}}[%4s]" value="%5s" %6s>' , $ args [ 'type' ] , $ classes , esc_attr ( $ id ) , esc_attr ( $ id ) , '{{' . esc_attr ( $ id ) . '}}' , $ required ) ; break ; } return apply_filters ( 'caldera_forms_processor_ui_input_html' , $ field , $ type , $ id , $ args ) ; }
Create the input for proccesor config field.
Create the input for proccesor config field .
/**
		 * Use to make custom HTML for admin input fields
		 *
		 * By returning a string, rest of this method -- Caldera_Forms_Processor_UI::input() -- is skipped
		 *
		 * @since 1.4.0
		 *
		 * @param string|null $field_html HTML to use instead of default, else null to let method to its thing.
		 * @param array $args Field args
		 * @param string $id ID attribute
		 * @param string $classes Class attribute.
		 * @param bool|string $required If is required or not
		 * @param bool $has_desc Does this input have a description?
		 */ /**
		 * Modify HTML for the input in processor UI
		 *
		 * @since 1.3.5.3
		 *
		 *
		 * @param string $id ID attribute
		 * @param string $type The type of input. This is NOT The input type. Options are simple|checkbox|advanced|dropdown
		 * @param array $args Field args
		 */