"textfield",
"class" => "",
"name" => "button_title",
"opts" => array(
"title" => __( "Button Title", "smile" ),
"value" => "AVAIL NOW",
"description" => __( "Enter the button title.", "smile" ),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'hidden', 'operator' => '==', 'value' => 'hide'),
),
/**
* Form Builder
*/
array(
"type" => "section",
"class" => "",
"name" => "form_builder_section",
"opts" => array(
"title" => "Form Builder",
"link" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "multi_box",
"class" => "",
"name" => "form_fields",
"opts" => array(
"title" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!=', 'value' => 'cp-form-layout-4'),
),
/* Form Layout */
array(
"type" => "section",
"class" => "",
"name" => "form_layout_section",
"opts" => array(
"title" => "Form Layout",
"link" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "radio-image",
"class" => "",
"name" => "form_layout",
"opts" => array(
"title" => __( "Layout", "smile"),
"value" => "",
"options" => array(
__( "cp-form-layout-1", "smile" ) => CP_BASE_URL. 'modules/assets/images/form-layout-1.png',
__( "cp-form-layout-2", "smile" ) => CP_BASE_URL. 'modules/assets/images/form-layout-2.png',
__( "cp-form-layout-3", "smile" ) => CP_BASE_URL. 'modules/assets/images/form-layout-3.png',
__( "cp-form-layout-4", "smile" ) => CP_BASE_URL. 'modules/assets/images/form-layout-4.png'
),
"width" => "130px",
"imagetitle" => array(
__( "title-0", "smile" ) => "Vertical - 1 Column Form Layout",
__( "title-1", "smile" ) => "Vertical - 2 Column Form Layout",
__( "title-2", "smile" ) => "Horizontal Form Layout",
__( "title-3", "smile" ) => "Only Submit Button Layout"
),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
// ONLY_BUTTON_LINK
array(
"type" => "section",
"class" => "",
"name" => "form_only_button_link_section",
"opts" => array(
"title" => "Submit Button Link",
"link" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "textfield",
"name" => "only_button_link",
"opts" => array(
"title" => __( "Button Link", "smile" ),
"description" => __( 'Provide a link to submit button. Please add http / https prefix to URL.
e.g. http://convertplug.com', 'smile' ),
"value" => "",
),
"dependency" => array('name' => 'hidden', 'operator' => '==', 'value' => 'hide'),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "dropdown",
"class" => "",
"name" => "only_button_link_target",
"opts" => array(
"title" => __( "Button Link Target", "smile"),
"description" => __( 'The button link target specifies where to open the button link.', 'smile' ),
"value" => "",
"options" => array(
__( 'Open in New Window (_blank)', 'smile' ) => "_blank",
__( 'Open in Same Window (_self)', 'smile' ) => "_self",
),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '==', 'value' => 'cp-form-layout-4'),
),
// Grid Structure
array(
"type" => "radio-image",
"class" => "",
"name" => "form_grid_structure",
"opts" => array(
"title" => __( "Grid Structure", "smile"),
"description" => __( 'Change submit button size depends on your grid selection.', 'smile' ),
"value" => "",
"options" => array(
__( "cp-form-grid-structure-1", "smile" ) => CP_BASE_URL . 'modules/assets/images/grid-structure-1-2.png',
__( "cp-form-grid-structure-2", "smile" ) => CP_BASE_URL . 'modules/assets/images/grid-structure-1-3.png',
__( "cp-form-grid-structure-3", "smile" ) => CP_BASE_URL . 'modules/assets/images/grid-structure-1-4.png'
),
"width" => "100%",
"imagetitle" => array(
__( "title-0", "smile" ) => "50% Submit Button Area",
__( "title-1", "smile" ) => "33.33% Submit Button Area",
__( "title-2", "smile" ) => "25% Submit Button Area",
),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '==', 'value' => 'cp-form-layout-3'),
),
array(
"type" => "switch",
"class" => "",
"name" => "btn_attached_email",
"opts" => array(
"title" => __( "Submit & Input box connected", "smile" ),
"description"=> __( "Enable this option to attach input field & submit button.
Note - This option will work for only one input field form.", "smile" ),
"value" => false,
"on" => __( "YES", "smile" ),
"off" => __( "NO", "smile" ),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '==', 'value' => 'cp-form-layout-3'),
),
// Label settings
array(
"type" => "section",
"class" => "",
"name" => "form_styling_section",
"opts" => array(
"title" => "Form Styling",
"link" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
// Form Styling - Input Styling
array(
"type" => "dropdown",
"class" => "",
"name" => "form_input_align",
"opts" => array(
"title" => __( "Form Text Alignment", "smile"),
"value" => "",
"css_property" => "text-align",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea, .cp-form-container label",
"css_preview" => true,
"options" => array(
__( "Left", "smile" ) => "left",
__( "Right", "smile" ) => "right",
__( "Center", "smile" ) => "center",
),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "colorpicker",
"class" => "",
"name" => "form_input_color",
"opts" => array(
"title" => __( "Input Box Text Color", "smile" ),
"value" => "rgb(153, 153, 153)",
"css_property" => "color",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "colorpicker",
"class" => "",
"name" => "form_input_bg_color",
"opts" => array(
"title" => __( "Input Box Background Color", "smile" ),
"value" => "rgb(255, 255, 255)",
"css_property" => "background-color",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "colorpicker",
"class" => "",
"name" => "form_input_border_color",
"opts" => array(
"title" => __( "Input Box Border Color", "smile" ),
"value" => "rgb(191, 190, 190)",
"css_property" => "border-color",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea,.cp-form-container input:focus:not([type='radio']):not([type='checkbox']):not([type='range']),.cp-form-container textarea:focus",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "switch",
"class" => "",
"name" => "input_shadow",
"opts" => array(
"title" => __( "Input Field Shadow", "smile" ),
"value" => false,
"on" => __( "YES", "smile" ),
"off" => __( "NO", "smile" ),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!=', 'value' => 'cp-form-layout-4'),
),
// Store the default initial color of button text
array(
"type" => "colorpicker",
"class" => "",
"name" => "input_shadow_color",
"opts" => array(
"title" => __( "Shadow Color", "smile" ),
"value" => "rgba(66, 66, 66, 0.6)",
//"css_property" => "border-radius",
//"css_selector" => ".cp-submit:hover",
// "css_preview" => true,
),
"dependency" => array('name' => 'input_shadow', 'operator' => '==', 'value' => true),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "slider",
"class" => "",
"name" => "input_border_radius",
"opts" => array(
"title" => __( "Input Border Radius", "smile" ),
"css_property" => "border-radius",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea , .cp-form-field.cp-enable-box-shadow > div",
"css_preview" => true,
"value" => 3,
"min" => 0,
"max" => 40,
"step" => 1,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "google_fonts",
"name" => "form_input_font",
"opts" => array(
"title" => __( "Input Box Font Name", "smile" ),
"value" => "",
"use_in" => "panel",
"css_property" => "font-family",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "slider",
"class" => "",
"name" => "form_input_font_size",
"opts" => array(
"title" => __( "Input Box Font Size", "smile" ),
"css_property" => "font-size",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
"value" => '15',
"min" => 0,
"max" => 40,
"step" => 1,
"suffix" => "px",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
// Submit Button Padding
array(
"type" => "slider",
"class" => "",
"name" => "form_input_padding_tb",
"opts" => array(
"title" => __( "Input Box Vertical Padding", "smile" ),
"css_property" => "padding-tb",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
"value" => 10,
"min" => 0,
"max" => 30,
"step" => 1,
"suffix" => "px",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
array(
"type" => "slider",
"class" => "",
"name" => "form_input_padding_lr",
"opts" => array(
"title" => __( "Input Box Horizontal Padding", "smile" ),
"css_property" => "padding-lr",
"css_selector" => ".cp-form-container .cp-form-field button, .cp-form-container .cp-form-field input, .cp-form-container .cp-form-field select, .cp-form-container .cp-form-field textarea",
"css_preview" => true,
"value" => 15,
"min" => 0,
"max" => 50,
"step" => 1,
"suffix" => "px",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4'),
),
// Label
array(
"type" => "switch",
"class" => "",
"name" => "form_lable_visible",
"opts" => array(
"title" => __( "Label Visibility", "smile" ),
"value" => false,
"on" => __( "Enable", "smile" ),
"off" => __( "Disable", "smile" ),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-4' ,'name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-3'),
),
array(
"type" => "colorpicker",
"class" => "",
"name" => "form_lable_color",
"opts" => array(
"title" => __( "Label Color", "smile" ),
"value" => "rgb(153, 153, 153)",
"css_property" => "color",
"css_selector" => ".cp-form-container label",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_lable_visible', 'operator' => '==', 'value' => 1),
),
array(
"type" => "google_fonts",
"name" => "form_label_font",
"opts" => array(
"title" => __( "Label Font Name", "smile" ),
"value" => "",
"use_in" => "panel",
"css_property" => "font-family",
"css_selector" => ".cp-form-container label",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_lable_visible', 'operator' => '==', 'value' => 1),
),
array(
"type" => "slider",
"class" => "",
"name" => "form_lable_font_size",
"opts" => array(
"title" => __( "Label Font Size", "smile" ),
"css_selector" => ".cp-form-container label",
"css_property" => "font-size",
"value" => 15,
"min" => 0,
"max" => 100,
"step" => 1,
"suffix" => "px",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'form_lable_visible', 'operator' => '==', 'value' => 1),
),
// Submit Button Styling
array(
"type" => "section",
"class" => "",
"name" => "form_submit_button_styling",
"opts" => array(
"title" => "Submit Button Styling",
"link" => "",
"value" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "dropdown",
"class" => "",
"name" => "btn_style",
"opts" => array(
"title" => __( "Button Style","smile"),
"value" => "cp-btn-flat",
"description"=> __( "Style your button with nice effects.", "smile" ),
"options" => array(
__( "Flat", "smile" ) => 'cp-btn-flat',
__( "3D", "smile" ) => 'cp-btn-3d',
__( "Outline", "smile" ) => 'cp-btn-outline',
__( "Gradient", "smile" ) => 'cp-btn-gradient',
)
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "colorpicker",
"class" => "",
"name" => "button_bg_color",
"opts" => array(
"title" => __( "Button Background Color", "smile" ),
"value" => "rgb(255, 153, 0)",
"css_property" => "background",
"css_selector" => ".cp-submit",
"css_preview" => true,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "slider",
"class" => "",
"name" => "btn_border_radius",
"opts" => array(
"title" => __( "Border Radius", "smile" ),
"css_property" => "border-radius",
"css_selector" => ".cp-submit",
//"css_preview" => true,
"value" => 3,
"min" => 0,
"max" => 40,
"step" => 1,
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "switch",
"class" => "",
"name" => "btn_shadow",
"opts" => array(
"title" => __( "Button Shadow", "smile" ),
"value" => false,
"on" => __( "YES", "smile" ),
"off" => __( "NO", "smile" ),
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
"dependency" => array('name' => 'btn_style', 'operator' => '!=', 'value' => 'cp-btn-3d'),
),
// Store the default initial color of button text
array(
"type" => "colorpicker",
"class" => "",
"name" => "button_txt_hover_color",
"opts" => array(
"title" => __( "Submit Button Text Hover Color", "smile" ),
"value" => "#ffffff",
"css_property" => "border-color",
"css_selector" => ".cp-submit:hover",
// "css_preview" => true,
),
"dependency" => array('name' => 'btn_style', 'operator' => '==', 'value' => 'cp-btn-outline'),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
// store button darken on hover
array(
"type" => "textfield",
"name" => "button_bg_hover_color",
"opts" => array(
"title" => __( "Button BG Hover Color", "smile" ),
"value" => "",
),
"dependency" => array('name' => 'hidden', 'operator' => '==', 'value' => 'hide'),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
// store button lighten gradient
array(
"type" => "textfield",
"name" => "button_bg_gradient_color",
"opts" => array(
"title" => __( "Button Gradient Color", "smile" ),
"value" => "",
),
"dependency" => array('name' => 'hidden', 'operator' => '==', 'value' => 'hide'),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "dropdown",
"class" => "",
"name" => "form_submit_align",
"opts" => array(
"title" => __( "Button Alignment", "smile"),
"value" => "",
"options" => array(
__( "Center", "smile" ) => "cp-submit-wrap-center",
__( "Left", "smile" ) => "cp-submit-wrap-left",
__( "Right", "smile" ) => "cp-submit-wrap-right",
__( "Full", "smile" ) => "cp-submit-wrap-full",
),
),
"dependency" => array('name' => 'form_layout', 'operator' => '!==', 'value' => 'cp-form-layout-3'),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
// Submit Button Padding
array(
"type" => "slider",
"class" => "",
"name" => "submit_button_tb_padding",
"opts" => array(
"title" => __( "Button Vertical Padding", "smile" ),
"css_property" => "padding-tb",
"css_selector" => ".cp-submit",
"value" => 10,
"min" => 0,
"max" => 100,
"step" => 1,
"suffix" => "px",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
array(
"type" => "slider",
"class" => "",
"name" => "submit_button_lr_padding",
"opts" => array(
"title" => __( "Button Horizontal Padding", "smile" ),
"css_property" => "padding-lr",
"css_selector" => ".cp-submit",
"value" => 15,
"min" => 0,
"max" => 100,
"step" => 1,
"suffix" => "px",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
// Note - Button Options
array(
"type" => "txt-link",
"class" => "",
"name" => "note_button_options",
"opts" => array(
"link" => __( "Note - Above settings apply to only Built-In Forms. These won't be effective with Custom Forms.", "smile" ),
"value" => "",
"title" => "",
),
"panel" => "Form Designer",
"section" => "Design",
"section_icon" => "connects-icon-disc",
),
);
/**
* 2. Global array for shortcode variables
*/
$cp_form_vars = generate_global_shortcode_vars( $cp_form );
/**
* 3. Generate Output by 'cp_get_form' filter
*/
add_filter( 'cp_get_form', 'cp_get_form_init' );
if( !function_exists('cp_get_form_init') ) {
function cp_get_form_init( $a ) { ?>
'.do_shortcode( $a['custom_html_form'] ).'';
} else {
// apply button styles
apply_filters_ref_array('cp_form_css', array( $a ) );
// default Form - ConvertPlug
$only_button_link = ''; // Only button - Link after conversion
$only_button_link_target = ''; // Only button - Link Target after conversion
$class_wrap = ''; // Class for - 'Form Wrapper'
$class_form = ''; // Class for - 'Form'
$class_submit = ''; // Class for - 'Submit CKEditor'
$class_inputs_wrap = ''; // Class for - 'Inputs Wrap'
$class_fields = ''; // Class for - 'All Inputs - Wrap'
$class_inputs = ''; // Class for - 'All Inputs'
$class_input_name = ''; // Class for - 'Input - Name'
$class_input_email = ''; // Class for - 'Input - Email'
$class_row_value = ''; // Class for - 'textarea - rows'
$class_shadow = ''; // Class for - 'shadow - input'
$enable_field_attached = ''; // Class for - 'enable attached fileds'
// Submit button alignment
$class_submit .= ( isset($a['form_submit_align']) && '' != $a['form_submit_align'] ) ? ' ' . $a['form_submit_align'] : '';
$class_shadow .= ( isset($a['input_shadow']) && '' != $a['input_shadow'] ) ? '' . 'enable_input_shadow' : '';
$enable_field_attached = ( isset($a['btn_attached_email']) && $a['btn_attached_email'] == '1' && isset( $a['form_layout'] ) && $a['form_layout']=='cp-form-layout-3' ) ? '' . 'enable-field-attached' : '';
if( isset( $a['form_layout'] ) ) {
$class_wrap = $a['form_layout'];
switch ( $a['form_layout'] ) {
case 'cp-form-layout-1': $class_fields .= ' col-md-12 col-lg-12 col-sm-12 col-xs-12';
$class_submit .= ' col-md-12 col-lg-12 col-sm-12 col-xs-12';
break;
case 'cp-form-layout-2': $class_fields .= ' col-md-6 col-lg-6 col-sm-6 col-xs-12 ';
$class_submit .= ' col-md-12 col-lg-12 col-sm-12 col-xs-12 ';
break;
case 'cp-form-layout-3': // Grid structure for All Input Wrap & Submit
switch( $a['form_grid_structure'] ) {
case 'cp-form-grid-structure-1':
$class_submit .= ' col-xs-12 col-sm-6 col-md-6 col-lg-6 ';
$class_inputs_wrap = ' col-xs-12 col-sm-6 col-md-6 col-lg-6 ';
break;
case 'cp-form-grid-structure-2':
$class_submit .= ' col-xs-12 col-sm-4 col-md-4 col-lg-4 ';
$class_inputs_wrap = ' col-xs-12 col-sm-8 col-md-8 col-lg-8 ';
break;
case 'cp-form-grid-structure-3':
default:
$class_submit .= ' col-xs-12 col-sm-3 col-md-3 col-lg-3 ';
$class_inputs_wrap = ' col-xs-12 col-sm-9 col-md-9 col-lg-9 ';
break;
}
$all_fields = explode(';', $a['form_fields'] );
if( count( $all_fields ) > 0 ) {
$fields_count = count( $all_fields );
// Remove hidden fields from count
$no_of_hiddens = substr_count( $a['form_fields'], 'input_type->hidden' );
if( $no_of_hiddens != '' ) {
$fields_count = $fields_count - $no_of_hiddens;
}
switch( $fields_count ) {
case 1:
$class_fields = ' col-md-12 col-lg-12 col-sm-12 col-xs-12';
break;
case 2:
$class_fields = ' col-md-6 col-lg-6 col-sm-6 col-xs-12';
break;
case 3:
$class_fields = ' col-md-4 col-lg-4 col-sm-4 col-xs-12';
break;
case 4:
case 5:
$class_fields = ' col-md-3 col-lg-3 col-sm-3 col-xs-12';
break;
case 6:
$class_fields = ' col-md-2 col-lg-2 col-sm-2 col-xs-12';
break;
}
}
break;
case 'cp-form-layout-4': $class_submit .= ' col-md-12 col-lg-12 col-sm-12 col-xs-12 ';
break;
break;
}
} ?>