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
CheckboxType.php
100 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\FieldTypeOption; |
| 12 | use WPDesk\FCF\Free\Settings\Option\FormattingOption; |
| 13 | use WPDesk\FCF\Free\Settings\Option\LabelOption; |
| 14 | use WPDesk\FCF\Free\Settings\Option\LogicAdvOption; |
| 15 | use WPDesk\FCF\Free\Settings\Option\NameOption; |
| 16 | use WPDesk\FCF\Free\Settings\Option\PlaceholderCheckboxOption; |
| 17 | use WPDesk\FCF\Free\Settings\Option\PricingAdvOption; |
| 18 | use WPDesk\FCF\Free\Settings\Option\PriorityOption; |
| 19 | use WPDesk\FCF\Free\Settings\Option\RequiredOption; |
| 20 | use WPDesk\FCF\Free\Settings\Tab\AppearanceTab; |
| 21 | use WPDesk\FCF\Free\Settings\Tab\DisplayTab; |
| 22 | use WPDesk\FCF\Free\Settings\Tab\GeneralTab; |
| 23 | use WPDesk\FCF\Free\Settings\Tab\LogicTab; |
| 24 | use WPDesk\FCF\Free\Settings\Tab\PricingTab; |
| 25 | |
| 26 | /** |
| 27 | * {@inheritdoc} |
| 28 | */ |
| 29 | class CheckboxType extends TypeAbstract { |
| 30 | |
| 31 | const FIELD_TYPE = 'inspirecheckbox'; |
| 32 | |
| 33 | /** |
| 34 | * {@inheritdoc} |
| 35 | */ |
| 36 | public function get_field_type(): string { |
| 37 | return self::FIELD_TYPE; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * {@inheritdoc} |
| 42 | */ |
| 43 | public function get_field_type_label(): string { |
| 44 | return __( 'Checkbox', 'flexible-checkout-fields' ); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * {@inheritdoc} |
| 49 | */ |
| 50 | public function get_field_group(): string { |
| 51 | return Types::FIELD_GROUP_OPTION; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * {@inheritdoc} |
| 56 | */ |
| 57 | public function get_field_type_icon(): string { |
| 58 | return 'icon-check-square'; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * {@inheritdoc} |
| 63 | */ |
| 64 | public function is_available(): bool { |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * {@inheritdoc} |
| 70 | */ |
| 71 | public function get_options_objects(): array { |
| 72 | return [ |
| 73 | GeneralTab::TAB_NAME => [ |
| 74 | PriorityOption::FIELD_NAME => new PriorityOption(), |
| 75 | FieldTypeOption::FIELD_NAME => new FieldTypeOption(), |
| 76 | CustomFieldOption::FIELD_NAME => new CustomFieldOption(), |
| 77 | EnabledOption::FIELD_NAME => new EnabledOption(), |
| 78 | RequiredOption::FIELD_NAME => new RequiredOption(), |
| 79 | LabelOption::FIELD_NAME => new LabelOption(), |
| 80 | PlaceholderCheckboxOption::FIELD_NAME => new PlaceholderCheckboxOption(), |
| 81 | DefaultOption::FIELD_NAME => new DefaultOption(), |
| 82 | NameOption::FIELD_NAME => new NameOption(), |
| 83 | ], |
| 84 | AppearanceTab::TAB_NAME => [ |
| 85 | CssOption::FIELD_NAME => new CssOption(), |
| 86 | ], |
| 87 | DisplayTab::TAB_NAME => [ |
| 88 | DisplayOnOption::FIELD_NAME => new DisplayOnOption(), |
| 89 | FormattingOption::FIELD_NAME => new FormattingOption(), |
| 90 | ], |
| 91 | LogicTab::TAB_NAME => [ |
| 92 | LogicAdvOption::FIELD_NAME => new LogicAdvOption(), |
| 93 | ], |
| 94 | PricingTab::TAB_NAME => [ |
| 95 | PricingAdvOption::FIELD_NAME => new PricingAdvOption(), |
| 96 | ], |
| 97 | ]; |
| 98 | } |
| 99 | } |
| 100 |