Code Duplication    Length = 14-14 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 727-740 (lines=14) @@
724
            $ajax = false;
725
726
        if ( 'single' == pods_var( self::$type . '_format_type', $options, 'single' ) ) {
727
            if ( 'dropdown' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
728
                $field_type = 'select';
729
            elseif ( 'radio' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
730
                $field_type = 'radio';
731
            elseif ( 'autocomplete' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
732
                $field_type = 'select2';
733
            elseif ( 'flexible' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) )
734
                $field_type = 'flexible';
735
            else {
736
                // Support custom integration
737
                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 );
738
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
739
                return;
740
            }
741
        }
742
        elseif ( 'multi' == pods_var( self::$type . '_format_type', $options, 'single' ) ) {
743
            if ( !empty( $value ) && !is_array( $value ) )
@@ 746-759 (lines=14) @@
743
            if ( !empty( $value ) && !is_array( $value ) )
744
                $value = explode( ',', $value );
745
746
            if ( 'checkbox' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
747
                $field_type = 'checkbox';
748
            elseif ( 'multiselect' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
749
                $field_type = 'select';
750
            elseif ( 'autocomplete' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
751
                $field_type = 'select2';
752
            elseif ( 'flexible' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
753
                $field_type = 'flexible';
754
            else {
755
                // Support custom integration
756
                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 );
757
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
758
                return;
759
            }
760
        }
761
        else {
762
            // Support custom integration