OxygenWidget.php 0000644 00000002346 15073227004 0007677 0 ustar 00 initWidgets();
}
public function initOxygenEl()
{
if (!class_exists('OxyEl')) {
return;
}
new OxygenEl();
}
public function initWidgets()
{
if (file_exists(FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/OxyFluentFormWidget.php')) {
require_once FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/OxyFluentFormWidget.php';
}
}
public function addAccordionSection()
{
$brand_name = __('Fluent Forms', 'fluentform');
\CT_Toolbar::oxygen_add_plus_accordion_section('fluentform', $brand_name);
}
public function registerAddPlusSubsections()
{
do_action('oxygen_add_plus_fluentform_form');
}
}
SidebarWidgets.php 0000644 00000006352 15073227004 0010163 0 ustar 00 esc_html__('Add your form by Fluent Forms', 'fluentform'), ]
);
}
public function widget($args, $instance)
{
$selectedForm = empty($instance['allforms']) ? '' : intval($instance['allforms']);
if (!$selectedForm) {
return;
}
echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
if (!empty($instance['title'])) {
echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}
if ('' != $selectedForm) {
$shortcode = "[fluentform id='$selectedForm']";
echo do_shortcode($shortcode); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}
echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}
public function form($instance)
{
$selectedForm = empty($instance['allforms']) ? '' : $instance['allforms'];
if (isset($instance['title'])) {
$title = $instance['title'];
} else {
$title = __('', 'fluentform');
}
// Widget admin form
?>
orderBy('id', 'DESC')
->get();
?>
app = $app;
add_action('elementor/widgets/register', [$this, 'init_widgets']);
}
public function init_widgets()
{
$this->enqueueAssets();
$widgets_manager = Elementor::instance()->widgets_manager;
if (file_exists(FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/FluentFormWidget.php')) {
require_once FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/FluentFormWidget.php';
$widgets_manager->register(new FluentFormWidget());
}
}
public function enqueueAssets()
{
wp_enqueue_style('fluentform-elementor-widget', fluentformMix('css/fluent-forms-elementor-widget.css'), [], FLUENTFORM_VERSION);
}
}
OxyFluentFormWidget.php 0000644 00000106325 15073227004 0011211 0 ustar 00 addOptionControl(
[
'type' => 'dropdown',
'name' => __('Select a Form', 'fluentform'),
'slug' => 'ff_form',
'value' => Helper::getForms(),
'default' => 'no',
'css' => false,
]
);
$templates_control->rebuildElementOnChange();
$this->formContainerStyleControls();
$this->formInputLabelsStyle();
$this->formInputsStyle();
$this->checkboxAndRadioStyle();
$this->gdprAndTermsConditionStyle();
$this->sectionBreakStyle();
$this->checkboxGridStyle();
$this->fileUploadStyle();
$this->progressBarStyle();
$this->submitBtnStyle();
$this->stepButtonStyle();
$this->successMessageStyle();
$this->errorMessageStyle();
}
public function formContainerStyleControls()
{
$section_container = $this->addControlSection(
'fluentform_container',
__('Form Container', 'fluentform'),
'assets/icon.png',
$this
);
$selector = '.fluentform';
$section_container->addStyleControls(
[
[
'name' => __('Background Color', 'fluentform'),
'selector' => $selector,
'property' => 'background-color',
],
[
'name' => __('Max Width', 'fluentform'),
'selector' => $selector,
'property' => 'width',
],
]
);
$section_container->addPreset(
'padding',
'fluentform_container_padding',
__('Padding', 'fluentform'),
$selector
)->whiteList();
$section_container->addPreset(
'margin',
'fluentform_container_margin',
__('Margin', 'fluentform'),
$selector
)->whiteList();
$section_container->addPreset(
'border',
'fluentform_container_border',
__('Border', 'fluentform'),
$selector
)->whiteList();
$section_container->addPreset(
'border-radius',
'fluentform_container_radius',
__('Border Radius', 'fluentform'),
$selector
)->whiteList();
$section_container->boxShadowSection(
__('Box Shadow', 'fluentform'),
$selector,
$this
);
}
public function formInputLabelsStyle()
{
$section_label = $this->addControlSection(
'fluentform_label',
__('Labels', 'fluentform'),
'assets/icon.png',
$this
);
$selector = '.fluentform .ff-el-input--label label';
$section_label->typographySection(__('Typography'), $selector, $this);
$section_label->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => $selector,
'property' => 'color',
],
]
);
$section_label->addStyleControl(
[
'name' => __('Asterisk Color', 'fluentform'),
'selector' => '.ff-el-input--label.ff-el-is-required.asterisk-right label:after ,.ff-el-input--label.ff-el-is-required.asterisk-left label:before',
'property' => 'color',
]
);
}
public function formInputsStyle()
{
$selector = '.ff-el-form-control';
$section_input = $this->addControlSection(
'fluentform_input',
__('Input & Textara', 'fluentform'),
'assets/icon.png',
$this
);
$section_input->addStyleControls(
[
[
'name' => __('Text Indent', 'fluentform'),
'selector' => $selector,
'property' => 'padding-left',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
[
'name' => __('Margin Bottom'),
'selector' => '.ff-el-group',
'property' => 'margin-bottom',
],
[
'name' => __('Input Width', 'fluentform'),
'selector' => $selector,
'property' => 'width',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
[
'name' => __('Input Height', 'fluentform'),
'selector' => $selector,
'property' => 'height',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
[
'name' => __('Textarea Width', 'fluentform'),
'selector' => '.ff-el-group textarea',
'property' => 'width',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
[
'name' => __('Textarea Height', 'fluentform'),
'selector' => '.ff-el-group textarea',
'property' => 'height',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
]
);
$section_input_normal = $section_input->addControlSection(
'fluentform_input_normal_section',
__('Normal', 'fluentform'),
'assets/icon.png',
$this
);
$section_input_normal->addStyleControls(
[
[
'name' => __('Color'),
'selector' => '.ff-el-form-control',
'property' => 'color',
],
[
'name' => __('Background Color'),
'selector' => '.ff-el-form-control',
'property' => 'background-color',
],
[
'name' => __('Placeholder Color'),
'slug' => 'fluentform_input_placeholder',
'selector' => '::placeholder',
'property' => 'color',
],
]
);
$section_input_hover = $section_input->addControlSection(
'fluentform_input_hover_section',
__('Hover', 'fluentform'),
'assets/icon.png',
$this
);
$section_input_hover->addStyleControls(
[
[
'name' => __('Background Color'),
'selector' => '.ff-el-form-control:focus',
'property' => 'background-color',
],
[
'name' => __('Text Color'),
'selector' => '.ff-el-form-control:focus',
'property' => 'color',
],
[
'name' => __('Border Color'),
'selector' => '.ff-el-form-control:focus',
'property' => 'border-color',
'control_type' => 'colorpicker',
],
]
);
$section_input->addPreset(
'padding',
'fluentform_input_spacing',
__('Padding', 'fluentform'),
$selector
)->whiteList();
$section_input->boxShadowSection(
__('Box Shadow', 'fluentform'),
$selector,
$this
);
$section_input->typographySection(
__('Typography'),
$selector,
$this
);
$section_input->addPreset(
'border',
'fluentform_input_border',
__('Border', 'fluentform'),
$selector
)->whiteList();
$section_input->addPreset(
'border-radius',
'fluentform_input_border_radius',
__('Border Radius', 'fluentform'),
$selector
)->whiteList();
}
public function checkboxGridStyle()
{
$section_checkbox_grid = $this->addControlSection(
'fluentform_checkbox_grid',
__('Checkable Grid Field', 'fluentform'),
'assets/icon.png',
$this
);
$section_checkbox_grid_spacing = $section_checkbox_grid->addControlSection(
'fluentform_checkbox_grid_sp',
__('Spacing', 'fluentform'),
'assets/icon.png',
$this
);
$section_checkbox_grid_width = $section_checkbox_grid_spacing->addStyleControl(
[
'selector' => '.fluentform .ff-checkable-grids',
'property' => 'width',
'control_type' => 'slider-measurebox',
]
);
$section_checkbox_grid_width->setRange('0', '100', '1');
$section_checkbox_grid_width->setUnits('%', 'px,%,em');
$section_checkbox_grid_width->setDefaultValue('100');
$section_checkbox_grid_spacing->addPreset(
'padding',
'fluentform_checkbox_grid_padding',
__('Table Head Cell Padding'),
'.fluentform .ff-checkable-grids thead>tr>th'
)->whiteList();
$section_checkbox_grid_spacing->addPreset(
'padding',
'fluentform_checkbox_grid_padding_tb',
__('Table Body Cell Padding'),
'.fluentform .ff-checkable-grids tbody>tr>td'
)->whiteList();
$section_checkbox_grid_color = $section_checkbox_grid->addControlSection(
'fluentform_checkbox_grid_color',
__('Color', 'fluentform'),
'assets/icon.png',
$this
);
$section_checkbox_grid_color->addStyleControls([
[
'name' => __('Table Outer Border Width', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids',
'property' => 'border-width',
],
[
'name' => __('Table Outer Border Color', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids',
'property' => 'border-color',
],
[
'name' => __('Table Head Background', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids thead>tr>th',
'property' => 'background-color',
],
[
'name' => __('Table Body Background', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids tbody>tr>td',
'property' => 'background-color',
],
[
'name' => __('Table Body Alt Background', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids tbody>tr:nth-child(2n)>td',
'property' => 'background-color',
],
[
'name' => __('Table Body Alt Text Color', 'fluentform'),
'selector' => '.fluentform .ff-checkable-grids tbody>tr:nth-child(2n)>td',
'property' => 'color',
],
]);
$section_checkbox_grid->typographySection(
__('Heading Typography', 'fluentform'),
'.fluentform .ff-checkable-grids thead>tr>th',
$this
);
$section_checkbox_grid->typographySection(
__('Cell Typography', 'fluentform'),
'.fluentform .ff-checkable-grids tbody>tr>td',
$this
);
}
public function gdprAndTermsConditionStyle()
{
$section_gdpr_terms = $this->addControlSection(
'fluentform_gdpr_terms_section',
__('GDPR, Terms & Condition', 'fluentform'),
'assets/icon.png',
$this
);
$section_gdpr_terms->typographySection(__('Typography'), '.ff-el-tc , .ff_t_c', $this);
$section_gdpr_terms->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => '.ff-el-tc , .ff_t_c',
'property' => 'color',
],
[
'name' => __('Link Color', 'fluentform'),
'selector' => '.ff-el-tc a, .ff_t_c a',
'property' => 'color',
],
]
);
}
public function sectionBreakStyle()
{
$section_section_break = $this->addControlSection(
'fluentform_section_break_section',
__('Section Break', 'fluentform'),
'assets/icon.png',
$this
);
$selector = '.ff-el-section-break';
$section_section_break->typographySection(__('Typography', 'fluentform'), $selector, $this);
$section_section_break->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => $selector,
'property' => 'color',
],
[
'selector' => $selector,
'slug' => 'ff_section_break_section_bg_color',
'property' => 'background-color',
],
]
);
$section_section_break->addPreset(
'padding',
'ff_section_break_section_padding',
__('Padding', 'fluentform'),
$selector
)->whiteList();
$section_section_break->addPreset(
'margin',
'ff_section_break_section_margin',
__('Margin', 'fluentform'),
$selector
)->whiteList();
$section_section_break->addStyleControl(
[
'selector' => $selector . ' hr',
'slug' => 'ffsb_line',
'property' => 'border-color',
]
)->setParam('hide_wrapper_end', true);
$section_section_break->addStyleControl(
[
'selector' => $selector . ' hr',
'slug' => 'ffsb_linew',
'property' => 'border-width',
]
)->setParam('hide_wrapper_start', true);
}
public function render($options, $defaults, $content)
{
if ('no' == $options['ff_form']) {
echo '' . __('Select a Form', 'fluentform') . '
';
return;
}
if (function_exists('do_oxygen_elements')) {
echo do_oxygen_elements('[fluentform id="' . (int) $options['ff_form'] . '"]'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
if (Helper::isConversionForm($options['ff_form'])) {
_e('This is a Conversational Form. You must use the default Design tab for this type of forms.', 'fluentform');
return;
}
echo do_shortcode('[fluentform id="' . (int) $options['ff_form'] . '"]'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
public function init()
{
$this->El->useAJAXControls();
$app = wpFluentForm();
if ($app->request->get('ct_builder')) {
wp_enqueue_style(
'fluent-form-styles',
fluentFormMix('css/fluent-forms-public.css'),
[],
FLUENTFORM_VERSION
);
wp_enqueue_style(
'fluentform-public-default',
fluentFormMix('css/fluentform-public-default.css'),
[],
FLUENTFORM_VERSION
);
if (!wp_script_is('flatpickr', 'registered')) {
wp_enqueue_style(
'flatpickr',
fluentFormMix('libs/flatpickr/flatpickr.min.css')
);
}
wp_enqueue_style(
'ff_choices',
fluentFormMix('css/choices.css'),
[],
FLUENTFORM_VERSION
);
}
}
public function enablePresets()
{
return true;
}
public function enableFullPresets()
{
return true;
}
public function customCSS($options, $selector)
{
$css = $defaultCSS = '';
$prefix = 'oxy-' . $this->slug();
if (isset($options[$prefix . '_ff_inp_placeholder'])) {
$css .= '.fluent_form_' . $options['fluentform'] . ' .ff-el-form-control::-webkit-input-placeholder,.fluent_form_' . $options['fluentform'] . ' .ff-el-form-control::-moz-input-placeholder,.fluent_form_' . $options['fluentform'] . ' .ff-el-form-control:-ms-input-placeholder,.fluent_form_' . $options['fluentform'] . ' .ff-el-form-control::placeholder{color:' . $options['ff_inp_placeholder'] . ';}';
}
if (isset($options[$prefix . '_rc_smart_ui']) && 'yes' == $options[$prefix . '_rc_smart_ui']) {
$css .= $selector . ' .ff-el-group input[type=checkbox]:after, ' . $selector . ' .ff-el-group input[type=radio]:after {content: " "!important;display: inline-block!important;border-style: solid}';
$css .= $selector . ' .ff-el-group input[type=checkbox], ' . $selector . ' .ff-el-group input[type=radio]{width: 1px;}';
} else {
$css .= $selector . ' .ff-el-group input[type=checkbox]:after, ' . $selector . ' .ff-el-group input[type=radio]:after {content: none;}';
}
return $defaultCSS . $css;
}
public function checkboxAndRadioStyle()
{
$input_section_radio_checkbox = $this->addControlSection(
'fluentform_checkbox_radio_style',
__('Checkbox & Radio', 'fluentform'),
'assets/icon.png',
$this
);
$selector_after = '.ff-el-group input[type=checkbox]:after,.ff-el-group input[type=radio]:after';
$selector = '.ff-el-group input[type=checkbox],.ff-el-group input[type=radio]';
$text = $input_section_radio_checkbox->addControlSection(
'fluentform_radio_checkbox_text',
__('Text Style', 'fluentform'),
'assets/icon.png',
$this
);
$text->addStyleControls(
[
[
'selector' => '.ff-el-form-check-label, .ff_t_c',
'property' => 'color',
'name' => __('Text Color', 'fluentform'),
],
[
'selector' => '.ff_t_c a',
'property' => 'color',
'name' => __('Link Color', 'fluentform'),
],
[
'selector' => '.ff_t_c a:hover',
'property' => 'color',
'name' => __('Link Hover Color', 'fluentform'),
],
[
'selector' => '.ff-el-form-check-label, .ff_t_c',
'property' => 'font-size',
'control_type' => 'slider-measurebox',
'name' => __('Text Font Size', 'fluentform'),
'unit' => 'px',
],
]
);
$smart_ui = $input_section_radio_checkbox->addControlSection(
'fluentform_radio_checkbox_smart_ui',
__('Checkbox/Radio Smart UI', 'fluentform'),
'assets/icon.png',
$this
);
$smart_ui->addOptionControl(
[
'type' => 'radio',
'name' => __('Enable Smart UI', 'fluentform'),
'slug' => 'rc_smart_ui',
'value' => ['yes' => __('Yes'), 'no' => __('No')],
'default' => 'no',
'css' => false,
]
)->rebuildElementOnChange();
$smart_ui->addStyleControl(
[
'selector' => $selector_after,
'name' => __('Width'),
'property' => 'width|height',
'control_type' => 'slider-measurebox',
'unit' => 'px',
'condition' => 'rc_smart_ui=yes',
]
);
$smart_ui->addStyleControl(
[
'selector' => $selector,
'name' => __('Text Indent'),
'property' => 'margin-right',
'control_type' => 'slider-measurebox',
'unit' => 'px',
'condition' => 'rc_smart_ui=yes',
]
);
$smart_ui->addStyleControls(
[
[
'selector' => $selector_after,
'property' => 'background-color',
'slug' => 'cr_bg_color',
'condition' => 'rc_smart_ui=yes',
],
[
'selector' => $selector_after,
'property' => 'border-color',
'slug' => 'cr_brd_color',
'condition' => 'rc_smart_ui=yes',
'value' => '#333',
],
[
'selector' => $selector_after . ', .ff-el-group input[type=checkbox]:checked:after, .ff-el-group input[type=radio]:checked:after',
'property' => 'border-width',
'condition' => 'rc_smart_ui=yes',
],
[
'name' => __('Border Radius for Checkbox', 'fluentform'),
'selector' => '.ff-el-group input[type=checkbox]:after, .ff-el-group input[type=checkbox]:checked:after',
'property' => 'border-radius',
'condition' => 'rc_smart_ui=yes',
],
]
);
$smart_ui->addStyleControls(
[
[
'name' => __('Background Color - Selected State', 'fluentform'),
'selector' => '.ff-el-group input[type=checkbox]:checked:after, .ff-el-group input[type=radio]:checked:after',
'property' => 'background-color',
'control_type' => 'colorpicker',
'condition' => 'rc_smart_ui=yes',
],
[
'name' => __('Border Size - Selected State', 'fluentform'),
'selector' => '.ff-el-group input[type=checkbox]:checked:after, .ff-el-group input[type=radio]:checked:after',
'property' => 'border-width',
'control_type' => 'slider-measurebox',
'unit' => 'px',
'condition' => 'rc_smart_ui=yes',
],
[
'name' => __('Border Color - Selected State', 'fluentform'),
'selector' => '.ff-el-group input[type=checkbox]:checked:after, .ff-el-group input[type=radio]:checked:after',
'property' => 'border-color',
'slug' => 'crc_bg_color',
'control_type' => 'colorpicker',
'condition' => 'rc_smart_ui=yes',
],
]
);
$input_section_radio_checkbox_space = $input_section_radio_checkbox->addControlSection(
'fluentform_radio_checkbox_sp',
__('Spacing', 'fluentform'),
'assets/icon.png',
$this
);
$input_section_radio_checkbox_space->addPreset(
'margin',
'fluentform_radio_checkbox_margin',
__('Checkbox/Radio Margin'),
'.fluentform input[type=checkbox], .ff-el-group input[type=radio]'
)->whiteList();
$input_section_radio_checkbox_space->addPreset(
'padding',
'fluentform_radio_checkbox_padding',
__('Label Spacing'),
'.ff-el-form-check-label, .ff_t_c'
)->whiteList();
}
public function fileUploadStyle()
{
$section_file_upload = $this->addControlSection(
'fluentform_file_upload',
__('File Upload Field', 'fluentform'),
'assets/icon.png',
$this
);
$selector = '.ff_upload_btn';
$section_file_upload->typographySection(__('Button Typography', 'fluentform'), $selector, $this);
$section_file_upload->borderSection(__('Button Border', 'fluentform'), $selector, $this);
$section_file_upload->boxShadowSection(__('Button Box Shadow', 'fluentform'), $selector, $this);
$section_file_upload->boxShadowSection(__('Button Hover Box Shadow', 'fluentform'), $selector . ':hover', $this);
$section_file_upload->borderSection(__('Button Hover Border', 'fluentform'), $selector . ':hover', $this);
$button = $section_file_upload->addControlSection(
'fluentform_file_upload_bttn',
__('Button Style', 'fluentform'),
'assets/icon.png',
$this
);
$button->addPreset(
'padding',
'fluentform_file_upload_bttn_padding',
__('Padding', 'fluentform'),
$selector
)->whiteList();
$button->addStyleControls(
[
[
'name' => __('Text Hover Color', 'fluentform'),
'selector' => $selector . ':hover',
'property' => 'color',
],
[
'selector' => $selector,
'property' => 'background-color',
],
[
'name' => __('Background Hover Color', 'fluentform'),
'selector' => $selector . ':Hover',
'property' => 'background-color',
'control_type' => 'colorpicker',
],
[
'name' => __('Width', 'fluentform'),
'selector' => $selector,
'property' => 'width',
],
]
);
}
public function progressBarStyle()
{
$section_progressbar = $this->addControlSection(
'fluentform_progress_bar',
__('Progress Bar', 'fluentform'),
'assets/icon.png',
$this
);
$section_progressbar->typographySection(__('Typography', 'fluentform'), '.ff-el-progress-status', $this);
$section_progressbar->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => '.ff-el-progress-status',
'property' => 'color',
],
]
);
$section_progressbar->addStyleControls(
[
[
'name' => __('Bar Color', 'fluentform'),
'selector' => '.ff-el-progress-bar',
'property' => 'background-color',
],
]
);
$section_progressbar->addPreset(
'padding',
'fluentform_progress_bar_padding',
__('Label Spacing', 'fluentform'),
'.ff-el-progress-status'
)->whiteList();
}
public function submitBtnStyle()
{
$section_submit_btn = $this->addControlSection(
'fluentform_submit_bttn',
__('Submit Button', 'fluentform'),
'assets/icon.png',
$this
);
$selector_submit_bttn = '.ff-btn-submit';
$section_submit_btn->addStyleControls(
[
[
'name' => __('Color', 'fluentform'),
'selector' => $selector_submit_bttn,
'property' => 'color',
],
[
'name' => __('Background Color', 'fluentform'),
'selector' => $selector_submit_bttn,
'property' => 'background-color',
],
[
'name' => __('Hover Color', 'fluentform'),
'selector' => '.ff-btn-submit:hover',
'property' => 'background-color',
],
[
'name' => __('Width', 'fluentform'),
'selector' => $selector_submit_bttn,
'property' => 'width',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
[
'name' => __('Margin Top', 'fluentform'),
'selector' => $selector_submit_bttn,
'property' => 'margin-top',
'control_type' => 'slider-measurebox',
'unit' => 'px',
],
]
);
$section_submit_btn->addPreset(
'padding',
'fluentform_submit_bttn_padding',
__('Padding', 'fluentform'),
$selector_submit_bttn
)->whiteList();
$section_submit_btn->addPreset(
'margin',
'fluentform_submit_bttn_margin',
__('Margin', 'fluentform'),
$selector_submit_bttn
)->whiteList();
$section_submit_btn->typographySection(__('Typography', 'fluentform'), $selector_submit_bttn, $this);
$section_submit_btn->borderSection(__('Border', 'fluentform'), $selector_submit_bttn, $this);
$section_submit_btn->borderSection(__('Hover Border', 'fluentform'), $selector_submit_bttn . ':hover', $this);
$section_submit_btn->boxShadowSection(__('Box Shadow', 'fluentform'), $selector_submit_bttn, $this);
$section_submit_btn->boxShadowSection(__('Hover Box Shadow', 'fluentform'), $selector_submit_bttn . ':hover', $this);
}
public function stepButtonStyle()
{
$section_step_button = $this->addControlSection(
'section_step_button',
__('Step Button', 'fluentform'),
'assets/icon.png',
$this
);
$section_step_button->addPreset(
'padding',
'section_step_button_padding',
__('Padding', 'fluentform'),
'.step-nav button'
)->whiteList();
$section_step_button->addStyleControl(
[
'name' => __('Width'),
'selector' => '.step-nav .ff-btn',
'property' => 'width',
]
);
$section_step_button_color = $section_step_button->addControlSection(
'ffsfnb_clr',
__('Color', 'fluentform'),
'assets/icon.png',
$this
);
$section_step_button_color->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => '.step-nav .ff-btn',
'property' => 'color',
],
[
'name' => __('Text Hover Color', 'fluentform'),
'selector' => '.step-nav .ff-btn:hover',
'property' => 'color',
],
[
'name' => __('Background Color', 'fluentform'),
'selector' => '.step-nav .ff-btn',
'property' => 'background-color',
'control_type' => 'colorpicker',
],
[
'name' => __('Background Hover Color', 'fluentform'),
'selector' => '.step-nav .ff-btn:hover',
'property' => 'background-color',
'control_type' => 'colorpicker',
],
]
);
$section_step_button->typographySection(__('Typography', 'fluentform'), '.step-nav .ff-btn', $this);
$section_step_button->borderSection(__('Border', 'fluentform'), '.step-nav .ff-btn', $this);
$section_step_button->borderSection(__('Hover Border', 'fluentform'), '.step-nav .ff-btn:hover', $this);
$section_step_button->boxShadowSection(__('Box Shadow', 'fluentform'), '.step-nav .ff-btn', $this);
$section_step_button->boxShadowSection(__('Hover Box Shadow', 'fluentform'), '.step-nav .ff-btn:hover', $this);
}
public function successMessageStyle()
{
$section_success_message = $this->addControlSection(
'fluentform_success_message',
__('Success Message', 'fluentform'),
'assets/icon.png',
$this
);
$section_success_message->addStyleControl(
[
'selector' => '.ff-message-success',
'value' => 100,
'property' => 'width',
]
)->setUnits('%', 'px,%');
$section_success_message->addStyleControl(
[
'selector' => '.ff-message-success',
'property' => 'background-color',
]
);
$section_success_message->typographySection(
__('Typography', 'fluentform'),
'.ff-message-success, .ff-message-success p',
$this
);
$section_success_message->borderSection(__('Border', 'fluentform'), '.ff-message-success', $this);
$section_success_message->boxShadowSection(__('Box Shadow', 'fluentform'), '.ff-message-success', $this);
$section_success_message->addPreset(
'padding',
'fluentform_success_message_padding',
__('Padding', 'fluentform'),
'.ff-message-success'
)->whiteList();
}
public function errorMessageStyle()
{
$section_error_message = $this->addControlSection(
'fluentform_error_message',
__('Validation Error', 'fluentform'),
'assets/icon.png',
$this
);
$section_error_message->addStyleControls(
[
[
'name' => __('Text Color', 'fluentform'),
'selector' => '.ff-el-is-error .text-danger',
'property' => 'color',
'value' => '#f56c6c',
],
[
'selector' => '.ff-el-is-error .text-danger',
'property' => 'font-size',
'value' => 14,
],
[
'selector' => '.ff-el-is-error .text-danger',
'property' => 'font-weight',
],
[
'selector' => '.ff-el-is-error .text-danger',
'property' => 'margin-top',
'value' => 4,
],
]
);
}
}
new OxyFluentFormWidget();
OxygenEl.php 0000644 00000001422 15073227004 0007006 0 ustar 00 El->useAJAXControls();
}
public function class_names()
{
return ['ff-oxy-element'];
}
public function button_place()
{
$button_place = $this->accordion_button_place();
if ($button_place) {
return 'fluentform::' . $button_place;
}
return '';
}
public function button_priority()
{
return '';
}
public function isBuilderEditorActive()
{
if (wpFluentForm('request')->get('oxygen_iframe') || defined('OXY_ELEMENTS_API_AJAX')) {
return true;
}
return false;
}
}
FluentFormWidget.php 0000644 00000264071 15073227004 0010514 0 ustar 00 register_general_controls();
$this->register_error_controls();
$this->register_title_description_style_controls();
$this->register_form_container_style_controls();
$this->register_label_style_controls();
$this->register_input_textarea_style_controls();
$this->register_placeholder_style_controls();
$this->register_radio_checkbox_style_controls();
$this->register_terms_gdpr_style_controls();
$this->register_section_break_style_controls();
$this->register_checkbox_grid_style_controls();
$this->register_address_line_style_controls();
$this->register_image_upload_style_controls();
$this->register_pagination_style_controls();
$this->register_submit_button_style_controls();
$this->register_success_message_style_controls();
$this->register_errors_style_controls();
}
protected function register_general_controls()
{
$this->start_controls_section(
'section_fluent_form',
[
'label' => __('Fluent Forms', 'fluentform'),
]
);
$this->add_control(
'form_list',
[
'label' => esc_html__('Fluent Forms', 'fluentform'),
'type' => Controls_Manager::SELECT,
'label_block' => true,
'options' => Helper::getForms(),
'default' => '0',
]
);
$this->add_control(
'custom_title_description',
[
'label' => __('Custom Title & Description', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'fluentform'),
'label_off' => __('No', 'fluentform'),
'return_value' => 'yes',
]
);
$this->add_control(
'form_title_custom',
[
'label' => esc_html__('Title', 'fluentform'),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => '',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_control(
'form_description_custom',
[
'label' => esc_html__('Description', 'fluentform'),
'type' => Controls_Manager::TEXTAREA,
'default' => '',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_control(
'labels_switch',
[
'label' => __('Labels', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => __('Show', 'fluentform'),
'label_off' => __('Hide', 'fluentform'),
'return_value' => 'yes',
]
);
$this->add_control(
'placeholder_switch',
[
'label' => __('Placeholder', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => __('Show', 'fluentform'),
'label_off' => __('Hide', 'fluentform'),
'return_value' => 'yes',
]
);
$this->end_controls_section();
}
protected function register_error_controls()
{
$this->start_controls_section(
'section_errors',
[
'label' => __('Errors', 'fluentform'),
]
);
$this->add_control(
'error_messages',
[
'label' => __('Error Messages', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => __('Show', 'fluentform'),
'label_off' => __('Hide', 'fluentform'),
'return_value' => 'yes',
]
);
$this->end_controls_section();
}
protected function register_title_description_style_controls()
{
$this->start_controls_section(
'section_form_title_style',
[
'label' => __('Title & Description', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_responsive_control(
'heading_alignment',
[
'label' => __('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'fluentform'),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __('Center', 'fluentform'),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __('Right', 'fluentform'),
'icon' => 'fa fa-align-right',
],
],
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-title' => 'text-align: {{VALUE}};',
'{{WRAPPER}} .fluentform-widget-description' => 'text-align: {{VALUE}};',
],
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_control(
'heading_title',
[
'label' => __('Title', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_control(
'form_title_text_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-title' => 'color: {{VALUE}}',
],
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_title_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-title',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_responsive_control(
'form_title_margin',
[
'label' => __('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'allowed_dimensions' => 'vertical',
'placeholder' => [
'top' => '',
'right' => 'auto',
'bottom' => '',
'left' => 'auto',
],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_responsive_control(
'form_title_padding',
[
'label' => esc_html__('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'heading_description',
[
'label' => __('Description', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_control(
'heading_description_text_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-description' => 'color: {{VALUE}}',
],
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'heading_description_typography',
'label' => __('Typography', 'fluentform'),
'scheme' => Scheme_Typography::TYPOGRAPHY_4,
'selector' => '{{WRAPPER}} .fluentform-widget-description',
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_responsive_control(
'heading_description_margin',
[
'label' => __('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'allowed_dimensions' => 'vertical',
'placeholder' => [
'top' => '',
'right' => 'auto',
'bottom' => '',
'left' => 'auto',
],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'custom_title_description' => 'yes',
],
]
);
$this->add_responsive_control(
'heading_description_padding',
[
'label' => esc_html__('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
protected function register_form_container_style_controls()
{
$this->start_controls_section(
'section_form_container_style',
[
'label' => __('Form Container', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'form_container_background',
'label' => __('Background', 'fluentform'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
]
);
$this->add_control(
'form_container_link_color',
[
'label' => __('Link Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group a' => 'color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'form_container_max_width',
[
'label' => esc_html__('Max Width', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px', 'em', '%'],
'range' => [
'px' => [
'min' => 10,
'max' => 1500,
],
'em' => [
'min' => 1,
'max' => 80,
],
],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper' => 'width: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_container_alignment',
[
'label' => esc_html__('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'label_block' => true,
'options' => [
'default' => [
'title' => __('Default', 'fluentform'),
'icon' => 'fa fa-ban',
],
'left' => [
'title' => esc_html__('Left', 'fluentform'),
'icon' => 'eicon-h-align-left',
],
'center' => [
'title' => esc_html__('Center', 'fluentform'),
'icon' => 'eicon-h-align-center',
],
'right' => [
'title' => esc_html__('Right', 'fluentform'),
'icon' => 'eicon-h-align-right',
],
],
'default' => 'default',
]
);
$this->add_responsive_control(
'form_container_margin',
[
'label' => esc_html__('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_container_padding',
[
'label' => esc_html__('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_container_border',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
]
);
$this->add_control(
'form_container_border_radius',
[
'label' => esc_html__('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'separator' => 'before',
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'form_container_box_shadow',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
]
);
$this->end_controls_section();
}
protected function register_label_style_controls()
{
$this->start_controls_section(
'section_form_label_style',
[
'label' => __('Labels', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_label_text_color',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_label_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label',
]
);
$this->end_controls_section();
}
protected function register_input_textarea_style_controls()
{
$this->start_controls_section(
'section_form_fields_style',
[
'label' => __('Input & Textarea', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'input_alignment',
[
'label' => __('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'fluentform'),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __('Center', 'fluentform'),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __('Right', 'fluentform'),
'icon' => 'fa fa-align-right',
],
],
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'text-align: {{VALUE}};',
],
]
);
$this->start_controls_tabs('tabs_form_fields_style');
$this->start_controls_tab(
'tab_form_fields_normal',
[
'label' => __('Normal', 'fluentform'),
]
);
$this->add_control(
'form_field_bg_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):not(.select2-search__field), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'form_field_text_color',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_field_border',
'label' => __('Border', 'fluentform'),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):not(.select2-search__field), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple',
'separator' => 'before',
]
);
$this->add_control(
'form_field_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_field_text_indent',
[
'label' => __('Text Indent', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 60,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 30,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'text-indent: {{SIZE}}{{UNIT}}',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'form_input_width',
[
'label' => __('Input Width', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1200,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'width: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_responsive_control(
'form_input_height',
[
'label' => __('Input Height', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 80,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'height: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_responsive_control(
'form_textarea_width',
[
'label' => __('Textarea Width', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1200,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'width: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_responsive_control(
'form_textarea_height',
[
'label' => __('Textarea Height', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 400,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'height: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_responsive_control(
'form_field_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_field_spacing',
[
'label' => __('Spacing', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group' => 'margin-bottom: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_field_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'form_field_box_shadow',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select',
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_form_fields_focus',
[
'label' => __('Focus', 'fluentform'),
]
);
$this->add_control(
'form_field_bg_color_focus',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus' => 'background-color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_input_focus_border',
'label' => __('Border', 'fluentform'),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'form_input_focus_box_shadow',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus',
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function register_terms_gdpr_style_controls()
{
$this->start_controls_section(
'section_form_terms_gdpr_style',
[
'label' => __('GDPR , Terms & Condition ', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'form_terms_gdpr_alignment',
[
'label' => __('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'fluentform'),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __('Center', 'fluentform'),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __('Right', 'fluentform'),
'icon' => 'fa fa-align-right',
],
],
'default' => '',
'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c' => 'text-align: {{VALUE}};'],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_terms_gdpr_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ',
]
);
$this->add_control(
'form_terms_gdpr_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ' => 'color: {{VALUE}};'],
]
);
$this->end_controls_section();
}
protected function register_placeholder_style_controls()
{
$this->start_controls_section(
'section_placeholder_style',
[
'label' => __('Placeholder', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'placeholder_switch' => 'yes',
],
]
);
$this->add_control(
'form_placeholder_text_color',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group input::-webkit-input-placeholder, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea::-webkit-input-placeholder' => 'color: {{VALUE}}',
],
'condition' => [
'placeholder_switch' => 'yes',
],
]
);
$this->end_controls_section();
}
protected function register_radio_checkbox_style_controls()
{
$this->start_controls_section(
'section_form_radio_checkbox_style',
[
'label' => __('Radio & Checkbox', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_custom_radio_checkbox',
[
'label' => __('Custom Styles', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'fluentform'),
'label_off' => __('No', 'fluentform'),
'return_value' => 'yes',
]
);
$this->add_responsive_control(
'form_radio_checkbox_size',
[
'label' => __('Size', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => '15',
'unit' => 'px',
],
'range' => [
'px' => [
'min' => 0,
'max' => 80,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_responsive_control(
'form_radio_checkbox_text_indent',
[
'label' => __('Text Indent', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 60,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 30,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'margin-right: {{SIZE}}{{UNIT}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->start_controls_tabs('tabs_radio_checkbox_style');
$this->start_controls_tab(
'form_radio_checkbox_normal',
[
'label' => __('Normal', 'fluentform'),
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_radio_checkbox_bg_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'background-color: {{VALUE}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_responsive_control(
'form_checkbox_border_width',
[
'label' => __('Border Width', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 15,
'step' => 1,
],
],
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-width: {{SIZE}}{{UNIT}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_checkbox_border_color',
[
'label' => __('Border Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-color: {{VALUE}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_checkbox_heading',
[
'label' => __('Checkbox', 'fluentform'),
'type' => Controls_Manager::HEADING,
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_checkbox_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_radio_heading',
[
'label' => __('Radio Buttons', 'fluentform'),
'type' => Controls_Manager::HEADING,
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_radio_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'form_radio_checkbox_checked',
[
'label' => __('Checked', 'fluentform'),
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_radio_checkbox_bg_color_checked',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:checked:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:checked:after' => 'background-color: {{VALUE}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->add_control(
'form_radio_checkbox_border_checked',
[
'label' => __('Border Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:checked:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:checked:after' => 'border-color: {{VALUE}}',
],
'condition' => [
'form_custom_radio_checkbox' => 'yes',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function register_section_break_style_controls()
{
$this->start_controls_section(
'form_section_break_style',
[
'label' => __('Section Break', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_section_break_label',
[
'label' => __('Label', 'fluentform'),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'form_section_break_label_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_section_break_label_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '.fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title',
'separator' => 'before',
]
);
$this->add_responsive_control(
'form_section_break_label_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_section_break_label_margin',
[
'label' => __('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'form_section_break_description',
[
'label' => __('Description', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'form_section_break_description_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_section_break_description_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break div',
'separator' => 'before',
]
);
$this->add_responsive_control(
'form_section_break_description_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_section_break_description_margin',
[
'label' => __('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_section_break_alignment',
[
'label' => __('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'fluentform'),
'icon' => 'eicon-h-align-left',
],
'center' => [
'title' => __('Center', 'fluentform'),
'icon' => 'eicon-h-align-center',
],
'right' => [
'title' => __('Right', 'fluentform'),
'icon' => 'eicon-h-align-right',
],
],
'prefix_class' => 'fluentform-widget-section-break-content-',
]
);
$this->end_controls_section();
}
protected function register_checkbox_grid_style_controls()
{
$this->start_controls_section(
'section_form_checkbox_grid',
[
'label' => __('Checkbox Grid', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'section_form_checkbox_grid_head',
[
'label' => __('Grid Table Head', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'form_checkbox_grid_table_head_text_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'form_checkbox_grid_table_head_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'background-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_checkbox_grid_table_head_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th',
'separator' => 'before',
]
);
$this->add_responsive_control(
'form_checkbox_grid_table_head_height',
[
'label' => __('Height', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1200,
'step' => 1,
],
],
'size_units' => ['px', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'height: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_checkbox_grid_table_head_border',
'label' => __('Border', 'fluentform'),
'default' => '',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead tr',
]
);
$this->add_responsive_control(
'form_checkbox_grid_table_head_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'form_checkbox_grid_table_item',
[
'label' => __('Grid Table Item', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'form_checkbox_grid_table_item_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_checkbox_grid_table_item_bg_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'form_checkbox_grid_table_item_odd_bg_color',
[
'label' => __('Odd Item Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper tbody>tr:nth-child(2n)>td' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_checkbox_grid_table_item_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td',
]
);
$this->add_responsive_control(
'form_checkbox_grid_table_item_height',
[
'label' => __('Height', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1200,
'step' => 1,
],
],
'size_units' => ['px', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'height: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_checkbox_grid_table_item_border',
'label' => __('Border', 'fluentform'),
'default' => '',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr',
]
);
$this->add_responsive_control(
'form_checkbox_grid_table_item_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
protected function register_address_line_style_controls()
{
$this->start_controls_section(
'section_form_address_line_style',
[
'label' => __('Address Line', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'address_line_label_color',
[
'label' => __('Label Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'address_line_label_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label',
]
);
$this->end_controls_section();
}
protected function register_image_upload_style_controls()
{
$this->start_controls_section(
'section_form_image_upload_style',
[
'label' => __('Image Upload', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->start_controls_tabs('tabs_form_image_upload_button_style');
$this->start_controls_tab(
'tab_form_image_upload_button_normal',
[
'label' => __('Normal', 'fluentform'),
]
);
$this->add_control(
'form_image_upload_bg_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'background-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_image_upload_button_border_normal',
'label' => __('Border', 'fluentform'),
'default' => '',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
]
);
$this->add_control(
'form_image_upload_button_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_image_upload_button_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_image_upload_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'form_image_upload_button_box_shadow',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_form_image_upload_button_hover',
[
'label' => __('Hover', 'fluentform'),
]
);
$this->add_control(
'form_image_upload_button_bg_color_hover',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_image_upload_button_text_color_hover',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_image_upload_button_border_color_hover',
[
'label' => __('Border Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'border-color: {{VALUE}}',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function register_pagination_style_controls()
{
if (defined('FLUENTFORMPRO')) {
$this->start_controls_section(
'section_form_pagination_style',
[
'label' => __('Pagination', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_pagination_progressbar_label',
[
'label' => __('Progressbar Label', 'fluentform'),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'show_label',
[
'label' => __('Show Label', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'fluentform'),
'label_off' => __('Hide', 'fluentform'),
'return_value' => 'yes',
'default' => 'yes',
'prefix_class' => 'fluent-form-widget-step-header-',
]
);
$this->add_control(
'form_progressbar_label_color',
[
'label' => __('Label Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'scheme' => [
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
],
'selectors' => [
'{{WRAPPER}} .ff-el-progress-status' => 'color: {{VALUE}}',
],
'condition' => [
'show_label' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_progressbar_label_typography',
'label' => __('Typography', 'fluentform'),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ff-el-progress-status',
'condition' => [
'show_label' => 'yes',
],
]
);
$this->add_control(
'form_progressbar_label_space',
[
'label' => __('Spacing', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .ff-el-progress-status' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'show_label' => 'yes',
],
'separator' => 'after',
]
);
$this->add_control(
'form_pagination_progressbar',
[
'label' => __('Progressbar', 'fluentform'),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'show_form_progressbar',
[
'label' => __('Show Progressbar', 'fluentform'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'fluentform'),
'label_off' => __('Hide', 'fluentform'),
'return_value' => 'yes',
'default' => 'yes',
'prefix_class' => 'fluent-form-widget-step-progressbar-',
]
);
$this->start_controls_tabs('form_progressbar_style_tabs');
$this->start_controls_tab(
'form_progressbar_normal',
[
'label' => __('Normal', 'fluentform'),
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'form_progressbar_bg',
'label' => __('Background', 'fluentform'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .ff-el-progress',
'condition' => [
'show_form_progressbar' => 'yes',
],
'exclude' => [
'image',
],
]
);
$this->add_control(
'form_progressbar_color',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'scheme' => [
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
],
'selectors' => [
'{{WRAPPER}} .ff-el-progress-bar span' => 'color: {{VALUE}};',
],
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->add_control(
'form_progressbar_height',
[
'label' => __('Height', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
],
],
'selectors' => [
'{{WRAPPER}} .ff-el-progress' => 'height: {{SIZE}}{{UNIT}};',
],
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_progressbar_border',
'label' => __('Border', 'fluentform'),
'selector' => '{{WRAPPER}} .ff-el-progress',
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->add_control(
'form_progressbar_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .ff-el-progress' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'form_progressbar_filled',
[
'label' => __('Filled', 'fluentform'),
'condition' => [
'show_form_progressbar' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'form_progressbar_bg_filled',
'label' => __('Background', 'fluentform'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .ff-el-progress-bar',
'condition' => [
'show_form_progressbar' => 'yes',
],
'exclude' => [
'image',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'form_pagination_button_style',
[
'label' => __('Button', 'fluentform'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->start_controls_tabs(
'form_pagination_button_style_tabs'
);
$this->start_controls_tab(
'form_pagination_button',
[
'label' => __('Normal', 'fluentform'),
]
);
$this->add_control(
'form_pagination_button_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .step-nav button' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_pagination_button_typography',
'label' => __('Typography', 'fluentform'),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .step-nav button',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'form_pagination_button_bg',
'label' => __('Background', 'fluentform'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .step-nav button',
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_pagination_button_border',
'label' => __('Border', 'fluentform'),
'selector' => '{{WRAPPER}} .step-nav button',
]
);
$this->add_control(
'form_pagination_button_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .step-nav button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'form_pagination_button_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .step-nav button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'form_pagination_button_hover',
[
'label' => __('Hover', 'fluentform'),
]
);
$this->add_control(
'form_pagination_button_hover_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .step-nav button:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'form_pagination_button_hover_bg',
'label' => __('Background', 'fluentform'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .step-nav button:hover',
]
);
$this->add_control(
'form_pagination_button_border_hover_color',
[
'label' => __('Border Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .step-nav button:hover' => 'border-color: {{VALUE}};',
],
]
);
$this->add_control(
'form_pagination_button_border_hover_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .step-nav button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
}
protected function register_submit_button_style_controls()
{
$this->start_controls_section(
'section_form_submit_button_style',
[
'label' => __('Submit Button', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'form_submit_button_align',
[
'label' => __('Alignment', 'fluentform'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'fluentform'),
'icon' => 'eicon-h-align-left',
],
'center' => [
'title' => __('Center', 'fluentform'),
'icon' => 'eicon-h-align-center',
],
'right' => [
'title' => __('Right', 'fluentform'),
'icon' => 'eicon-h-align-right',
],
],
'default' => '',
'prefix_class' => 'fluentform-widget-submit-button-',
'condition' => [
'form_submit_button_width_type' => 'custom',
],
]
);
$this->add_control(
'form_submit_button_width_type',
[
'label' => __('Width', 'fluentform'),
'type' => Controls_Manager::SELECT,
'default' => 'custom',
'options' => [
'full-width' => __('Full Width', 'fluentform'),
'custom' => __('Custom', 'fluentform'),
],
'prefix_class' => 'fluentform-widget-submit-button-',
]
);
$this->add_responsive_control(
'form_submit_button_width',
[
'label' => __('Width', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1200,
'step' => 1,
],
],
'size_units' => ['px', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'width: {{SIZE}}{{UNIT}}', ],
'condition' => [
'form_submit_button_width_type' => 'custom',
],
]
);
$this->start_controls_tabs('tabs_submit_button_style');
$this->start_controls_tab(
'tab_submit_button_normal',
[
'label' => __('Normal', 'fluentform'),
]
);
$this->add_control(
'form_submit_button_bg_color_normal',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '#1a7efb',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_submit_button_text_color_normal',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_submit_button_border_normal',
'label' => __('Border', 'fluentform'),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
]
);
$this->add_control(
'form_submit_button_border_radius',
[
'label' => __('Border Radius', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_submit_button_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_submit_button_margin',
[
'label' => __('Margin Top', 'fluentform'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 150,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'margin-top: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_submit_button_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'form_submit_button_box_shadow',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_submit_button_hover',
[
'label' => __('Hover', 'fluentform'),
]
);
$this->add_control(
'form_submit_button_bg_color_hover',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_submit_button_text_color_hover',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'form_submit_button_border_color_hover',
[
'label' => __('Border Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'border-color: {{VALUE}}',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function register_success_message_style_controls()
{
$this->start_controls_section(
'section_form_success_message_style',
[
'label' => __('Success Message', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_success_message_bg_color',
[
'label' => __('Background Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'form_success_message_text_color',
[
'label' => __('Text Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'form_success_message_border',
'label' => __('Border', 'fluentform'),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_success_message_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success',
]
);
$this->end_controls_section();
}
protected function register_errors_style_controls()
{
$this->start_controls_section(
'section_form_error_style',
[
'label' => __('Error Message', 'fluentform'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'form_error_message_text_color',
[
'label' => __('Color', 'fluentform'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_error_message_typography',
'label' => __('Typography', 'fluentform'),
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger',
]
);
$this->add_responsive_control(
'form_error_message_padding',
[
'label' => __('Padding', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'form_error_message_margin',
[
'label' => __('Margin', 'fluentform'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
/**
* Render the widget output on the frontend.
*
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
*
* @access protected
*/
protected function render()
{
$settings = $this->get_settings_for_display();
extract($settings);
$this->add_render_attribute(
'fluentform_widget_wrapper',
[
'class' => [
'fluentform-widget-wrapper',
],
]
);
if ('yes' != $placeholder_switch) {
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-placeholder');
}
if ('yes' != $labels_switch) {
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-fluent-form-labels');
}
if ('no' == $error_messages) {
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-error-message');
}
if ('yes' == $form_custom_radio_checkbox) {
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-custom-radio-checkbox');
}
if ($form_container_alignment) {
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-align-' . $form_container_alignment . '');
}
if (!empty($form_list)) { ?>
get_render_attribute_string('fluentform_widget_wrapper')); ?>>