control-type-animation.php
4 years ago
control-type-background.php
2 years ago
control-type-border.php
2 years ago
control-type-box-shadow.php
4 years ago
control-type-choose.php
4 years ago
control-type-code.php
4 years ago
control-type-color.php
4 years ago
control-type-date-time.php
1 year ago
control-type-dimensions.php
4 years ago
control-type-font.php
4 years ago
control-type-gallery.php
4 years ago
control-type-hover.php
4 years ago
control-type-icons.php
4 years ago
control-type-image-dimensions.php
4 years ago
control-type-image-size.php
4 years ago
control-type-input.php
4 years ago
control-type-media.php
4 years ago
control-type-number.php
4 years ago
control-type-select.php
4 years ago
control-type-select2.php
4 years ago
control-type-slider.php
4 years ago
control-type-switch.php
4 years ago
control-type-text-area.php
4 years ago
control-type-text-shadow.php
4 years ago
control-type-typography.php
4 years ago
control-type-url.php
4 years ago
control-type-wys.php
4 years ago
ct-base.php
4 years ago
ct-contract.php
4 years ago
ct-factory.php
4 years ago
widget-writer.php
1 week ago
ct-factory.php
113 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Modules\Widget_Builder\Controls; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class CT_Factory { |
| 8 | |
| 9 | public function make( $type, $domain, $group = 'single' ) { |
| 10 | |
| 11 | if ( $group == 'single' ) { |
| 12 | |
| 13 | switch ( $type ) { |
| 14 | |
| 15 | case 'TextControl': |
| 16 | return new Control_Type_Input( $domain ); |
| 17 | |
| 18 | case 'NumberControl': |
| 19 | return new Control_Type_Number( $domain ); |
| 20 | |
| 21 | case 'UrlControl': |
| 22 | return new Control_Type_URL( $domain ); |
| 23 | |
| 24 | case 'TextareaControl': |
| 25 | return new Control_Type_Text_Area( $domain ); |
| 26 | |
| 27 | case 'SelectControl': |
| 28 | return new Control_Type_Select( $domain ); |
| 29 | |
| 30 | case 'Select2Control': |
| 31 | return new Control_Type_Select2( $domain ); |
| 32 | |
| 33 | case 'CodeControl': |
| 34 | return new Control_Type_Code( $domain ); |
| 35 | |
| 36 | case 'SwitcherControl': |
| 37 | return new Control_Type_Switch( $domain ); |
| 38 | |
| 39 | case 'ChooseControl': |
| 40 | return new Control_Type_Choose( $domain ); |
| 41 | |
| 42 | case 'ColorControl': |
| 43 | return new Control_Type_Color( $domain ); |
| 44 | |
| 45 | case 'EntranceAnimationControl': |
| 46 | return new Control_Type_Animation( $domain ); |
| 47 | |
| 48 | case 'HoverAnimationControl': |
| 49 | return new Control_Type_Animation( $domain ); |
| 50 | |
| 51 | case 'DateTimeControl': |
| 52 | return new Control_Type_Date_Time( $domain ); |
| 53 | |
| 54 | case 'FontControl': |
| 55 | return new Control_Type_Font( $domain ); |
| 56 | |
| 57 | case 'GalleryControl': |
| 58 | return new Control_Type_Gallery( $domain ); |
| 59 | |
| 60 | case 'SliderControl': |
| 61 | return new Control_Type_Slider( $domain ); |
| 62 | |
| 63 | case 'IconsControl': |
| 64 | return new Control_Type_Icons( $domain ); |
| 65 | |
| 66 | case 'MediaControl': |
| 67 | return new Control_Type_Media( $domain ); |
| 68 | |
| 69 | case 'WysiwygControl': |
| 70 | return new Control_Type_Wys( $domain ); |
| 71 | |
| 72 | case 'DimensionsControl': |
| 73 | return new Control_Type_Dimensions( $domain ); |
| 74 | |
| 75 | case 'ImageDimensionsControl': |
| 76 | return new Control_Type_Image_Dimensions( $domain ); |
| 77 | |
| 78 | default: |
| 79 | return new Control_Type_Input( $domain ); |
| 80 | } |
| 81 | } elseif ( $group == 'group' ) { |
| 82 | |
| 83 | switch ( $type ) { |
| 84 | |
| 85 | case 'BackgroundControl': |
| 86 | return new Control_Type_Background( $domain ); |
| 87 | |
| 88 | case 'BorderControl': |
| 89 | return new Control_Type_Border( $domain ); |
| 90 | |
| 91 | case 'TextShadowControl': |
| 92 | return new Control_Type_Text_Shadow( $domain ); |
| 93 | |
| 94 | case 'BoxShadowControl': |
| 95 | return new Control_Type_Box_Shadow( $domain ); |
| 96 | |
| 97 | case 'TypographyControl': |
| 98 | return new Control_Type_Typography( $domain ); |
| 99 | |
| 100 | case 'ImageSizeControl': |
| 101 | return new Control_Type_Image_Size( $domain ); |
| 102 | |
| 103 | default: |
| 104 | return new Control_Type_Border( $domain ); |
| 105 | } |
| 106 | } elseif ( $group == 'responsive' ) { |
| 107 | |
| 108 | } |
| 109 | |
| 110 | return new Control_Type_Input( $domain ); |
| 111 | } |
| 112 | } |
| 113 |