[all-fields]'
),
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$site_domain = $this->get_site_domain();
$widget->add_control(
$this->get_control_id('email_from'),
[
'label' => esc_html__('From Email', 'king-addons'),
'type' => Controls_Manager::TEXT,
'description' => esc_html__('Shortcodes such as [id="email"] can be inserted based on the ID of the associated mail field.', 'king-addons'),
'default' => 'email@' . $site_domain,
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$widget->add_control(
$this->get_control_id('email_from_name'),
[
'label' => esc_html__('From Name', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => get_bloginfo('name'),
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$widget->add_control(
$this->get_control_id('email_reply_to'),
[
'label' => esc_html__('Reply To', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => 'email@' . $site_domain,
'render_type' => 'none'
]
);
$widget->add_control(
$this->get_control_id('email_to_cc'),
[
'label' => esc_html__('Cc', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'title' => esc_html__('Separate emails with commas', 'king-addons'),
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$widget->add_control(
$this->get_control_id('email_to_bcc'),
[
'label' => esc_html__('Bcc', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'title' => esc_html__('Separate emails with commas', 'king-addons'),
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$widget->add_control(
$this->get_control_id('form_metadata'),
[
'label' => esc_html__('Meta Data', 'king-addons'),
'type' => Controls_Manager::SELECT2,
'multiple' => true,
'label_block' => true,
'separator' => 'before',
'default' => [
'date',
'time',
'credit'
],
'options' => [
'date' => esc_html__('Date', 'king-addons'),
'time' => esc_html__('Time', 'king-addons'),
'page_url' => esc_html__('Page URL', 'king-addons'),
'page_title' => esc_html__('Page Title', 'king-addons'),
'user_agent' => esc_html__('User Agent', 'king-addons'),
'remote_ip' => esc_html__('Remote IP', 'king-addons'),
'credit' => esc_html__('Credit', 'king-addons'),
],
'render_type' => 'none',
]
);
$widget->add_control(
$this->get_control_id('email_content_type'),
[
'label' => esc_html__('Send As', 'king-addons'),
'type' => Controls_Manager::SELECT,
'default' => 'html',
'render_type' => 'none',
'options' => [
'html' => esc_html__('HTML', 'king-addons'),
'plain' => esc_html__('Plain', 'king-addons'),
],
]
);
$widget->end_controls_section();
}
public function register_settings_section_redirect($widget)
{
$widget->start_controls_section(
'section_redirect',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Redirect', 'king-addons'),
'condition' => [
'submit_actions' => 'redirect',
],
]
);
$widget->add_control(
'redirect_to',
[
'label' => esc_html__('Redirect To', 'king-addons'),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true
],
'placeholder' => esc_html__('https://example.com', 'king-addons'),
'label_block' => true
]
);
$widget->end_controls_section();
}
public function register_settings_section_mailchimp()
{
$this->start_controls_section(
'section_mailchimp',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Mailchimp', 'king-addons'),
'tab' => Controls_Manager::TAB_CONTENT,
'condition' => [
'submit_actions' => 'mailchimp'
]
]
);
$this->add_control(
'mailchimp_audience',
[
'label' => esc_html__('Select Audience', 'king-addons'),
'type' => Controls_Manager::SELECT,
'default' => 'def',
'options' => Core::getMailchimpLists(),
]
);
$this->add_control(
'mailchimp_groups',
[
'label' => esc_html__('Groups', 'king-addons'),
'type' => Controls_Manager::SELECT2,
'multiple' => true,
'options' => Core::getMailchimpGroups(),
'label_block' => true,
]
);
if ('' == get_option('king_addons_mailchimp_api_key')) {
$this->add_control(
'mailchimp_key_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(__('Navigate to Dashboard > %s > Integrations to set up MailChimp API Key.', 'king-addons'), admin_url('admin.php?page=king-addons-settings'), Core::getPluginName()),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
]
);
}
$this->add_control(
'mailchimp_fields',
[
'label' => esc_html__('Fields', 'king-addons'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'email_field',
[
'label' => esc_html__('Email', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'first_name_field',
[
'label' => esc_html__('First Name', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'last_name_field',
[
'label' => esc_html__('Last Name', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'phone_field',
[
'label' => esc_html__('Phone', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'birthday_field',
[
'label' => esc_html__('Birthday', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'address_field',
[
'label' => esc_html__('Address', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'country_field',
[
'label' => esc_html__('Country', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'city_field',
[
'label' => esc_html__('City', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'state_field',
[
'label' => esc_html__('State', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->add_control(
'zip_field',
[
'label' => esc_html__('Zip', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => []
]
);
$this->end_controls_section();
}
public $last_prev_btn_text;
public $last_next_btn_text;
protected function register_controls()
{
$this->start_controls_section(
'section_form_fields',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Fields', 'king-addons'),
]
);
$repeater = new Repeater();
$field_types = [
'text' => esc_html__('Text', 'king-addons'),
'textarea' => esc_html__('Textarea', 'king-addons'),
'email' => esc_html__('Email', 'king-addons'),
'url' => esc_html__('URL (Link)', 'king-addons'),
'number' => esc_html__('Number', 'king-addons'),
'tel' => esc_html__('Tel (Phone Number)', 'king-addons'),
'radio' => esc_html__('Radio', 'king-addons'),
'select' => esc_html__('Select', 'king-addons'),
'checkbox' => esc_html__('Checkbox', 'king-addons'),
'date' => esc_html__('Date', 'king-addons'),
'time' => esc_html__('Time', 'king-addons'),
'upload' => esc_html__('File Upload', 'king-addons'),
'password' => esc_html__('Password', 'king-addons'),
'html' => esc_html__('HTML', 'king-addons'),
'recaptcha-v3' => esc_html__('reCAPTCHA V3', 'king-addons'),
'hidden' => esc_html__('Hidden Field', 'king-addons'),
'king-addons-fb-step' => esc_html__('Step', 'king-addons'),
];
// Range, rating, signature and acceptance: controls and markup live in
// helpers/Extra_Fields.php.
if (class_exists('King_Addons\\Form_Extra_Fields')) {
$field_types = array_merge($field_types, Form_Extra_Fields::field_types());
}
$repeater->add_control(
'field_type',
[
'label' => esc_html__('Type', 'king-addons'),
'type' => Controls_Manager::SELECT,
'options' => $field_types,
'default' => 'text',
]
);
$repeater->add_control(
'field_step_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__('Step should be a First element of fields group. Ex: Step 1 followed by Field 1, Field 2. Step 2 followed by Field 3, Field 4.', 'king-addons'),
'content_classes' => 'elementor-panel-alert',
'condition' => [
'field_type' => 'king-addons-fb-step'
]
]
);
if (class_exists('King_Addons\\Form_Extra_Fields')) {
Form_Extra_Fields::register_controls($repeater);
}
if (class_exists('King_Addons\\Form_Conditional_Logic')) {
Form_Conditional_Logic::register_controls($repeater);
}
if ('' == get_option('king_addons_recaptcha_v3_site_key')) {
$repeater->add_control(
'recaptcha_key_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(__('Navigate to Dashboard > %s > Integrations to set up reCaptcha Site Key.', 'king-addons'), admin_url('admin.php?page=king-addons-settings'), Core::getPluginName()),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
'condition' => [
'field_type' => 'recaptcha-v3'
]
]
);
}
$repeater->add_control(
'field_label',
[
'label' => esc_html__('Label', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'dynamic' => [
'active' => true,
],
]
);
$repeater->add_control(
'field_sub_label',
[
'label' => esc_html__('Sub Label', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'dynamic' => [
'active' => true,
],
'condition' => [
'field_type' => 'king-addons-fb-step'
]
]
);
$repeater->add_control(
'previous_button_text',
[
'label' => esc_html__('Previous Button', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => 'Previous',
'dynamic' => [
'active' => true,
],
'condition' => [
'field_type' => 'king-addons-fb-step'
]
]
);
$repeater->add_control(
'next_button_text',
[
'label' => esc_html__('Next Button', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => 'Next',
'dynamic' => [
'active' => true,
],
'condition' => [
'field_type' => 'king-addons-fb-step'
]
]
);
$repeater->add_control(
'step_icon',
[
'label' => esc_html__('Icon', 'king-addons'),
'type' => Controls_Manager::ICONS,
'skin' => 'inline',
'label_block' => false,
'separator' => 'before',
'default' => [
'value' => 'far fa-edit',
'library' => 'regular'
],
'condition' => [
'field_type' => 'king-addons-fb-step'
]
]
);
$repeater->add_control(
'placeholder',
[
'label' => esc_html__('Placeholder', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => 'in',
'value' => [
'tel',
'text',
'email',
'textarea',
'number',
'url',
'password',
],
],
],
],
'dynamic' => [
'active' => true,
],
]
);
$repeater->add_control(
'field_value',
[
'label' => esc_html__('Default Value', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'dynamic' => [
'active' => true,
],
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => 'in',
'value' => [
'text',
'email',
'textarea',
'url',
'tel',
'radio',
'select',
'number',
'date',
'time',
'hidden',
],
],
],
],
]
);
$repeater->add_control(
'field_id',
[
'label' => esc_html__('ID', 'king-addons'),
'type' => Controls_Manager::TEXT,
'description' => esc_html__('Element ID should be unique and not used elsewhere in this widget.', 'king-addons'),
'default' => '',
'render_type' => 'none',
'required' => true,
'dynamic' => [
'active' => true,
]
]
);
$shortcode_value = '{{ view.container.settings.get( \'field_id\' ) }}';
$repeater->add_control(
'shortcode',
[
'label' => esc_html__('Shortcode', 'king-addons'),
'type' => Controls_Manager::RAW_HTML,
'classes' => 'forms-field-shortcode',
'raw' => ''
]
);
$repeater->add_control(
'required',
[
'label' => esc_html__('Required', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'true',
'default' => '',
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => '!in',
'value' => [
'recaptcha',
'recaptcha-v3',
'hidden',
'html',
'king-addons-fb-step',
],
],
],
],
]
);
$repeater->add_control(
'allow_multiple_upload',
[
'label' => esc_html__('Multiple', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'condition' => [
'field_type' => 'upload'
],
]
);
$max_file_size = wp_max_upload_size() / pow(1024, 2);
$repeater->add_control(
'file_size',
[
'label' => esc_html__('File Size (MB)', 'king-addons'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => $max_file_size,
'king-addons-fb-step' => 1,
'description' => esc_html__('Max upload size allowed is ' . $max_file_size . 'MB. Please contact your hosting to increase it.', 'king-addons'),
'condition' => [
'field_type' => 'upload'
]
]
);
$repeater->add_control(
'file_types',
[
'label' => esc_html__('File Types', 'king-addons'),
'type' => Controls_Manager::TEXT,
'description' => esc_html__('Enter the comma separated file types to allow.', 'king-addons'),
'condition' => [
'field_type' => 'upload',
]
]
);
$repeater->add_control(
'field_options',
[
'label' => esc_html__('Options', 'king-addons'),
'type' => Controls_Manager::TEXTAREA,
'default' => '',
'description' => esc_html__('Insert each option on a separate line. To set a different label and value for an option, separate them with a pipe ("|"). Example: First Option|f_option', 'king-addons'),
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => 'in',
'value' => [
'select',
'checkbox',
'radio',
],
],
],
],
]
);
$repeater->add_control(
'allow_multiple',
[
'label' => esc_html__('Multiple Selection', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'true',
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'select',
],
],
],
]
);
$repeater->add_control(
'select_size',
[
'label' => esc_html__('Rows', 'king-addons'),
'type' => Controls_Manager::NUMBER,
'min' => 2,
'king-addons-fb-step' => 1,
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'select',
],
[
'name' => 'allow_multiple',
'value' => 'true',
],
],
],
]
);
$repeater->add_control(
'inline_list',
[
'label' => esc_html__('Inline List', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'king-addons-inline-sub-group',
'default' => '',
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => 'in',
'value' => [
'checkbox',
'radio',
],
],
],
],
]
);
$repeater->add_control(
'field_html',
[
'label' => esc_html__('HTML', 'king-addons'),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'html',
],
],
],
]
);
$repeater->add_responsive_control(
'width',
[
'label' => esc_html__('Column Width', 'king-addons'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['%'],
'range' => [
'%' => [
'min' => 10,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 100,
],
'selectors' => [
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;',
],
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'operator' => '!in',
'value' => [
'hidden',
'recaptcha',
'recaptcha-v3',
'king-addons-fb-step',
],
],
],
],
]
);
$repeater->add_control(
'rows',
[
'label' => esc_html__('Rows', 'king-addons'),
'type' => Controls_Manager::NUMBER,
'default' => 7,
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'textarea',
],
],
],
]
);
$repeater->add_control(
'recaptcha_size', [
'label' => esc_html__('Size', 'king-addons'),
'type' => Controls_Manager::SELECT,
'default' => 'normal',
'options' => [
'normal' => esc_html__('Normal', 'king-addons'),
'compact' => esc_html__('Compact', 'king-addons'),
],
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'recaptcha',
],
],
],
]
);
$repeater->add_control(
'recaptcha_style',
[
'label' => esc_html__('Style', 'king-addons'),
'type' => Controls_Manager::SELECT,
'default' => 'light',
'options' => [
'light' => esc_html__('Light', 'king-addons'),
'dark' => esc_html__('Dark', 'king-addons'),
],
'conditions' => [
'terms' => [
[
'name' => 'field_type',
'value' => 'recaptcha',
],
],
],
]
);
$repeater->add_control(
'css_classes',
[
'label' => esc_html__('CSS Classes', 'king-addons'),
'type' => Controls_Manager::HIDDEN,
'default' => '',
'title' => esc_html__('Add your custom class without the dot, e.g: "your-class"', 'king-addons'),
]
);
$this->add_control(
'form_fields',
[
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => [
[
'field_id' => 'name',
'field_type' => 'text',
'field_label' => esc_html__('Name', 'king-addons'),
'placeholder' => esc_html__('Name', 'king-addons'),
'width' => '100',
'dynamic' => [
'active' => true,
],
],
[
'field_id' => 'email',
'field_type' => 'email',
'required' => 'true',
'field_label' => esc_html__('Email', 'king-addons'),
'placeholder' => esc_html__('Email', 'king-addons'),
'width' => '100',
],
[
'field_id' => 'message',
'field_type' => 'textarea',
'field_label' => esc_html__('Message', 'king-addons'),
'placeholder' => esc_html__('Message', 'king-addons'),
'width' => '100',
],
],
'title_field' => '{{ field_label }}',
]
);
if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
$this->add_control(
'fields_to_show_pro_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => __('More than 3 Fields (Excluding Steps) are available in the Pro version'),
'content_classes' => 'king-addons-pro-notice'
]
);
}
$this->end_controls_section();
$this->start_controls_section(
'section_buttons',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Buttons', 'king-addons'),
]
);
$this->add_responsive_control(
'button_width',
[
'label' => esc_html__('Column Width', 'king-addons'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['%'],
'range' => [
'%' => [
'min' => 10,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 100,
],
'selectors' => [
'{{WRAPPER}} .king-addons-field-group.king-addons-form-field-type-submit' => 'width: {{SIZE}}%;',
'{{WRAPPER}} .king-addons-step-buttons-wrap' => 'width: {{SIZE}}%;'
],
'frontend_available' => true,
]
);
$this->add_responsive_control(
'buttons_width',
[
'label' => esc_html__('Step Buttons Width', 'king-addons'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px', '%'],
'range' => [
'px' => [
'min' => 0,
'max' => 500,
],
'%' => [
'min' => 0,
'max' => 100,
]
],
'default' => [
'unit' => 'px',
'size' => 150,
],
'selectors' => [
'{{WRAPPER}} .king-addons-fb-step-prev' => 'width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .king-addons-fb-step-next' => 'width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .king-addons-fb-step-tab .king-addons-button' => 'width: {{SIZE}}{{UNIT}};'
],
]
);
$this->add_responsive_control(
'button_align',
[
'label' => esc_html__('Alignment', 'king-addons'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__('Left', 'king-addons'),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__('Center', 'king-addons'),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__('Right', 'king-addons'),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'center',
'selectors_dictionary' => [
'left' => 'margin-left: 0; margin-right: auto;',
'center' => 'margin-left: auto; margin-right: auto;',
'right' => 'margin-left: auto; margin-right: 0;'
],
'selectors' => [
'{{WRAPPER}} .king-addons-step-buttons-wrap' => '{{VALUE}}',
'{{WRAPPER}} .king-addons-fb-step-tab:first-of-type .king-addons-fb-step-next' => '{{VALUE}}',
],
]
);
$this->add_control(
'heading_submit_button',
[
'label' => esc_html__('Submit Button', 'king-addons'),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'button_text',
[
'label' => esc_html__('Submit', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Send', 'king-addons'),
'placeholder' => esc_html__('Send', 'king-addons'),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'selected_button_icon',
[
'label' => esc_html__('Icon', 'king-addons'),
'type' => Controls_Manager::ICONS,
'skin' => 'inline',
'label_block' => false,
]
);
$this->add_control(
'button_icon_align',
[
'label' => esc_html__('Icon Position', 'king-addons'),
'type' => Controls_Manager::SELECT,
'default' => 'left',
'options' => [
'left' => esc_html__('Before', 'king-addons'),
'right' => esc_html__('After', 'king-addons'),
],
'condition' => [
'selected_button_icon[value]!' => '',
],
]
);
$this->add_control(
'button_icon_indent',
[
'label' => esc_html__('Icon Spacing', 'king-addons'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'max' => 50,
],
],
'condition' => [
'selected_button_icon[value]!' => '',
],
'selectors' => [
'{{WRAPPER}} .king-addons-button .king-addons-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .king-addons-button .king-addons-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'button_css_id',
[
'label' => esc_html__('Button ID', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => '',
'title' => esc_html__('Add your custom id WITHOUT the Pound key. e.g: my-id', 'king-addons'),
'description' => esc_html__('Element ID should be unique and not used elsewhere in this widget', 'king-addons'),
'separator' => 'before',
'dynamic' => [
'active' => true,
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_form_settings',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Settings', 'king-addons'),
'tab' => Controls_Manager::TAB_CONTENT
]
);
$this->add_control(
'form_name',
[
'label' => esc_html__('Form Name', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('New Form', 'king-addons'),
'placeholder' => esc_html__('Form Name', 'king-addons'),
]
);
$this->add_control(
'form_id',
[
'label' => esc_html__('Form ID', 'king-addons'),
'type' => Controls_Manager::TEXT,
'placeholder' => 'form_id',
'description' => esc_html__('Form ID should be unique and shouldn\'t contain spaces', 'king-addons'),
'separator' => 'after',
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'success_message',
[
'label' => esc_html__('Success Message', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Submission successful', 'king-addons'),
'placeholder' => esc_html__('Submission successful', 'king-addons'),
'label_block' => true,
'frontend_available' => true,
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'error_message',
[
'label' => esc_html__('Error Message', 'king-addons'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Submission failed', 'king-addons'),
'placeholder' => esc_html__('Submission failed', 'king-addons'),
'label_block' => true,
'frontend_available' => true,
'render_type' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'show_labels',
[
'label' => esc_html__('Show Field Labels', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__('Show', 'king-addons'),
'label_off' => esc_html__('Hide', 'king-addons'),
'return_value' => 'true',
'default' => 'true',
'separator' => 'before',
]
);
$this->add_control(
'show_placeholders',
[
'label' => esc_html__('Show Placeholders', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__('Show', 'king-addons'),
'label_off' => esc_html__('Hide', 'king-addons'),
'return_value' => 'true',
'default' => 'true'
]
);
$this->add_control(
'label_position',
[
'label' => esc_html__('Label Position', 'king-addons'),
'type' => Controls_Manager::HIDDEN,
'options' => [
'above' => esc_html__('Above', 'king-addons'),
'inline' => esc_html__('Inline', 'king-addons'),
],
'default' => 'above',
'condition' => [
'show_labels!' => '',
],
]
);
$this->add_control(
'mark_required',
[
'label' => esc_html__('Show Required Mark', 'king-addons'),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__('Show', 'king-addons'),
'label_off' => esc_html__('Hide', 'king-addons'),
'default' => '',
'condition' => [
'show_labels!' => '',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_integration',
[
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Actions', 'king-addons'),
]
);
$default_submit_actions = ['email'];
$this->add_control(
'submit_actions',
[
'label' => esc_html__('Add Action', 'king-addons'),
'type' => Controls_Manager::SELECT2,
'multiple' => true,
'options' => $this->submit_action_args(),
'render_type' => 'none',
'label_block' => true,
'default' => $default_submit_actions,
'description' => esc_html__('Select the actions to perform after a user submits the form (e.g., sending an email notification). Once an action is selected, its corresponding settings will be displayed below.', 'king-addons'),
]
);
if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
$this->add_control(
'submit_actions_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => __('Submission and Mailchimp actions are only available