Code Duplication    Length = 14-14 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 737-750 (lines=14) @@
734
            $ajax = false;
735
736
        if ( 'single' == pods_var( self::$type . '_format_type', $options, 'single' ) ) {
737
            if ( 'dropdown' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
738
                $field_type = 'select';
739
            elseif ( 'radio' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
740
                $field_type = 'radio';
741
            elseif ( 'autocomplete' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
742
                $field_type = 'select2';
743
            elseif ( 'flexible' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
744
                $field_type = 'flexible';
745
            else {
746
                // Support custom integration
747
                do_action( 'pods_form_ui_field_pick_input_' . pods_var( self::$type . '_format_type', $options, 'single' ) . '_' . pods_var( self::$type . '_format_single', $options, 'dropdown' ), $name, $value, $options, $pod, $id );
748
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
749
                return;
750
            }
751
        }
752
        elseif ( 'multi' == pods_var( self::$type . '_format_type', $options, 'single' ) ) {
753
            if ( !empty( $value ) && !is_array( $value ) )
@@ 756-769 (lines=14) @@
753
            if ( !empty( $value ) && !is_array( $value ) )
754
                $value = explode( ',', $value );
755
756
            if ( 'checkbox' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
757
                $field_type = 'checkbox';
758
            elseif ( 'multiselect' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
759
                $field_type = 'select';
760
            elseif ( 'autocomplete' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
761
                $field_type = 'select2';
762
            elseif ( 'flexible' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
763
                $field_type = 'flexible';
764
            else {
765
                // Support custom integration
766
                do_action( 'pods_form_ui_field_pick_input_' . pods_var( self::$type . '_format_type', $options, 'single' ) . '_' . pods_var( self::$type . '_format_multi', $options, 'checkbox' ), $name, $value, $options, $pod, $id );
767
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
768
                return;
769
            }
770
        }
771
        else {
772
            // Support custom integration