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
SelectType.php
72 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\FieldTypeOption; |
| 7 | use WPDesk\FCF\Free\Settings\Option\OptionInterface; |
| 8 | use WPDesk\FCF\Free\Settings\Tab\GeneralTab; |
| 9 | |
| 10 | /** |
| 11 | * {@inheritdoc} |
| 12 | */ |
| 13 | class SelectType extends DefaultType implements TypeInterface { |
| 14 | |
| 15 | const FIELD_TYPE = 'select'; |
| 16 | |
| 17 | /** |
| 18 | * {@inheritdoc} |
| 19 | */ |
| 20 | public function get_field_type(): string { |
| 21 | return self::FIELD_TYPE; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * {@inheritdoc} |
| 26 | */ |
| 27 | public function get_field_type_label(): string { |
| 28 | return __( 'Select', 'flexible-checkout-fields' ); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * {@inheritdoc} |
| 33 | */ |
| 34 | public function get_field_group(): string { |
| 35 | return Types::FIELD_GROUP_OPTION; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * {@inheritdoc} |
| 40 | */ |
| 41 | public function get_field_type_icon(): string { |
| 42 | return 'icon-tasks-alt'; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * {@inheritdoc} |
| 47 | */ |
| 48 | public function is_hidden(): bool { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * {@inheritdoc} |
| 54 | */ |
| 55 | public function is_available(): bool { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Returns list of options for field settings. |
| 61 | * |
| 62 | * @return OptionInterface[] List of option fields. |
| 63 | */ |
| 64 | public function get_options_objects(): array { |
| 65 | $options = parent::get_options_objects(); |
| 66 | |
| 67 | $options[ GeneralTab::TAB_NAME ][ FieldTypeOption::FIELD_NAME ] = new FieldTypeOption(); |
| 68 | |
| 69 | return $options; |
| 70 | } |
| 71 | } |
| 72 |