Code Duplication    Length = 17-17 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 792-808 (lines=17) @@
789
	    $format_type = pods_v( self::$type . '_format_type', $options, 'single' );
790
791
        if ( 'single' == $format_type ) {
792
            if ( 'dropdown' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) ) {
793
	            $field_type = 'select';
794
	            $options[ 'view_name' ] = 'select';
795
            } elseif ( 'radio' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) ) {
796
	            $field_type = 'radio';
797
	            $options[ 'view_name' ] = 'radio';
798
            } elseif ( 'autocomplete' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) ) {
799
	            $field_type = 'select2';
800
	            $options[ 'view_name' ] = 'select2';
801
            } elseif ( 'flexible' == pods_var( self::$type . '_format_single', $options, 'dropdown' ) ) {
802
	            $options[ 'view_name' ] = 'flexible';
803
            } else {
804
                // Support custom integration
805
                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 );
806
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
807
                return;
808
            }
809
        }
810
        elseif ( 'multi' == $format_type ) {
811
            if ( !empty( $value ) && !is_array( $value ) ) {
@@ 815-831 (lines=17) @@
812
	            $value = explode( ',', $value );
813
            }
814
815
            if ( 'checkbox' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) ) {
816
	            $field_type = 'checkbox';
817
	            $options[ 'view_name' ] = 'checkbox';
818
            } elseif ( 'multiselect' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) ) {
819
	            $field_type = 'select';
820
	            $options[ 'view_name' ] = 'select';
821
            } elseif ( 'autocomplete' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) ) {
822
	            $field_type = 'select2';
823
	            $options[ 'view_name' ] = 'select2';
824
            } elseif ( 'flexible' == pods_var( self::$type . '_format_multi', $options, 'checkbox' ) ) {
825
	            $options[ 'view_name' ] = 'flexible';
826
            } else {
827
                // Support custom integration
828
                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 );
829
                do_action( 'pods_form_ui_field_pick_input', pods_var( self::$type . '_format_type', $options, 'single' ), $name, $value, $options, $pod, $id );
830
                return;
831
            }
832
        }
833
        else {
834
            // Support custom integration