first commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\DefaultType;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
|
||||
/**
|
||||
* Generates field data based on options for field type.
|
||||
*/
|
||||
class FieldData {
|
||||
|
||||
/**
|
||||
* Returns parsed data for field.
|
||||
*
|
||||
* @param array $field_settings Settings of field.
|
||||
* @param bool $is_decode Is it decoding (used saved settings) data instead of encoding (for settings save).
|
||||
*
|
||||
* @return array Data of field.
|
||||
*/
|
||||
public static function get_field_data( array $field_settings, bool $is_decode = true ): array {
|
||||
$field_data = [];
|
||||
$option_objects = self::get_field_options( $field_settings );
|
||||
|
||||
if ( ! $option_objects ) {
|
||||
return $field_data;
|
||||
}
|
||||
|
||||
$field_data['name'] = $field_settings['name'];
|
||||
foreach ( $option_objects as $field_option ) {
|
||||
$field_data = $field_option[ ( $is_decode ) ? 'update_field_callback' : 'save_field_callback' ](
|
||||
$field_data,
|
||||
$field_settings
|
||||
);
|
||||
}
|
||||
return $field_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of option objects.
|
||||
*
|
||||
* @param array $field_settings Settings of field.
|
||||
*
|
||||
* @return OptionInterface[] List of options.
|
||||
*/
|
||||
public static function get_field_options( array $field_settings ): array {
|
||||
$field_types = apply_filters( 'flexible_checkout_fields/field_types', [] );
|
||||
foreach ( $field_types as $field_type ) {
|
||||
if ( in_array( $field_settings['name'], $field_type['reserved_field_names'], true ) ) {
|
||||
return $field_type['options'];
|
||||
}
|
||||
}
|
||||
foreach ( $field_types as $field_type ) {
|
||||
if ( isset( $field_settings['type'] ) && ( $field_settings['type'] === $field_type['type'] ) ) {
|
||||
return $field_type['options'];
|
||||
}
|
||||
}
|
||||
return $field_types[ DefaultType::FIELD_TYPE ]['options'] ?? [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field;
|
||||
|
||||
use FcfVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
||||
use WPDesk\FCF\Free\Exception\TemplateLoadingFailed;
|
||||
use WPDesk\FCF\Free\Service\TemplateLoader;
|
||||
use WPDesk\FCF\Free\Settings\Form\EditFieldsForm;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
|
||||
/**
|
||||
* .
|
||||
*/
|
||||
class FieldTemplateLoader implements Hookable {
|
||||
|
||||
/**
|
||||
* @var TemplateLoader
|
||||
*/
|
||||
private $template_loader;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
public function __construct( TemplateLoader $template_loader ) {
|
||||
$this->template_loader = $template_loader;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hooks() {
|
||||
add_filter( 'woocommerce_form_field', [ $this, 'load_field_template' ], 999, 4 );
|
||||
add_filter( 'flexible_checkout_fields_form_field', [ $this, 'load_field_template' ], 10, 4 );
|
||||
add_filter( 'woocommerce_form_field_args', [ $this, 'load_default_field_args' ], 10, 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $output HTML output.
|
||||
* @param string $key Field name.
|
||||
* @param array $args Fields args.
|
||||
* @param mixed $value .
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws TemplateLoadingFailed
|
||||
* @internal
|
||||
*/
|
||||
public function load_field_template( $output, $key, $args, $value ) {
|
||||
if ( ! isset( $args[ CustomFieldOption::FIELD_NAME ] ) || ! $args[ CustomFieldOption::FIELD_NAME ] ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
$field_data = $this->get_field_data( $key );
|
||||
if ( $field_data === null ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
$field_type = $args[ FieldTypeOption::FIELD_NAME ];
|
||||
$field_types = apply_filters( 'flexible_checkout_fields/field_types', [] );
|
||||
if ( ! isset( $field_types[ $field_type ] ) || ! $field_types[ $field_type ]['is_available'] ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
remove_filter( 'woocommerce_form_field', [ $this, 'load_field_template' ], 999 );
|
||||
|
||||
$output = $this->template_loader->load_template(
|
||||
'fields/' . $field_type,
|
||||
[
|
||||
'args' => apply_filters( 'flexible_checkout_fields_field_args', $field_data, $key ),
|
||||
'key' => $key,
|
||||
'value' => $value,
|
||||
'custom_attributes' => apply_filters( 'flexible_checkout_fields_custom_attributes', [], $field_data ),
|
||||
]
|
||||
);
|
||||
|
||||
add_filter( 'woocommerce_form_field', [ $this, 'load_field_template' ], 999, 4 );
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $field_name .
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
private function get_field_data( string $field_name ) {
|
||||
$fields_settings = get_option( EditFieldsForm::SETTINGS_OPTION_NAME, [] );
|
||||
|
||||
foreach ( $fields_settings as $group_name => $fields ) {
|
||||
foreach ( $fields as $field_id => $field_data ) {
|
||||
if ( $field_id === $field_name ) {
|
||||
return $field_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $args .
|
||||
*
|
||||
* @return array
|
||||
* @internal
|
||||
*/
|
||||
public function load_default_field_args( $args ) {
|
||||
if ( ! isset( $args[ CustomFieldOption::FIELD_NAME ] ) || ! $args[ CustomFieldOption::FIELD_NAME ] ) {
|
||||
return $args;
|
||||
}
|
||||
|
||||
$args['options'] = [];
|
||||
return $args;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field;
|
||||
|
||||
use FcfVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
||||
|
||||
/**
|
||||
* Supports translating field settings via external plugins.
|
||||
*/
|
||||
class FieldTranslator implements Hookable {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hooks() {
|
||||
add_filter( 'flexible_checkout_fields_field_args', [ $this, 'translate_field' ], 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $field_data .
|
||||
* @param string $field_name .
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function translate_field( $field_data, $field_name ) {
|
||||
if ( isset( $field_data['label'] ) ) {
|
||||
$field_data['label'] = wpdesk__( $field_data['label'], 'flexible-checkout-fields' );
|
||||
}
|
||||
if ( isset( $field_data['placeholder'] ) ) {
|
||||
$field_data['placeholder'] = wpdesk__( $field_data['placeholder'], 'flexible-checkout-fields' );
|
||||
}
|
||||
if ( isset( $field_data['default'] ) ) {
|
||||
$field_data['default'] = wpdesk__( $field_data['default'], 'flexible-checkout-fields' );
|
||||
}
|
||||
if ( isset( $field_data['options'] ) ) {
|
||||
foreach ( $field_data['options'] as $option_index => $option ) {
|
||||
$field_data['options'][ $option_index ]['value'] = wpdesk__( $option['value'], 'flexible-checkout-fields' );
|
||||
}
|
||||
}
|
||||
|
||||
return $field_data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class CheckboxDefaultType extends DefaultType implements TypeInterface {
|
||||
|
||||
const FIELD_TYPE = 'checkbox';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
$options = parent::get_options_objects();
|
||||
|
||||
$options[ GeneralTab::TAB_NAME ][ FieldTypeOption::FIELD_NAME ] = new FieldTypeOption();
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DefaultOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderCheckboxOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class CheckboxType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'inspirecheckbox';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Checkbox', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-check-square';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
PlaceholderCheckboxOption::FIELD_NAME => new PlaceholderCheckboxOption(),
|
||||
DefaultOption::FIELD_NAME => new DefaultOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DefaultOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class ColorType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'colorpicker';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Color', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_PICKER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-paint-brush';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
DefaultOption::FIELD_NAME => new DefaultOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class DateType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'datepicker';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Date', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_PICKER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-calendar-alt';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldDisabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeDefaultOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class DefaultType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'fcf_default';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeDefaultOption::FIELD_NAME => new FieldTypeDefaultOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldDisabledOption::FIELD_NAME => new CustomFieldDisabledOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class EmailType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'email';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'E-mail', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-at-email';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class FileType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'file';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'File Upload', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_PICKER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-upload';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class HeadingType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'heading';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Heading', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-heading';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredHiddenOption::FIELD_NAME => new RequiredHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class HiddenType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'hidden';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Hidden', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-eye-slash';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class HtmlType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'info';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'HTML', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-code';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredHiddenOption::FIELD_NAME => new RequiredHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ImageOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ImageWidthOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class ImageType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'image';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Image', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-image';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredHiddenOption::FIELD_NAME => new RequiredHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
ImageOption::FIELD_NAME => new ImageOption(),
|
||||
ImageWidthOption::FIELD_NAME => new ImageWidthOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class MultiCheckboxType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'multicheckbox';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Multi-checkbox', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-check-square-multi';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class MultiSelectType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wpdeskmultiselect';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Multi-select', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-tasks';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValueMaxOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValueMinOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValueStepOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class NumberType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'number';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Number', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-digits';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValueMinOption::FIELD_NAME => new ValueMinOption(),
|
||||
ValueMaxOption::FIELD_NAME => new ValueMaxOption(),
|
||||
ValueStepOption::FIELD_NAME => new ValueStepOption(),
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class ParagraphType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'paragraph';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Paragraph', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-paragraph';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredHiddenOption::FIELD_NAME => new RequiredHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RegexMessageOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RegexPhoneOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class PhoneType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'phone';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Phone', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-phone';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
RegexPhoneOption::FIELD_NAME => new RegexPhoneOption(),
|
||||
RegexMessageOption::FIELD_NAME => new RegexMessageOption(),
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class RadioColorsType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'radiocolors';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Radio with colors', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-palette';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class RadioDefaultType extends DefaultType implements TypeInterface {
|
||||
|
||||
const FIELD_TYPE = 'radio';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
$options = parent::get_options_objects();
|
||||
|
||||
$options[ GeneralTab::TAB_NAME ][ FieldTypeOption::FIELD_NAME ] = new FieldTypeOption();
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class RadioImagesType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'radioimages';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Radio with images', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-images';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class RadioType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'inspireradio';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Radio', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-list-ul';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class SelectType extends DefaultType implements TypeInterface {
|
||||
|
||||
const FIELD_TYPE = 'select';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Select', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_OPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-tasks-alt';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
$options = parent::get_options_objects();
|
||||
|
||||
$options[ GeneralTab::TAB_NAME ][ FieldTypeOption::FIELD_NAME ] = new FieldTypeOption();
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DefaultOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class TextType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'text';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Text', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-font';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
DefaultOption::FIELD_NAME => new DefaultOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DefaultOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class TextareaType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'textarea';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Textarea', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-align-left';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
DefaultOption::FIELD_NAME => new DefaultOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class TimeType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'timepicker';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'Time', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_PICKER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-clock';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionIntegration;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
abstract class TypeAbstract implements TypeInterface {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_raw_field_type(): string {
|
||||
return $this->get_field_type();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_options(): array {
|
||||
$options = [];
|
||||
foreach ( $this->get_options_objects() as $option_objects ) {
|
||||
foreach ( $option_objects as $option_object ) {
|
||||
$options[] = ( new OptionIntegration( $option_object ) )->get_field_settings();
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
/**
|
||||
* Initializes integration for REST API route.
|
||||
*/
|
||||
class TypeIntegration {
|
||||
|
||||
/**
|
||||
* Class object for field type.
|
||||
*
|
||||
* @var TypeInterface
|
||||
*/
|
||||
private $type_object;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param TypeInterface $type_object Class object of field type.
|
||||
*/
|
||||
public function __construct( TypeInterface $type_object ) {
|
||||
$this->type_object = $type_object;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hooks() {
|
||||
add_filter( 'flexible_checkout_fields/field_types', [ $this, 'add_field_type' ], 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds new field type with settings of field type.
|
||||
*
|
||||
* @param array $types List of field types.
|
||||
*
|
||||
* @return array Updated list of field types.
|
||||
* @internal
|
||||
*/
|
||||
public function add_field_type( array $types ): array {
|
||||
$field_type = $this->type_object->get_field_type();
|
||||
$types[ $field_type ] = $this->get_field_type_settings();
|
||||
return $types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of settings for field type.
|
||||
*
|
||||
* @return array Settings of field type.
|
||||
*/
|
||||
private function get_field_type_settings(): array {
|
||||
return [
|
||||
'type' => $this->type_object->get_field_type(),
|
||||
'field_group' => $this->type_object->get_field_group(),
|
||||
'reserved_field_names' => $this->type_object->get_reserved_field_names(),
|
||||
'label' => $this->type_object->get_field_type_label(),
|
||||
'icon' => $this->type_object->get_field_type_icon(),
|
||||
'is_hidden' => $this->type_object->is_hidden(),
|
||||
'is_available' => $this->type_object->is_available(),
|
||||
'options' => $this->type_object->get_options(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
|
||||
/**
|
||||
* Interface of field type.
|
||||
*/
|
||||
interface TypeInterface {
|
||||
|
||||
/**
|
||||
* Returns value of field type.
|
||||
*
|
||||
* @return string Field type.
|
||||
*/
|
||||
public function get_field_type(): string;
|
||||
|
||||
/**
|
||||
* Returns value of field type used in HTML.
|
||||
*
|
||||
* @return string Field type.
|
||||
*/
|
||||
public function get_raw_field_type(): string;
|
||||
|
||||
/**
|
||||
* Returns reserved field names, overriding this field type for selected field names.
|
||||
*
|
||||
* @return array Field names.
|
||||
*/
|
||||
public function get_reserved_field_names(): array;
|
||||
|
||||
/**
|
||||
* Returns label of field type.
|
||||
*
|
||||
* @return string Field label.
|
||||
*/
|
||||
public function get_field_type_label(): string;
|
||||
|
||||
/**
|
||||
* Returns key of field group.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function get_field_group();
|
||||
|
||||
/**
|
||||
* Returns field icon as CSS Class supported by Icomoon.
|
||||
*
|
||||
* @return string Field icon.
|
||||
*/
|
||||
public function get_field_type_icon(): string;
|
||||
|
||||
/**
|
||||
* Returns whether field type is hidden.
|
||||
*
|
||||
* @return bool Status if field type is hidden.
|
||||
*/
|
||||
public function is_hidden(): bool;
|
||||
|
||||
/**
|
||||
* Returns whether field type is available for plugin version.
|
||||
*
|
||||
* @return bool Status if field type is available.
|
||||
*/
|
||||
public function is_available(): bool;
|
||||
|
||||
/**
|
||||
* Returns list of options objects for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of field options objects.
|
||||
*/
|
||||
public function get_options_objects(): array;
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return array List of field options.
|
||||
*/
|
||||
public function get_options(): array;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Types;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\CustomFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ExternalFieldOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FieldTypeOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PricingAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\PricingTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class UrlType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'url';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'URL', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_group(): string {
|
||||
return Types::FIELD_GROUP_TEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_icon(): string {
|
||||
return 'icon-link';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
ExternalFieldInfoOption::FIELD_NAME => new ExternalFieldInfoOption(),
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
FieldTypeOption::FIELD_NAME => new FieldTypeOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
CustomFieldOption::FIELD_NAME => new CustomFieldOption(),
|
||||
ExternalFieldOption::FIELD_NAME => new ExternalFieldOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationOption::FIELD_NAME => new ValidationOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingOption::FIELD_NAME => new FormattingOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
PricingTab::TAB_NAME => [
|
||||
PricingAdvOption::FIELD_NAME => new PricingAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOptionallyOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcAddress2Type extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_address2';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_address_2',
|
||||
'shipping_address_2',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOptionallyOption::FIELD_NAME => new LabelOptionallyOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOnlyAddressOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcContactType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_contact';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_phone',
|
||||
'billing_email',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOnlyAddressOption::FIELD_NAME => new DisplayOnOnlyAddressOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredWcHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcCountryType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_country';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_country',
|
||||
'shipping_country',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredWcHiddenOption::FIELD_NAME => new RequiredWcHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcDefaultType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_text';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_first_name',
|
||||
'billing_last_name',
|
||||
'billing_company',
|
||||
'billing_address_1',
|
||||
'billing_city',
|
||||
'shipping_first_name',
|
||||
'shipping_last_name',
|
||||
'shipping_company',
|
||||
'shipping_address_1',
|
||||
'shipping_city',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnWithoutAddressOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LogicAdvOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\LogicTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcNotesType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_notes';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'order_comments',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredOption::FIELD_NAME => new RequiredOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnWithoutAddressOption::FIELD_NAME => new DisplayOnWithoutAddressOption(),
|
||||
],
|
||||
LogicTab::TAB_NAME => [
|
||||
LogicAdvOption::FIELD_NAME => new LogicAdvOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PlaceholderOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredWcHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationPostcodeOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcPostcodeType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_postcode';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_postcode',
|
||||
'shipping_postcode',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredWcHiddenOption::FIELD_NAME => new RequiredWcHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationPostcodeOption::FIELD_NAME => new ValidationPostcodeOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
PlaceholderOption::FIELD_NAME => new PlaceholderOption(),
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field\Type\Wc;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\TypeAbstract;
|
||||
use WPDesk\FCF\Free\Settings\Option\CssOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\DisplayOnOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\EnabledOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingStateOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\FormattingWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\LabelOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\NameOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\OptionInterface;
|
||||
use WPDesk\FCF\Free\Settings\Option\PriorityOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\RequiredWcHiddenOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationInfoOption;
|
||||
use WPDesk\FCF\Free\Settings\Option\ValidationWcOption;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AdvancedTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\AppearanceTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\DisplayTab;
|
||||
use WPDesk\FCF\Free\Settings\Tab\GeneralTab;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
class WcStateType extends TypeAbstract {
|
||||
|
||||
const FIELD_TYPE = 'wc_state';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type(): string {
|
||||
return self::FIELD_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_field_type_label(): string {
|
||||
return __( 'WooCommerce Default Field', 'flexible-checkout-fields' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_reserved_field_names(): array {
|
||||
return [
|
||||
'billing_state',
|
||||
'shipping_state',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_hidden(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of options for field settings.
|
||||
*
|
||||
* @return OptionInterface[] List of option fields.
|
||||
*/
|
||||
public function get_options_objects(): array {
|
||||
return [
|
||||
GeneralTab::TAB_NAME => [
|
||||
PriorityOption::FIELD_NAME => new PriorityOption(),
|
||||
EnabledOption::FIELD_NAME => new EnabledOption(),
|
||||
RequiredWcHiddenOption::FIELD_NAME => new RequiredWcHiddenOption(),
|
||||
LabelOption::FIELD_NAME => new LabelOption(),
|
||||
NameOption::FIELD_NAME => new NameOption(),
|
||||
],
|
||||
AdvancedTab::TAB_NAME => [
|
||||
ValidationWcOption::FIELD_NAME => new ValidationWcOption(),
|
||||
ValidationInfoOption::FIELD_NAME => new ValidationInfoOption(),
|
||||
],
|
||||
AppearanceTab::TAB_NAME => [
|
||||
CssOption::FIELD_NAME => new CssOption(),
|
||||
],
|
||||
DisplayTab::TAB_NAME => [
|
||||
DisplayOnOption::FIELD_NAME => new DisplayOnOption(),
|
||||
FormattingWcOption::FIELD_NAME => new FormattingWcOption(),
|
||||
FormattingStateOption::FIELD_NAME => new FormattingStateOption(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace WPDesk\FCF\Free\Field;
|
||||
|
||||
use WPDesk\FCF\Free\Field\Type\CheckboxDefaultType;
|
||||
use WPDesk\FCF\Free\Field\Type\CheckboxType;
|
||||
use WPDesk\FCF\Free\Field\Type\ColorType;
|
||||
use WPDesk\FCF\Free\Field\Type\DateType;
|
||||
use WPDesk\FCF\Free\Field\Type\DefaultType;
|
||||
use WPDesk\FCF\Free\Field\Type\EmailType;
|
||||
use WPDesk\FCF\Free\Field\Type\FileType;
|
||||
use WPDesk\FCF\Free\Field\Type\HeadingType;
|
||||
use WPDesk\FCF\Free\Field\Type\HiddenType;
|
||||
use WPDesk\FCF\Free\Field\Type\HtmlType;
|
||||
use WPDesk\FCF\Free\Field\Type\ImageType;
|
||||
use WPDesk\FCF\Free\Field\Type\MultiCheckboxType;
|
||||
use WPDesk\FCF\Free\Field\Type\MultiSelectType;
|
||||
use WPDesk\FCF\Free\Field\Type\NumberType;
|
||||
use WPDesk\FCF\Free\Field\Type\ParagraphType;
|
||||
use WPDesk\FCF\Free\Field\Type\PhoneType;
|
||||
use WPDesk\FCF\Free\Field\Type\RadioColorsType;
|
||||
use WPDesk\FCF\Free\Field\Type\RadioDefaultType;
|
||||
use WPDesk\FCF\Free\Field\Type\RadioImagesType;
|
||||
use WPDesk\FCF\Free\Field\Type\RadioType;
|
||||
use WPDesk\FCF\Free\Field\Type\SelectType;
|
||||
use WPDesk\FCF\Free\Field\Type\TextareaType;
|
||||
use WPDesk\FCF\Free\Field\Type\TextType;
|
||||
use WPDesk\FCF\Free\Field\Type\TimeType;
|
||||
use WPDesk\FCF\Free\Field\Type\TypeIntegration;
|
||||
use WPDesk\FCF\Free\Field\Type\UrlType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcAddress2Type;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcContactType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcCountryType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcDefaultType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcNotesType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcPostcodeType;
|
||||
use WPDesk\FCF\Free\Field\Type\Wc\WcStateType;
|
||||
|
||||
/**
|
||||
* Supports management for field types.
|
||||
*/
|
||||
class Types {
|
||||
|
||||
const FIELD_GROUP_TEXT = 'text';
|
||||
const FIELD_GROUP_OPTION = 'option';
|
||||
const FIELD_GROUP_PICKER = 'picker';
|
||||
const FIELD_GROUP_OTHER = 'other';
|
||||
|
||||
/**
|
||||
* Initializes actions for class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init() {
|
||||
( new TypeIntegration( new TextType() ) )->hooks();
|
||||
( new TypeIntegration( new TextareaType() ) )->hooks();
|
||||
( new TypeIntegration( new NumberType() ) )->hooks();
|
||||
( new TypeIntegration( new EmailType() ) )->hooks();
|
||||
( new TypeIntegration( new PhoneType() ) )->hooks();
|
||||
( new TypeIntegration( new UrlType() ) )->hooks();
|
||||
|
||||
( new TypeIntegration( new CheckboxType() ) )->hooks();
|
||||
( new TypeIntegration( new MultiCheckboxType() ) )->hooks();
|
||||
( new TypeIntegration( new SelectType() ) )->hooks();
|
||||
( new TypeIntegration( new MultiSelectType() ) )->hooks();
|
||||
( new TypeIntegration( new RadioType() ) )->hooks();
|
||||
( new TypeIntegration( new RadioImagesType() ) )->hooks();
|
||||
( new TypeIntegration( new RadioColorsType() ) )->hooks();
|
||||
|
||||
( new TypeIntegration( new ColorType() ) )->hooks();
|
||||
( new TypeIntegration( new DateType() ) )->hooks();
|
||||
( new TypeIntegration( new TimeType() ) )->hooks();
|
||||
( new TypeIntegration( new FileType() ) )->hooks();
|
||||
|
||||
( new TypeIntegration( new HeadingType() ) )->hooks();
|
||||
( new TypeIntegration( new ParagraphType() ) )->hooks();
|
||||
( new TypeIntegration( new ImageType() ) )->hooks();
|
||||
( new TypeIntegration( new HtmlType() ) )->hooks();
|
||||
( new TypeIntegration( new HiddenType() ) )->hooks();
|
||||
|
||||
( new TypeIntegration( new DefaultType() ) )->hooks();
|
||||
( new TypeIntegration( new CheckboxDefaultType() ) )->hooks();
|
||||
( new TypeIntegration( new RadioDefaultType() ) )->hooks();
|
||||
( new TypeIntegration( new WcDefaultType() ) )->hooks();
|
||||
( new TypeIntegration( new WcContactType() ) )->hooks();
|
||||
( new TypeIntegration( new WcAddress2Type() ) )->hooks();
|
||||
( new TypeIntegration( new WcCountryType() ) )->hooks();
|
||||
( new TypeIntegration( new WcPostcodeType() ) )->hooks();
|
||||
( new TypeIntegration( new WcStateType() ) )->hooks();
|
||||
( new TypeIntegration( new WcNotesType() ) )->hooks();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user