Code Duplication    Length = 12-12 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 727-738 (lines=12) @@
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
            else {
734
                // Support custom integration
735
                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 );
736
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
737
                return;
738
            }
739
        }
740
        elseif ( 'multi' == pods_var( self::$type . '_format_type', $options, 'single' ) ) {
741
            if ( !empty( $value ) && !is_array( $value ) )
@@ 744-755 (lines=12) @@
741
            if ( !empty( $value ) && !is_array( $value ) )
742
                $value = explode( ',', $value );
743
744
            if ( 'checkbox' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
745
                $field_type = 'checkbox';
746
            elseif ( 'multiselect' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
747
                $field_type = 'select';
748
            elseif ( 'autocomplete' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) )
749
                $field_type = 'select2';
750
            else {
751
                // Support custom integration
752
                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 );
753
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
754
                return;
755
            }
756
        }
757
        else {
758
            // Support custom integration