| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\App\Modules\Widgets; |
| 4 |
|
| 5 |
use Elementor\Widget_Base; |
| 6 |
use Elementor\Controls_Manager; |
| 7 |
use Elementor\Group_Control_Border; |
| 8 |
use Elementor\Group_Control_Box_Shadow; |
| 9 |
use Elementor\Group_Control_Typography; |
| 10 |
use Elementor\Core\Schemes\Typography as Scheme_Typography; |
| 11 |
use Elementor\Group_Control_Background; |
| 12 |
use Elementor\Core\Schemes\Color as Scheme_Color; |
| 13 |
use FluentForm\App\Helpers\Helper; |
| 14 |
|
| 15 |
if (!defined('ABSPATH')) { |
| 16 |
exit; |
| 17 |
} // Exit if accessed directly |
| 18 |
|
| 19 |
class FluentFormWidget extends Widget_Base |
| 20 |
{ |
| 21 |
public function get_name() |
| 22 |
{ |
| 23 |
return 'fluent-form-widget'; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_title() |
| 27 |
{ |
| 28 |
return __('Fluent Forms', 'fluentform'); |
| 29 |
} |
| 30 |
|
| 31 |
public function get_icon() |
| 32 |
{ |
| 33 |
return 'eicon-form-horizontal'; |
| 34 |
} |
| 35 |
|
| 36 |
public function get_keywords() |
| 37 |
{ |
| 38 |
return [ |
| 39 |
'fluentform', |
| 40 |
'fluentforms', |
| 41 |
'fluent form', |
| 42 |
'fluent forms', |
| 43 |
'contact form', |
| 44 |
'form', |
| 45 |
'elementor form', |
| 46 |
]; |
| 47 |
} |
| 48 |
|
| 49 |
public function get_categories() |
| 50 |
{ |
| 51 |
return ['general']; |
| 52 |
} |
| 53 |
|
| 54 |
public function get_style_depends() |
| 55 |
{ |
| 56 |
return [ |
| 57 |
'fluent-form-styles', |
| 58 |
'fluentform-public-default', |
| 59 |
]; |
| 60 |
} |
| 61 |
|
| 62 |
public function get_script_depends() |
| 63 |
{ |
| 64 |
return ['fluentform-elementor']; |
| 65 |
} |
| 66 |
|
| 67 |
protected function register_controls() |
| 68 |
{ |
| 69 |
$this->register_general_controls(); |
| 70 |
$this->register_error_controls(); |
| 71 |
$this->register_title_description_style_controls(); |
| 72 |
$this->register_form_container_style_controls(); |
| 73 |
$this->register_label_style_controls(); |
| 74 |
$this->register_input_textarea_style_controls(); |
| 75 |
$this->register_placeholder_style_controls(); |
| 76 |
$this->register_radio_checkbox_style_controls(); |
| 77 |
$this->register_terms_gdpr_style_controls(); |
| 78 |
$this->register_section_break_style_controls(); |
| 79 |
$this->register_checkbox_grid_style_controls(); |
| 80 |
$this->register_address_line_style_controls(); |
| 81 |
$this->register_image_upload_style_controls(); |
| 82 |
$this->register_pagination_style_controls(); |
| 83 |
$this->register_submit_button_style_controls(); |
| 84 |
$this->register_success_message_style_controls(); |
| 85 |
$this->register_errors_style_controls(); |
| 86 |
} |
| 87 |
|
| 88 |
protected function register_general_controls() |
| 89 |
{ |
| 90 |
$this->start_controls_section( |
| 91 |
'section_fluent_form', |
| 92 |
[ |
| 93 |
'label' => __('Fluent Forms', 'fluentform'), |
| 94 |
] |
| 95 |
); |
| 96 |
|
| 97 |
$this->add_control( |
| 98 |
'form_list', |
| 99 |
[ |
| 100 |
'label' => esc_html__('Fluent Forms', 'fluentform'), |
| 101 |
'type' => Controls_Manager::SELECT, |
| 102 |
'label_block' => true, |
| 103 |
'options' => Helper::getForms(), |
| 104 |
'default' => '0', |
| 105 |
] |
| 106 |
); |
| 107 |
|
| 108 |
$this->add_control( |
| 109 |
'custom_title_description', |
| 110 |
[ |
| 111 |
'label' => __('Custom Title & Description', 'fluentform'), |
| 112 |
'type' => Controls_Manager::SWITCHER, |
| 113 |
'label_on' => __('Yes', 'fluentform'), |
| 114 |
'label_off' => __('No', 'fluentform'), |
| 115 |
'return_value' => 'yes', |
| 116 |
] |
| 117 |
); |
| 118 |
|
| 119 |
$this->add_control( |
| 120 |
'form_title_custom', |
| 121 |
[ |
| 122 |
'label' => esc_html__('Title', 'fluentform'), |
| 123 |
'type' => Controls_Manager::TEXT, |
| 124 |
'label_block' => true, |
| 125 |
'default' => '', |
| 126 |
'condition' => [ |
| 127 |
'custom_title_description' => 'yes', |
| 128 |
], |
| 129 |
] |
| 130 |
); |
| 131 |
|
| 132 |
$this->add_control( |
| 133 |
'form_description_custom', |
| 134 |
[ |
| 135 |
'label' => esc_html__('Description', 'fluentform'), |
| 136 |
'type' => Controls_Manager::TEXTAREA, |
| 137 |
'default' => '', |
| 138 |
'condition' => [ |
| 139 |
'custom_title_description' => 'yes', |
| 140 |
], |
| 141 |
] |
| 142 |
); |
| 143 |
|
| 144 |
$this->add_control( |
| 145 |
'labels_switch', |
| 146 |
[ |
| 147 |
'label' => __('Labels', 'fluentform'), |
| 148 |
'type' => Controls_Manager::SWITCHER, |
| 149 |
'default' => 'yes', |
| 150 |
'label_on' => __('Show', 'fluentform'), |
| 151 |
'label_off' => __('Hide', 'fluentform'), |
| 152 |
'return_value' => 'yes', |
| 153 |
] |
| 154 |
); |
| 155 |
|
| 156 |
$this->add_control( |
| 157 |
'placeholder_switch', |
| 158 |
[ |
| 159 |
'label' => __('Placeholder', 'fluentform'), |
| 160 |
'type' => Controls_Manager::SWITCHER, |
| 161 |
'default' => 'yes', |
| 162 |
'label_on' => __('Show', 'fluentform'), |
| 163 |
'label_off' => __('Hide', 'fluentform'), |
| 164 |
'return_value' => 'yes', |
| 165 |
] |
| 166 |
); |
| 167 |
|
| 168 |
$this->end_controls_section(); |
| 169 |
} |
| 170 |
|
| 171 |
protected function register_error_controls() |
| 172 |
{ |
| 173 |
$this->start_controls_section( |
| 174 |
'section_errors', |
| 175 |
[ |
| 176 |
'label' => __('Errors', 'fluentform'), |
| 177 |
] |
| 178 |
); |
| 179 |
|
| 180 |
$this->add_control( |
| 181 |
'error_messages', |
| 182 |
[ |
| 183 |
'label' => __('Error Messages', 'fluentform'), |
| 184 |
'type' => Controls_Manager::SWITCHER, |
| 185 |
'default' => 'yes', |
| 186 |
'label_on' => __('Show', 'fluentform'), |
| 187 |
'label_off' => __('Hide', 'fluentform'), |
| 188 |
'return_value' => 'yes', |
| 189 |
] |
| 190 |
); |
| 191 |
|
| 192 |
$this->end_controls_section(); |
| 193 |
} |
| 194 |
|
| 195 |
protected function register_title_description_style_controls() |
| 196 |
{ |
| 197 |
$this->start_controls_section( |
| 198 |
'section_form_title_style', |
| 199 |
[ |
| 200 |
'label' => __('Title & Description', 'fluentform'), |
| 201 |
'tab' => Controls_Manager::TAB_STYLE, |
| 202 |
'condition' => [ |
| 203 |
'custom_title_description' => 'yes', |
| 204 |
], |
| 205 |
] |
| 206 |
); |
| 207 |
|
| 208 |
$this->add_responsive_control( |
| 209 |
'heading_alignment', |
| 210 |
[ |
| 211 |
'label' => __('Alignment', 'fluentform'), |
| 212 |
'type' => Controls_Manager::CHOOSE, |
| 213 |
'options' => [ |
| 214 |
'left' => [ |
| 215 |
'title' => __('Left', 'fluentform'), |
| 216 |
'icon' => 'fa fa-align-left', |
| 217 |
], |
| 218 |
'center' => [ |
| 219 |
'title' => __('Center', 'fluentform'), |
| 220 |
'icon' => 'fa fa-align-center', |
| 221 |
], |
| 222 |
'right' => [ |
| 223 |
'title' => __('Right', 'fluentform'), |
| 224 |
'icon' => 'fa fa-align-right', |
| 225 |
], |
| 226 |
], |
| 227 |
'default' => '', |
| 228 |
'selectors' => [ |
| 229 |
'{{WRAPPER}} .fluentform-widget-title' => 'text-align: {{VALUE}};', |
| 230 |
'{{WRAPPER}} .fluentform-widget-description' => 'text-align: {{VALUE}};', |
| 231 |
], |
| 232 |
'condition' => [ |
| 233 |
'custom_title_description' => 'yes', |
| 234 |
], |
| 235 |
] |
| 236 |
); |
| 237 |
|
| 238 |
$this->add_control( |
| 239 |
'heading_title', |
| 240 |
[ |
| 241 |
'label' => __('Title', 'fluentform'), |
| 242 |
'type' => Controls_Manager::HEADING, |
| 243 |
'separator' => 'before', |
| 244 |
'condition' => [ |
| 245 |
'custom_title_description' => 'yes', |
| 246 |
], |
| 247 |
] |
| 248 |
); |
| 249 |
|
| 250 |
$this->add_control( |
| 251 |
'form_title_text_color', |
| 252 |
[ |
| 253 |
'label' => __('Color', 'fluentform'), |
| 254 |
'type' => Controls_Manager::COLOR, |
| 255 |
'default' => '', |
| 256 |
'selectors' => [ |
| 257 |
'{{WRAPPER}} .fluentform-widget-title' => 'color: {{VALUE}}', |
| 258 |
], |
| 259 |
'condition' => [ |
| 260 |
'custom_title_description' => 'yes', |
| 261 |
], |
| 262 |
] |
| 263 |
); |
| 264 |
|
| 265 |
$this->add_group_control( |
| 266 |
Group_Control_Typography::get_type(), |
| 267 |
[ |
| 268 |
'name' => 'form_title_typography', |
| 269 |
'label' => __('Typography', 'fluentform'), |
| 270 |
'selector' => '{{WRAPPER}} .fluentform-widget-title', |
| 271 |
'condition' => [ |
| 272 |
'custom_title_description' => 'yes', |
| 273 |
], |
| 274 |
] |
| 275 |
); |
| 276 |
|
| 277 |
$this->add_responsive_control( |
| 278 |
'form_title_margin', |
| 279 |
[ |
| 280 |
'label' => __('Margin', 'fluentform'), |
| 281 |
'type' => Controls_Manager::DIMENSIONS, |
| 282 |
'size_units' => ['px', 'em', '%'], |
| 283 |
'allowed_dimensions' => 'vertical', |
| 284 |
'placeholder' => [ |
| 285 |
'top' => '', |
| 286 |
'right' => 'auto', |
| 287 |
'bottom' => '', |
| 288 |
'left' => 'auto', |
| 289 |
], |
| 290 |
'selectors' => [ |
| 291 |
'{{WRAPPER}} .fluentform-widget-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 292 |
], |
| 293 |
'condition' => [ |
| 294 |
'custom_title_description' => 'yes', |
| 295 |
], |
| 296 |
] |
| 297 |
); |
| 298 |
|
| 299 |
$this->add_responsive_control( |
| 300 |
'form_title_padding', |
| 301 |
[ |
| 302 |
'label' => esc_html__('Padding', 'fluentform'), |
| 303 |
'type' => Controls_Manager::DIMENSIONS, |
| 304 |
'size_units' => ['px', 'em', '%'], |
| 305 |
'selectors' => [ |
| 306 |
'{{WRAPPER}} .fluentform-widget-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 307 |
], |
| 308 |
] |
| 309 |
); |
| 310 |
|
| 311 |
$this->add_control( |
| 312 |
'heading_description', |
| 313 |
[ |
| 314 |
'label' => __('Description', 'fluentform'), |
| 315 |
'type' => Controls_Manager::HEADING, |
| 316 |
'separator' => 'before', |
| 317 |
'condition' => [ |
| 318 |
'custom_title_description' => 'yes', |
| 319 |
], |
| 320 |
] |
| 321 |
); |
| 322 |
|
| 323 |
$this->add_control( |
| 324 |
'heading_description_text_color', |
| 325 |
[ |
| 326 |
'label' => __('Color', 'fluentform'), |
| 327 |
'type' => Controls_Manager::COLOR, |
| 328 |
'default' => '', |
| 329 |
'selectors' => [ |
| 330 |
'{{WRAPPER}} .fluentform-widget-description' => 'color: {{VALUE}}', |
| 331 |
], |
| 332 |
'condition' => [ |
| 333 |
'custom_title_description' => 'yes', |
| 334 |
], |
| 335 |
] |
| 336 |
); |
| 337 |
|
| 338 |
$this->add_group_control( |
| 339 |
Group_Control_Typography::get_type(), |
| 340 |
[ |
| 341 |
'name' => 'heading_description_typography', |
| 342 |
'label' => __('Typography', 'fluentform'), |
| 343 |
'scheme' => Scheme_Typography::TYPOGRAPHY_4, |
| 344 |
'selector' => '{{WRAPPER}} .fluentform-widget-description', |
| 345 |
'condition' => [ |
| 346 |
'custom_title_description' => 'yes', |
| 347 |
], |
| 348 |
] |
| 349 |
); |
| 350 |
|
| 351 |
$this->add_responsive_control( |
| 352 |
'heading_description_margin', |
| 353 |
[ |
| 354 |
'label' => __('Margin', 'fluentform'), |
| 355 |
'type' => Controls_Manager::DIMENSIONS, |
| 356 |
'size_units' => ['px', 'em', '%'], |
| 357 |
'allowed_dimensions' => 'vertical', |
| 358 |
'placeholder' => [ |
| 359 |
'top' => '', |
| 360 |
'right' => 'auto', |
| 361 |
'bottom' => '', |
| 362 |
'left' => 'auto', |
| 363 |
], |
| 364 |
'selectors' => [ |
| 365 |
'{{WRAPPER}} .fluentform-widget-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 366 |
], |
| 367 |
'condition' => [ |
| 368 |
'custom_title_description' => 'yes', |
| 369 |
], |
| 370 |
] |
| 371 |
); |
| 372 |
|
| 373 |
$this->add_responsive_control( |
| 374 |
'heading_description_padding', |
| 375 |
[ |
| 376 |
'label' => esc_html__('Padding', 'fluentform'), |
| 377 |
'type' => Controls_Manager::DIMENSIONS, |
| 378 |
'size_units' => ['px', 'em', '%'], |
| 379 |
'selectors' => [ |
| 380 |
'{{WRAPPER}} .fluentform-widget-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 381 |
], |
| 382 |
] |
| 383 |
); |
| 384 |
|
| 385 |
$this->end_controls_section(); |
| 386 |
} |
| 387 |
|
| 388 |
protected function register_form_container_style_controls() |
| 389 |
{ |
| 390 |
$this->start_controls_section( |
| 391 |
'section_form_container_style', |
| 392 |
[ |
| 393 |
'label' => __('Form Container', 'fluentform'), |
| 394 |
'tab' => Controls_Manager::TAB_STYLE, |
| 395 |
] |
| 396 |
); |
| 397 |
|
| 398 |
$this->add_group_control( |
| 399 |
Group_Control_Background::get_type(), |
| 400 |
[ |
| 401 |
'name' => 'form_container_background', |
| 402 |
'label' => __('Background', 'fluentform'), |
| 403 |
'types' => ['classic', 'gradient'], |
| 404 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper', |
| 405 |
] |
| 406 |
); |
| 407 |
|
| 408 |
$this->add_control( |
| 409 |
'form_container_link_color', |
| 410 |
[ |
| 411 |
'label' => __('Link Color', 'fluentform'), |
| 412 |
'type' => Controls_Manager::COLOR, |
| 413 |
'default' => '', |
| 414 |
'selectors' => [ |
| 415 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group a' => 'color: {{VALUE}};', |
| 416 |
], |
| 417 |
] |
| 418 |
); |
| 419 |
|
| 420 |
$this->add_responsive_control( |
| 421 |
'form_container_max_width', |
| 422 |
[ |
| 423 |
'label' => esc_html__('Max Width', 'fluentform'), |
| 424 |
'type' => Controls_Manager::SLIDER, |
| 425 |
'size_units' => ['px', 'em', '%'], |
| 426 |
'range' => [ |
| 427 |
'px' => [ |
| 428 |
'min' => 10, |
| 429 |
'max' => 1500, |
| 430 |
], |
| 431 |
'em' => [ |
| 432 |
'min' => 1, |
| 433 |
'max' => 80, |
| 434 |
], |
| 435 |
], |
| 436 |
'selectors' => [ |
| 437 |
'{{WRAPPER}} .fluentform-widget-wrapper' => 'width: {{SIZE}}{{UNIT}};', |
| 438 |
], |
| 439 |
] |
| 440 |
); |
| 441 |
|
| 442 |
$this->add_responsive_control( |
| 443 |
'form_container_alignment', |
| 444 |
[ |
| 445 |
'label' => esc_html__('Alignment', 'fluentform'), |
| 446 |
'type' => Controls_Manager::CHOOSE, |
| 447 |
'label_block' => true, |
| 448 |
'options' => [ |
| 449 |
'default' => [ |
| 450 |
'title' => __('Default', 'fluentform'), |
| 451 |
'icon' => 'fa fa-ban', |
| 452 |
], |
| 453 |
'left' => [ |
| 454 |
'title' => esc_html__('Left', 'fluentform'), |
| 455 |
'icon' => 'eicon-h-align-left', |
| 456 |
], |
| 457 |
'center' => [ |
| 458 |
'title' => esc_html__('Center', 'fluentform'), |
| 459 |
'icon' => 'eicon-h-align-center', |
| 460 |
], |
| 461 |
'right' => [ |
| 462 |
'title' => esc_html__('Right', 'fluentform'), |
| 463 |
'icon' => 'eicon-h-align-right', |
| 464 |
], |
| 465 |
], |
| 466 |
'default' => 'default', |
| 467 |
] |
| 468 |
); |
| 469 |
|
| 470 |
$this->add_responsive_control( |
| 471 |
'form_container_margin', |
| 472 |
[ |
| 473 |
'label' => esc_html__('Margin', 'fluentform'), |
| 474 |
'type' => Controls_Manager::DIMENSIONS, |
| 475 |
'size_units' => ['px', 'em', '%'], |
| 476 |
'selectors' => [ |
| 477 |
'{{WRAPPER}} .fluentform-widget-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 478 |
], |
| 479 |
] |
| 480 |
); |
| 481 |
|
| 482 |
$this->add_responsive_control( |
| 483 |
'form_container_padding', |
| 484 |
[ |
| 485 |
'label' => esc_html__('Padding', 'fluentform'), |
| 486 |
'type' => Controls_Manager::DIMENSIONS, |
| 487 |
'size_units' => ['px', 'em', '%'], |
| 488 |
'selectors' => [ |
| 489 |
'{{WRAPPER}} .fluentform-widget-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 490 |
], |
| 491 |
] |
| 492 |
); |
| 493 |
|
| 494 |
$this->add_group_control( |
| 495 |
Group_Control_Border::get_type(), |
| 496 |
[ |
| 497 |
'name' => 'form_container_border', |
| 498 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper', |
| 499 |
] |
| 500 |
); |
| 501 |
|
| 502 |
$this->add_control( |
| 503 |
'form_container_border_radius', |
| 504 |
[ |
| 505 |
'label' => esc_html__('Border Radius', 'fluentform'), |
| 506 |
'type' => Controls_Manager::DIMENSIONS, |
| 507 |
'separator' => 'before', |
| 508 |
'size_units' => ['px'], |
| 509 |
'selectors' => [ |
| 510 |
'{{WRAPPER}} .fluentform-widget-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 511 |
], |
| 512 |
] |
| 513 |
); |
| 514 |
|
| 515 |
$this->add_group_control( |
| 516 |
Group_Control_Box_Shadow::get_type(), |
| 517 |
[ |
| 518 |
'name' => 'form_container_box_shadow', |
| 519 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper', |
| 520 |
] |
| 521 |
); |
| 522 |
|
| 523 |
$this->end_controls_section(); |
| 524 |
} |
| 525 |
|
| 526 |
protected function register_label_style_controls() |
| 527 |
{ |
| 528 |
$this->start_controls_section( |
| 529 |
'section_form_label_style', |
| 530 |
[ |
| 531 |
'label' => __('Labels', 'fluentform'), |
| 532 |
'tab' => Controls_Manager::TAB_STYLE, |
| 533 |
] |
| 534 |
); |
| 535 |
|
| 536 |
$this->add_control( |
| 537 |
'form_label_text_color', |
| 538 |
[ |
| 539 |
'label' => __('Text Color', 'fluentform'), |
| 540 |
'type' => Controls_Manager::COLOR, |
| 541 |
'selectors' => [ |
| 542 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label' => 'color: {{VALUE}}', |
| 543 |
], |
| 544 |
] |
| 545 |
); |
| 546 |
|
| 547 |
$this->add_group_control( |
| 548 |
Group_Control_Typography::get_type(), |
| 549 |
[ |
| 550 |
'name' => 'form_label_typography', |
| 551 |
'label' => __('Typography', 'fluentform'), |
| 552 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label', |
| 553 |
] |
| 554 |
); |
| 555 |
|
| 556 |
$this->end_controls_section(); |
| 557 |
} |
| 558 |
|
| 559 |
protected function register_input_textarea_style_controls() |
| 560 |
{ |
| 561 |
$this->start_controls_section( |
| 562 |
'section_form_fields_style', |
| 563 |
[ |
| 564 |
'label' => __('Input & Textarea', 'fluentform'), |
| 565 |
'tab' => Controls_Manager::TAB_STYLE, |
| 566 |
] |
| 567 |
); |
| 568 |
|
| 569 |
$this->add_responsive_control( |
| 570 |
'input_alignment', |
| 571 |
[ |
| 572 |
'label' => __('Alignment', 'fluentform'), |
| 573 |
'type' => Controls_Manager::CHOOSE, |
| 574 |
'options' => [ |
| 575 |
'left' => [ |
| 576 |
'title' => __('Left', 'fluentform'), |
| 577 |
'icon' => 'fa fa-align-left', |
| 578 |
], |
| 579 |
'center' => [ |
| 580 |
'title' => __('Center', 'fluentform'), |
| 581 |
'icon' => 'fa fa-align-center', |
| 582 |
], |
| 583 |
'right' => [ |
| 584 |
'title' => __('Right', 'fluentform'), |
| 585 |
'icon' => 'fa fa-align-right', |
| 586 |
], |
| 587 |
], |
| 588 |
'default' => '', |
| 589 |
'selectors' => [ |
| 590 |
'{{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}};', |
| 591 |
], |
| 592 |
] |
| 593 |
); |
| 594 |
|
| 595 |
$this->start_controls_tabs('tabs_form_fields_style'); |
| 596 |
|
| 597 |
$this->start_controls_tab( |
| 598 |
'tab_form_fields_normal', |
| 599 |
[ |
| 600 |
'label' => __('Normal', 'fluentform'), |
| 601 |
] |
| 602 |
); |
| 603 |
|
| 604 |
$this->add_control( |
| 605 |
'form_field_bg_color', |
| 606 |
[ |
| 607 |
'label' => __('Background Color', 'fluentform'), |
| 608 |
'type' => Controls_Manager::COLOR, |
| 609 |
'default' => '', |
| 610 |
'selectors' => [ |
| 611 |
'{{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}}', |
| 612 |
], |
| 613 |
] |
| 614 |
); |
| 615 |
|
| 616 |
$this->add_control( |
| 617 |
'form_field_text_color', |
| 618 |
[ |
| 619 |
'label' => __('Text Color', 'fluentform'), |
| 620 |
'type' => Controls_Manager::COLOR, |
| 621 |
'default' => '', |
| 622 |
'selectors' => [ |
| 623 |
'{{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}}', |
| 624 |
], |
| 625 |
] |
| 626 |
); |
| 627 |
|
| 628 |
$this->add_group_control( |
| 629 |
Group_Control_Border::get_type(), |
| 630 |
[ |
| 631 |
'name' => 'form_field_border', |
| 632 |
'label' => __('Border', 'fluentform'), |
| 633 |
'placeholder' => '1px', |
| 634 |
'default' => '1px', |
| 635 |
'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', |
| 636 |
'separator' => 'before', |
| 637 |
] |
| 638 |
); |
| 639 |
|
| 640 |
$this->add_control( |
| 641 |
'form_field_radius', |
| 642 |
[ |
| 643 |
'label' => __('Border Radius', 'fluentform'), |
| 644 |
'type' => Controls_Manager::DIMENSIONS, |
| 645 |
'size_units' => ['px', 'em', '%'], |
| 646 |
'selectors' => [ |
| 647 |
'{{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}};', |
| 648 |
], |
| 649 |
] |
| 650 |
); |
| 651 |
|
| 652 |
$this->add_responsive_control( |
| 653 |
'form_field_text_indent', |
| 654 |
[ |
| 655 |
'label' => __('Text Indent', 'fluentform'), |
| 656 |
'type' => Controls_Manager::SLIDER, |
| 657 |
'range' => [ |
| 658 |
'px' => [ |
| 659 |
'min' => 0, |
| 660 |
'max' => 60, |
| 661 |
'step' => 1, |
| 662 |
], |
| 663 |
'%' => [ |
| 664 |
'min' => 0, |
| 665 |
'max' => 30, |
| 666 |
'step' => 1, |
| 667 |
], |
| 668 |
], |
| 669 |
'size_units' => ['px', 'em', '%'], |
| 670 |
'selectors' => [ |
| 671 |
'{{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}}', |
| 672 |
], |
| 673 |
'separator' => 'before', |
| 674 |
] |
| 675 |
); |
| 676 |
|
| 677 |
$this->add_responsive_control( |
| 678 |
'form_input_width', |
| 679 |
[ |
| 680 |
'label' => __('Input Width', 'fluentform'), |
| 681 |
'type' => Controls_Manager::SLIDER, |
| 682 |
'range' => [ |
| 683 |
'px' => [ |
| 684 |
'min' => 0, |
| 685 |
'max' => 1200, |
| 686 |
'step' => 1, |
| 687 |
], |
| 688 |
], |
| 689 |
'size_units' => ['px', 'em', '%'], |
| 690 |
'selectors' => [ |
| 691 |
'{{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}}', |
| 692 |
], |
| 693 |
] |
| 694 |
); |
| 695 |
|
| 696 |
$this->add_responsive_control( |
| 697 |
'form_input_height', |
| 698 |
[ |
| 699 |
'label' => __('Input Height', 'fluentform'), |
| 700 |
'type' => Controls_Manager::SLIDER, |
| 701 |
'range' => [ |
| 702 |
'px' => [ |
| 703 |
'min' => 0, |
| 704 |
'max' => 80, |
| 705 |
'step' => 1, |
| 706 |
], |
| 707 |
], |
| 708 |
'size_units' => ['px', 'em', '%'], |
| 709 |
'selectors' => [ |
| 710 |
'{{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}}', |
| 711 |
], |
| 712 |
] |
| 713 |
); |
| 714 |
|
| 715 |
$this->add_responsive_control( |
| 716 |
'form_textarea_width', |
| 717 |
[ |
| 718 |
'label' => __('Textarea Width', 'fluentform'), |
| 719 |
'type' => Controls_Manager::SLIDER, |
| 720 |
'range' => [ |
| 721 |
'px' => [ |
| 722 |
'min' => 0, |
| 723 |
'max' => 1200, |
| 724 |
'step' => 1, |
| 725 |
], |
| 726 |
], |
| 727 |
'size_units' => ['px', 'em', '%'], |
| 728 |
'selectors' => [ |
| 729 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'width: {{SIZE}}{{UNIT}}', |
| 730 |
], |
| 731 |
] |
| 732 |
); |
| 733 |
|
| 734 |
$this->add_responsive_control( |
| 735 |
'form_textarea_height', |
| 736 |
[ |
| 737 |
'label' => __('Textarea Height', 'fluentform'), |
| 738 |
'type' => Controls_Manager::SLIDER, |
| 739 |
'range' => [ |
| 740 |
'px' => [ |
| 741 |
'min' => 0, |
| 742 |
'max' => 400, |
| 743 |
'step' => 1, |
| 744 |
], |
| 745 |
], |
| 746 |
'size_units' => ['px', 'em', '%'], |
| 747 |
'selectors' => [ |
| 748 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'height: {{SIZE}}{{UNIT}}', |
| 749 |
], |
| 750 |
] |
| 751 |
); |
| 752 |
|
| 753 |
$this->add_responsive_control( |
| 754 |
'form_field_padding', |
| 755 |
[ |
| 756 |
'label' => __('Padding', 'fluentform'), |
| 757 |
'type' => Controls_Manager::DIMENSIONS, |
| 758 |
'size_units' => ['px', 'em', '%'], |
| 759 |
'selectors' => [ |
| 760 |
'{{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}};', |
| 761 |
], |
| 762 |
] |
| 763 |
); |
| 764 |
|
| 765 |
$this->add_responsive_control( |
| 766 |
'form_field_spacing', |
| 767 |
[ |
| 768 |
'label' => __('Spacing', 'fluentform'), |
| 769 |
'type' => Controls_Manager::SLIDER, |
| 770 |
'range' => [ |
| 771 |
'px' => [ |
| 772 |
'min' => 0, |
| 773 |
'max' => 100, |
| 774 |
'step' => 1, |
| 775 |
], |
| 776 |
], |
| 777 |
'size_units' => ['px', 'em', '%'], |
| 778 |
'selectors' => [ |
| 779 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group' => 'margin-bottom: {{SIZE}}{{UNIT}}', |
| 780 |
], |
| 781 |
] |
| 782 |
); |
| 783 |
|
| 784 |
$this->add_group_control( |
| 785 |
Group_Control_Typography::get_type(), |
| 786 |
[ |
| 787 |
'name' => 'form_field_typography', |
| 788 |
'label' => __('Typography', 'fluentform'), |
| 789 |
'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', |
| 790 |
'separator' => 'before', |
| 791 |
] |
| 792 |
); |
| 793 |
|
| 794 |
$this->add_group_control( |
| 795 |
Group_Control_Box_Shadow::get_type(), |
| 796 |
[ |
| 797 |
'name' => 'form_field_box_shadow', |
| 798 |
'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', |
| 799 |
'separator' => 'before', |
| 800 |
] |
| 801 |
); |
| 802 |
|
| 803 |
$this->end_controls_tab(); |
| 804 |
|
| 805 |
$this->start_controls_tab( |
| 806 |
'tab_form_fields_focus', |
| 807 |
[ |
| 808 |
'label' => __('Focus', 'fluentform'), |
| 809 |
] |
| 810 |
); |
| 811 |
|
| 812 |
$this->add_control( |
| 813 |
'form_field_bg_color_focus', |
| 814 |
[ |
| 815 |
'label' => __('Background Color', 'fluentform'), |
| 816 |
'type' => Controls_Manager::COLOR, |
| 817 |
'default' => '', |
| 818 |
'selectors' => [ |
| 819 |
'{{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}}', |
| 820 |
], |
| 821 |
] |
| 822 |
); |
| 823 |
|
| 824 |
$this->add_group_control( |
| 825 |
Group_Control_Border::get_type(), |
| 826 |
[ |
| 827 |
'name' => 'form_input_focus_border', |
| 828 |
'label' => __('Border', 'fluentform'), |
| 829 |
'placeholder' => '1px', |
| 830 |
'default' => '1px', |
| 831 |
'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', |
| 832 |
] |
| 833 |
); |
| 834 |
|
| 835 |
$this->add_group_control( |
| 836 |
Group_Control_Box_Shadow::get_type(), |
| 837 |
[ |
| 838 |
'name' => 'form_input_focus_box_shadow', |
| 839 |
'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', |
| 840 |
'separator' => 'before', |
| 841 |
] |
| 842 |
); |
| 843 |
|
| 844 |
$this->end_controls_tab(); |
| 845 |
|
| 846 |
$this->end_controls_tabs(); |
| 847 |
|
| 848 |
$this->end_controls_section(); |
| 849 |
} |
| 850 |
|
| 851 |
protected function register_terms_gdpr_style_controls() |
| 852 |
{ |
| 853 |
$this->start_controls_section( |
| 854 |
'section_form_terms_gdpr_style', |
| 855 |
[ |
| 856 |
'label' => __('GDPR , Terms & Condition ', 'fluentform'), |
| 857 |
'tab' => Controls_Manager::TAB_STYLE, |
| 858 |
] |
| 859 |
); |
| 860 |
|
| 861 |
$this->add_responsive_control( |
| 862 |
'form_terms_gdpr_alignment', |
| 863 |
[ |
| 864 |
'label' => __('Alignment', 'fluentform'), |
| 865 |
'type' => Controls_Manager::CHOOSE, |
| 866 |
'options' => [ |
| 867 |
'left' => [ |
| 868 |
'title' => __('Left', 'fluentform'), |
| 869 |
'icon' => 'fa fa-align-left', |
| 870 |
], |
| 871 |
'center' => [ |
| 872 |
'title' => __('Center', 'fluentform'), |
| 873 |
'icon' => 'fa fa-align-center', |
| 874 |
], |
| 875 |
'right' => [ |
| 876 |
'title' => __('Right', 'fluentform'), |
| 877 |
'icon' => 'fa fa-align-right', |
| 878 |
], |
| 879 |
], |
| 880 |
'default' => '', |
| 881 |
'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c' => 'text-align: {{VALUE}};'], |
| 882 |
] |
| 883 |
); |
| 884 |
|
| 885 |
$this->add_group_control( |
| 886 |
Group_Control_Typography::get_type(), |
| 887 |
[ |
| 888 |
'name' => 'form_terms_gdpr_typography', |
| 889 |
'label' => __('Typography', 'fluentform'), |
| 890 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ', |
| 891 |
|
| 892 |
] |
| 893 |
); |
| 894 |
$this->add_control( |
| 895 |
'form_terms_gdpr_color', |
| 896 |
[ |
| 897 |
'label' => __('Color', 'fluentform'), |
| 898 |
'type' => Controls_Manager::COLOR, |
| 899 |
'default' => '', |
| 900 |
'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ' => 'color: {{VALUE}};'], |
| 901 |
] |
| 902 |
); |
| 903 |
|
| 904 |
$this->end_controls_section(); |
| 905 |
} |
| 906 |
|
| 907 |
protected function register_placeholder_style_controls() |
| 908 |
{ |
| 909 |
$this->start_controls_section( |
| 910 |
'section_placeholder_style', |
| 911 |
[ |
| 912 |
'label' => __('Placeholder', 'fluentform'), |
| 913 |
'tab' => Controls_Manager::TAB_STYLE, |
| 914 |
'condition' => [ |
| 915 |
'placeholder_switch' => 'yes', |
| 916 |
], |
| 917 |
] |
| 918 |
); |
| 919 |
|
| 920 |
$this->add_control( |
| 921 |
'form_placeholder_text_color', |
| 922 |
[ |
| 923 |
'label' => __('Text Color', 'fluentform'), |
| 924 |
'type' => Controls_Manager::COLOR, |
| 925 |
'selectors' => [ |
| 926 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group input::-webkit-input-placeholder, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea::-webkit-input-placeholder' => 'color: {{VALUE}}', |
| 927 |
], |
| 928 |
'condition' => [ |
| 929 |
'placeholder_switch' => 'yes', |
| 930 |
], |
| 931 |
] |
| 932 |
); |
| 933 |
|
| 934 |
$this->end_controls_section(); |
| 935 |
} |
| 936 |
|
| 937 |
protected function register_radio_checkbox_style_controls() |
| 938 |
{ |
| 939 |
$this->start_controls_section( |
| 940 |
'section_form_radio_checkbox_style', |
| 941 |
[ |
| 942 |
'label' => __('Radio & Checkbox', 'fluentform'), |
| 943 |
'tab' => Controls_Manager::TAB_STYLE, |
| 944 |
] |
| 945 |
); |
| 946 |
|
| 947 |
$this->add_control( |
| 948 |
'form_custom_radio_checkbox', |
| 949 |
[ |
| 950 |
'label' => __('Custom Styles', 'fluentform'), |
| 951 |
'type' => Controls_Manager::SWITCHER, |
| 952 |
'label_on' => __('Yes', 'fluentform'), |
| 953 |
'label_off' => __('No', 'fluentform'), |
| 954 |
'return_value' => 'yes', |
| 955 |
] |
| 956 |
); |
| 957 |
|
| 958 |
$this->add_responsive_control( |
| 959 |
'form_radio_checkbox_size', |
| 960 |
[ |
| 961 |
'label' => __('Size', 'fluentform'), |
| 962 |
'type' => Controls_Manager::SLIDER, |
| 963 |
'default' => [ |
| 964 |
'size' => '15', |
| 965 |
'unit' => 'px', |
| 966 |
], |
| 967 |
'range' => [ |
| 968 |
'px' => [ |
| 969 |
'min' => 0, |
| 970 |
'max' => 80, |
| 971 |
'step' => 1, |
| 972 |
], |
| 973 |
], |
| 974 |
'size_units' => ['px', 'em', '%'], |
| 975 |
'selectors' => [ |
| 976 |
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 977 |
], |
| 978 |
'condition' => [ |
| 979 |
'form_custom_radio_checkbox' => 'yes', |
| 980 |
], |
| 981 |
] |
| 982 |
); |
| 983 |
|
| 984 |
$this->add_responsive_control( |
| 985 |
'form_radio_checkbox_text_indent', |
| 986 |
[ |
| 987 |
'label' => __('Text Indent', 'fluentform'), |
| 988 |
'type' => Controls_Manager::SLIDER, |
| 989 |
'range' => [ |
| 990 |
'px' => [ |
| 991 |
'min' => 0, |
| 992 |
'max' => 60, |
| 993 |
'step' => 1, |
| 994 |
], |
| 995 |
'%' => [ |
| 996 |
'min' => 0, |
| 997 |
'max' => 30, |
| 998 |
'step' => 1, |
| 999 |
], |
| 1000 |
], |
| 1001 |
'size_units' => ['px', 'em', '%'], |
| 1002 |
'selectors' => [ |
| 1003 |
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'margin-right: {{SIZE}}{{UNIT}}', |
| 1004 |
], |
| 1005 |
'condition' => [ |
| 1006 |
'form_custom_radio_checkbox' => 'yes', |
| 1007 |
], |
| 1008 |
] |
| 1009 |
); |
| 1010 |
|
| 1011 |
$this->start_controls_tabs('tabs_radio_checkbox_style'); |
| 1012 |
|
| 1013 |
$this->start_controls_tab( |
| 1014 |
'form_radio_checkbox_normal', |
| 1015 |
[ |
| 1016 |
'label' => __('Normal', 'fluentform'), |
| 1017 |
'condition' => [ |
| 1018 |
'form_custom_radio_checkbox' => 'yes', |
| 1019 |
], |
| 1020 |
] |
| 1021 |
); |
| 1022 |
|
| 1023 |
$this->add_control( |
| 1024 |
'form_radio_checkbox_bg_color', |
| 1025 |
[ |
| 1026 |
'label' => __('Background Color', 'fluentform'), |
| 1027 |
'type' => Controls_Manager::COLOR, |
| 1028 |
'default' => '', |
| 1029 |
'selectors' => [ |
| 1030 |
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'background-color: {{VALUE}}', |
| 1031 |
], |
| 1032 |
'condition' => [ |
| 1033 |
'form_custom_radio_checkbox' => 'yes', |
| 1034 |
], |
| 1035 |
] |
| 1036 |
); |
| 1037 |
|
| 1038 |
$this->add_responsive_control( |
| 1039 |
'form_checkbox_border_width', |
| 1040 |
[ |
| 1041 |
'label' => __('Border Width', 'fluentform'), |
| 1042 |
'type' => Controls_Manager::SLIDER, |
| 1043 |
'range' => [ |
| 1044 |
'px' => [ |
| 1045 |
'min' => 0, |
| 1046 |
'max' => 15, |
| 1047 |
'step' => 1, |
| 1048 |
], |
| 1049 |
], |
| 1050 |
'size_units' => ['px'], |
| 1051 |
'selectors' => [ |
| 1052 |
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-width: {{SIZE}}{{UNIT}}', |
| 1053 |
], |
| 1054 |
'condition' => [ |
| 1055 |
'form_custom_radio_checkbox' => 'yes', |
| 1056 |
], |
| 1057 |
] |
| 1058 |
); |
| 1059 |
|
| 1060 |
$this->add_control( |
| 1061 |
'form_checkbox_border_color', |
| 1062 |
[ |
| 1063 |
'label' => __('Border Color', 'fluentform'), |
| 1064 |
'type' => Controls_Manager::COLOR, |
| 1065 |
'default' => '', |
| 1066 |
'selectors' => [ |
| 1067 |
'{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-color: {{VALUE}}', |
| 1068 |
], |
| 1069 |
'condition' => [ |
| 1070 |
'form_custom_radio_checkbox' => 'yes', |
| 1071 |
], |
| 1072 |
] |
| 1073 |
); |
| 1074 |
|
| 1075 |
$this->add_control( |
| 1076 |
'form_checkbox_heading', |
| 1077 |
[ |
| 1078 |
'label' => __('Checkbox', 'fluentform'), |
| 1079 |
'type' => Controls_Manager::HEADING, |
| 1080 |
'condition' => [ |
| 1081 |
'form_custom_radio_checkbox' => 'yes', |
| 1082 |
], |
| 1083 |
] |
| 1084 |
); |
| 1085 |
|
| 1086 |
$this->add_control( |
| 1087 |
'form_checkbox_border_radius', |
| 1088 |
[ |
| 1089 |
'label' => __('Border Radius', 'fluentform'), |
| 1090 |
'type' => Controls_Manager::DIMENSIONS, |
| 1091 |
'size_units' => ['px', 'em', '%'], |
| 1092 |
'selectors' => [ |
| 1093 |
'{{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}};', |
| 1094 |
], |
| 1095 |
'condition' => [ |
| 1096 |
'form_custom_radio_checkbox' => 'yes', |
| 1097 |
], |
| 1098 |
] |
| 1099 |
); |
| 1100 |
|
| 1101 |
$this->add_control( |
| 1102 |
'form_radio_heading', |
| 1103 |
[ |
| 1104 |
'label' => __('Radio Buttons', 'fluentform'), |
| 1105 |
'type' => Controls_Manager::HEADING, |
| 1106 |
'condition' => [ |
| 1107 |
'form_custom_radio_checkbox' => 'yes', |
| 1108 |
], |
| 1109 |
] |
| 1110 |
); |
| 1111 |
|
| 1112 |
$this->add_control( |
| 1113 |
'form_radio_border_radius', |
| 1114 |
[ |
| 1115 |
'label' => __('Border Radius', 'fluentform'), |
| 1116 |
'type' => Controls_Manager::DIMENSIONS, |
| 1117 |
'size_units' => ['px', 'em', '%'], |
| 1118 |
'selectors' => [ |
| 1119 |
'{{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}};', |
| 1120 |
], |
| 1121 |
'condition' => [ |
| 1122 |
'form_custom_radio_checkbox' => 'yes', |
| 1123 |
], |
| 1124 |
] |
| 1125 |
); |
| 1126 |
|
| 1127 |
$this->end_controls_tab(); |
| 1128 |
|
| 1129 |
$this->start_controls_tab( |
| 1130 |
'form_radio_checkbox_checked', |
| 1131 |
[ |
| 1132 |
'label' => __('Checked', 'fluentform'), |
| 1133 |
'condition' => [ |
| 1134 |
'form_custom_radio_checkbox' => 'yes', |
| 1135 |
], |
| 1136 |
] |
| 1137 |
); |
| 1138 |
|
| 1139 |
$this->add_control( |
| 1140 |
'form_radio_checkbox_bg_color_checked', |
| 1141 |
[ |
| 1142 |
'label' => __('Background Color', 'fluentform'), |
| 1143 |
'type' => Controls_Manager::COLOR, |
| 1144 |
'default' => '', |
| 1145 |
'selectors' => [ |
| 1146 |
'{{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}}', |
| 1147 |
], |
| 1148 |
'condition' => [ |
| 1149 |
'form_custom_radio_checkbox' => 'yes', |
| 1150 |
], |
| 1151 |
] |
| 1152 |
); |
| 1153 |
|
| 1154 |
$this->add_control( |
| 1155 |
'form_radio_checkbox_border_checked', |
| 1156 |
[ |
| 1157 |
'label' => __('Border Color', 'fluentform'), |
| 1158 |
'type' => Controls_Manager::COLOR, |
| 1159 |
'default' => '', |
| 1160 |
'selectors' => [ |
| 1161 |
'{{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}}', |
| 1162 |
], |
| 1163 |
'condition' => [ |
| 1164 |
'form_custom_radio_checkbox' => 'yes', |
| 1165 |
], |
| 1166 |
] |
| 1167 |
); |
| 1168 |
|
| 1169 |
$this->end_controls_tab(); |
| 1170 |
|
| 1171 |
$this->end_controls_tabs(); |
| 1172 |
|
| 1173 |
$this->end_controls_section(); |
| 1174 |
} |
| 1175 |
|
| 1176 |
protected function register_section_break_style_controls() |
| 1177 |
{ |
| 1178 |
$this->start_controls_section( |
| 1179 |
'form_section_break_style', |
| 1180 |
[ |
| 1181 |
'label' => __('Section Break', 'fluentform'), |
| 1182 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1183 |
] |
| 1184 |
); |
| 1185 |
|
| 1186 |
$this->add_control( |
| 1187 |
'form_section_break_label', |
| 1188 |
[ |
| 1189 |
'label' => __('Label', 'fluentform'), |
| 1190 |
'type' => Controls_Manager::HEADING, |
| 1191 |
] |
| 1192 |
); |
| 1193 |
|
| 1194 |
$this->add_control( |
| 1195 |
'form_section_break_label_color', |
| 1196 |
[ |
| 1197 |
'label' => __('Color', 'fluentform'), |
| 1198 |
'type' => Controls_Manager::COLOR, |
| 1199 |
'default' => '', |
| 1200 |
'selectors' => [ |
| 1201 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'color: {{VALUE}};', |
| 1202 |
], |
| 1203 |
] |
| 1204 |
); |
| 1205 |
|
| 1206 |
$this->add_group_control( |
| 1207 |
Group_Control_Typography::get_type(), |
| 1208 |
[ |
| 1209 |
'name' => 'form_section_break_label_typography', |
| 1210 |
'label' => __('Typography', 'fluentform'), |
| 1211 |
'selector' => '.fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title', |
| 1212 |
'separator' => 'before', |
| 1213 |
] |
| 1214 |
); |
| 1215 |
|
| 1216 |
$this->add_responsive_control( |
| 1217 |
'form_section_break_label_padding', |
| 1218 |
[ |
| 1219 |
'label' => __('Padding', 'fluentform'), |
| 1220 |
'type' => Controls_Manager::DIMENSIONS, |
| 1221 |
'size_units' => ['px', 'em', '%'], |
| 1222 |
'selectors' => [ |
| 1223 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1224 |
], |
| 1225 |
] |
| 1226 |
); |
| 1227 |
|
| 1228 |
$this->add_responsive_control( |
| 1229 |
'form_section_break_label_margin', |
| 1230 |
[ |
| 1231 |
'label' => __('Margin', 'fluentform'), |
| 1232 |
'type' => Controls_Manager::DIMENSIONS, |
| 1233 |
'size_units' => ['px', 'em', '%'], |
| 1234 |
'selectors' => [ |
| 1235 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1236 |
], |
| 1237 |
] |
| 1238 |
); |
| 1239 |
|
| 1240 |
$this->add_control( |
| 1241 |
'form_section_break_description', |
| 1242 |
[ |
| 1243 |
'label' => __('Description', 'fluentform'), |
| 1244 |
'type' => Controls_Manager::HEADING, |
| 1245 |
'separator' => 'before', |
| 1246 |
] |
| 1247 |
); |
| 1248 |
|
| 1249 |
$this->add_control( |
| 1250 |
'form_section_break_description_color', |
| 1251 |
[ |
| 1252 |
'label' => __('Color', 'fluentform'), |
| 1253 |
'type' => Controls_Manager::COLOR, |
| 1254 |
'default' => '', |
| 1255 |
'selectors' => [ |
| 1256 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'color: {{VALUE}};', |
| 1257 |
], |
| 1258 |
] |
| 1259 |
); |
| 1260 |
|
| 1261 |
$this->add_group_control( |
| 1262 |
Group_Control_Typography::get_type(), |
| 1263 |
[ |
| 1264 |
'name' => 'form_section_break_description_typography', |
| 1265 |
'label' => __('Typography', 'fluentform'), |
| 1266 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break div', |
| 1267 |
'separator' => 'before', |
| 1268 |
] |
| 1269 |
); |
| 1270 |
|
| 1271 |
$this->add_responsive_control( |
| 1272 |
'form_section_break_description_padding', |
| 1273 |
[ |
| 1274 |
'label' => __('Padding', 'fluentform'), |
| 1275 |
'type' => Controls_Manager::DIMENSIONS, |
| 1276 |
'size_units' => ['px', 'em', '%'], |
| 1277 |
'selectors' => [ |
| 1278 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1279 |
], |
| 1280 |
] |
| 1281 |
); |
| 1282 |
|
| 1283 |
$this->add_responsive_control( |
| 1284 |
'form_section_break_description_margin', |
| 1285 |
[ |
| 1286 |
'label' => __('Margin', 'fluentform'), |
| 1287 |
'type' => Controls_Manager::DIMENSIONS, |
| 1288 |
'size_units' => ['px', 'em', '%'], |
| 1289 |
'selectors' => [ |
| 1290 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1291 |
], |
| 1292 |
] |
| 1293 |
); |
| 1294 |
|
| 1295 |
$this->add_responsive_control( |
| 1296 |
'form_section_break_alignment', |
| 1297 |
[ |
| 1298 |
'label' => __('Alignment', 'fluentform'), |
| 1299 |
'type' => Controls_Manager::CHOOSE, |
| 1300 |
'options' => [ |
| 1301 |
'left' => [ |
| 1302 |
'title' => __('Left', 'fluentform'), |
| 1303 |
'icon' => 'eicon-h-align-left', |
| 1304 |
], |
| 1305 |
'center' => [ |
| 1306 |
'title' => __('Center', 'fluentform'), |
| 1307 |
'icon' => 'eicon-h-align-center', |
| 1308 |
], |
| 1309 |
'right' => [ |
| 1310 |
'title' => __('Right', 'fluentform'), |
| 1311 |
'icon' => 'eicon-h-align-right', |
| 1312 |
], |
| 1313 |
], |
| 1314 |
'prefix_class' => 'fluentform-widget-section-break-content-', |
| 1315 |
] |
| 1316 |
); |
| 1317 |
|
| 1318 |
$this->end_controls_section(); |
| 1319 |
} |
| 1320 |
|
| 1321 |
protected function register_checkbox_grid_style_controls() |
| 1322 |
{ |
| 1323 |
$this->start_controls_section( |
| 1324 |
'section_form_checkbox_grid', |
| 1325 |
[ |
| 1326 |
'label' => __('Checkbox Grid', 'fluentform'), |
| 1327 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1328 |
] |
| 1329 |
); |
| 1330 |
|
| 1331 |
$this->add_control( |
| 1332 |
'section_form_checkbox_grid_head', |
| 1333 |
[ |
| 1334 |
'label' => __('Grid Table Head', 'fluentform'), |
| 1335 |
'type' => Controls_Manager::HEADING, |
| 1336 |
'separator' => 'before', |
| 1337 |
] |
| 1338 |
); |
| 1339 |
|
| 1340 |
$this->add_control( |
| 1341 |
'form_checkbox_grid_table_head_text_color', |
| 1342 |
[ |
| 1343 |
'label' => __('Color', 'fluentform'), |
| 1344 |
'type' => Controls_Manager::COLOR, |
| 1345 |
'default' => '', |
| 1346 |
'selectors' => [ |
| 1347 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'color: {{VALUE}};', |
| 1348 |
], |
| 1349 |
] |
| 1350 |
); |
| 1351 |
|
| 1352 |
$this->add_control( |
| 1353 |
'form_checkbox_grid_table_head_color', |
| 1354 |
[ |
| 1355 |
'label' => __('Background Color', 'fluentform'), |
| 1356 |
'type' => Controls_Manager::COLOR, |
| 1357 |
'default' => '', |
| 1358 |
'selectors' => [ |
| 1359 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'background-color: {{VALUE}};', |
| 1360 |
], |
| 1361 |
] |
| 1362 |
); |
| 1363 |
|
| 1364 |
$this->add_group_control( |
| 1365 |
Group_Control_Typography::get_type(), |
| 1366 |
[ |
| 1367 |
'name' => 'form_checkbox_grid_table_head_typography', |
| 1368 |
'label' => __('Typography', 'fluentform'), |
| 1369 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th', |
| 1370 |
'separator' => 'before', |
| 1371 |
] |
| 1372 |
); |
| 1373 |
|
| 1374 |
$this->add_responsive_control( |
| 1375 |
'form_checkbox_grid_table_head_height', |
| 1376 |
[ |
| 1377 |
'label' => __('Height', 'fluentform'), |
| 1378 |
'type' => Controls_Manager::SLIDER, |
| 1379 |
'range' => [ |
| 1380 |
'px' => [ |
| 1381 |
'min' => 0, |
| 1382 |
'max' => 1200, |
| 1383 |
'step' => 1, |
| 1384 |
], |
| 1385 |
], |
| 1386 |
'size_units' => ['px', '%'], |
| 1387 |
'selectors' => [ |
| 1388 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'height: {{SIZE}}{{UNIT}}', |
| 1389 |
], |
| 1390 |
] |
| 1391 |
); |
| 1392 |
|
| 1393 |
$this->add_group_control( |
| 1394 |
Group_Control_Border::get_type(), |
| 1395 |
[ |
| 1396 |
'name' => 'form_checkbox_grid_table_head_border', |
| 1397 |
'label' => __('Border', 'fluentform'), |
| 1398 |
'default' => '', |
| 1399 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead tr', |
| 1400 |
] |
| 1401 |
); |
| 1402 |
|
| 1403 |
$this->add_responsive_control( |
| 1404 |
'form_checkbox_grid_table_head_padding', |
| 1405 |
[ |
| 1406 |
'label' => __('Padding', 'fluentform'), |
| 1407 |
'type' => Controls_Manager::DIMENSIONS, |
| 1408 |
'size_units' => ['px', 'em', '%'], |
| 1409 |
'selectors' => [ |
| 1410 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1411 |
], |
| 1412 |
] |
| 1413 |
); |
| 1414 |
|
| 1415 |
$this->add_control( |
| 1416 |
'form_checkbox_grid_table_item', |
| 1417 |
[ |
| 1418 |
'label' => __('Grid Table Item', 'fluentform'), |
| 1419 |
'type' => Controls_Manager::HEADING, |
| 1420 |
'separator' => 'before', |
| 1421 |
] |
| 1422 |
); |
| 1423 |
|
| 1424 |
$this->add_control( |
| 1425 |
'form_checkbox_grid_table_item_color', |
| 1426 |
[ |
| 1427 |
'label' => __('Color', 'fluentform'), |
| 1428 |
'type' => Controls_Manager::COLOR, |
| 1429 |
'default' => '', |
| 1430 |
'selectors' => [ |
| 1431 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'color: {{VALUE}} !important;', |
| 1432 |
], |
| 1433 |
] |
| 1434 |
); |
| 1435 |
|
| 1436 |
$this->add_control( |
| 1437 |
'form_checkbox_grid_table_item_bg_color', |
| 1438 |
[ |
| 1439 |
'label' => __('Background Color', 'fluentform'), |
| 1440 |
'type' => Controls_Manager::COLOR, |
| 1441 |
'default' => '', |
| 1442 |
'selectors' => [ |
| 1443 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'background-color: {{VALUE}};', |
| 1444 |
], |
| 1445 |
] |
| 1446 |
); |
| 1447 |
|
| 1448 |
$this->add_control( |
| 1449 |
'form_checkbox_grid_table_item_odd_bg_color', |
| 1450 |
[ |
| 1451 |
'label' => __('Odd Item Background Color', 'fluentform'), |
| 1452 |
'type' => Controls_Manager::COLOR, |
| 1453 |
'default' => '', |
| 1454 |
'selectors' => [ |
| 1455 |
'{{WRAPPER}} .fluentform-widget-wrapper tbody>tr:nth-child(2n)>td' => 'background-color: {{VALUE}} !important;', |
| 1456 |
], |
| 1457 |
] |
| 1458 |
); |
| 1459 |
|
| 1460 |
$this->add_group_control( |
| 1461 |
Group_Control_Typography::get_type(), |
| 1462 |
[ |
| 1463 |
'name' => 'form_checkbox_grid_table_item_typography', |
| 1464 |
'label' => __('Typography', 'fluentform'), |
| 1465 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td', |
| 1466 |
] |
| 1467 |
); |
| 1468 |
|
| 1469 |
$this->add_responsive_control( |
| 1470 |
'form_checkbox_grid_table_item_height', |
| 1471 |
[ |
| 1472 |
'label' => __('Height', 'fluentform'), |
| 1473 |
'type' => Controls_Manager::SLIDER, |
| 1474 |
'range' => [ |
| 1475 |
'px' => [ |
| 1476 |
'min' => 0, |
| 1477 |
'max' => 1200, |
| 1478 |
'step' => 1, |
| 1479 |
], |
| 1480 |
], |
| 1481 |
'size_units' => ['px', '%'], |
| 1482 |
'selectors' => [ |
| 1483 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'height: {{SIZE}}{{UNIT}}', |
| 1484 |
], |
| 1485 |
] |
| 1486 |
); |
| 1487 |
|
| 1488 |
$this->add_group_control( |
| 1489 |
Group_Control_Border::get_type(), |
| 1490 |
[ |
| 1491 |
'name' => 'form_checkbox_grid_table_item_border', |
| 1492 |
'label' => __('Border', 'fluentform'), |
| 1493 |
'default' => '', |
| 1494 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr', |
| 1495 |
] |
| 1496 |
); |
| 1497 |
|
| 1498 |
$this->add_responsive_control( |
| 1499 |
'form_checkbox_grid_table_item_padding', |
| 1500 |
[ |
| 1501 |
'label' => __('Padding', 'fluentform'), |
| 1502 |
'type' => Controls_Manager::DIMENSIONS, |
| 1503 |
'size_units' => ['px', 'em', '%'], |
| 1504 |
'selectors' => [ |
| 1505 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1506 |
], |
| 1507 |
] |
| 1508 |
); |
| 1509 |
|
| 1510 |
$this->end_controls_section(); |
| 1511 |
} |
| 1512 |
|
| 1513 |
protected function register_address_line_style_controls() |
| 1514 |
{ |
| 1515 |
$this->start_controls_section( |
| 1516 |
'section_form_address_line_style', |
| 1517 |
[ |
| 1518 |
'label' => __('Address Line', 'fluentform'), |
| 1519 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1520 |
] |
| 1521 |
); |
| 1522 |
|
| 1523 |
$this->add_control( |
| 1524 |
'address_line_label_color', |
| 1525 |
[ |
| 1526 |
'label' => __('Label Color', 'fluentform'), |
| 1527 |
'type' => Controls_Manager::COLOR, |
| 1528 |
'default' => '', |
| 1529 |
'selectors' => [ |
| 1530 |
'{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label' => 'color: {{VALUE}};', |
| 1531 |
], |
| 1532 |
] |
| 1533 |
); |
| 1534 |
|
| 1535 |
$this->add_group_control( |
| 1536 |
Group_Control_Typography::get_type(), |
| 1537 |
[ |
| 1538 |
'name' => 'address_line_label_typography', |
| 1539 |
'label' => __('Typography', 'fluentform'), |
| 1540 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label', |
| 1541 |
] |
| 1542 |
); |
| 1543 |
|
| 1544 |
$this->end_controls_section(); |
| 1545 |
} |
| 1546 |
|
| 1547 |
protected function register_image_upload_style_controls() |
| 1548 |
{ |
| 1549 |
$this->start_controls_section( |
| 1550 |
'section_form_image_upload_style', |
| 1551 |
[ |
| 1552 |
'label' => __('Image Upload', 'fluentform'), |
| 1553 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1554 |
] |
| 1555 |
); |
| 1556 |
|
| 1557 |
$this->start_controls_tabs('tabs_form_image_upload_button_style'); |
| 1558 |
|
| 1559 |
$this->start_controls_tab( |
| 1560 |
'tab_form_image_upload_button_normal', |
| 1561 |
[ |
| 1562 |
'label' => __('Normal', 'fluentform'), |
| 1563 |
] |
| 1564 |
); |
| 1565 |
|
| 1566 |
$this->add_control( |
| 1567 |
'form_image_upload_bg_color', |
| 1568 |
[ |
| 1569 |
'label' => __('Background Color', 'fluentform'), |
| 1570 |
'type' => Controls_Manager::COLOR, |
| 1571 |
'default' => '', |
| 1572 |
'selectors' => [ |
| 1573 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'background-color: {{VALUE}};', |
| 1574 |
], |
| 1575 |
] |
| 1576 |
); |
| 1577 |
|
| 1578 |
$this->add_group_control( |
| 1579 |
Group_Control_Border::get_type(), |
| 1580 |
[ |
| 1581 |
'name' => 'form_image_upload_button_border_normal', |
| 1582 |
'label' => __('Border', 'fluentform'), |
| 1583 |
'default' => '', |
| 1584 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn', |
| 1585 |
] |
| 1586 |
); |
| 1587 |
|
| 1588 |
$this->add_control( |
| 1589 |
'form_image_upload_button_border_radius', |
| 1590 |
[ |
| 1591 |
'label' => __('Border Radius', 'fluentform'), |
| 1592 |
'type' => Controls_Manager::DIMENSIONS, |
| 1593 |
'size_units' => ['px', 'em', '%'], |
| 1594 |
'selectors' => [ |
| 1595 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1596 |
], |
| 1597 |
] |
| 1598 |
); |
| 1599 |
|
| 1600 |
$this->add_responsive_control( |
| 1601 |
'form_image_upload_button_padding', |
| 1602 |
[ |
| 1603 |
'label' => __('Padding', 'fluentform'), |
| 1604 |
'type' => Controls_Manager::DIMENSIONS, |
| 1605 |
'size_units' => ['px', 'em', '%'], |
| 1606 |
'selectors' => [ |
| 1607 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1608 |
], |
| 1609 |
] |
| 1610 |
); |
| 1611 |
|
| 1612 |
$this->add_group_control( |
| 1613 |
Group_Control_Typography::get_type(), |
| 1614 |
[ |
| 1615 |
'name' => 'form_image_upload_typography', |
| 1616 |
'label' => __('Typography', 'fluentform'), |
| 1617 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn', |
| 1618 |
] |
| 1619 |
); |
| 1620 |
|
| 1621 |
$this->add_group_control( |
| 1622 |
Group_Control_Box_Shadow::get_type(), |
| 1623 |
[ |
| 1624 |
'name' => 'form_image_upload_button_box_shadow', |
| 1625 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn', |
| 1626 |
] |
| 1627 |
); |
| 1628 |
|
| 1629 |
$this->end_controls_tab(); |
| 1630 |
|
| 1631 |
$this->start_controls_tab( |
| 1632 |
'tab_form_image_upload_button_hover', |
| 1633 |
[ |
| 1634 |
'label' => __('Hover', 'fluentform'), |
| 1635 |
] |
| 1636 |
); |
| 1637 |
|
| 1638 |
$this->add_control( |
| 1639 |
'form_image_upload_button_bg_color_hover', |
| 1640 |
[ |
| 1641 |
'label' => __('Background Color', 'fluentform'), |
| 1642 |
'type' => Controls_Manager::COLOR, |
| 1643 |
'default' => '', |
| 1644 |
'selectors' => [ |
| 1645 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'background-color: {{VALUE}} !important;', |
| 1646 |
], |
| 1647 |
] |
| 1648 |
); |
| 1649 |
|
| 1650 |
$this->add_control( |
| 1651 |
'form_image_upload_button_text_color_hover', |
| 1652 |
[ |
| 1653 |
'label' => __('Text Color', 'fluentform'), |
| 1654 |
'type' => Controls_Manager::COLOR, |
| 1655 |
'default' => '', |
| 1656 |
'selectors' => [ |
| 1657 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'color: {{VALUE}} !important;', |
| 1658 |
], |
| 1659 |
] |
| 1660 |
); |
| 1661 |
|
| 1662 |
$this->add_control( |
| 1663 |
'form_image_upload_button_border_color_hover', |
| 1664 |
[ |
| 1665 |
'label' => __('Border Color', 'fluentform'), |
| 1666 |
'type' => Controls_Manager::COLOR, |
| 1667 |
'default' => '', |
| 1668 |
'selectors' => [ |
| 1669 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'border-color: {{VALUE}}', |
| 1670 |
], |
| 1671 |
] |
| 1672 |
); |
| 1673 |
|
| 1674 |
$this->end_controls_tab(); |
| 1675 |
|
| 1676 |
$this->end_controls_tabs(); |
| 1677 |
$this->end_controls_section(); |
| 1678 |
} |
| 1679 |
|
| 1680 |
protected function register_pagination_style_controls() |
| 1681 |
{ |
| 1682 |
if (defined('FLUENTFORMPRO')) { |
| 1683 |
$this->start_controls_section( |
| 1684 |
'section_form_pagination_style', |
| 1685 |
[ |
| 1686 |
'label' => __('Pagination', 'fluentform'), |
| 1687 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1688 |
] |
| 1689 |
); |
| 1690 |
|
| 1691 |
$this->add_control( |
| 1692 |
'form_pagination_progressbar_label', |
| 1693 |
[ |
| 1694 |
'label' => __('Progressbar Label', 'fluentform'), |
| 1695 |
'type' => Controls_Manager::HEADING, |
| 1696 |
] |
| 1697 |
); |
| 1698 |
|
| 1699 |
$this->add_control( |
| 1700 |
'show_label', |
| 1701 |
[ |
| 1702 |
'label' => __('Show Label', 'fluentform'), |
| 1703 |
'type' => Controls_Manager::SWITCHER, |
| 1704 |
'label_on' => __('Show', 'fluentform'), |
| 1705 |
'label_off' => __('Hide', 'fluentform'), |
| 1706 |
'return_value' => 'yes', |
| 1707 |
'default' => 'yes', |
| 1708 |
'prefix_class' => 'fluent-form-widget-step-header-', |
| 1709 |
] |
| 1710 |
); |
| 1711 |
|
| 1712 |
$this->add_control( |
| 1713 |
'form_progressbar_label_color', |
| 1714 |
[ |
| 1715 |
'label' => __('Label Color', 'fluentform'), |
| 1716 |
'type' => Controls_Manager::COLOR, |
| 1717 |
'scheme' => [ |
| 1718 |
'type' => Scheme_Color::get_type(), |
| 1719 |
'value' => Scheme_Color::COLOR_1, |
| 1720 |
], |
| 1721 |
'selectors' => [ |
| 1722 |
'{{WRAPPER}} .ff-el-progress-status' => 'color: {{VALUE}}', |
| 1723 |
], |
| 1724 |
'condition' => [ |
| 1725 |
'show_label' => 'yes', |
| 1726 |
], |
| 1727 |
] |
| 1728 |
); |
| 1729 |
|
| 1730 |
$this->add_group_control( |
| 1731 |
Group_Control_Typography::get_type(), |
| 1732 |
[ |
| 1733 |
'name' => 'form_progressbar_label_typography', |
| 1734 |
'label' => __('Typography', 'fluentform'), |
| 1735 |
'scheme' => Scheme_Typography::TYPOGRAPHY_1, |
| 1736 |
'selector' => '{{WRAPPER}} .ff-el-progress-status', |
| 1737 |
'condition' => [ |
| 1738 |
'show_label' => 'yes', |
| 1739 |
], |
| 1740 |
] |
| 1741 |
); |
| 1742 |
|
| 1743 |
$this->add_control( |
| 1744 |
'form_progressbar_label_space', |
| 1745 |
[ |
| 1746 |
'label' => __('Spacing', 'fluentform'), |
| 1747 |
'type' => Controls_Manager::DIMENSIONS, |
| 1748 |
'size_units' => ['px', '%', 'em'], |
| 1749 |
'selectors' => [ |
| 1750 |
'{{WRAPPER}} .ff-el-progress-status' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1751 |
], |
| 1752 |
'condition' => [ |
| 1753 |
'show_label' => 'yes', |
| 1754 |
], |
| 1755 |
'separator' => 'after', |
| 1756 |
] |
| 1757 |
); |
| 1758 |
|
| 1759 |
$this->add_control( |
| 1760 |
'form_pagination_progressbar', |
| 1761 |
[ |
| 1762 |
'label' => __('Progressbar', 'fluentform'), |
| 1763 |
'type' => Controls_Manager::HEADING, |
| 1764 |
] |
| 1765 |
); |
| 1766 |
|
| 1767 |
$this->add_control( |
| 1768 |
'show_form_progressbar', |
| 1769 |
[ |
| 1770 |
'label' => __('Show Progressbar', 'fluentform'), |
| 1771 |
'type' => Controls_Manager::SWITCHER, |
| 1772 |
'label_on' => __('Show', 'fluentform'), |
| 1773 |
'label_off' => __('Hide', 'fluentform'), |
| 1774 |
'return_value' => 'yes', |
| 1775 |
'default' => 'yes', |
| 1776 |
'prefix_class' => 'fluent-form-widget-step-progressbar-', |
| 1777 |
] |
| 1778 |
); |
| 1779 |
|
| 1780 |
$this->start_controls_tabs('form_progressbar_style_tabs'); |
| 1781 |
|
| 1782 |
$this->start_controls_tab( |
| 1783 |
'form_progressbar_normal', |
| 1784 |
[ |
| 1785 |
'label' => __('Normal', 'fluentform'), |
| 1786 |
'condition' => [ |
| 1787 |
'show_form_progressbar' => 'yes', |
| 1788 |
], |
| 1789 |
] |
| 1790 |
); |
| 1791 |
|
| 1792 |
$this->add_group_control( |
| 1793 |
Group_Control_Background::get_type(), |
| 1794 |
[ |
| 1795 |
'name' => 'form_progressbar_bg', |
| 1796 |
'label' => __('Background', 'fluentform'), |
| 1797 |
'types' => ['classic', 'gradient'], |
| 1798 |
'selector' => '{{WRAPPER}} .ff-el-progress', |
| 1799 |
'condition' => [ |
| 1800 |
'show_form_progressbar' => 'yes', |
| 1801 |
], |
| 1802 |
'exclude' => [ |
| 1803 |
'image', |
| 1804 |
], |
| 1805 |
] |
| 1806 |
); |
| 1807 |
|
| 1808 |
$this->add_control( |
| 1809 |
'form_progressbar_color', |
| 1810 |
[ |
| 1811 |
'label' => __('Text Color', 'fluentform'), |
| 1812 |
'type' => Controls_Manager::COLOR, |
| 1813 |
'scheme' => [ |
| 1814 |
'type' => Scheme_Color::get_type(), |
| 1815 |
'value' => Scheme_Color::COLOR_1, |
| 1816 |
], |
| 1817 |
'selectors' => [ |
| 1818 |
'{{WRAPPER}} .ff-el-progress-bar span' => 'color: {{VALUE}};', |
| 1819 |
], |
| 1820 |
'condition' => [ |
| 1821 |
'show_form_progressbar' => 'yes', |
| 1822 |
], |
| 1823 |
] |
| 1824 |
); |
| 1825 |
|
| 1826 |
$this->add_control( |
| 1827 |
'form_progressbar_height', |
| 1828 |
[ |
| 1829 |
'label' => __('Height', 'fluentform'), |
| 1830 |
'type' => Controls_Manager::SLIDER, |
| 1831 |
'size_units' => ['px'], |
| 1832 |
'range' => [ |
| 1833 |
'px' => [ |
| 1834 |
'min' => 0, |
| 1835 |
'max' => 100, |
| 1836 |
'step' => 1, |
| 1837 |
], |
| 1838 |
], |
| 1839 |
'selectors' => [ |
| 1840 |
'{{WRAPPER}} .ff-el-progress' => 'height: {{SIZE}}{{UNIT}};', |
| 1841 |
], |
| 1842 |
'condition' => [ |
| 1843 |
'show_form_progressbar' => 'yes', |
| 1844 |
], |
| 1845 |
] |
| 1846 |
); |
| 1847 |
|
| 1848 |
$this->add_group_control( |
| 1849 |
Group_Control_Border::get_type(), |
| 1850 |
[ |
| 1851 |
'name' => 'form_progressbar_border', |
| 1852 |
'label' => __('Border', 'fluentform'), |
| 1853 |
'selector' => '{{WRAPPER}} .ff-el-progress', |
| 1854 |
'condition' => [ |
| 1855 |
'show_form_progressbar' => 'yes', |
| 1856 |
], |
| 1857 |
] |
| 1858 |
); |
| 1859 |
|
| 1860 |
$this->add_control( |
| 1861 |
'form_progressbar_border_radius', |
| 1862 |
[ |
| 1863 |
'label' => __('Border Radius', 'fluentform'), |
| 1864 |
'type' => Controls_Manager::DIMENSIONS, |
| 1865 |
'size_units' => ['px', '%', 'em'], |
| 1866 |
'selectors' => [ |
| 1867 |
'{{WRAPPER}} .ff-el-progress' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1868 |
], |
| 1869 |
'condition' => [ |
| 1870 |
'show_form_progressbar' => 'yes', |
| 1871 |
], |
| 1872 |
] |
| 1873 |
); |
| 1874 |
|
| 1875 |
$this->end_controls_tab(); |
| 1876 |
|
| 1877 |
$this->start_controls_tab( |
| 1878 |
'form_progressbar_filled', |
| 1879 |
[ |
| 1880 |
'label' => __('Filled', 'fluentform'), |
| 1881 |
'condition' => [ |
| 1882 |
'show_form_progressbar' => 'yes', |
| 1883 |
], |
| 1884 |
] |
| 1885 |
); |
| 1886 |
|
| 1887 |
$this->add_group_control( |
| 1888 |
Group_Control_Background::get_type(), |
| 1889 |
[ |
| 1890 |
'name' => 'form_progressbar_bg_filled', |
| 1891 |
'label' => __('Background', 'fluentform'), |
| 1892 |
'types' => ['classic', 'gradient'], |
| 1893 |
'selector' => '{{WRAPPER}} .ff-el-progress-bar', |
| 1894 |
'condition' => [ |
| 1895 |
'show_form_progressbar' => 'yes', |
| 1896 |
], |
| 1897 |
'exclude' => [ |
| 1898 |
'image', |
| 1899 |
], |
| 1900 |
] |
| 1901 |
); |
| 1902 |
|
| 1903 |
$this->end_controls_tab(); |
| 1904 |
|
| 1905 |
$this->end_controls_tabs(); |
| 1906 |
|
| 1907 |
$this->add_control( |
| 1908 |
'form_pagination_button_style', |
| 1909 |
[ |
| 1910 |
'label' => __('Button', 'fluentform'), |
| 1911 |
'type' => Controls_Manager::HEADING, |
| 1912 |
'separator' => 'before', |
| 1913 |
] |
| 1914 |
); |
| 1915 |
|
| 1916 |
$this->start_controls_tabs( |
| 1917 |
'form_pagination_button_style_tabs' |
| 1918 |
); |
| 1919 |
|
| 1920 |
$this->start_controls_tab( |
| 1921 |
'form_pagination_button', |
| 1922 |
[ |
| 1923 |
'label' => __('Normal', 'fluentform'), |
| 1924 |
] |
| 1925 |
); |
| 1926 |
|
| 1927 |
$this->add_control( |
| 1928 |
'form_pagination_button_color', |
| 1929 |
[ |
| 1930 |
'label' => __('Color', 'fluentform'), |
| 1931 |
'type' => Controls_Manager::COLOR, |
| 1932 |
'selectors' => [ |
| 1933 |
'{{WRAPPER}} .step-nav button' => 'color: {{VALUE}};', |
| 1934 |
], |
| 1935 |
] |
| 1936 |
); |
| 1937 |
|
| 1938 |
$this->add_group_control( |
| 1939 |
Group_Control_Typography::get_type(), |
| 1940 |
[ |
| 1941 |
'name' => 'form_pagination_button_typography', |
| 1942 |
'label' => __('Typography', 'fluentform'), |
| 1943 |
'scheme' => Scheme_Typography::TYPOGRAPHY_1, |
| 1944 |
'selector' => '{{WRAPPER}} .step-nav button', |
| 1945 |
] |
| 1946 |
); |
| 1947 |
|
| 1948 |
$this->add_group_control( |
| 1949 |
Group_Control_Background::get_type(), |
| 1950 |
[ |
| 1951 |
'name' => 'form_pagination_button_bg', |
| 1952 |
'label' => __('Background', 'fluentform'), |
| 1953 |
'types' => ['classic', 'gradient'], |
| 1954 |
'selector' => '{{WRAPPER}} .step-nav button', |
| 1955 |
] |
| 1956 |
); |
| 1957 |
|
| 1958 |
$this->add_group_control( |
| 1959 |
Group_Control_Border::get_type(), |
| 1960 |
[ |
| 1961 |
'name' => 'form_pagination_button_border', |
| 1962 |
'label' => __('Border', 'fluentform'), |
| 1963 |
'selector' => '{{WRAPPER}} .step-nav button', |
| 1964 |
] |
| 1965 |
); |
| 1966 |
|
| 1967 |
$this->add_control( |
| 1968 |
'form_pagination_button_border_radius', |
| 1969 |
[ |
| 1970 |
'label' => __('Border Radius', 'fluentform'), |
| 1971 |
'type' => Controls_Manager::DIMENSIONS, |
| 1972 |
'size_units' => ['px', '%', 'em'], |
| 1973 |
'selectors' => [ |
| 1974 |
'{{WRAPPER}} .step-nav button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1975 |
], |
| 1976 |
] |
| 1977 |
); |
| 1978 |
|
| 1979 |
$this->add_control( |
| 1980 |
'form_pagination_button_padding', |
| 1981 |
[ |
| 1982 |
'label' => __('Padding', 'fluentform'), |
| 1983 |
'type' => Controls_Manager::DIMENSIONS, |
| 1984 |
'size_units' => ['px', '%', 'em'], |
| 1985 |
'selectors' => [ |
| 1986 |
'{{WRAPPER}} .step-nav button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1987 |
], |
| 1988 |
] |
| 1989 |
); |
| 1990 |
|
| 1991 |
$this->end_controls_tab(); |
| 1992 |
|
| 1993 |
$this->start_controls_tab( |
| 1994 |
'form_pagination_button_hover', |
| 1995 |
[ |
| 1996 |
'label' => __('Hover', 'fluentform'), |
| 1997 |
] |
| 1998 |
); |
| 1999 |
|
| 2000 |
$this->add_control( |
| 2001 |
'form_pagination_button_hover_color', |
| 2002 |
[ |
| 2003 |
'label' => __('Color', 'fluentform'), |
| 2004 |
'type' => Controls_Manager::COLOR, |
| 2005 |
'selectors' => [ |
| 2006 |
'{{WRAPPER}} .step-nav button:hover' => 'color: {{VALUE}};', |
| 2007 |
], |
| 2008 |
] |
| 2009 |
); |
| 2010 |
|
| 2011 |
$this->add_group_control( |
| 2012 |
Group_Control_Background::get_type(), |
| 2013 |
[ |
| 2014 |
'name' => 'form_pagination_button_hover_bg', |
| 2015 |
'label' => __('Background', 'fluentform'), |
| 2016 |
'types' => ['classic', 'gradient'], |
| 2017 |
'selector' => '{{WRAPPER}} .step-nav button:hover', |
| 2018 |
] |
| 2019 |
); |
| 2020 |
|
| 2021 |
$this->add_control( |
| 2022 |
'form_pagination_button_border_hover_color', |
| 2023 |
[ |
| 2024 |
'label' => __('Border Color', 'fluentform'), |
| 2025 |
'type' => Controls_Manager::COLOR, |
| 2026 |
'selectors' => [ |
| 2027 |
'{{WRAPPER}} .step-nav button:hover' => 'border-color: {{VALUE}};', |
| 2028 |
], |
| 2029 |
] |
| 2030 |
); |
| 2031 |
|
| 2032 |
$this->add_control( |
| 2033 |
'form_pagination_button_border_hover_radius', |
| 2034 |
[ |
| 2035 |
'label' => __('Border Radius', 'fluentform'), |
| 2036 |
'type' => Controls_Manager::DIMENSIONS, |
| 2037 |
'size_units' => ['px', '%', 'em'], |
| 2038 |
'selectors' => [ |
| 2039 |
'{{WRAPPER}} .step-nav button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2040 |
], |
| 2041 |
] |
| 2042 |
); |
| 2043 |
|
| 2044 |
$this->end_controls_tab(); |
| 2045 |
|
| 2046 |
$this->end_controls_tabs(); |
| 2047 |
|
| 2048 |
$this->end_controls_section(); |
| 2049 |
} |
| 2050 |
} |
| 2051 |
|
| 2052 |
protected function register_submit_button_style_controls() |
| 2053 |
{ |
| 2054 |
$this->start_controls_section( |
| 2055 |
'section_form_submit_button_style', |
| 2056 |
[ |
| 2057 |
'label' => __('Submit Button', 'fluentform'), |
| 2058 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2059 |
] |
| 2060 |
); |
| 2061 |
|
| 2062 |
$this->add_responsive_control( |
| 2063 |
'form_submit_button_align', |
| 2064 |
[ |
| 2065 |
'label' => __('Alignment', 'fluentform'), |
| 2066 |
'type' => Controls_Manager::CHOOSE, |
| 2067 |
'options' => [ |
| 2068 |
'left' => [ |
| 2069 |
'title' => __('Left', 'fluentform'), |
| 2070 |
'icon' => 'eicon-h-align-left', |
| 2071 |
], |
| 2072 |
'center' => [ |
| 2073 |
'title' => __('Center', 'fluentform'), |
| 2074 |
'icon' => 'eicon-h-align-center', |
| 2075 |
], |
| 2076 |
'right' => [ |
| 2077 |
'title' => __('Right', 'fluentform'), |
| 2078 |
'icon' => 'eicon-h-align-right', |
| 2079 |
], |
| 2080 |
], |
| 2081 |
'default' => '', |
| 2082 |
'prefix_class' => 'fluentform-widget-submit-button-', |
| 2083 |
'condition' => [ |
| 2084 |
'form_submit_button_width_type' => 'custom', |
| 2085 |
], |
| 2086 |
] |
| 2087 |
); |
| 2088 |
|
| 2089 |
$this->add_control( |
| 2090 |
'form_submit_button_width_type', |
| 2091 |
[ |
| 2092 |
'label' => __('Width', 'fluentform'), |
| 2093 |
'type' => Controls_Manager::SELECT, |
| 2094 |
'default' => 'custom', |
| 2095 |
'options' => [ |
| 2096 |
'full-width' => __('Full Width', 'fluentform'), |
| 2097 |
'custom' => __('Custom', 'fluentform'), |
| 2098 |
], |
| 2099 |
'prefix_class' => 'fluentform-widget-submit-button-', |
| 2100 |
] |
| 2101 |
); |
| 2102 |
|
| 2103 |
$this->add_responsive_control( |
| 2104 |
'form_submit_button_width', |
| 2105 |
[ |
| 2106 |
'label' => __('Width', 'fluentform'), |
| 2107 |
'type' => Controls_Manager::SLIDER, |
| 2108 |
'range' => [ |
| 2109 |
'px' => [ |
| 2110 |
'min' => 0, |
| 2111 |
'max' => 1200, |
| 2112 |
'step' => 1, |
| 2113 |
], |
| 2114 |
], |
| 2115 |
'size_units' => ['px', '%'], |
| 2116 |
'selectors' => [ |
| 2117 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'width: {{SIZE}}{{UNIT}}', ], |
| 2118 |
'condition' => [ |
| 2119 |
'form_submit_button_width_type' => 'custom', |
| 2120 |
], |
| 2121 |
] |
| 2122 |
); |
| 2123 |
|
| 2124 |
$this->start_controls_tabs('tabs_submit_button_style'); |
| 2125 |
|
| 2126 |
$this->start_controls_tab( |
| 2127 |
'tab_submit_button_normal', |
| 2128 |
[ |
| 2129 |
'label' => __('Normal', 'fluentform'), |
| 2130 |
] |
| 2131 |
); |
| 2132 |
|
| 2133 |
$this->add_control( |
| 2134 |
'form_submit_button_bg_color_normal', |
| 2135 |
[ |
| 2136 |
'label' => __('Background Color', 'fluentform'), |
| 2137 |
'type' => Controls_Manager::COLOR, |
| 2138 |
'default' => '#409EFF', |
| 2139 |
'selectors' => [ |
| 2140 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'background-color: {{VALUE}} !important;', |
| 2141 |
], |
| 2142 |
] |
| 2143 |
); |
| 2144 |
|
| 2145 |
$this->add_control( |
| 2146 |
'form_submit_button_text_color_normal', |
| 2147 |
[ |
| 2148 |
'label' => __('Text Color', 'fluentform'), |
| 2149 |
'type' => Controls_Manager::COLOR, |
| 2150 |
'default' => '#ffffff', |
| 2151 |
'selectors' => [ |
| 2152 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'color: {{VALUE}} !important;', |
| 2153 |
], |
| 2154 |
] |
| 2155 |
); |
| 2156 |
|
| 2157 |
$this->add_group_control( |
| 2158 |
Group_Control_Border::get_type(), |
| 2159 |
[ |
| 2160 |
'name' => 'form_submit_button_border_normal', |
| 2161 |
'label' => __('Border', 'fluentform'), |
| 2162 |
'placeholder' => '1px', |
| 2163 |
'default' => '1px', |
| 2164 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit', |
| 2165 |
] |
| 2166 |
); |
| 2167 |
|
| 2168 |
$this->add_control( |
| 2169 |
'form_submit_button_border_radius', |
| 2170 |
[ |
| 2171 |
'label' => __('Border Radius', 'fluentform'), |
| 2172 |
'type' => Controls_Manager::DIMENSIONS, |
| 2173 |
'size_units' => ['px', 'em', '%'], |
| 2174 |
'selectors' => [ |
| 2175 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2176 |
], |
| 2177 |
] |
| 2178 |
); |
| 2179 |
|
| 2180 |
$this->add_responsive_control( |
| 2181 |
'form_submit_button_padding', |
| 2182 |
[ |
| 2183 |
'label' => __('Padding', 'fluentform'), |
| 2184 |
'type' => Controls_Manager::DIMENSIONS, |
| 2185 |
'size_units' => ['px', 'em', '%'], |
| 2186 |
'selectors' => [ |
| 2187 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2188 |
], |
| 2189 |
] |
| 2190 |
); |
| 2191 |
|
| 2192 |
$this->add_responsive_control( |
| 2193 |
'form_submit_button_margin', |
| 2194 |
[ |
| 2195 |
'label' => __('Margin Top', 'fluentform'), |
| 2196 |
'type' => Controls_Manager::SLIDER, |
| 2197 |
'range' => [ |
| 2198 |
'px' => [ |
| 2199 |
'min' => 0, |
| 2200 |
'max' => 150, |
| 2201 |
'step' => 1, |
| 2202 |
], |
| 2203 |
], |
| 2204 |
'size_units' => ['px', 'em', '%'], |
| 2205 |
'selectors' => [ |
| 2206 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'margin-top: {{SIZE}}{{UNIT}}', |
| 2207 |
], |
| 2208 |
] |
| 2209 |
); |
| 2210 |
|
| 2211 |
$this->add_group_control( |
| 2212 |
Group_Control_Typography::get_type(), |
| 2213 |
[ |
| 2214 |
'name' => 'form_submit_button_typography', |
| 2215 |
'label' => __('Typography', 'fluentform'), |
| 2216 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit', |
| 2217 |
'separator' => 'before', |
| 2218 |
] |
| 2219 |
); |
| 2220 |
|
| 2221 |
$this->add_group_control( |
| 2222 |
Group_Control_Box_Shadow::get_type(), |
| 2223 |
[ |
| 2224 |
'name' => 'form_submit_button_box_shadow', |
| 2225 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit', |
| 2226 |
'separator' => 'before', |
| 2227 |
] |
| 2228 |
); |
| 2229 |
|
| 2230 |
$this->end_controls_tab(); |
| 2231 |
|
| 2232 |
$this->start_controls_tab( |
| 2233 |
'tab_submit_button_hover', |
| 2234 |
[ |
| 2235 |
'label' => __('Hover', 'fluentform'), |
| 2236 |
] |
| 2237 |
); |
| 2238 |
|
| 2239 |
$this->add_control( |
| 2240 |
'form_submit_button_bg_color_hover', |
| 2241 |
[ |
| 2242 |
'label' => __('Background Color', 'fluentform'), |
| 2243 |
'type' => Controls_Manager::COLOR, |
| 2244 |
'default' => '', |
| 2245 |
'selectors' => [ |
| 2246 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'background-color: {{VALUE}} !important;', |
| 2247 |
], |
| 2248 |
] |
| 2249 |
); |
| 2250 |
|
| 2251 |
$this->add_control( |
| 2252 |
'form_submit_button_text_color_hover', |
| 2253 |
[ |
| 2254 |
'label' => __('Text Color', 'fluentform'), |
| 2255 |
'type' => Controls_Manager::COLOR, |
| 2256 |
'default' => '', |
| 2257 |
'selectors' => [ |
| 2258 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'color: {{VALUE}} !important;', |
| 2259 |
], |
| 2260 |
] |
| 2261 |
); |
| 2262 |
|
| 2263 |
$this->add_control( |
| 2264 |
'form_submit_button_border_color_hover', |
| 2265 |
[ |
| 2266 |
'label' => __('Border Color', 'fluentform'), |
| 2267 |
'type' => Controls_Manager::COLOR, |
| 2268 |
'default' => '', |
| 2269 |
'selectors' => [ |
| 2270 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'border-color: {{VALUE}}', |
| 2271 |
], |
| 2272 |
] |
| 2273 |
); |
| 2274 |
|
| 2275 |
$this->end_controls_tab(); |
| 2276 |
|
| 2277 |
$this->end_controls_tabs(); |
| 2278 |
|
| 2279 |
$this->end_controls_section(); |
| 2280 |
} |
| 2281 |
|
| 2282 |
protected function register_success_message_style_controls() |
| 2283 |
{ |
| 2284 |
$this->start_controls_section( |
| 2285 |
'section_form_success_message_style', |
| 2286 |
[ |
| 2287 |
'label' => __('Success Message', 'fluentform'), |
| 2288 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2289 |
] |
| 2290 |
); |
| 2291 |
|
| 2292 |
$this->add_control( |
| 2293 |
'form_success_message_bg_color', |
| 2294 |
[ |
| 2295 |
'label' => __('Background Color', 'fluentform'), |
| 2296 |
'type' => Controls_Manager::COLOR, |
| 2297 |
'selectors' => [ |
| 2298 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'background-color: {{VALUE}}', |
| 2299 |
], |
| 2300 |
] |
| 2301 |
); |
| 2302 |
|
| 2303 |
$this->add_control( |
| 2304 |
'form_success_message_text_color', |
| 2305 |
[ |
| 2306 |
'label' => __('Text Color', 'fluentform'), |
| 2307 |
'type' => Controls_Manager::COLOR, |
| 2308 |
'selectors' => [ |
| 2309 |
'{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'color: {{VALUE}}', |
| 2310 |
], |
| 2311 |
] |
| 2312 |
); |
| 2313 |
|
| 2314 |
$this->add_group_control( |
| 2315 |
Group_Control_Border::get_type(), |
| 2316 |
[ |
| 2317 |
'name' => 'form_success_message_border', |
| 2318 |
'label' => __('Border', 'fluentform'), |
| 2319 |
'placeholder' => '1px', |
| 2320 |
'default' => '1px', |
| 2321 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success', |
| 2322 |
] |
| 2323 |
); |
| 2324 |
|
| 2325 |
$this->add_group_control( |
| 2326 |
Group_Control_Typography::get_type(), |
| 2327 |
[ |
| 2328 |
'name' => 'form_success_message_typography', |
| 2329 |
'label' => __('Typography', 'fluentform'), |
| 2330 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success', |
| 2331 |
] |
| 2332 |
); |
| 2333 |
|
| 2334 |
$this->end_controls_section(); |
| 2335 |
} |
| 2336 |
|
| 2337 |
protected function register_errors_style_controls() |
| 2338 |
{ |
| 2339 |
$this->start_controls_section( |
| 2340 |
'section_form_error_style', |
| 2341 |
[ |
| 2342 |
'label' => __('Error Message', 'fluentform'), |
| 2343 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2344 |
] |
| 2345 |
); |
| 2346 |
|
| 2347 |
$this->add_control( |
| 2348 |
'form_error_message_text_color', |
| 2349 |
[ |
| 2350 |
'label' => __('Color', 'fluentform'), |
| 2351 |
'type' => Controls_Manager::COLOR, |
| 2352 |
'default' => '', |
| 2353 |
'selectors' => [ |
| 2354 |
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'color: {{VALUE}}', |
| 2355 |
], |
| 2356 |
] |
| 2357 |
); |
| 2358 |
|
| 2359 |
$this->add_group_control( |
| 2360 |
Group_Control_Typography::get_type(), |
| 2361 |
[ |
| 2362 |
'name' => 'form_error_message_typography', |
| 2363 |
'label' => __('Typography', 'fluentform'), |
| 2364 |
'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger', |
| 2365 |
] |
| 2366 |
); |
| 2367 |
|
| 2368 |
$this->add_responsive_control( |
| 2369 |
'form_error_message_padding', |
| 2370 |
[ |
| 2371 |
'label' => __('Padding', 'fluentform'), |
| 2372 |
'type' => Controls_Manager::DIMENSIONS, |
| 2373 |
'size_units' => ['px', 'em', '%'], |
| 2374 |
'selectors' => [ |
| 2375 |
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2376 |
], |
| 2377 |
] |
| 2378 |
); |
| 2379 |
|
| 2380 |
$this->add_responsive_control( |
| 2381 |
'form_error_message_margin', |
| 2382 |
[ |
| 2383 |
'label' => __('Margin', 'fluentform'), |
| 2384 |
'type' => Controls_Manager::DIMENSIONS, |
| 2385 |
'size_units' => ['px', 'em', '%'], |
| 2386 |
'selectors' => [ |
| 2387 |
'{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2388 |
], |
| 2389 |
] |
| 2390 |
); |
| 2391 |
|
| 2392 |
$this->end_controls_section(); |
| 2393 |
} |
| 2394 |
|
| 2395 |
/** |
| 2396 |
* Render the widget output on the frontend. |
| 2397 |
* |
| 2398 |
* Written in PHP and used to generate the final HTML. |
| 2399 |
* |
| 2400 |
* @since 1.0.0 |
| 2401 |
* |
| 2402 |
* @access protected |
| 2403 |
*/ |
| 2404 |
protected function render() |
| 2405 |
{ |
| 2406 |
$settings = $this->get_settings_for_display(); |
| 2407 |
extract($settings); |
| 2408 |
|
| 2409 |
$this->add_render_attribute( |
| 2410 |
'fluentform_widget_wrapper', |
| 2411 |
[ |
| 2412 |
'class' => [ |
| 2413 |
'fluentform-widget-wrapper', |
| 2414 |
], |
| 2415 |
] |
| 2416 |
); |
| 2417 |
|
| 2418 |
if ('yes' != $placeholder_switch) { |
| 2419 |
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-placeholder'); |
| 2420 |
} |
| 2421 |
|
| 2422 |
if ('yes' != $labels_switch) { |
| 2423 |
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-fluent-form-labels'); |
| 2424 |
} |
| 2425 |
|
| 2426 |
if ('no' == $error_messages) { |
| 2427 |
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-error-message'); |
| 2428 |
} |
| 2429 |
|
| 2430 |
if ('yes' == $form_custom_radio_checkbox) { |
| 2431 |
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-custom-radio-checkbox'); |
| 2432 |
} |
| 2433 |
|
| 2434 |
if ($form_container_alignment) { |
| 2435 |
$this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-align-' . $form_container_alignment . ''); |
| 2436 |
} |
| 2437 |
|
| 2438 |
if (!empty($form_list)) { ?> |
| 2439 |
|
| 2440 |
<div <?php echo wp_kses_post($this->get_render_attribute_string('fluentform_widget_wrapper')); ?>> |
| 2441 |
|
| 2442 |
<?php if ('yes' == $custom_title_description) { ?> |
| 2443 |
<div class="fluentform-widget-heading"> |
| 2444 |
<?php if ('' != $form_title_custom) { ?> |
| 2445 |
<h3 class="fluentform-widget-title"> |
| 2446 |
<?php echo esc_attr($form_title_custom); ?> |
| 2447 |
</h3> |
| 2448 |
<?php } ?> |
| 2449 |
<?php if ('' != $form_description_custom) { ?> |
| 2450 |
<p class="fluentform-widget-description"> |
| 2451 |
<?php echo wp_kses_post($this->parse_text_editor($form_description_custom)); ?> |
| 2452 |
</p> |
| 2453 |
<?php } ?> |
| 2454 |
</div> |
| 2455 |
<?php } ?> |
| 2456 |
|
| 2457 |
<?php echo do_shortcode('[fluentform id="' . $form_list . '"]'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $form_list is escaped before being passed in.?> |
| 2458 |
</div> |
| 2459 |
|
| 2460 |
<?php |
| 2461 |
} |
| 2462 |
} |
| 2463 |
|
| 2464 |
/** |
| 2465 |
* Render the widget output in the editor. |
| 2466 |
* |
| 2467 |
* Written as a Backbone JavaScript template and used to generate the live preview. |
| 2468 |
* |
| 2469 |
* @since 1.0.0 |
| 2470 |
* |
| 2471 |
* @access protected |
| 2472 |
*/ |
| 2473 |
protected function content_template() |
| 2474 |
{ |
| 2475 |
} |
| 2476 |
} |
| 2477 |
|