Wc
1 week ago
CheckboxDefaultType.php
1 week ago
CheckboxType.php
1 week ago
ColorType.php
1 week ago
DateType.php
1 week ago
DefaultType.php
1 week ago
EmailType.php
1 week ago
FileType.php
1 week ago
HeadingType.php
1 week ago
HiddenType.php
1 week ago
HtmlType.php
1 week ago
ImageType.php
1 week ago
MultiCheckboxType.php
1 week ago
MultiSelectType.php
1 week ago
NumberType.php
1 week ago
ParagraphType.php
1 week ago
PhoneType.php
1 week ago
RadioColorsType.php
1 week ago
RadioDefaultType.php
1 week ago
RadioImagesType.php
1 week ago
RadioType.php
1 week ago
SelectType.php
1 week ago
TextType.php
1 week ago
TextareaType.php
1 week ago
TimeType.php
1 week ago
TypeAbstract.php
1 week ago
TypeIntegration.php
1 week ago
TypeInterface.php
1 week ago
UrlType.php
1 week ago
TextType.php
114 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPDesk\FCF\Free\Field\Type; |
| 4 | |
| 5 | use WPDesk\FCF\Free\Field\Types; |
| 6 | use WPDesk\FCF\Free\Settings\Option\CssOption; |
| 7 | use WPDesk\FCF\Free\Settings\Option\CustomFieldOption; |
| 8 | use WPDesk\FCF\Free\Settings\Option\DefaultOption; |
| 9 | use WPDesk\FCF\Free\Settings\Option\DisplayOnOption; |
| 10 | use WPDesk\FCF\Free\Settings\Option\EnabledOption; |
| 11 | use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption; |
| 12 | use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption; |
| 13 | use WPDesk\FCF\Free\Settings\Option\FieldTypeOption; |
| 14 | use WPDesk\FCF\Free\Settings\Option\FormattingOption; |
| 15 | use WPDesk\FCF\Free\Settings\Option\LabelOption; |
| 16 | use WPDesk\FCF\Free\Settings\Option\LogicAdvOption; |
| 17 | use WPDesk\FCF\Free\Settings\Option\NameOption; |
| 18 | use WPDesk\FCF\Free\Settings\Option\OptionInterface; |
| 19 | use WPDesk\FCF\Free\Settings\Option\PlaceholderOption; |
| 20 | use WPDesk\FCF\Free\Settings\Option\PricingAdvOption; |
| 21 | use WPDesk\FCF\Free\Settings\Option\PriorityOption; |
| 22 | use WPDesk\FCF\Free\Settings\Option\RequiredOption; |
| 23 | use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption; |
| 24 | use WPDesk\FCF\Free\Settings\Option\ValidationWcOption; |
| 25 | use WPDesk\FCF\Free\Settings\Tab\AdvancedTab; |
| 26 | use WPDesk\FCF\Free\Settings\Tab\AppearanceTab; |
| 27 | use WPDesk\FCF\Free\Settings\Tab\DisplayTab; |
| 28 | use WPDesk\FCF\Free\Settings\Tab\GeneralTab; |
| 29 | use WPDesk\FCF\Free\Settings\Tab\LogicTab; |
| 30 | use WPDesk\FCF\Free\Settings\Tab\PricingTab; |
| 31 | |
| 32 | /** |
| 33 | * {@inheritdoc} |
| 34 | */ |
| 35 | class TextType extends TypeAbstract { |
| 36 | |
| 37 | const FIELD_TYPE = 'text'; |
| 38 | |
| 39 | /** |
| 40 | * {@inheritdoc} |
| 41 | */ |
| 42 | public function get_field_type(): string { |
| 43 | return self::FIELD_TYPE; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * {@inheritdoc} |
| 48 | */ |
| 49 | public function get_field_type_label(): string { |
| 50 | return __( 'Text', 'flexible-checkout-fields' ); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * {@inheritdoc} |
| 55 | */ |
| 56 | public function get_field_group(): string { |
| 57 | return Types::FIELD_GROUP_TEXT; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * {@inheritdoc} |
| 62 | */ |
| 63 | public function get_field_type_icon(): string { |
| 64 | return 'icon-font'; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * {@inheritdoc} |
| 69 | */ |
| 70 | public function is_available(): bool { |
| 71 | return true; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Returns list of options for field settings. |
| 76 | * |
| 77 | * @return OptionInterface[] List of option fields. |
| 78 | */ |
| 79 | public function get_options_objects(): array { |
| 80 | return [ |
| 81 | GeneralTab::TAB_NAME => [ |
| 82 | ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(), |
| 83 | PriorityOption::FIELD_NAME => new PriorityOption(), |
| 84 | FieldTypeOption::FIELD_NAME => new FieldTypeOption(), |
| 85 | EnabledOption::FIELD_NAME => new EnabledOption(), |
| 86 | CustomFieldOption::FIELD_NAME => new CustomFieldOption(), |
| 87 | ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(), |
| 88 | RequiredOption::FIELD_NAME => new RequiredOption(), |
| 89 | LabelOption::FIELD_NAME => new LabelOption(), |
| 90 | DefaultOption::FIELD_NAME => new DefaultOption(), |
| 91 | NameOption::FIELD_NAME => new NameOption(), |
| 92 | ], |
| 93 | AdvancedTab::TAB_NAME => [ |
| 94 | ValidationWcOption::FIELD_NAME => new ValidationWcOption(), |
| 95 | ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(), |
| 96 | ], |
| 97 | AppearanceTab::TAB_NAME => [ |
| 98 | PlaceholderOption::FIELD_NAME => new PlaceholderOption(), |
| 99 | CssOption::FIELD_NAME => new CssOption(), |
| 100 | ], |
| 101 | DisplayTab::TAB_NAME => [ |
| 102 | DisplayOnOption::FIELD_NAME => new DisplayOnOption(), |
| 103 | FormattingOption::FIELD_NAME => new FormattingOption(), |
| 104 | ], |
| 105 | LogicTab::TAB_NAME => [ |
| 106 | LogicAdvOption::FIELD_NAME => new LogicAdvOption(), |
| 107 | ], |
| 108 | PricingTab::TAB_NAME => [ |
| 109 | PricingAdvOption::FIELD_NAME => new PricingAdvOption(), |
| 110 | ], |
| 111 | ]; |
| 112 | } |
| 113 | } |
| 114 |