Code Duplication    Length = 12-12 lines in 2 locations

classes/fields/pick.php 2 locations

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