| 1 |
<?php |
| 2 |
|
| 3 |
namespace King_Addons; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
use Elementor\Group_Control_Border; |
| 7 |
use Elementor\Group_Control_Typography; |
| 8 |
use Elementor\Icons_Manager; |
| 9 |
use Elementor\Repeater; |
| 10 |
use Elementor\Utils; |
| 11 |
use Elementor\Widget_Base; |
| 12 |
use Elementor\Plugin; |
| 13 |
|
| 14 |
if (!defined('ABSPATH')) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
class Form_Builder extends Widget_Base |
| 19 |
{ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
public function get_name() |
| 24 |
{ |
| 25 |
return 'king-addons-form-builder'; |
| 26 |
} |
| 27 |
|
| 28 |
public function get_title() |
| 29 |
{ |
| 30 |
return esc_html__('Form Builder', 'king-addons'); |
| 31 |
} |
| 32 |
|
| 33 |
public function get_icon() |
| 34 |
{ |
| 35 |
return 'king-addons-icon king-addons-form-builder'; |
| 36 |
} |
| 37 |
|
| 38 |
public function get_categories() |
| 39 |
{ |
| 40 |
return ['king-addons']; |
| 41 |
} |
| 42 |
|
| 43 |
public function get_keywords() |
| 44 |
{ |
| 45 |
return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'cf7', 'contact form 7', 'builder', 'ninja', 'caldera', 'contact form', |
| 46 |
'caldera forms', 'ninja forms', 'wpforms', 'wp forms', 'email', 'mail', 'email', 'form', 'forms', 'email', 'contact']; |
| 47 |
} |
| 48 |
|
| 49 |
public function get_script_depends() |
| 50 |
{ |
| 51 |
return [ |
| 52 |
KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-loading', |
| 53 |
KING_ADDONS_ASSETS_UNIQUE_KEY . '-form-builder-script' |
| 54 |
]; |
| 55 |
} |
| 56 |
|
| 57 |
public function get_style_depends(): array |
| 58 |
{ |
| 59 |
return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-form-builder-style']; |
| 60 |
} |
| 61 |
|
| 62 |
public function get_custom_help_url() |
| 63 |
{ |
| 64 |
return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue'; |
| 65 |
} |
| 66 |
|
| 67 |
protected function get_control_id($control_id) |
| 68 |
{ |
| 69 |
return $control_id; |
| 70 |
} |
| 71 |
|
| 72 |
public function get_label() |
| 73 |
{ |
| 74 |
return esc_html__('Email', 'king-addons'); |
| 75 |
} |
| 76 |
|
| 77 |
public static function get_site_domain() |
| 78 |
{ |
| 79 |
return str_ireplace('www.', '', parse_url(home_url(), PHP_URL_HOST)); |
| 80 |
} |
| 81 |
|
| 82 |
public function submit_action_args() |
| 83 |
{ |
| 84 |
return [ |
| 85 |
'email' => 'Email', |
| 86 |
'redirect' => 'Redirect', |
| 87 |
'pro-sb' => 'Submission (Pro)', |
| 88 |
'pro-mch' => 'Mailchimp (Pro)', |
| 89 |
'pro-wh' => 'Webhook (Pro)' |
| 90 |
]; |
| 91 |
} |
| 92 |
|
| 93 |
public function register_settings_section_submissions($widget) |
| 94 |
{ |
| 95 |
$widget->start_controls_section( |
| 96 |
$this->get_control_id('section_submissions'), |
| 97 |
[ |
| 98 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Submissions', 'king-addons'), |
| 99 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 100 |
'condition' => [ |
| 101 |
'submit_actions' => 'submissions', |
| 102 |
], |
| 103 |
] |
| 104 |
); |
| 105 |
|
| 106 |
$widget->add_control( |
| 107 |
$this->get_control_id('submissions_action_message'), |
| 108 |
[ |
| 109 |
'type' => Controls_Manager::RAW_HTML, |
| 110 |
'raw' => sprintf( |
| 111 |
__( |
| 112 |
'View Submissions in King Addons > <a href="%s" target="_blank">Form Submissions</a>', |
| 113 |
'king-addons' |
| 114 |
), |
| 115 |
self_admin_url('edit.php?post_type=king-addons-fb-sub') |
| 116 |
), |
| 117 |
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 118 |
] |
| 119 |
); |
| 120 |
|
| 121 |
$widget->end_controls_section(); |
| 122 |
} |
| 123 |
|
| 124 |
public function register_settings_section_webhook($widget) |
| 125 |
{ |
| 126 |
$widget->start_controls_section( |
| 127 |
$this->get_control_id('section_webhook'), |
| 128 |
[ |
| 129 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Webhook', 'king-addons'), |
| 130 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 131 |
'condition' => [ |
| 132 |
'submit_actions' => 'webhook', |
| 133 |
], |
| 134 |
] |
| 135 |
); |
| 136 |
|
| 137 |
$widget->add_control( |
| 138 |
'webhook_url', |
| 139 |
[ |
| 140 |
'label' => esc_html__('Webhook URL', 'king-addons'), |
| 141 |
'type' => Controls_Manager::TEXT, |
| 142 |
'placeholder' => esc_html__('your-webhook-url.com', 'king-addons'), |
| 143 |
'ai' => [ |
| 144 |
'active' => false, |
| 145 |
], |
| 146 |
'dynamic' => [ |
| 147 |
'active' => true, |
| 148 |
], |
| 149 |
'label_block' => true, |
| 150 |
'separator' => 'before', |
| 151 |
'description' => esc_html__('Enter the webhook URL (e.g. Zapier) that will receive the submitted data.', 'king-addons'), |
| 152 |
'render_type' => 'none', |
| 153 |
] |
| 154 |
); |
| 155 |
|
| 156 |
$widget->end_controls_section(); |
| 157 |
} |
| 158 |
|
| 159 |
public function register_settings_section_email($widget) |
| 160 |
{ |
| 161 |
$widget->start_controls_section( |
| 162 |
$this->get_control_id('section_email'), |
| 163 |
[ |
| 164 |
'label' => KING_ADDONS_ELEMENTOR_ICON . $this->get_label(), |
| 165 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 166 |
'condition' => [ |
| 167 |
'submit_actions' => 'email', |
| 168 |
], |
| 169 |
] |
| 170 |
); |
| 171 |
|
| 172 |
$widget->add_control( |
| 173 |
$this->get_control_id('email_to'), |
| 174 |
[ |
| 175 |
'label' => esc_html__('To', 'king-addons'), |
| 176 |
'type' => Controls_Manager::TEXT, |
| 177 |
'default' => get_option('admin_email'), |
| 178 |
'label_block' => true, |
| 179 |
'title' => esc_html__('Separate emails with commas', 'king-addons'), |
| 180 |
'render_type' => 'none', |
| 181 |
'dynamic' => [ |
| 182 |
'active' => true, |
| 183 |
], |
| 184 |
] |
| 185 |
); |
| 186 |
|
| 187 |
|
| 188 |
$default_message = sprintf(esc_html__('New message from %s', 'king-addons'), get_option('blogname')); |
| 189 |
|
| 190 |
$widget->add_control( |
| 191 |
$this->get_control_id('email_subject'), |
| 192 |
[ |
| 193 |
'label' => esc_html__('Subject', 'king-addons'), |
| 194 |
'type' => Controls_Manager::TEXT, |
| 195 |
'default' => $default_message, |
| 196 |
'placeholder' => $default_message, |
| 197 |
'label_block' => true, |
| 198 |
'render_type' => 'none', |
| 199 |
'dynamic' => [ |
| 200 |
'active' => true, |
| 201 |
], |
| 202 |
] |
| 203 |
); |
| 204 |
|
| 205 |
$widget->add_control( |
| 206 |
$this->get_control_id('email_content'), |
| 207 |
[ |
| 208 |
'label' => esc_html__('Message', 'king-addons'), |
| 209 |
'type' => Controls_Manager::TEXTAREA, |
| 210 |
'default' => '[all-fields]', |
| 211 |
'placeholder' => '[all-fields]', |
| 212 |
'description' => sprintf( |
| 213 |
esc_html__('By default, the form submits all fields. To modify this behavior, copy the shortcode of the fields you wish to include and paste it in place of %s.', 'king-addons'), |
| 214 |
'<code>[all-fields]</code>' |
| 215 |
), |
| 216 |
'render_type' => 'none', |
| 217 |
'dynamic' => [ |
| 218 |
'active' => true, |
| 219 |
], |
| 220 |
] |
| 221 |
); |
| 222 |
|
| 223 |
$site_domain = $this->get_site_domain(); |
| 224 |
|
| 225 |
$widget->add_control( |
| 226 |
$this->get_control_id('email_from'), |
| 227 |
[ |
| 228 |
'label' => esc_html__('From Email', 'king-addons'), |
| 229 |
'type' => Controls_Manager::TEXT, |
| 230 |
'description' => esc_html__('Shortcodes such as [id="email"] can be inserted based on the ID of the associated mail field.', 'king-addons'), |
| 231 |
'default' => 'email@' . $site_domain, |
| 232 |
'render_type' => 'none', |
| 233 |
'dynamic' => [ |
| 234 |
'active' => true, |
| 235 |
], |
| 236 |
] |
| 237 |
); |
| 238 |
|
| 239 |
$widget->add_control( |
| 240 |
$this->get_control_id('email_from_name'), |
| 241 |
[ |
| 242 |
'label' => esc_html__('From Name', 'king-addons'), |
| 243 |
'type' => Controls_Manager::TEXT, |
| 244 |
'default' => get_bloginfo('name'), |
| 245 |
'render_type' => 'none', |
| 246 |
'dynamic' => [ |
| 247 |
'active' => true, |
| 248 |
], |
| 249 |
] |
| 250 |
); |
| 251 |
|
| 252 |
$widget->add_control( |
| 253 |
$this->get_control_id('email_reply_to'), |
| 254 |
[ |
| 255 |
'label' => esc_html__('Reply To', 'king-addons'), |
| 256 |
'type' => Controls_Manager::TEXT, |
| 257 |
'default' => 'email@' . $site_domain, |
| 258 |
'render_type' => 'none' |
| 259 |
] |
| 260 |
); |
| 261 |
|
| 262 |
$widget->add_control( |
| 263 |
$this->get_control_id('email_to_cc'), |
| 264 |
[ |
| 265 |
'label' => esc_html__('Cc', 'king-addons'), |
| 266 |
'type' => Controls_Manager::TEXT, |
| 267 |
'default' => '', |
| 268 |
'title' => esc_html__('Separate emails with commas', 'king-addons'), |
| 269 |
'render_type' => 'none', |
| 270 |
'dynamic' => [ |
| 271 |
'active' => true, |
| 272 |
], |
| 273 |
] |
| 274 |
); |
| 275 |
|
| 276 |
$widget->add_control( |
| 277 |
$this->get_control_id('email_to_bcc'), |
| 278 |
[ |
| 279 |
'label' => esc_html__('Bcc', 'king-addons'), |
| 280 |
'type' => Controls_Manager::TEXT, |
| 281 |
'default' => '', |
| 282 |
'title' => esc_html__('Separate emails with commas', 'king-addons'), |
| 283 |
'render_type' => 'none', |
| 284 |
'dynamic' => [ |
| 285 |
'active' => true, |
| 286 |
], |
| 287 |
] |
| 288 |
); |
| 289 |
|
| 290 |
$widget->add_control( |
| 291 |
$this->get_control_id('form_metadata'), |
| 292 |
[ |
| 293 |
'label' => esc_html__('Meta Data', 'king-addons'), |
| 294 |
'type' => Controls_Manager::SELECT2, |
| 295 |
'multiple' => true, |
| 296 |
'label_block' => true, |
| 297 |
'separator' => 'before', |
| 298 |
'default' => [ |
| 299 |
'date', |
| 300 |
'time', |
| 301 |
'credit' |
| 302 |
], |
| 303 |
'options' => [ |
| 304 |
'date' => esc_html__('Date', 'king-addons'), |
| 305 |
'time' => esc_html__('Time', 'king-addons'), |
| 306 |
'page_url' => esc_html__('Page URL', 'king-addons'), |
| 307 |
'page_title' => esc_html__('Page Title', 'king-addons'), |
| 308 |
'user_agent' => esc_html__('User Agent', 'king-addons'), |
| 309 |
'remote_ip' => esc_html__('Remote IP', 'king-addons'), |
| 310 |
'credit' => esc_html__('Credit', 'king-addons'), |
| 311 |
], |
| 312 |
'render_type' => 'none', |
| 313 |
] |
| 314 |
); |
| 315 |
|
| 316 |
$widget->add_control( |
| 317 |
$this->get_control_id('email_content_type'), |
| 318 |
[ |
| 319 |
'label' => esc_html__('Send As', 'king-addons'), |
| 320 |
'type' => Controls_Manager::SELECT, |
| 321 |
'default' => 'html', |
| 322 |
'render_type' => 'none', |
| 323 |
'options' => [ |
| 324 |
'html' => esc_html__('HTML', 'king-addons'), |
| 325 |
'plain' => esc_html__('Plain', 'king-addons'), |
| 326 |
], |
| 327 |
] |
| 328 |
); |
| 329 |
|
| 330 |
$widget->end_controls_section(); |
| 331 |
} |
| 332 |
|
| 333 |
public function register_settings_section_redirect($widget) |
| 334 |
{ |
| 335 |
$widget->start_controls_section( |
| 336 |
'section_redirect', |
| 337 |
[ |
| 338 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Redirect', 'king-addons'), |
| 339 |
'condition' => [ |
| 340 |
'submit_actions' => 'redirect', |
| 341 |
], |
| 342 |
] |
| 343 |
); |
| 344 |
|
| 345 |
$widget->add_control( |
| 346 |
'redirect_to', |
| 347 |
[ |
| 348 |
'label' => esc_html__('Redirect To', 'king-addons'), |
| 349 |
'type' => Controls_Manager::TEXT, |
| 350 |
'dynamic' => [ |
| 351 |
'active' => true |
| 352 |
], |
| 353 |
'placeholder' => esc_html__('https://example.com', 'king-addons'), |
| 354 |
'label_block' => true |
| 355 |
] |
| 356 |
); |
| 357 |
|
| 358 |
$widget->end_controls_section(); |
| 359 |
} |
| 360 |
|
| 361 |
public function register_settings_section_mailchimp() |
| 362 |
{ |
| 363 |
$this->start_controls_section( |
| 364 |
'section_mailchimp', |
| 365 |
[ |
| 366 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Mailchimp', 'king-addons'), |
| 367 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 368 |
'condition' => [ |
| 369 |
'submit_actions' => 'mailchimp' |
| 370 |
] |
| 371 |
] |
| 372 |
); |
| 373 |
|
| 374 |
$this->add_control( |
| 375 |
'mailchimp_audience', |
| 376 |
[ |
| 377 |
'label' => esc_html__('Select Audience', 'king-addons'), |
| 378 |
'type' => Controls_Manager::SELECT, |
| 379 |
'default' => 'def', |
| 380 |
|
| 381 |
'options' => Core::getMailchimpLists(), |
| 382 |
] |
| 383 |
); |
| 384 |
|
| 385 |
|
| 386 |
$this->add_control( |
| 387 |
'mailchimp_groups', |
| 388 |
[ |
| 389 |
'label' => esc_html__('Groups', 'king-addons'), |
| 390 |
'type' => Controls_Manager::SELECT2, |
| 391 |
'multiple' => true, |
| 392 |
'options' => Core::getMailchimpGroups(), |
| 393 |
|
| 394 |
'label_block' => true, |
| 395 |
] |
| 396 |
); |
| 397 |
|
| 398 |
if ('' == get_option('king_addons_mailchimp_api_key')) { |
| 399 |
$this->add_control( |
| 400 |
'mailchimp_key_notice', |
| 401 |
[ |
| 402 |
'type' => Controls_Manager::RAW_HTML, |
| 403 |
'raw' => sprintf(__('Navigate to <strong><a href="%s" target="_blank">Dashboard > %s > Integrations</a></strong> to set up <strong>MailChimp API Key</strong>.', 'king-addons'), admin_url('admin.php?page=king-addons-settings'), Core::getPluginName()), |
| 404 |
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 405 |
] |
| 406 |
); |
| 407 |
} |
| 408 |
|
| 409 |
$this->add_control( |
| 410 |
'mailchimp_fields', |
| 411 |
[ |
| 412 |
'label' => esc_html__('Fields', 'king-addons'), |
| 413 |
'type' => Controls_Manager::HEADING, |
| 414 |
'separator' => 'before', |
| 415 |
] |
| 416 |
); |
| 417 |
|
| 418 |
$this->add_control( |
| 419 |
'email_field', |
| 420 |
[ |
| 421 |
'label' => esc_html__('Email', 'king-addons'), |
| 422 |
'type' => Controls_Manager::SELECT, |
| 423 |
'options' => [] |
| 424 |
] |
| 425 |
); |
| 426 |
|
| 427 |
$this->add_control( |
| 428 |
'first_name_field', |
| 429 |
[ |
| 430 |
'label' => esc_html__('First Name', 'king-addons'), |
| 431 |
'type' => Controls_Manager::SELECT, |
| 432 |
'options' => [] |
| 433 |
] |
| 434 |
); |
| 435 |
|
| 436 |
$this->add_control( |
| 437 |
'last_name_field', |
| 438 |
[ |
| 439 |
'label' => esc_html__('Last Name', 'king-addons'), |
| 440 |
'type' => Controls_Manager::SELECT, |
| 441 |
'options' => [] |
| 442 |
] |
| 443 |
); |
| 444 |
|
| 445 |
$this->add_control( |
| 446 |
'phone_field', |
| 447 |
[ |
| 448 |
'label' => esc_html__('Phone', 'king-addons'), |
| 449 |
'type' => Controls_Manager::SELECT, |
| 450 |
'options' => [] |
| 451 |
] |
| 452 |
); |
| 453 |
|
| 454 |
$this->add_control( |
| 455 |
'birthday_field', |
| 456 |
[ |
| 457 |
'label' => esc_html__('Birthday', 'king-addons'), |
| 458 |
'type' => Controls_Manager::SELECT, |
| 459 |
'options' => [] |
| 460 |
] |
| 461 |
); |
| 462 |
|
| 463 |
$this->add_control( |
| 464 |
'address_field', |
| 465 |
[ |
| 466 |
'label' => esc_html__('Address', 'king-addons'), |
| 467 |
'type' => Controls_Manager::SELECT, |
| 468 |
'options' => [] |
| 469 |
] |
| 470 |
); |
| 471 |
|
| 472 |
$this->add_control( |
| 473 |
'country_field', |
| 474 |
[ |
| 475 |
'label' => esc_html__('Country', 'king-addons'), |
| 476 |
'type' => Controls_Manager::SELECT, |
| 477 |
'options' => [] |
| 478 |
] |
| 479 |
); |
| 480 |
|
| 481 |
$this->add_control( |
| 482 |
'city_field', |
| 483 |
[ |
| 484 |
'label' => esc_html__('City', 'king-addons'), |
| 485 |
'type' => Controls_Manager::SELECT, |
| 486 |
'options' => [] |
| 487 |
] |
| 488 |
); |
| 489 |
|
| 490 |
$this->add_control( |
| 491 |
'state_field', |
| 492 |
[ |
| 493 |
'label' => esc_html__('State', 'king-addons'), |
| 494 |
'type' => Controls_Manager::SELECT, |
| 495 |
'options' => [] |
| 496 |
] |
| 497 |
); |
| 498 |
|
| 499 |
$this->add_control( |
| 500 |
'zip_field', |
| 501 |
[ |
| 502 |
'label' => esc_html__('Zip', 'king-addons'), |
| 503 |
'type' => Controls_Manager::SELECT, |
| 504 |
'options' => [] |
| 505 |
] |
| 506 |
); |
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
$this->end_controls_section(); |
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
} |
| 516 |
|
| 517 |
public $last_prev_btn_text; |
| 518 |
|
| 519 |
protected function register_controls() |
| 520 |
{ |
| 521 |
|
| 522 |
$this->start_controls_section( |
| 523 |
'section_form_fields', |
| 524 |
[ |
| 525 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Fields', 'king-addons'), |
| 526 |
] |
| 527 |
); |
| 528 |
|
| 529 |
|
| 530 |
$repeater = new Repeater(); |
| 531 |
|
| 532 |
$field_types = [ |
| 533 |
'text' => esc_html__('Text', 'king-addons'), |
| 534 |
'textarea' => esc_html__('Textarea', 'king-addons'), |
| 535 |
'email' => esc_html__('Email', 'king-addons'), |
| 536 |
'url' => esc_html__('URL (Link)', 'king-addons'), |
| 537 |
'number' => esc_html__('Number', 'king-addons'), |
| 538 |
'tel' => esc_html__('Tel (Phone Number)', 'king-addons'), |
| 539 |
'radio' => esc_html__('Radio', 'king-addons'), |
| 540 |
'select' => esc_html__('Select', 'king-addons'), |
| 541 |
'checkbox' => esc_html__('Checkbox', 'king-addons'), |
| 542 |
'date' => esc_html__('Date', 'king-addons'), |
| 543 |
'time' => esc_html__('Time', 'king-addons'), |
| 544 |
'upload' => esc_html__('File Upload', 'king-addons'), |
| 545 |
'password' => esc_html__('Password', 'king-addons'), |
| 546 |
'html' => esc_html__('HTML', 'king-addons'), |
| 547 |
'recaptcha-v3' => esc_html__('reCAPTCHA V3', 'king-addons'), |
| 548 |
'hidden' => esc_html__('Hidden Field', 'king-addons'), |
| 549 |
'king-addons-fb-step' => esc_html__('Step', 'king-addons'), |
| 550 |
]; |
| 551 |
|
| 552 |
$repeater->add_control( |
| 553 |
'field_type', |
| 554 |
[ |
| 555 |
'label' => esc_html__('Type', 'king-addons'), |
| 556 |
'type' => Controls_Manager::SELECT, |
| 557 |
'options' => $field_types, |
| 558 |
'default' => 'text', |
| 559 |
] |
| 560 |
); |
| 561 |
|
| 562 |
$repeater->add_control( |
| 563 |
'field_step_notice', |
| 564 |
[ |
| 565 |
'type' => Controls_Manager::RAW_HTML, |
| 566 |
'raw' => esc_html__('Step should be a First element of fields group. Ex: Step 1 followed by Field 1, Field 2. Step 2 followed by Field 3, Field 4.', 'king-addons'), |
| 567 |
'content_classes' => 'elementor-panel-alert', |
| 568 |
'condition' => [ |
| 569 |
'field_type' => 'king-addons-fb-step' |
| 570 |
] |
| 571 |
] |
| 572 |
); |
| 573 |
|
| 574 |
if ('' == get_option('king_addons_recaptcha_v3_site_key')) { |
| 575 |
$repeater->add_control( |
| 576 |
'recaptcha_key_notice', |
| 577 |
[ |
| 578 |
'type' => Controls_Manager::RAW_HTML, |
| 579 |
'raw' => sprintf(__('Navigate to <strong><a href="%s" target="_blank">Dashboard > %s > Integrations</a></strong> to set up <strong>reCaptcha Site Key</strong>.', 'king-addons'), admin_url('admin.php?page=king-addons-settings'), Core::getPluginName()), |
| 580 |
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 581 |
'condition' => [ |
| 582 |
'field_type' => 'recaptcha-v3' |
| 583 |
] |
| 584 |
] |
| 585 |
); |
| 586 |
} |
| 587 |
|
| 588 |
$repeater->add_control( |
| 589 |
'field_label', |
| 590 |
[ |
| 591 |
'label' => esc_html__('Label', 'king-addons'), |
| 592 |
'type' => Controls_Manager::TEXT, |
| 593 |
'default' => '', |
| 594 |
'dynamic' => [ |
| 595 |
'active' => true, |
| 596 |
], |
| 597 |
] |
| 598 |
); |
| 599 |
|
| 600 |
$repeater->add_control( |
| 601 |
'field_sub_label', |
| 602 |
[ |
| 603 |
'label' => esc_html__('Sub Label', 'king-addons'), |
| 604 |
'type' => Controls_Manager::TEXT, |
| 605 |
'default' => '', |
| 606 |
'dynamic' => [ |
| 607 |
'active' => true, |
| 608 |
], |
| 609 |
'condition' => [ |
| 610 |
'field_type' => 'king-addons-fb-step' |
| 611 |
] |
| 612 |
] |
| 613 |
); |
| 614 |
|
| 615 |
$repeater->add_control( |
| 616 |
'previous_button_text', |
| 617 |
[ |
| 618 |
'label' => esc_html__('Previous Button', 'king-addons'), |
| 619 |
'type' => Controls_Manager::TEXT, |
| 620 |
'default' => 'Previous', |
| 621 |
'dynamic' => [ |
| 622 |
'active' => true, |
| 623 |
], |
| 624 |
'condition' => [ |
| 625 |
'field_type' => 'king-addons-fb-step' |
| 626 |
] |
| 627 |
] |
| 628 |
); |
| 629 |
|
| 630 |
$repeater->add_control( |
| 631 |
'next_button_text', |
| 632 |
[ |
| 633 |
'label' => esc_html__('Next Button', 'king-addons'), |
| 634 |
'type' => Controls_Manager::TEXT, |
| 635 |
'default' => 'Next', |
| 636 |
'dynamic' => [ |
| 637 |
'active' => true, |
| 638 |
], |
| 639 |
'condition' => [ |
| 640 |
'field_type' => 'king-addons-fb-step' |
| 641 |
] |
| 642 |
] |
| 643 |
); |
| 644 |
|
| 645 |
$repeater->add_control( |
| 646 |
'step_icon', |
| 647 |
[ |
| 648 |
'label' => esc_html__('Icon', 'king-addons'), |
| 649 |
'type' => Controls_Manager::ICONS, |
| 650 |
'skin' => 'inline', |
| 651 |
'label_block' => false, |
| 652 |
'separator' => 'before', |
| 653 |
'default' => [ |
| 654 |
'value' => 'far fa-edit', |
| 655 |
'library' => 'regular' |
| 656 |
], |
| 657 |
'condition' => [ |
| 658 |
'field_type' => 'king-addons-fb-step' |
| 659 |
] |
| 660 |
] |
| 661 |
); |
| 662 |
|
| 663 |
$repeater->add_control( |
| 664 |
'placeholder', |
| 665 |
[ |
| 666 |
'label' => esc_html__('Placeholder', 'king-addons'), |
| 667 |
'type' => Controls_Manager::TEXT, |
| 668 |
'default' => '', |
| 669 |
'conditions' => [ |
| 670 |
'terms' => [ |
| 671 |
[ |
| 672 |
'name' => 'field_type', |
| 673 |
'operator' => 'in', |
| 674 |
'value' => [ |
| 675 |
'tel', |
| 676 |
'text', |
| 677 |
'email', |
| 678 |
'textarea', |
| 679 |
'number', |
| 680 |
'url', |
| 681 |
'password', |
| 682 |
], |
| 683 |
], |
| 684 |
], |
| 685 |
], |
| 686 |
'dynamic' => [ |
| 687 |
'active' => true, |
| 688 |
], |
| 689 |
] |
| 690 |
); |
| 691 |
|
| 692 |
$repeater->add_control( |
| 693 |
'field_value', |
| 694 |
[ |
| 695 |
'label' => esc_html__('Default Value', 'king-addons'), |
| 696 |
'type' => Controls_Manager::TEXT, |
| 697 |
'default' => '', |
| 698 |
'dynamic' => [ |
| 699 |
'active' => true, |
| 700 |
], |
| 701 |
'conditions' => [ |
| 702 |
'terms' => [ |
| 703 |
[ |
| 704 |
'name' => 'field_type', |
| 705 |
'operator' => 'in', |
| 706 |
'value' => [ |
| 707 |
'text', |
| 708 |
'email', |
| 709 |
'textarea', |
| 710 |
'url', |
| 711 |
'tel', |
| 712 |
'radio', |
| 713 |
'select', |
| 714 |
'number', |
| 715 |
'date', |
| 716 |
'time', |
| 717 |
'hidden', |
| 718 |
], |
| 719 |
], |
| 720 |
], |
| 721 |
], |
| 722 |
] |
| 723 |
); |
| 724 |
|
| 725 |
$repeater->add_control( |
| 726 |
'field_id', |
| 727 |
[ |
| 728 |
'label' => esc_html__('ID', 'king-addons'), |
| 729 |
'type' => Controls_Manager::TEXT, |
| 730 |
'description' => esc_html__('Element ID should be unique and not used elsewhere in this widget.', 'king-addons'), |
| 731 |
'default' => '', |
| 732 |
'render_type' => 'none', |
| 733 |
'required' => true, |
| 734 |
'dynamic' => [ |
| 735 |
'active' => true, |
| 736 |
] |
| 737 |
] |
| 738 |
); |
| 739 |
|
| 740 |
$shortcode_value = '{{ view.container.settings.get( \'field_id\' ) }}'; |
| 741 |
|
| 742 |
$repeater->add_control( |
| 743 |
'shortcode', |
| 744 |
[ |
| 745 |
'label' => esc_html__('Shortcode', 'king-addons'), |
| 746 |
'type' => Controls_Manager::RAW_HTML, |
| 747 |
'classes' => 'forms-field-shortcode', |
| 748 |
'raw' => '<input class="king-addons-form-field-shortcode" value=\'[id="' . $shortcode_value . '"]\' readonly />' |
| 749 |
] |
| 750 |
); |
| 751 |
|
| 752 |
$repeater->add_control( |
| 753 |
'required', |
| 754 |
[ |
| 755 |
'label' => esc_html__('Required', 'king-addons'), |
| 756 |
'type' => Controls_Manager::SWITCHER, |
| 757 |
'return_value' => 'true', |
| 758 |
'default' => '', |
| 759 |
'conditions' => [ |
| 760 |
'terms' => [ |
| 761 |
[ |
| 762 |
'name' => 'field_type', |
| 763 |
'operator' => '!in', |
| 764 |
'value' => [ |
| 765 |
'recaptcha', |
| 766 |
'recaptcha-v3', |
| 767 |
'hidden', |
| 768 |
'html', |
| 769 |
'king-addons-fb-step', |
| 770 |
], |
| 771 |
], |
| 772 |
], |
| 773 |
], |
| 774 |
] |
| 775 |
); |
| 776 |
|
| 777 |
$repeater->add_control( |
| 778 |
'allow_multiple_upload', |
| 779 |
[ |
| 780 |
'label' => esc_html__('Multiple', 'king-addons'), |
| 781 |
'type' => Controls_Manager::SWITCHER, |
| 782 |
'condition' => [ |
| 783 |
'field_type' => 'upload' |
| 784 |
], |
| 785 |
] |
| 786 |
); |
| 787 |
|
| 788 |
$max_file_size = wp_max_upload_size() / pow(1024, 2); |
| 789 |
|
| 790 |
$repeater->add_control( |
| 791 |
'file_size', |
| 792 |
[ |
| 793 |
'label' => esc_html__('File Size (MB)', 'king-addons'), |
| 794 |
'type' => Controls_Manager::NUMBER, |
| 795 |
'min' => 1, |
| 796 |
'max' => $max_file_size, |
| 797 |
'king-addons-fb-step' => 1, |
| 798 |
'description' => esc_html__('Max upload size allowed is ' . $max_file_size . 'MB. Please contact your hosting to increase it.', 'king-addons'), |
| 799 |
'condition' => [ |
| 800 |
'field_type' => 'upload' |
| 801 |
] |
| 802 |
] |
| 803 |
); |
| 804 |
|
| 805 |
$repeater->add_control( |
| 806 |
'file_types', |
| 807 |
[ |
| 808 |
'label' => esc_html__('File Types', 'king-addons'), |
| 809 |
'type' => Controls_Manager::TEXT, |
| 810 |
'description' => esc_html__('Enter the comma separated file types to allow.', 'king-addons'), |
| 811 |
'condition' => [ |
| 812 |
'field_type' => 'upload', |
| 813 |
] |
| 814 |
] |
| 815 |
); |
| 816 |
|
| 817 |
$repeater->add_control( |
| 818 |
'field_options', |
| 819 |
[ |
| 820 |
'label' => esc_html__('Options', 'king-addons'), |
| 821 |
'type' => Controls_Manager::TEXTAREA, |
| 822 |
'default' => '', |
| 823 |
'description' => esc_html__('Insert each option on a separate line. To set a different label and value for an option, separate them with a pipe ("|"). Example: First Option|f_option', 'king-addons'), |
| 824 |
'conditions' => [ |
| 825 |
'terms' => [ |
| 826 |
[ |
| 827 |
'name' => 'field_type', |
| 828 |
'operator' => 'in', |
| 829 |
'value' => [ |
| 830 |
'select', |
| 831 |
'checkbox', |
| 832 |
'radio', |
| 833 |
], |
| 834 |
], |
| 835 |
], |
| 836 |
], |
| 837 |
] |
| 838 |
); |
| 839 |
|
| 840 |
$repeater->add_control( |
| 841 |
'allow_multiple', |
| 842 |
[ |
| 843 |
'label' => esc_html__('Multiple Selection', 'king-addons'), |
| 844 |
'type' => Controls_Manager::SWITCHER, |
| 845 |
'return_value' => 'true', |
| 846 |
'conditions' => [ |
| 847 |
'terms' => [ |
| 848 |
[ |
| 849 |
'name' => 'field_type', |
| 850 |
'value' => 'select', |
| 851 |
], |
| 852 |
], |
| 853 |
], |
| 854 |
] |
| 855 |
); |
| 856 |
|
| 857 |
$repeater->add_control( |
| 858 |
'select_size', |
| 859 |
[ |
| 860 |
'label' => esc_html__('Rows', 'king-addons'), |
| 861 |
'type' => Controls_Manager::NUMBER, |
| 862 |
'min' => 2, |
| 863 |
'king-addons-fb-step' => 1, |
| 864 |
'conditions' => [ |
| 865 |
'terms' => [ |
| 866 |
[ |
| 867 |
'name' => 'field_type', |
| 868 |
'value' => 'select', |
| 869 |
], |
| 870 |
[ |
| 871 |
'name' => 'allow_multiple', |
| 872 |
'value' => 'true', |
| 873 |
], |
| 874 |
], |
| 875 |
], |
| 876 |
] |
| 877 |
); |
| 878 |
|
| 879 |
$repeater->add_control( |
| 880 |
'inline_list', |
| 881 |
[ |
| 882 |
'label' => esc_html__('Inline List', 'king-addons'), |
| 883 |
'type' => Controls_Manager::SWITCHER, |
| 884 |
'return_value' => 'king-addons-inline-sub-group', |
| 885 |
'default' => '', |
| 886 |
'conditions' => [ |
| 887 |
'terms' => [ |
| 888 |
[ |
| 889 |
'name' => 'field_type', |
| 890 |
'operator' => 'in', |
| 891 |
'value' => [ |
| 892 |
'checkbox', |
| 893 |
'radio', |
| 894 |
], |
| 895 |
], |
| 896 |
], |
| 897 |
], |
| 898 |
] |
| 899 |
); |
| 900 |
|
| 901 |
$repeater->add_control( |
| 902 |
'field_html', |
| 903 |
[ |
| 904 |
'label' => esc_html__('HTML', 'king-addons'), |
| 905 |
'type' => Controls_Manager::TEXTAREA, |
| 906 |
'dynamic' => [ |
| 907 |
'active' => true, |
| 908 |
], |
| 909 |
'conditions' => [ |
| 910 |
'terms' => [ |
| 911 |
[ |
| 912 |
'name' => 'field_type', |
| 913 |
'value' => 'html', |
| 914 |
], |
| 915 |
], |
| 916 |
], |
| 917 |
] |
| 918 |
); |
| 919 |
|
| 920 |
$repeater->add_responsive_control( |
| 921 |
'width', |
| 922 |
[ |
| 923 |
'label' => esc_html__('Column Width', 'king-addons'), |
| 924 |
'type' => Controls_Manager::SLIDER, |
| 925 |
'size_units' => ['%'], |
| 926 |
'range' => [ |
| 927 |
'%' => [ |
| 928 |
'min' => 10, |
| 929 |
'max' => 100, |
| 930 |
], |
| 931 |
], |
| 932 |
'default' => [ |
| 933 |
'unit' => '%', |
| 934 |
'size' => 100, |
| 935 |
], |
| 936 |
'selectors' => [ |
| 937 |
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;', |
| 938 |
], |
| 939 |
'conditions' => [ |
| 940 |
'terms' => [ |
| 941 |
[ |
| 942 |
'name' => 'field_type', |
| 943 |
'operator' => '!in', |
| 944 |
'value' => [ |
| 945 |
'hidden', |
| 946 |
'recaptcha', |
| 947 |
'recaptcha-v3', |
| 948 |
'king-addons-fb-step', |
| 949 |
], |
| 950 |
], |
| 951 |
], |
| 952 |
], |
| 953 |
] |
| 954 |
); |
| 955 |
|
| 956 |
$repeater->add_control( |
| 957 |
'rows', |
| 958 |
[ |
| 959 |
'label' => esc_html__('Rows', 'king-addons'), |
| 960 |
'type' => Controls_Manager::NUMBER, |
| 961 |
'default' => 7, |
| 962 |
'conditions' => [ |
| 963 |
'terms' => [ |
| 964 |
[ |
| 965 |
'name' => 'field_type', |
| 966 |
'value' => 'textarea', |
| 967 |
], |
| 968 |
], |
| 969 |
], |
| 970 |
] |
| 971 |
); |
| 972 |
|
| 973 |
$repeater->add_control( |
| 974 |
'recaptcha_size', [ |
| 975 |
'label' => esc_html__('Size', 'king-addons'), |
| 976 |
'type' => Controls_Manager::SELECT, |
| 977 |
'default' => 'normal', |
| 978 |
'options' => [ |
| 979 |
'normal' => esc_html__('Normal', 'king-addons'), |
| 980 |
'compact' => esc_html__('Compact', 'king-addons'), |
| 981 |
], |
| 982 |
'conditions' => [ |
| 983 |
'terms' => [ |
| 984 |
[ |
| 985 |
'name' => 'field_type', |
| 986 |
'value' => 'recaptcha', |
| 987 |
], |
| 988 |
], |
| 989 |
], |
| 990 |
] |
| 991 |
); |
| 992 |
|
| 993 |
$repeater->add_control( |
| 994 |
'recaptcha_style', |
| 995 |
[ |
| 996 |
'label' => esc_html__('Style', 'king-addons'), |
| 997 |
'type' => Controls_Manager::SELECT, |
| 998 |
'default' => 'light', |
| 999 |
'options' => [ |
| 1000 |
'light' => esc_html__('Light', 'king-addons'), |
| 1001 |
'dark' => esc_html__('Dark', 'king-addons'), |
| 1002 |
], |
| 1003 |
'conditions' => [ |
| 1004 |
'terms' => [ |
| 1005 |
[ |
| 1006 |
'name' => 'field_type', |
| 1007 |
'value' => 'recaptcha', |
| 1008 |
], |
| 1009 |
], |
| 1010 |
], |
| 1011 |
] |
| 1012 |
); |
| 1013 |
|
| 1014 |
|
| 1015 |
$repeater->add_control( |
| 1016 |
'css_classes', |
| 1017 |
[ |
| 1018 |
'label' => esc_html__('CSS Classes', 'king-addons'), |
| 1019 |
'type' => Controls_Manager::HIDDEN, |
| 1020 |
'default' => '', |
| 1021 |
'title' => esc_html__('Add your custom class without the dot, e.g: "your-class"', 'king-addons'), |
| 1022 |
] |
| 1023 |
); |
| 1024 |
|
| 1025 |
$this->add_control( |
| 1026 |
'form_fields', |
| 1027 |
[ |
| 1028 |
|
| 1029 |
'type' => Controls_Manager::REPEATER, |
| 1030 |
'fields' => $repeater->get_controls(), |
| 1031 |
'default' => [ |
| 1032 |
[ |
| 1033 |
'field_id' => 'name', |
| 1034 |
'field_type' => 'text', |
| 1035 |
'field_label' => esc_html__('Name', 'king-addons'), |
| 1036 |
'placeholder' => esc_html__('Name', 'king-addons'), |
| 1037 |
'width' => '100', |
| 1038 |
'dynamic' => [ |
| 1039 |
'active' => true, |
| 1040 |
], |
| 1041 |
], |
| 1042 |
[ |
| 1043 |
'field_id' => 'email', |
| 1044 |
'field_type' => 'email', |
| 1045 |
'required' => 'true', |
| 1046 |
'field_label' => esc_html__('Email', 'king-addons'), |
| 1047 |
'placeholder' => esc_html__('Email', 'king-addons'), |
| 1048 |
'width' => '100', |
| 1049 |
], |
| 1050 |
[ |
| 1051 |
'field_id' => 'message', |
| 1052 |
'field_type' => 'textarea', |
| 1053 |
'field_label' => esc_html__('Message', 'king-addons'), |
| 1054 |
'placeholder' => esc_html__('Message', 'king-addons'), |
| 1055 |
'width' => '100', |
| 1056 |
], |
| 1057 |
], |
| 1058 |
'title_field' => '{{{ field_label }}}', |
| 1059 |
] |
| 1060 |
); |
| 1061 |
|
| 1062 |
if (!king_addons_freemius()->can_use_premium_code__premium_only()) { |
| 1063 |
$this->add_control( |
| 1064 |
'fields_to_show_pro_notice', |
| 1065 |
[ |
| 1066 |
'type' => Controls_Manager::RAW_HTML, |
| 1067 |
'raw' => __('More than 3 Fields (Excluding Steps) are available in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-form-builder-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>'), |
| 1068 |
'content_classes' => 'king-addons-pro-notice' |
| 1069 |
] |
| 1070 |
); |
| 1071 |
} |
| 1072 |
|
| 1073 |
$this->end_controls_section(); |
| 1074 |
|
| 1075 |
$this->start_controls_section( |
| 1076 |
'section_buttons', |
| 1077 |
[ |
| 1078 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Buttons', 'king-addons'), |
| 1079 |
] |
| 1080 |
); |
| 1081 |
|
| 1082 |
$this->add_responsive_control( |
| 1083 |
'button_width', |
| 1084 |
[ |
| 1085 |
'label' => esc_html__('Column Width', 'king-addons'), |
| 1086 |
'type' => Controls_Manager::SLIDER, |
| 1087 |
'size_units' => ['%'], |
| 1088 |
'range' => [ |
| 1089 |
'%' => [ |
| 1090 |
'min' => 10, |
| 1091 |
'max' => 100, |
| 1092 |
], |
| 1093 |
], |
| 1094 |
'default' => [ |
| 1095 |
'unit' => '%', |
| 1096 |
'size' => 100, |
| 1097 |
], |
| 1098 |
'selectors' => [ |
| 1099 |
'{{WRAPPER}} .king-addons-field-group.king-addons-form-field-type-submit' => 'width: {{SIZE}}%;', |
| 1100 |
'{{WRAPPER}} .king-addons-step-buttons-wrap' => 'width: {{SIZE}}%;' |
| 1101 |
], |
| 1102 |
'frontend_available' => true, |
| 1103 |
] |
| 1104 |
); |
| 1105 |
|
| 1106 |
$this->add_responsive_control( |
| 1107 |
'buttons_width', |
| 1108 |
[ |
| 1109 |
'label' => esc_html__('Step Buttons Width', 'king-addons'), |
| 1110 |
'type' => Controls_Manager::SLIDER, |
| 1111 |
'size_units' => ['px', '%'], |
| 1112 |
'range' => [ |
| 1113 |
'px' => [ |
| 1114 |
'min' => 0, |
| 1115 |
'max' => 500, |
| 1116 |
], |
| 1117 |
'%' => [ |
| 1118 |
'min' => 0, |
| 1119 |
'max' => 100, |
| 1120 |
] |
| 1121 |
], |
| 1122 |
'default' => [ |
| 1123 |
'unit' => 'px', |
| 1124 |
'size' => 150, |
| 1125 |
], |
| 1126 |
'selectors' => [ |
| 1127 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'width: {{SIZE}}{{UNIT}};', |
| 1128 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'width: {{SIZE}}{{UNIT}};', |
| 1129 |
'{{WRAPPER}} .king-addons-fb-step-tab .king-addons-button' => 'width: {{SIZE}}{{UNIT}};' |
| 1130 |
], |
| 1131 |
] |
| 1132 |
); |
| 1133 |
|
| 1134 |
$this->add_responsive_control( |
| 1135 |
'button_align', |
| 1136 |
[ |
| 1137 |
'label' => esc_html__('Alignment', 'king-addons'), |
| 1138 |
'type' => Controls_Manager::CHOOSE, |
| 1139 |
'options' => [ |
| 1140 |
'left' => [ |
| 1141 |
'title' => esc_html__('Left', 'king-addons'), |
| 1142 |
'icon' => 'eicon-text-align-left', |
| 1143 |
], |
| 1144 |
'center' => [ |
| 1145 |
'title' => esc_html__('Center', 'king-addons'), |
| 1146 |
'icon' => 'eicon-text-align-center', |
| 1147 |
], |
| 1148 |
'right' => [ |
| 1149 |
'title' => esc_html__('Right', 'king-addons'), |
| 1150 |
'icon' => 'eicon-text-align-right', |
| 1151 |
], |
| 1152 |
], |
| 1153 |
'default' => 'center', |
| 1154 |
'selectors_dictionary' => [ |
| 1155 |
'left' => 'margin-left: 0; margin-right: auto;', |
| 1156 |
'center' => 'margin-left: auto; margin-right: auto;', |
| 1157 |
'right' => 'margin-left: auto; margin-right: 0;' |
| 1158 |
], |
| 1159 |
'selectors' => [ |
| 1160 |
'{{WRAPPER}} .king-addons-step-buttons-wrap' => '{{VALUE}}', |
| 1161 |
'{{WRAPPER}} .king-addons-fb-step-tab:first-of-type .king-addons-fb-step-next' => '{{VALUE}}', |
| 1162 |
], |
| 1163 |
] |
| 1164 |
); |
| 1165 |
|
| 1166 |
|
| 1167 |
$this->add_control( |
| 1168 |
'heading_submit_button', |
| 1169 |
[ |
| 1170 |
'label' => esc_html__('Submit Button', 'king-addons'), |
| 1171 |
'type' => Controls_Manager::HEADING, |
| 1172 |
] |
| 1173 |
); |
| 1174 |
|
| 1175 |
$this->add_control( |
| 1176 |
'button_text', |
| 1177 |
[ |
| 1178 |
'label' => esc_html__('Submit', 'king-addons'), |
| 1179 |
'type' => Controls_Manager::TEXT, |
| 1180 |
'default' => esc_html__('Send', 'king-addons'), |
| 1181 |
'placeholder' => esc_html__('Send', 'king-addons'), |
| 1182 |
'dynamic' => [ |
| 1183 |
'active' => true, |
| 1184 |
], |
| 1185 |
] |
| 1186 |
); |
| 1187 |
|
| 1188 |
$this->add_control( |
| 1189 |
'selected_button_icon', |
| 1190 |
[ |
| 1191 |
'label' => esc_html__('Icon', 'king-addons'), |
| 1192 |
'type' => Controls_Manager::ICONS, |
| 1193 |
'skin' => 'inline', |
| 1194 |
'label_block' => false, |
| 1195 |
] |
| 1196 |
); |
| 1197 |
|
| 1198 |
$this->add_control( |
| 1199 |
'button_icon_align', |
| 1200 |
[ |
| 1201 |
'label' => esc_html__('Icon Position', 'king-addons'), |
| 1202 |
'type' => Controls_Manager::SELECT, |
| 1203 |
'default' => 'left', |
| 1204 |
'options' => [ |
| 1205 |
'left' => esc_html__('Before', 'king-addons'), |
| 1206 |
'right' => esc_html__('After', 'king-addons'), |
| 1207 |
], |
| 1208 |
'condition' => [ |
| 1209 |
'selected_button_icon[value]!' => '', |
| 1210 |
], |
| 1211 |
] |
| 1212 |
); |
| 1213 |
|
| 1214 |
$this->add_control( |
| 1215 |
'button_icon_indent', |
| 1216 |
[ |
| 1217 |
'label' => esc_html__('Icon Spacing', 'king-addons'), |
| 1218 |
'type' => Controls_Manager::SLIDER, |
| 1219 |
'range' => [ |
| 1220 |
'px' => [ |
| 1221 |
'max' => 50, |
| 1222 |
], |
| 1223 |
], |
| 1224 |
'condition' => [ |
| 1225 |
'selected_button_icon[value]!' => '', |
| 1226 |
], |
| 1227 |
'selectors' => [ |
| 1228 |
'{{WRAPPER}} .king-addons-button .king-addons-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1229 |
'{{WRAPPER}} .king-addons-button .king-addons-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1230 |
], |
| 1231 |
] |
| 1232 |
); |
| 1233 |
|
| 1234 |
$this->add_control( |
| 1235 |
'button_css_id', |
| 1236 |
[ |
| 1237 |
'label' => esc_html__('Button ID', 'king-addons'), |
| 1238 |
'type' => Controls_Manager::TEXT, |
| 1239 |
'default' => '', |
| 1240 |
'title' => esc_html__('Add your custom id WITHOUT the Pound key. e.g: my-id', 'king-addons'), |
| 1241 |
'description' => esc_html__('Element ID should be unique and not used elsewhere in this widget', 'king-addons'), |
| 1242 |
'separator' => 'before', |
| 1243 |
'dynamic' => [ |
| 1244 |
'active' => true, |
| 1245 |
], |
| 1246 |
] |
| 1247 |
); |
| 1248 |
|
| 1249 |
$this->end_controls_section(); |
| 1250 |
|
| 1251 |
|
| 1252 |
$this->start_controls_section( |
| 1253 |
'section_form_settings', |
| 1254 |
[ |
| 1255 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Settings', 'king-addons'), |
| 1256 |
'tab' => Controls_Manager::TAB_CONTENT |
| 1257 |
] |
| 1258 |
); |
| 1259 |
|
| 1260 |
$this->add_control( |
| 1261 |
'form_name', |
| 1262 |
[ |
| 1263 |
'label' => esc_html__('Form Name', 'king-addons'), |
| 1264 |
'type' => Controls_Manager::TEXT, |
| 1265 |
'default' => esc_html__('New Form', 'king-addons'), |
| 1266 |
'placeholder' => esc_html__('Form Name', 'king-addons'), |
| 1267 |
] |
| 1268 |
); |
| 1269 |
|
| 1270 |
$this->add_control( |
| 1271 |
'form_id', |
| 1272 |
[ |
| 1273 |
'label' => esc_html__('Form ID', 'king-addons'), |
| 1274 |
'type' => Controls_Manager::TEXT, |
| 1275 |
'placeholder' => 'form_id', |
| 1276 |
'description' => esc_html__('Form ID should be unique and shouldn\'t contain spaces', 'king-addons'), |
| 1277 |
'separator' => 'after', |
| 1278 |
'dynamic' => [ |
| 1279 |
'active' => true, |
| 1280 |
], |
| 1281 |
] |
| 1282 |
); |
| 1283 |
|
| 1284 |
$this->add_control( |
| 1285 |
'success_message', |
| 1286 |
[ |
| 1287 |
'label' => esc_html__('Success Message', 'king-addons'), |
| 1288 |
'type' => Controls_Manager::TEXT, |
| 1289 |
'default' => esc_html__('Submission successful', 'king-addons'), |
| 1290 |
'placeholder' => esc_html__('Submission successful', 'king-addons'), |
| 1291 |
'label_block' => true, |
| 1292 |
'frontend_available' => true, |
| 1293 |
|
| 1294 |
|
| 1295 |
'render_type' => 'none', |
| 1296 |
'dynamic' => [ |
| 1297 |
'active' => true, |
| 1298 |
], |
| 1299 |
] |
| 1300 |
); |
| 1301 |
|
| 1302 |
$this->add_control( |
| 1303 |
'error_message', |
| 1304 |
[ |
| 1305 |
'label' => esc_html__('Error Message', 'king-addons'), |
| 1306 |
'type' => Controls_Manager::TEXT, |
| 1307 |
'default' => esc_html__('Submission failed', 'king-addons'), |
| 1308 |
'placeholder' => esc_html__('Submission failed', 'king-addons'), |
| 1309 |
'label_block' => true, |
| 1310 |
'frontend_available' => true, |
| 1311 |
|
| 1312 |
|
| 1313 |
'render_type' => 'none', |
| 1314 |
'dynamic' => [ |
| 1315 |
'active' => true, |
| 1316 |
], |
| 1317 |
] |
| 1318 |
); |
| 1319 |
|
| 1320 |
$this->add_control( |
| 1321 |
'show_labels', |
| 1322 |
[ |
| 1323 |
'label' => esc_html__('Show Field Labels', 'king-addons'), |
| 1324 |
'type' => Controls_Manager::SWITCHER, |
| 1325 |
'label_on' => esc_html__('Show', 'king-addons'), |
| 1326 |
'label_off' => esc_html__('Hide', 'king-addons'), |
| 1327 |
'return_value' => 'true', |
| 1328 |
'default' => 'true', |
| 1329 |
'separator' => 'before', |
| 1330 |
] |
| 1331 |
); |
| 1332 |
|
| 1333 |
$this->add_control( |
| 1334 |
'show_placeholders', |
| 1335 |
[ |
| 1336 |
'label' => esc_html__('Show Placeholders', 'king-addons'), |
| 1337 |
'type' => Controls_Manager::SWITCHER, |
| 1338 |
'label_on' => esc_html__('Show', 'king-addons'), |
| 1339 |
'label_off' => esc_html__('Hide', 'king-addons'), |
| 1340 |
'return_value' => 'true', |
| 1341 |
'default' => 'true' |
| 1342 |
] |
| 1343 |
); |
| 1344 |
|
| 1345 |
$this->add_control( |
| 1346 |
'label_position', |
| 1347 |
[ |
| 1348 |
'label' => esc_html__('Label Position', 'king-addons'), |
| 1349 |
'type' => Controls_Manager::HIDDEN, |
| 1350 |
'options' => [ |
| 1351 |
'above' => esc_html__('Above', 'king-addons'), |
| 1352 |
'inline' => esc_html__('Inline', 'king-addons'), |
| 1353 |
], |
| 1354 |
'default' => 'above', |
| 1355 |
'condition' => [ |
| 1356 |
'show_labels!' => '', |
| 1357 |
], |
| 1358 |
] |
| 1359 |
); |
| 1360 |
|
| 1361 |
$this->add_control( |
| 1362 |
'mark_required', |
| 1363 |
[ |
| 1364 |
'label' => esc_html__('Show Required Mark', 'king-addons'), |
| 1365 |
'type' => Controls_Manager::SWITCHER, |
| 1366 |
'label_on' => esc_html__('Show', 'king-addons'), |
| 1367 |
'label_off' => esc_html__('Hide', 'king-addons'), |
| 1368 |
'default' => '', |
| 1369 |
'condition' => [ |
| 1370 |
'show_labels!' => '', |
| 1371 |
], |
| 1372 |
] |
| 1373 |
); |
| 1374 |
|
| 1375 |
$this->end_controls_section(); |
| 1376 |
|
| 1377 |
$this->start_controls_section( |
| 1378 |
'section_integration', |
| 1379 |
[ |
| 1380 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Actions', 'king-addons'), |
| 1381 |
] |
| 1382 |
); |
| 1383 |
|
| 1384 |
|
| 1385 |
$default_submit_actions = ['email']; |
| 1386 |
|
| 1387 |
$this->add_control( |
| 1388 |
'submit_actions', |
| 1389 |
[ |
| 1390 |
'label' => esc_html__('Add Action', 'king-addons'), |
| 1391 |
'type' => Controls_Manager::SELECT2, |
| 1392 |
'multiple' => true, |
| 1393 |
'options' => $this->submit_action_args(), |
| 1394 |
'render_type' => 'none', |
| 1395 |
'label_block' => true, |
| 1396 |
'default' => $default_submit_actions, |
| 1397 |
'description' => esc_html__('Select the actions to perform after a user submits the form (e.g., sending an email notification). Once an action is selected, its corresponding settings will be displayed below.', 'king-addons'), |
| 1398 |
] |
| 1399 |
); |
| 1400 |
|
| 1401 |
if (!king_addons_freemius()->can_use_premium_code__premium_only()) { |
| 1402 |
$this->add_control( |
| 1403 |
'submit_actions_notice', |
| 1404 |
[ |
| 1405 |
'type' => Controls_Manager::RAW_HTML, |
| 1406 |
'raw' => __('<strong>Submission</strong> and <strong>Mailchimp</strong> actions are only available <br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-form-builder-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>'), |
| 1407 |
'content_classes' => 'king-addons-pro-notice' |
| 1408 |
] |
| 1409 |
); |
| 1410 |
} |
| 1411 |
|
| 1412 |
$this->end_controls_section(); |
| 1413 |
|
| 1414 |
$this->register_settings_section_submissions($this); |
| 1415 |
|
| 1416 |
$this->register_settings_section_email($this); |
| 1417 |
|
| 1418 |
$this->register_settings_section_webhook($this); |
| 1419 |
|
| 1420 |
$this->register_settings_section_redirect($this); |
| 1421 |
|
| 1422 |
$this->register_settings_section_mailchimp(); |
| 1423 |
|
| 1424 |
$this->start_controls_section( |
| 1425 |
'section_form_step_settings', |
| 1426 |
[ |
| 1427 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Steps', 'king-addons'), |
| 1428 |
'tab' => Controls_Manager::TAB_CONTENT |
| 1429 |
] |
| 1430 |
); |
| 1431 |
|
| 1432 |
$this->add_control( |
| 1433 |
'step_type', |
| 1434 |
[ |
| 1435 |
'label' => esc_html__('Type', 'king-addons'), |
| 1436 |
'type' => Controls_Manager::SELECT, |
| 1437 |
'frontend_available' => true, |
| 1438 |
'render_type' => 'template', |
| 1439 |
'options' => [ |
| 1440 |
'none' => 'None', |
| 1441 |
'text' => 'Label', |
| 1442 |
'icon' => 'Icon', |
| 1443 |
'number' => 'Number', |
| 1444 |
'progress_bar' => 'Progress Bar', |
| 1445 |
'number_text' => 'Number & Label', |
| 1446 |
'icon_text' => 'Icon & Label', |
| 1447 |
], |
| 1448 |
'prefix_class' => 'king-addons-fb-step-type-', |
| 1449 |
'default' => 'number_text' |
| 1450 |
] |
| 1451 |
); |
| 1452 |
|
| 1453 |
$this->add_control( |
| 1454 |
'step_content_layout', |
| 1455 |
[ |
| 1456 |
'label' => esc_html__('Content Layout', 'king-addons'), |
| 1457 |
'type' => Controls_Manager::SELECT, |
| 1458 |
'frontend_available' => true, |
| 1459 |
'options' => [ |
| 1460 |
'horizontal' => 'Horizontal', |
| 1461 |
'vertical' => 'Vertical', |
| 1462 |
], |
| 1463 |
'default' => 'vertical', |
| 1464 |
'prefix_class' => 'king-addons-fb-step-content-layout-', |
| 1465 |
'condition' => [ |
| 1466 |
'step_type!' => ['progress_bar', 'none'] |
| 1467 |
] |
| 1468 |
] |
| 1469 |
); |
| 1470 |
|
| 1471 |
$this->add_control( |
| 1472 |
'show_separator', |
| 1473 |
[ |
| 1474 |
'label' => esc_html__('Separator', 'king-addons'), |
| 1475 |
'type' => Controls_Manager::SWITCHER, |
| 1476 |
'default' => 'yes', |
| 1477 |
'condition' => [ |
| 1478 |
'step_type!' => 'progress_bar' |
| 1479 |
] |
| 1480 |
] |
| 1481 |
); |
| 1482 |
|
| 1483 |
$this->add_responsive_control( |
| 1484 |
'step_box_align', |
| 1485 |
[ |
| 1486 |
'label' => esc_html__('Box Alignment', 'king-addons'), |
| 1487 |
'type' => Controls_Manager::CHOOSE, |
| 1488 |
'options' => [ |
| 1489 |
'flex-start' => [ |
| 1490 |
'title' => esc_html__('Left', 'king-addons'), |
| 1491 |
'icon' => 'eicon-text-align-left', |
| 1492 |
], |
| 1493 |
'center' => [ |
| 1494 |
'title' => esc_html__('Center', 'king-addons'), |
| 1495 |
'icon' => 'eicon-text-align-center', |
| 1496 |
], |
| 1497 |
'flex-end' => [ |
| 1498 |
'title' => esc_html__('Right', 'king-addons'), |
| 1499 |
'icon' => 'eicon-text-align-right', |
| 1500 |
], |
| 1501 |
], |
| 1502 |
'default' => 'center', |
| 1503 |
'selectors' => [ |
| 1504 |
'{{WRAPPER}}.king-addons-fb-step-content-layout-vertical .king-addons-fb-step' => 'align-items: {{VALUE}}', |
| 1505 |
'{{WRAPPER}}.king-addons-fb-step-content-layout-horizontal .king-addons-fb-step' => 'justify-content: {{VALUE}}' |
| 1506 |
], |
| 1507 |
'condition' => [ |
| 1508 |
'step_type!' => ['progress_bar', 'none'] |
| 1509 |
] |
| 1510 |
] |
| 1511 |
); |
| 1512 |
|
| 1513 |
$this->add_responsive_control( |
| 1514 |
'step_align', |
| 1515 |
[ |
| 1516 |
'label' => esc_html__('Alignment', 'king-addons'), |
| 1517 |
'type' => Controls_Manager::CHOOSE, |
| 1518 |
'options' => [ |
| 1519 |
'left' => [ |
| 1520 |
'title' => esc_html__('Left', 'king-addons'), |
| 1521 |
'icon' => 'eicon-text-align-left', |
| 1522 |
], |
| 1523 |
'center' => [ |
| 1524 |
'title' => esc_html__('Center', 'king-addons'), |
| 1525 |
'icon' => 'eicon-text-align-center', |
| 1526 |
], |
| 1527 |
'right' => [ |
| 1528 |
'title' => esc_html__('Right', 'king-addons'), |
| 1529 |
'icon' => 'eicon-text-align-right', |
| 1530 |
], |
| 1531 |
], |
| 1532 |
'default' => 'center', |
| 1533 |
'selectors' => [ |
| 1534 |
'{{WRAPPER}} .king-addons-fb-step' => 'text-align: {{VALUE}}' |
| 1535 |
], |
| 1536 |
'condition' => [ |
| 1537 |
'step_type!' => ['progress_bar', 'none'] |
| 1538 |
] |
| 1539 |
] |
| 1540 |
); |
| 1541 |
|
| 1542 |
$this->end_controls_section(); |
| 1543 |
|
| 1544 |
$this->start_controls_section( |
| 1545 |
'section_form_style', |
| 1546 |
[ |
| 1547 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Form', 'king-addons'), |
| 1548 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1549 |
] |
| 1550 |
); |
| 1551 |
|
| 1552 |
$this->add_control( |
| 1553 |
'label_color', |
| 1554 |
[ |
| 1555 |
'label' => esc_html__('Label Color', 'king-addons'), |
| 1556 |
'type' => Controls_Manager::COLOR, |
| 1557 |
'default' => '#7a7a7a', |
| 1558 |
'selectors' => [ |
| 1559 |
'{{WRAPPER}} .king-addons-field-group > label, {{WRAPPER}} .king-addons-field-sub-group label' => 'color: {{VALUE}};', |
| 1560 |
] |
| 1561 |
] |
| 1562 |
); |
| 1563 |
|
| 1564 |
$this->add_control( |
| 1565 |
'mark_required_color', |
| 1566 |
[ |
| 1567 |
'label' => esc_html__('Mark Color', 'king-addons'), |
| 1568 |
'type' => Controls_Manager::COLOR, |
| 1569 |
'default' => '#CB3030', |
| 1570 |
'selectors' => [ |
| 1571 |
'{{WRAPPER}} .king-addons-required-mark .king-addons-form-field-label:after' => 'color: {{COLOR}};', |
| 1572 |
], |
| 1573 |
'condition' => [ |
| 1574 |
'mark_required' => 'yes', |
| 1575 |
], |
| 1576 |
] |
| 1577 |
); |
| 1578 |
|
| 1579 |
$this->add_group_control( |
| 1580 |
Group_Control_Typography::get_type(), |
| 1581 |
[ |
| 1582 |
'name' => 'label_typography', |
| 1583 |
'selector' => '{{WRAPPER}} .king-addons-field-group > label' |
| 1584 |
] |
| 1585 |
); |
| 1586 |
|
| 1587 |
$this->add_control( |
| 1588 |
'label_spacing', |
| 1589 |
[ |
| 1590 |
'label' => esc_html__('Distance', 'king-addons'), |
| 1591 |
'type' => Controls_Manager::SLIDER, |
| 1592 |
'default' => [ |
| 1593 |
'size' => 0, |
| 1594 |
], |
| 1595 |
'range' => [ |
| 1596 |
'px' => [ |
| 1597 |
'min' => 0, |
| 1598 |
'max' => 60, |
| 1599 |
], |
| 1600 |
], |
| 1601 |
'selectors' => [ |
| 1602 |
'body.rtl {{WRAPPER}} .king-addons-labels-inline .king-addons-field-group > label' => 'padding-left: {{SIZE}}{{UNIT}};', |
| 1603 |
|
| 1604 |
'body:not(.rtl) {{WRAPPER}} .king-addons-labels-inline .king-addons-field-group > label' => 'padding-right: {{SIZE}}{{UNIT}};', |
| 1605 |
|
| 1606 |
'body {{WRAPPER}} .king-addons-labels-above .king-addons-field-group > label' => 'padding-bottom: {{SIZE}}{{UNIT}};', |
| 1607 |
|
| 1608 |
], |
| 1609 |
] |
| 1610 |
); |
| 1611 |
|
| 1612 |
$this->add_control( |
| 1613 |
'heading_label', |
| 1614 |
[ |
| 1615 |
'label' => esc_html__('Inputs', 'king-addons'), |
| 1616 |
'type' => Controls_Manager::HEADING, |
| 1617 |
'separator' => 'before', |
| 1618 |
] |
| 1619 |
); |
| 1620 |
|
| 1621 |
$this->add_control( |
| 1622 |
'column_gap', |
| 1623 |
[ |
| 1624 |
'label' => esc_html__('Horizontal Distance', 'king-addons'), |
| 1625 |
'type' => Controls_Manager::SLIDER, |
| 1626 |
'default' => [ |
| 1627 |
'size' => 10, |
| 1628 |
], |
| 1629 |
'range' => [ |
| 1630 |
'px' => [ |
| 1631 |
'min' => 0, |
| 1632 |
'max' => 60, |
| 1633 |
], |
| 1634 |
], |
| 1635 |
'selectors' => [ |
| 1636 |
'{{WRAPPER}} .king-addons-field-group' => 'padding-right: calc( {{SIZE}}{{UNIT}}/2 ); padding-left: calc( {{SIZE}}{{UNIT}}/2 );', |
| 1637 |
'{{WRAPPER}} .king-addons-fb-step-wrap' => 'padding-left: calc( -{{SIZE}}{{UNIT}}/2 ); padding-right: calc( -{{SIZE}}{{UNIT}}/2 );', |
| 1638 |
'{{WRAPPER}} .king-addons-step-buttons-wrap' => 'padding-right: calc( {{SIZE}}{{UNIT}}/2 ); padding-left: calc( {{SIZE}}{{UNIT}}/2 );', |
| 1639 |
'{{WRAPPER}} .king-addons-form-fields-wrap' => 'margin-left: calc( -{{SIZE}}{{UNIT}}/2 ); margin-right: calc( -{{SIZE}}{{UNIT}}/2 );', |
| 1640 |
], |
| 1641 |
] |
| 1642 |
); |
| 1643 |
|
| 1644 |
$this->add_control( |
| 1645 |
'row_gap', |
| 1646 |
[ |
| 1647 |
'label' => esc_html__('Vertical Distance', 'king-addons'), |
| 1648 |
'type' => Controls_Manager::SLIDER, |
| 1649 |
'default' => [ |
| 1650 |
'size' => 10, |
| 1651 |
], |
| 1652 |
'range' => [ |
| 1653 |
'px' => [ |
| 1654 |
'min' => 0, |
| 1655 |
'max' => 60, |
| 1656 |
], |
| 1657 |
], |
| 1658 |
'selectors' => [ |
| 1659 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-step-buttons-wrap)' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 1660 |
'{{WRAPPER}} .king-addons-field-group.recaptcha-v3-bottomleft, {{WRAPPER}} .king-addons-field-group.recaptcha-v3-bottomright' => 'margin-bottom: 0;', |
| 1661 |
], |
| 1662 |
] |
| 1663 |
); |
| 1664 |
|
| 1665 |
$this->add_responsive_control( |
| 1666 |
'labels_align', |
| 1667 |
[ |
| 1668 |
'label' => esc_html__('Align Labels', 'king-addons'), |
| 1669 |
'type' => Controls_Manager::CHOOSE, |
| 1670 |
'options' => [ |
| 1671 |
'flex-start' => [ |
| 1672 |
'title' => esc_html__('Left', 'king-addons'), |
| 1673 |
'icon' => 'eicon-text-align-left', |
| 1674 |
], |
| 1675 |
'center' => [ |
| 1676 |
'title' => esc_html__('Center', 'king-addons'), |
| 1677 |
'icon' => 'eicon-text-align-center', |
| 1678 |
], |
| 1679 |
'flex-end' => [ |
| 1680 |
'title' => esc_html__('Right', 'king-addons'), |
| 1681 |
'icon' => 'eicon-text-align-right', |
| 1682 |
], |
| 1683 |
], |
| 1684 |
'default' => 'flex-start', |
| 1685 |
'selectors' => [ |
| 1686 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-step-buttons-wrap)' => 'justify-content: {{VALUE}}' |
| 1687 |
], |
| 1688 |
'separator' => 'before' |
| 1689 |
] |
| 1690 |
); |
| 1691 |
|
| 1692 |
$this->end_controls_section(); |
| 1693 |
|
| 1694 |
$this->start_controls_section( |
| 1695 |
'section_field_style', |
| 1696 |
[ |
| 1697 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Field', 'king-addons'), |
| 1698 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1699 |
] |
| 1700 |
); |
| 1701 |
|
| 1702 |
$this->start_controls_tabs('tabs_fields_style'); |
| 1703 |
|
| 1704 |
$this->start_controls_tab( |
| 1705 |
'tab_fields_normal', |
| 1706 |
[ |
| 1707 |
'label' => esc_html__('Normal', 'king-addons'), |
| 1708 |
] |
| 1709 |
); |
| 1710 |
|
| 1711 |
$this->add_control( |
| 1712 |
'field_text_color', |
| 1713 |
[ |
| 1714 |
'label' => esc_html__('Color', 'king-addons'), |
| 1715 |
'type' => Controls_Manager::COLOR, |
| 1716 |
'default' => '#7a7a7a', |
| 1717 |
'selectors' => [ |
| 1718 |
'{{WRAPPER}} .king-addons-field-group .king-addons-form-field' => 'color: {{VALUE}};', |
| 1719 |
'{{WRAPPER}} .king-addons-field-group .king-addons-form-field svg' => 'fill: {{VALUE}};', |
| 1720 |
'{{WRAPPER}} .king-addons-field-group input[type="radio"] + label' => 'color: {{VALUE}};', |
| 1721 |
'{{WRAPPER}} .king-addons-field-group input[type="checkbox"] + label' => 'color: {{VALUE}};' |
| 1722 |
] |
| 1723 |
] |
| 1724 |
); |
| 1725 |
|
| 1726 |
$this->add_control( |
| 1727 |
'field_background_color', |
| 1728 |
[ |
| 1729 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 1730 |
'type' => Controls_Manager::COLOR, |
| 1731 |
'default' => '#ffffff', |
| 1732 |
'selectors' => [ |
| 1733 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap)' => 'background-color: {{VALUE}};', |
| 1734 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select' => 'background-color: {{VALUE}};', |
| 1735 |
] |
| 1736 |
] |
| 1737 |
); |
| 1738 |
|
| 1739 |
$this->add_control( |
| 1740 |
'field_border_color', |
| 1741 |
[ |
| 1742 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 1743 |
'type' => Controls_Manager::COLOR, |
| 1744 |
'selectors' => [ |
| 1745 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap)' => 'border-color: {{VALUE}};', |
| 1746 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select' => 'border-color: {{VALUE}};', |
| 1747 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap::before' => 'color: {{VALUE}};', |
| 1748 |
] |
| 1749 |
] |
| 1750 |
); |
| 1751 |
|
| 1752 |
$this->add_group_control( |
| 1753 |
Group_Control_Typography::get_type(), |
| 1754 |
[ |
| 1755 |
'name' => 'field_typography', |
| 1756 |
'selector' => '{{WRAPPER}} .king-addons-field-group .king-addons-form-field, {{WRAPPER}} .king-addons-field-sub-group label' |
| 1757 |
] |
| 1758 |
); |
| 1759 |
|
| 1760 |
$this->end_controls_tab(); |
| 1761 |
|
| 1762 |
$this->start_controls_tab( |
| 1763 |
'tab_fields_focus', |
| 1764 |
[ |
| 1765 |
'label' => esc_html__('Focus', 'king-addons'), |
| 1766 |
] |
| 1767 |
); |
| 1768 |
|
| 1769 |
$this->add_control( |
| 1770 |
'field_text_color_focus', |
| 1771 |
[ |
| 1772 |
'label' => esc_html__('Color', 'king-addons'), |
| 1773 |
'type' => Controls_Manager::COLOR, |
| 1774 |
'default' => '#7a7a7a', |
| 1775 |
'selectors' => [ |
| 1776 |
'{{WRAPPER}} .king-addons-field-group .king-addons-form-field:focus' => 'color: {{VALUE}};', |
| 1777 |
'{{WRAPPER}} .king-addons-field-group input[type="radio"]:focus' => 'color: {{VALUE}};', |
| 1778 |
'{{WRAPPER}} .king-addons-field-group input[type="checkbox"]:focus' => 'color: {{VALUE}};' |
| 1779 |
] |
| 1780 |
] |
| 1781 |
); |
| 1782 |
|
| 1783 |
$this->add_control( |
| 1784 |
'field_background_color_focus', |
| 1785 |
[ |
| 1786 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 1787 |
'type' => Controls_Manager::COLOR, |
| 1788 |
'default' => '#ffffff', |
| 1789 |
'selectors' => [ |
| 1790 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap):focus' => 'background-color: {{VALUE}};', |
| 1791 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select:focus' => 'background-color: {{VALUE}};', |
| 1792 |
] |
| 1793 |
] |
| 1794 |
); |
| 1795 |
|
| 1796 |
$this->add_control( |
| 1797 |
'field_border_color_focus', |
| 1798 |
[ |
| 1799 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 1800 |
'type' => Controls_Manager::COLOR, |
| 1801 |
'selectors' => [ |
| 1802 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap):focus' => 'border-color: {{VALUE}};', |
| 1803 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select:focus' => 'border-color: {{VALUE}};', |
| 1804 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap:focus-within::before' => 'color: {{VALUE}};', |
| 1805 |
] |
| 1806 |
] |
| 1807 |
); |
| 1808 |
|
| 1809 |
$this->end_controls_tab(); |
| 1810 |
|
| 1811 |
$this->start_controls_tab( |
| 1812 |
'tab_fields_error', |
| 1813 |
[ |
| 1814 |
'label' => esc_html__('Error', 'king-addons'), |
| 1815 |
] |
| 1816 |
); |
| 1817 |
|
| 1818 |
$this->add_control( |
| 1819 |
'field_text_color_error', |
| 1820 |
[ |
| 1821 |
'label' => esc_html__('Color', 'king-addons'), |
| 1822 |
'type' => Controls_Manager::COLOR, |
| 1823 |
'default' => '#CB3030', |
| 1824 |
'selectors' => [ |
| 1825 |
'{{WRAPPER}} .king-addons-field-group .king-addons-form-field.king-addons-form-error' => 'color: {{VALUE}};', |
| 1826 |
'{{WRAPPER}} .king-addons-field-group input[type="radio"].king-addons-form-error' => 'color: {{VALUE}};', |
| 1827 |
'{{WRAPPER}} .king-addons-field-group input[type="checkbox"].king-addons-form-error' => 'color: {{VALUE}};', |
| 1828 |
|
| 1829 |
] |
| 1830 |
] |
| 1831 |
); |
| 1832 |
|
| 1833 |
$this->add_control( |
| 1834 |
'field_background_color_error', |
| 1835 |
[ |
| 1836 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 1837 |
'type' => Controls_Manager::COLOR, |
| 1838 |
'default' => '#ffffff', |
| 1839 |
'selectors' => [ |
| 1840 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap).king-addons-form-error' => 'background-color: {{VALUE}};', |
| 1841 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select.king-addons-form-error' => 'background-color: {{VALUE}};', |
| 1842 |
] |
| 1843 |
] |
| 1844 |
); |
| 1845 |
|
| 1846 |
$this->add_control( |
| 1847 |
'field_border_color_error', |
| 1848 |
[ |
| 1849 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 1850 |
'type' => Controls_Manager::COLOR, |
| 1851 |
'default' => '#CB3030', |
| 1852 |
'selectors' => [ |
| 1853 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap).king-addons-form-error' => 'border-color: {{VALUE}};', |
| 1854 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select.king-addons-form-error' => 'border-color: {{VALUE}};', |
| 1855 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap.king-addons-form-error-wrap::before' => 'color: {{VALUE}};', |
| 1856 |
] |
| 1857 |
] |
| 1858 |
); |
| 1859 |
|
| 1860 |
$this->end_controls_tab(); |
| 1861 |
|
| 1862 |
$this->end_controls_tabs(); |
| 1863 |
|
| 1864 |
$this->add_control( |
| 1865 |
'field_border_width', |
| 1866 |
[ |
| 1867 |
'label' => esc_html__('Border Width', 'king-addons'), |
| 1868 |
'type' => Controls_Manager::DIMENSIONS, |
| 1869 |
'placeholder' => '1', |
| 1870 |
'size_units' => ['px', '%', 'em'], |
| 1871 |
'selectors' => [ |
| 1872 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap)' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1873 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1874 |
], |
| 1875 |
'separator' => 'before' |
| 1876 |
] |
| 1877 |
); |
| 1878 |
|
| 1879 |
$this->add_control( |
| 1880 |
'field_border_radius', |
| 1881 |
[ |
| 1882 |
'label' => esc_html__('Border Radius', 'king-addons'), |
| 1883 |
'type' => Controls_Manager::DIMENSIONS, |
| 1884 |
'size_units' => ['px', '%', 'em'], |
| 1885 |
'default' => [ |
| 1886 |
'top' => 3, |
| 1887 |
'right' => 3, |
| 1888 |
'bottom' => 3, |
| 1889 |
'left' => 3, |
| 1890 |
'unit' => 'px' |
| 1891 |
], |
| 1892 |
'selectors' => [ |
| 1893 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1894 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1895 |
], |
| 1896 |
] |
| 1897 |
); |
| 1898 |
|
| 1899 |
$this->add_control( |
| 1900 |
'field_padding', |
| 1901 |
[ |
| 1902 |
'label' => esc_html__('Padding', 'king-addons'), |
| 1903 |
'type' => Controls_Manager::DIMENSIONS, |
| 1904 |
'size_units' => ['px', '%', 'em'], |
| 1905 |
'default' => [ |
| 1906 |
'top' => 6, |
| 1907 |
'right' => 5, |
| 1908 |
'bottom' => 7, |
| 1909 |
'left' => 10, |
| 1910 |
'unit' => 'px' |
| 1911 |
], |
| 1912 |
'selectors' => [ |
| 1913 |
'{{WRAPPER}} .king-addons-field-group:not(.king-addons-form-field-type-upload) .king-addons-form-field:not(.king-addons-select-wrap)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1914 |
'{{WRAPPER}} .king-addons-field-group .king-addons-select-wrap select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1915 |
'{{WRAPPER}} .king-addons-field-group input[type="date"]::before' => 'right: {{RIGHT}}{{UNIT}};', |
| 1916 |
'{{WRAPPER}} .king-addons-field-group input[type="time"]::before' => 'right: {{RIGHT}}{{UNIT}};', |
| 1917 |
], |
| 1918 |
] |
| 1919 |
); |
| 1920 |
|
| 1921 |
$this->add_control( |
| 1922 |
'radio_and_checkbox_distance', |
| 1923 |
[ |
| 1924 |
'label' => esc_html__('Radio & Checkbox', 'king-addons'), |
| 1925 |
'type' => Controls_Manager::HEADING, |
| 1926 |
] |
| 1927 |
); |
| 1928 |
|
| 1929 |
$this->add_control( |
| 1930 |
'radion_&_checkbox_padding', |
| 1931 |
[ |
| 1932 |
'label' => esc_html__('Margin', 'king-addons'), |
| 1933 |
'type' => Controls_Manager::DIMENSIONS, |
| 1934 |
'size_units' => ['px', '%', 'em'], |
| 1935 |
'default' => [ |
| 1936 |
'top' => 0, |
| 1937 |
'right' => 0, |
| 1938 |
'bottom' => 0, |
| 1939 |
'left' => 0, |
| 1940 |
'unit' => 'px' |
| 1941 |
], |
| 1942 |
'selectors' => [ |
| 1943 |
'{{WRAPPER}} .king-addons-form-field-option' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1944 |
], |
| 1945 |
] |
| 1946 |
); |
| 1947 |
|
| 1948 |
$this->add_responsive_control( |
| 1949 |
'radion_&_checkbox_gutter', |
| 1950 |
[ |
| 1951 |
'label' => esc_html__('Inner Gutter', 'king-addons'), |
| 1952 |
'type' => Controls_Manager::SLIDER, |
| 1953 |
'size_units' => ['px'], |
| 1954 |
'range' => [ |
| 1955 |
'px' => [ |
| 1956 |
'min' => 0, |
| 1957 |
'max' => 50, |
| 1958 |
], |
| 1959 |
], |
| 1960 |
'default' => [ |
| 1961 |
'unit' => 'px', |
| 1962 |
'size' => 5, |
| 1963 |
], |
| 1964 |
'selectors' => [ |
| 1965 |
'{{WRAPPER}} .king-addons-form-field-option label' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1966 |
'{{WRAPPER}}.king-addons-custom-styles-yes .king-addons-form-field-option label:before' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1967 |
], |
| 1968 |
'separator' => 'before' |
| 1969 |
] |
| 1970 |
); |
| 1971 |
|
| 1972 |
$this->end_controls_section(); |
| 1973 |
|
| 1974 |
|
| 1975 |
$this->start_controls_section( |
| 1976 |
'section_style_checkbox_radio', |
| 1977 |
[ |
| 1978 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Checkbox & Radio', 'king-addons'), |
| 1979 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1980 |
'show_label' => false, |
| 1981 |
] |
| 1982 |
); |
| 1983 |
|
| 1984 |
$this->add_control( |
| 1985 |
'checkbox_radio_custom', |
| 1986 |
[ |
| 1987 |
'label' => esc_html__('Use Custom Styles', 'king-addons'), |
| 1988 |
'type' => Controls_Manager::SWITCHER, |
| 1989 |
'default' => 'yes', |
| 1990 |
'prefix_class' => 'king-addons-custom-styles-' |
| 1991 |
] |
| 1992 |
); |
| 1993 |
|
| 1994 |
$this->add_control( |
| 1995 |
'checkbox_radio_static_color', |
| 1996 |
[ |
| 1997 |
'label' => esc_html__('Static Color', 'king-addons'), |
| 1998 |
'type' => Controls_Manager::COLOR, |
| 1999 |
'default' => '#FFFFFF', |
| 2000 |
'selectors' => [ |
| 2001 |
'{{WRAPPER}} .king-addons-form-field-type-checkbox .king-addons-form-field-option label:before' => 'background-color: {{VALUE}}', |
| 2002 |
'{{WRAPPER}} .king-addons-form-field-type-radio .king-addons-form-field-option label:before' => 'background-color: {{VALUE}}', |
| 2003 |
], |
| 2004 |
'condition' => [ |
| 2005 |
'checkbox_radio_custom' => 'yes' |
| 2006 |
] |
| 2007 |
] |
| 2008 |
); |
| 2009 |
|
| 2010 |
$this->add_control( |
| 2011 |
'checkbox_radio_active_color', |
| 2012 |
[ |
| 2013 |
'label' => esc_html__('Active Color', 'king-addons'), |
| 2014 |
'type' => Controls_Manager::COLOR, |
| 2015 |
'default' => '#5B03FF', |
| 2016 |
'selectors' => [ |
| 2017 |
'{{WRAPPER}} .king-addons-form-field-type-checkbox .king-addons-form-field-option label:before' => 'color: {{VALUE}}', |
| 2018 |
'{{WRAPPER}} .king-addons-form-field-type-radio .king-addons-form-field-option label:before' => 'color: {{VALUE}}', |
| 2019 |
], |
| 2020 |
'condition' => [ |
| 2021 |
'checkbox_radio_custom' => 'yes' |
| 2022 |
] |
| 2023 |
] |
| 2024 |
); |
| 2025 |
|
| 2026 |
$this->add_control( |
| 2027 |
'checkbox_radio_border_color', |
| 2028 |
[ |
| 2029 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2030 |
'type' => Controls_Manager::COLOR, |
| 2031 |
'default' => '#E8E8E8', |
| 2032 |
'selectors' => [ |
| 2033 |
'{{WRAPPER}} .king-addons-form-field-type-checkbox .king-addons-form-field-option label:before' => 'border-color: {{VALUE}}', |
| 2034 |
'{{WRAPPER}} .king-addons-form-field-type-radio .king-addons-form-field-option label:before' => 'border-color: {{VALUE}}', |
| 2035 |
], |
| 2036 |
'condition' => [ |
| 2037 |
'checkbox_radio_custom' => 'yes' |
| 2038 |
] |
| 2039 |
] |
| 2040 |
); |
| 2041 |
|
| 2042 |
$this->add_control( |
| 2043 |
'checkbox_radio_size', |
| 2044 |
[ |
| 2045 |
'label' => esc_html__('Size', 'king-addons'), |
| 2046 |
'type' => Controls_Manager::SLIDER, |
| 2047 |
'size_units' => ['px'], |
| 2048 |
'range' => [ |
| 2049 |
'px' => [ |
| 2050 |
'min' => 10, |
| 2051 |
'max' => 50, |
| 2052 |
], |
| 2053 |
], |
| 2054 |
'default' => [ |
| 2055 |
'unit' => 'px', |
| 2056 |
'size' => 16, |
| 2057 |
], |
| 2058 |
'selectors' => [ |
| 2059 |
'{{WRAPPER}} .king-addons-form-field-type-checkbox .king-addons-form-field-option label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);', |
| 2060 |
'{{WRAPPER}} .king-addons-form-field-type-radio .king-addons-form-field-option label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);', |
| 2061 |
'{{WRAPPER}} .king-addons-form-field-type-checkbox input' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2062 |
'{{WRAPPER}} .king-addons-form-field-type-radio input' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};' |
| 2063 |
], |
| 2064 |
'separator' => 'before', |
| 2065 |
'condition' => [ |
| 2066 |
'checkbox_radio_custom' => 'yes' |
| 2067 |
] |
| 2068 |
] |
| 2069 |
); |
| 2070 |
|
| 2071 |
$this->end_controls_section(); |
| 2072 |
|
| 2073 |
$this->start_controls_section( |
| 2074 |
'section_button_style', |
| 2075 |
[ |
| 2076 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Buttons', 'king-addons'), |
| 2077 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2078 |
] |
| 2079 |
); |
| 2080 |
|
| 2081 |
$this->start_controls_tabs('tabs_button_style'); |
| 2082 |
|
| 2083 |
$this->start_controls_tab( |
| 2084 |
'tab_button_normal', |
| 2085 |
[ |
| 2086 |
'label' => esc_html__('Normal', 'king-addons'), |
| 2087 |
] |
| 2088 |
); |
| 2089 |
|
| 2090 |
$this->add_control( |
| 2091 |
'heading_next_submit_button', |
| 2092 |
[ |
| 2093 |
'label' => esc_html__('Submit Button, Next Button', 'king-addons'), |
| 2094 |
'type' => Controls_Manager::HEADING, |
| 2095 |
] |
| 2096 |
); |
| 2097 |
|
| 2098 |
$this->add_control( |
| 2099 |
'button_background_color', |
| 2100 |
[ |
| 2101 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2102 |
'type' => Controls_Manager::COLOR, |
| 2103 |
'default' => '#5B03FF', |
| 2104 |
'selectors' => [ |
| 2105 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'background-color: {{VALUE}};', |
| 2106 |
'{{WRAPPER}} .king-addons-button[type="submit"]' => 'background-color: {{VALUE}};', |
| 2107 |
], |
| 2108 |
] |
| 2109 |
); |
| 2110 |
|
| 2111 |
$this->add_control( |
| 2112 |
'button_text_color', |
| 2113 |
[ |
| 2114 |
'label' => esc_html__('Text Color', 'king-addons'), |
| 2115 |
'type' => Controls_Manager::COLOR, |
| 2116 |
'default' => '#ffffff', |
| 2117 |
'selectors' => [ |
| 2118 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'color: {{VALUE}};', |
| 2119 |
'{{WRAPPER}} .king-addons-button[type="submit"]' => 'color: {{VALUE}};', |
| 2120 |
'{{WRAPPER}} .king-addons-double-bounce .king-addons-child' => 'background-color: {{VALUE}} !important;', |
| 2121 |
'{{WRAPPER}} .king-addons-button[type="submit"] svg *' => 'fill: {{VALUE}};' |
| 2122 |
], |
| 2123 |
] |
| 2124 |
); |
| 2125 |
|
| 2126 |
$this->add_control( |
| 2127 |
'button_border_color', |
| 2128 |
[ |
| 2129 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2130 |
'type' => Controls_Manager::COLOR, |
| 2131 |
'default' => '', |
| 2132 |
'selectors' => [ |
| 2133 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'border-color: {{VALUE}};', |
| 2134 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'border-color: {{VALUE}};', |
| 2135 |
'{{WRAPPER}} .king-addons-button[type="submit"]' => 'border-color: {{VALUE}};', |
| 2136 |
], |
| 2137 |
'condition' => [ |
| 2138 |
'button_border_border!' => '', |
| 2139 |
], |
| 2140 |
] |
| 2141 |
); |
| 2142 |
|
| 2143 |
$this->add_control( |
| 2144 |
'heading_previous_button', |
| 2145 |
[ |
| 2146 |
'label' => esc_html__('Previous Button', 'king-addons'), |
| 2147 |
'type' => Controls_Manager::HEADING, |
| 2148 |
] |
| 2149 |
); |
| 2150 |
|
| 2151 |
$this->add_control( |
| 2152 |
'previous_button_background_color', |
| 2153 |
[ |
| 2154 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2155 |
'type' => Controls_Manager::COLOR, |
| 2156 |
'default' => '#5B03FF', |
| 2157 |
'selectors' => [ |
| 2158 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'background-color: {{VALUE}};', |
| 2159 |
], |
| 2160 |
] |
| 2161 |
); |
| 2162 |
|
| 2163 |
$this->add_control( |
| 2164 |
'previous_button_text_color', |
| 2165 |
[ |
| 2166 |
'label' => esc_html__('Text Color', 'king-addons'), |
| 2167 |
'type' => Controls_Manager::COLOR, |
| 2168 |
'default' => '#ffffff', |
| 2169 |
'selectors' => [ |
| 2170 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'color: {{VALUE}};', |
| 2171 |
], |
| 2172 |
] |
| 2173 |
); |
| 2174 |
|
| 2175 |
$this->add_control( |
| 2176 |
'previous_button_border_color', |
| 2177 |
[ |
| 2178 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2179 |
'type' => Controls_Manager::COLOR, |
| 2180 |
'default' => '', |
| 2181 |
'selectors' => [ |
| 2182 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'border-color: {{VALUE}};', |
| 2183 |
], |
| 2184 |
'condition' => [ |
| 2185 |
'button_border_border!' => '', |
| 2186 |
], |
| 2187 |
] |
| 2188 |
); |
| 2189 |
|
| 2190 |
$this->add_group_control( |
| 2191 |
Group_Control_Typography::get_type(), |
| 2192 |
[ |
| 2193 |
'name' => 'button_typography', |
| 2194 |
'selector' => '{{WRAPPER}} .king-addons-button, {{WRAPPER}} .king-addons-fb-step-prev, {{WRAPPER}} .king-addons-fb-step-next', |
| 2195 |
] |
| 2196 |
); |
| 2197 |
|
| 2198 |
$this->end_controls_tab(); |
| 2199 |
|
| 2200 |
$this->start_controls_tab( |
| 2201 |
'tab_button_hover', |
| 2202 |
[ |
| 2203 |
'label' => esc_html__('Hover', 'king-addons'), |
| 2204 |
] |
| 2205 |
); |
| 2206 |
|
| 2207 |
$this->add_control( |
| 2208 |
'heading_next_submit_button_hover', |
| 2209 |
[ |
| 2210 |
'label' => esc_html__('Next & Submit Button', 'king-addons'), |
| 2211 |
'type' => Controls_Manager::HEADING, |
| 2212 |
] |
| 2213 |
); |
| 2214 |
|
| 2215 |
$this->add_control( |
| 2216 |
'button_background_hover_color', |
| 2217 |
[ |
| 2218 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2219 |
'type' => Controls_Manager::COLOR, |
| 2220 |
'default' => '', |
| 2221 |
'selectors' => [ |
| 2222 |
'{{WRAPPER}} .king-addons-fb-step-next:hover' => 'background-color: {{VALUE}};', |
| 2223 |
'{{WRAPPER}} .king-addons-button[type="submit"]:hover' => 'background-color: {{VALUE}};', |
| 2224 |
], |
| 2225 |
] |
| 2226 |
); |
| 2227 |
|
| 2228 |
$this->add_control( |
| 2229 |
'button_hover_color', |
| 2230 |
[ |
| 2231 |
'label' => esc_html__('Text Color', 'king-addons'), |
| 2232 |
'type' => Controls_Manager::COLOR, |
| 2233 |
'default' => '#ffffff', |
| 2234 |
'selectors' => [ |
| 2235 |
'{{WRAPPER}} .king-addons-fb-step-next:hover' => 'color: {{VALUE}};', |
| 2236 |
'{{WRAPPER}} .king-addons-button[type="submit"]:hover' => 'color: {{VALUE}};', |
| 2237 |
'{{WRAPPER}} .king-addons-button[type="submit"]:hover svg *' => 'fill: {{VALUE}};', |
| 2238 |
], |
| 2239 |
] |
| 2240 |
); |
| 2241 |
|
| 2242 |
$this->add_control( |
| 2243 |
'button_hover_border_color', |
| 2244 |
[ |
| 2245 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2246 |
'type' => Controls_Manager::COLOR, |
| 2247 |
'default' => '', |
| 2248 |
'selectors' => [ |
| 2249 |
'{{WRAPPER}} .king-addons-fb-step-next:hover' => 'border-color: {{VALUE}};', |
| 2250 |
'{{WRAPPER}} .king-addons-button[type="submit"]:hover' => 'border-color: {{VALUE}};', |
| 2251 |
], |
| 2252 |
'condition' => [ |
| 2253 |
'button_border_border!' => '', |
| 2254 |
], |
| 2255 |
] |
| 2256 |
); |
| 2257 |
|
| 2258 |
$this->add_control( |
| 2259 |
'heading_previous_button_hover', |
| 2260 |
[ |
| 2261 |
'label' => esc_html__('Previous Button', 'king-addons'), |
| 2262 |
'type' => Controls_Manager::HEADING, |
| 2263 |
] |
| 2264 |
); |
| 2265 |
|
| 2266 |
$this->add_control( |
| 2267 |
'previous_button_background_color_hover', |
| 2268 |
[ |
| 2269 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2270 |
'type' => Controls_Manager::COLOR, |
| 2271 |
'default' => '', |
| 2272 |
'selectors' => [ |
| 2273 |
'{{WRAPPER}} .king-addons-fb-step-prev:hover' => 'background-color: {{VALUE}};', |
| 2274 |
], |
| 2275 |
] |
| 2276 |
); |
| 2277 |
|
| 2278 |
$this->add_control( |
| 2279 |
'previous_button_text_color_hover', |
| 2280 |
[ |
| 2281 |
'label' => esc_html__('Text Color', 'king-addons'), |
| 2282 |
'type' => Controls_Manager::COLOR, |
| 2283 |
'default' => '#ffffff', |
| 2284 |
'selectors' => [ |
| 2285 |
'{{WRAPPER}} .king-addons-fb-step-prev:hover' => 'color: {{VALUE}};', |
| 2286 |
], |
| 2287 |
] |
| 2288 |
); |
| 2289 |
|
| 2290 |
$this->add_control( |
| 2291 |
'previous_button_border_color_hover', |
| 2292 |
[ |
| 2293 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2294 |
'type' => Controls_Manager::COLOR, |
| 2295 |
'default' => '', |
| 2296 |
'selectors' => [ |
| 2297 |
'{{WRAPPER}} .king-addons-fb-step-prev:hover' => 'border-color: {{VALUE}};', |
| 2298 |
], |
| 2299 |
'condition' => [ |
| 2300 |
'button_border_border!' => '', |
| 2301 |
], |
| 2302 |
] |
| 2303 |
); |
| 2304 |
|
| 2305 |
|
| 2306 |
$this->end_controls_tab(); |
| 2307 |
|
| 2308 |
$this->end_controls_tabs(); |
| 2309 |
|
| 2310 |
$this->add_group_control( |
| 2311 |
Group_Control_Border::get_type(), [ |
| 2312 |
'name' => 'button_border', |
| 2313 |
'selector' => '{{WRAPPER}} .king-addons-button, {{WRAPPER}} .king-addons-fb-step-prev, {{WRAPPER}} .king-addons-fb-step-next', |
| 2314 |
'exclude' => [ |
| 2315 |
'color', |
| 2316 |
], |
| 2317 |
'separator' => 'before', |
| 2318 |
] |
| 2319 |
); |
| 2320 |
|
| 2321 |
$this->add_control( |
| 2322 |
'button_border_radius', |
| 2323 |
[ |
| 2324 |
'label' => esc_html__('Border Radius', 'king-addons'), |
| 2325 |
'type' => Controls_Manager::DIMENSIONS, |
| 2326 |
'size_units' => ['px', '%', 'em'], |
| 2327 |
'selectors' => [ |
| 2328 |
'{{WRAPPER}} .king-addons-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2329 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2330 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2331 |
], |
| 2332 |
] |
| 2333 |
); |
| 2334 |
|
| 2335 |
$this->add_control( |
| 2336 |
'button_text_padding', |
| 2337 |
[ |
| 2338 |
'label' => esc_html__('Text Padding', 'king-addons'), |
| 2339 |
'type' => Controls_Manager::DIMENSIONS, |
| 2340 |
'size_units' => ['px', 'em', '%'], |
| 2341 |
'selectors' => [ |
| 2342 |
'{{WRAPPER}} .king-addons-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2343 |
'{{WRAPPER}} .king-addons-fb-step-prev' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2344 |
'{{WRAPPER}} .king-addons-fb-step-next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2345 |
], |
| 2346 |
] |
| 2347 |
); |
| 2348 |
|
| 2349 |
$this->end_controls_section(); |
| 2350 |
|
| 2351 |
$this->start_controls_section( |
| 2352 |
'section_step_style', |
| 2353 |
[ |
| 2354 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Step', 'king-addons'), |
| 2355 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2356 |
] |
| 2357 |
); |
| 2358 |
|
| 2359 |
$this->start_controls_tabs('tabs_step_style'); |
| 2360 |
|
| 2361 |
$this->start_controls_tab( |
| 2362 |
'tab_step_normal', |
| 2363 |
[ |
| 2364 |
'label' => esc_html__('Normal', 'king-addons'), |
| 2365 |
] |
| 2366 |
); |
| 2367 |
|
| 2368 |
$this->add_control( |
| 2369 |
'main_label_color', |
| 2370 |
[ |
| 2371 |
'label' => esc_html__('Label Color', 'king-addons'), |
| 2372 |
'type' => Controls_Manager::COLOR, |
| 2373 |
'default' => '#7a7a7a', |
| 2374 |
'selectors' => [ |
| 2375 |
'{{WRAPPER}} .king-addons-fb-step-main-label' => 'color: {{VALUE}};', |
| 2376 |
] |
| 2377 |
] |
| 2378 |
); |
| 2379 |
|
| 2380 |
$this->add_control( |
| 2381 |
'sub_label_color', |
| 2382 |
[ |
| 2383 |
'label' => esc_html__('Sub Label Color', 'king-addons'), |
| 2384 |
'type' => Controls_Manager::COLOR, |
| 2385 |
'default' => '#7a7a7a', |
| 2386 |
'selectors' => [ |
| 2387 |
'{{WRAPPER}} .king-addons-fb-step-sub-label' => 'color: {{VALUE}};', |
| 2388 |
] |
| 2389 |
] |
| 2390 |
); |
| 2391 |
|
| 2392 |
$this->add_control( |
| 2393 |
'step_bg_color', |
| 2394 |
[ |
| 2395 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2396 |
'type' => Controls_Manager::COLOR, |
| 2397 |
'selectors' => [ |
| 2398 |
'{{WRAPPER}} .king-addons-fb-step' => 'background-color: {{VALUE}};' |
| 2399 |
], |
| 2400 |
] |
| 2401 |
); |
| 2402 |
|
| 2403 |
$this->add_control( |
| 2404 |
'step_border_color', |
| 2405 |
[ |
| 2406 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2407 |
'type' => Controls_Manager::COLOR, |
| 2408 |
'default' => '#5B03FF', |
| 2409 |
'selectors' => [ |
| 2410 |
'{{WRAPPER}} .king-addons-fb-step' => 'border-color: {{VALUE}};' |
| 2411 |
] |
| 2412 |
] |
| 2413 |
); |
| 2414 |
|
| 2415 |
$this->end_controls_tab(); |
| 2416 |
|
| 2417 |
$this->start_controls_tab( |
| 2418 |
'tab_step_active', |
| 2419 |
[ |
| 2420 |
'label' => esc_html__('Active', 'king-addons'), |
| 2421 |
] |
| 2422 |
); |
| 2423 |
|
| 2424 |
$this->add_control( |
| 2425 |
'main_label_color_active', |
| 2426 |
[ |
| 2427 |
'label' => esc_html__('Label Color', 'king-addons'), |
| 2428 |
'type' => Controls_Manager::COLOR, |
| 2429 |
'default' => '#7a7a7a', |
| 2430 |
'selectors' => [ |
| 2431 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active .king-addons-fb-step-main-label' => 'color: {{VALUE}};', |
| 2432 |
] |
| 2433 |
] |
| 2434 |
); |
| 2435 |
|
| 2436 |
$this->add_control( |
| 2437 |
'sub_label_color_active', |
| 2438 |
[ |
| 2439 |
'label' => esc_html__('Sub Label Color', 'king-addons'), |
| 2440 |
'type' => Controls_Manager::COLOR, |
| 2441 |
'default' => '#7a7a7a', |
| 2442 |
'selectors' => [ |
| 2443 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active .king-addons-fb-step-sub-label' => 'color: {{VALUE}};', |
| 2444 |
] |
| 2445 |
] |
| 2446 |
); |
| 2447 |
|
| 2448 |
$this->add_control( |
| 2449 |
'step_bg_color_active', |
| 2450 |
[ |
| 2451 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2452 |
'type' => Controls_Manager::COLOR, |
| 2453 |
'selectors' => [ |
| 2454 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active' => 'background-color: {{VALUE}};', |
| 2455 |
] |
| 2456 |
] |
| 2457 |
); |
| 2458 |
|
| 2459 |
$this->add_control( |
| 2460 |
'step_border_color_active', |
| 2461 |
[ |
| 2462 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2463 |
'type' => Controls_Manager::COLOR, |
| 2464 |
'selectors' => [ |
| 2465 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active' => 'border-color: {{VALUE}};' |
| 2466 |
] |
| 2467 |
] |
| 2468 |
); |
| 2469 |
|
| 2470 |
$this->end_controls_tab(); |
| 2471 |
|
| 2472 |
$this->start_controls_tab( |
| 2473 |
'tab_step_finished', |
| 2474 |
[ |
| 2475 |
'label' => esc_html__('Finished', 'king-addons'), |
| 2476 |
] |
| 2477 |
); |
| 2478 |
|
| 2479 |
$this->add_control( |
| 2480 |
'main_label_color_finish', |
| 2481 |
[ |
| 2482 |
'label' => esc_html__('Label Color', 'king-addons'), |
| 2483 |
'type' => Controls_Manager::COLOR, |
| 2484 |
'default' => '#7a7a7a', |
| 2485 |
'selectors' => [ |
| 2486 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish .king-addons-fb-step-main-label' => 'color: {{VALUE}};', |
| 2487 |
] |
| 2488 |
] |
| 2489 |
); |
| 2490 |
|
| 2491 |
$this->add_control( |
| 2492 |
'sub_label_color_finish', |
| 2493 |
[ |
| 2494 |
'label' => esc_html__('Sub Label Color', 'king-addons'), |
| 2495 |
'type' => Controls_Manager::COLOR, |
| 2496 |
'default' => '#7a7a7a', |
| 2497 |
'selectors' => [ |
| 2498 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish .king-addons-fb-step-sub-label' => 'color: {{VALUE}};', |
| 2499 |
] |
| 2500 |
] |
| 2501 |
); |
| 2502 |
|
| 2503 |
$this->add_control( |
| 2504 |
'step_bg_color_finish', |
| 2505 |
[ |
| 2506 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2507 |
'type' => Controls_Manager::COLOR, |
| 2508 |
'selectors' => [ |
| 2509 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish' => 'background-color: {{VALUE}};', |
| 2510 |
] |
| 2511 |
] |
| 2512 |
); |
| 2513 |
|
| 2514 |
$this->add_control( |
| 2515 |
'step_border_color_finish', |
| 2516 |
[ |
| 2517 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2518 |
'type' => Controls_Manager::COLOR, |
| 2519 |
'selectors' => [ |
| 2520 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish' => 'border-color: {{VALUE}};' |
| 2521 |
] |
| 2522 |
] |
| 2523 |
); |
| 2524 |
|
| 2525 |
$this->end_controls_tab(); |
| 2526 |
|
| 2527 |
$this->end_controls_tabs(); |
| 2528 |
|
| 2529 |
$this->add_responsive_control( |
| 2530 |
'step_wrap_distance', |
| 2531 |
[ |
| 2532 |
'label' => esc_html__('Distance', 'king-addons'), |
| 2533 |
'type' => Controls_Manager::SLIDER, |
| 2534 |
'size_units' => ['px'], |
| 2535 |
'range' => [ |
| 2536 |
'px' => [ |
| 2537 |
'min' => 0, |
| 2538 |
'max' => 50, |
| 2539 |
], |
| 2540 |
], |
| 2541 |
'default' => [ |
| 2542 |
'unit' => 'px', |
| 2543 |
'size' => 15, |
| 2544 |
], |
| 2545 |
'selectors' => [ |
| 2546 |
'{{WRAPPER}} .king-addons-fb-step-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 2547 |
], |
| 2548 |
'separator' => 'before' |
| 2549 |
] |
| 2550 |
); |
| 2551 |
|
| 2552 |
$this->add_responsive_control( |
| 2553 |
'step_wrap_gutter', |
| 2554 |
[ |
| 2555 |
'label' => esc_html__('Gutter', 'king-addons'), |
| 2556 |
'type' => Controls_Manager::SLIDER, |
| 2557 |
'size_units' => ['px'], |
| 2558 |
'range' => [ |
| 2559 |
'px' => [ |
| 2560 |
'min' => 0, |
| 2561 |
'max' => 25 |
| 2562 |
] |
| 2563 |
], |
| 2564 |
'default' => [ |
| 2565 |
'unit' => 'px', |
| 2566 |
'size' => 5 |
| 2567 |
], |
| 2568 |
'selectors' => [ |
| 2569 |
'{{WRAPPER}} .king-addons-fb-step-sep' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}}', |
| 2570 |
'{{WRAPPER}} .king-addons-separator-off .king-addons-fb-step:not(:last-of-type)' => 'margin-right: {{SIZE}}{{UNIT}}' |
| 2571 |
], |
| 2572 |
'separator' => 'before' |
| 2573 |
] |
| 2574 |
); |
| 2575 |
|
| 2576 |
$this->add_control( |
| 2577 |
'step_border_type', |
| 2578 |
[ |
| 2579 |
'label' => esc_html__('Border Type', 'king-addons'), |
| 2580 |
'type' => Controls_Manager::SELECT, |
| 2581 |
'options' => [ |
| 2582 |
'none' => esc_html__('None', 'king-addons'), |
| 2583 |
'solid' => esc_html__('Solid', 'king-addons'), |
| 2584 |
'double' => esc_html__('Double', 'king-addons'), |
| 2585 |
'dotted' => esc_html__('Dotted', 'king-addons'), |
| 2586 |
'dashed' => esc_html__('Dashed', 'king-addons'), |
| 2587 |
'groove' => esc_html__('Groove', 'king-addons'), |
| 2588 |
], |
| 2589 |
'default' => 'solid', |
| 2590 |
'selectors' => [ |
| 2591 |
'{{WRAPPER}} .king-addons-fb-step' => 'border-style: {{VALUE}};', |
| 2592 |
], |
| 2593 |
'separator' => 'before', |
| 2594 |
] |
| 2595 |
); |
| 2596 |
|
| 2597 |
$this->add_responsive_control( |
| 2598 |
'step_border_width', |
| 2599 |
[ |
| 2600 |
'label' => esc_html__('Border Width', 'king-addons'), |
| 2601 |
'type' => Controls_Manager::DIMENSIONS, |
| 2602 |
'size_units' => ['px'], |
| 2603 |
'default' => [ |
| 2604 |
'top' => 1, |
| 2605 |
'right' => 1, |
| 2606 |
'bottom' => 1, |
| 2607 |
'left' => 1, |
| 2608 |
], |
| 2609 |
'selectors' => [ |
| 2610 |
'{{WRAPPER}} .king-addons-fb-step' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2611 |
], |
| 2612 |
'condition' => [ |
| 2613 |
'step_border_type!' => 'none', |
| 2614 |
], |
| 2615 |
] |
| 2616 |
); |
| 2617 |
|
| 2618 |
$this->add_control( |
| 2619 |
'step_border_radius', |
| 2620 |
[ |
| 2621 |
'label' => esc_html__('Border Radius', 'king-addons'), |
| 2622 |
'type' => Controls_Manager::DIMENSIONS, |
| 2623 |
'size_units' => ['px', '%', 'em'], |
| 2624 |
'selectors' => [ |
| 2625 |
'{{WRAPPER}} .king-addons-fb-step' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2626 |
], |
| 2627 |
'separator' => 'before', |
| 2628 |
] |
| 2629 |
); |
| 2630 |
|
| 2631 |
$this->add_responsive_control( |
| 2632 |
'step_padding', |
| 2633 |
[ |
| 2634 |
'label' => esc_html__('Padding', 'king-addons'), |
| 2635 |
'type' => Controls_Manager::DIMENSIONS, |
| 2636 |
'size_units' => ['px', 'em', '%'], |
| 2637 |
'default' => [ |
| 2638 |
'unit' => 'px', |
| 2639 |
'top' => 10, |
| 2640 |
'right' => 10, |
| 2641 |
'bottom' => 10, |
| 2642 |
'left' => 10, |
| 2643 |
], |
| 2644 |
'selectors' => [ |
| 2645 |
|
| 2646 |
'{{WRAPPER}} .king-addons-fb-step' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2647 |
'{{WRAPPER}}' => '--king-addons-fb-steps-padding: {{TOP}}{{UNIT}};' |
| 2648 |
], |
| 2649 |
] |
| 2650 |
); |
| 2651 |
|
| 2652 |
$this->add_control( |
| 2653 |
'step_inner_styles', |
| 2654 |
[ |
| 2655 |
'label' => esc_html__('Step Indicator', 'king-addons'), |
| 2656 |
'type' => Controls_Manager::HEADING, |
| 2657 |
'separator' => 'before', |
| 2658 |
] |
| 2659 |
); |
| 2660 |
|
| 2661 |
$this->start_controls_tabs('tabs_step_inner_style'); |
| 2662 |
|
| 2663 |
$this->start_controls_tab( |
| 2664 |
'tab_step_inner_normal', |
| 2665 |
[ |
| 2666 |
'label' => esc_html__('Normal', 'king-addons'), |
| 2667 |
] |
| 2668 |
); |
| 2669 |
|
| 2670 |
$this->add_control( |
| 2671 |
'step_inner_color', |
| 2672 |
[ |
| 2673 |
'label' => esc_html__('Color', 'king-addons'), |
| 2674 |
'type' => Controls_Manager::COLOR, |
| 2675 |
'default' => '#FFFFFF', |
| 2676 |
'selectors' => [ |
| 2677 |
'{{WRAPPER}} .king-addons-fb-step-content i' => 'color: {{VALUE}};', |
| 2678 |
'{{WRAPPER}} .king-addons-fb-step-content svg' => 'fill: {{VALUE}};', |
| 2679 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'color: {{VALUE}};' |
| 2680 |
] |
| 2681 |
] |
| 2682 |
); |
| 2683 |
|
| 2684 |
$this->add_control( |
| 2685 |
'step_inner_bg_color', |
| 2686 |
[ |
| 2687 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2688 |
'type' => Controls_Manager::COLOR, |
| 2689 |
'default' => '#5B03FF', |
| 2690 |
'selectors' => [ |
| 2691 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'background-color: {{VALUE}};' |
| 2692 |
], |
| 2693 |
] |
| 2694 |
); |
| 2695 |
|
| 2696 |
$this->add_control( |
| 2697 |
'step_inner_border_color', |
| 2698 |
[ |
| 2699 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2700 |
'type' => Controls_Manager::COLOR, |
| 2701 |
'default' => '#5B03FF', |
| 2702 |
'selectors' => [ |
| 2703 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'border-color: {{VALUE}};' |
| 2704 |
] |
| 2705 |
] |
| 2706 |
); |
| 2707 |
|
| 2708 |
$this->end_controls_tab(); |
| 2709 |
|
| 2710 |
$this->start_controls_tab( |
| 2711 |
'tab_step_inner_active', |
| 2712 |
[ |
| 2713 |
'label' => esc_html__('Active', 'king-addons'), |
| 2714 |
] |
| 2715 |
); |
| 2716 |
|
| 2717 |
$this->add_control( |
| 2718 |
'step_inner_color_active', |
| 2719 |
[ |
| 2720 |
'label' => esc_html__('Color', 'king-addons'), |
| 2721 |
'type' => Controls_Manager::COLOR, |
| 2722 |
'default' => '#FFFFFF', |
| 2723 |
'selectors' => [ |
| 2724 |
'{{WRAPPER}} .king-addons-fb-step-active .king-addons-fb-step-content i' => 'color: {{VALUE}};', |
| 2725 |
'{{WRAPPER}} .king-addons-fb-step-active .king-addons-fb-step-content svg' => 'fill: {{VALUE}};', |
| 2726 |
'{{WRAPPER}} .king-addons-fb-step-active .king-addons-fb-step-content' => 'color: {{VALUE}};' |
| 2727 |
] |
| 2728 |
] |
| 2729 |
); |
| 2730 |
|
| 2731 |
$this->add_control( |
| 2732 |
'step_inner_bg_color_active', |
| 2733 |
[ |
| 2734 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2735 |
'type' => Controls_Manager::COLOR, |
| 2736 |
'default' => '#5B03FF', |
| 2737 |
'selectors' => [ |
| 2738 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active .king-addons-fb-step-content' => 'background-color: {{VALUE}};', |
| 2739 |
] |
| 2740 |
] |
| 2741 |
); |
| 2742 |
|
| 2743 |
$this->add_control( |
| 2744 |
'step_inner_border_color_active', |
| 2745 |
[ |
| 2746 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2747 |
'type' => Controls_Manager::COLOR, |
| 2748 |
'default' => '#5B03FF', |
| 2749 |
'selectors' => [ |
| 2750 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-active .king-addons-fb-step-content' => 'border-color: {{VALUE}};' |
| 2751 |
] |
| 2752 |
] |
| 2753 |
); |
| 2754 |
|
| 2755 |
$this->end_controls_tab(); |
| 2756 |
|
| 2757 |
$this->start_controls_tab( |
| 2758 |
'tab_step_inner_finish', |
| 2759 |
[ |
| 2760 |
'label' => esc_html__('Finish', 'king-addons'), |
| 2761 |
] |
| 2762 |
); |
| 2763 |
|
| 2764 |
$this->add_control( |
| 2765 |
'step_inner_color_finish', |
| 2766 |
[ |
| 2767 |
'label' => esc_html__('Color (Labels, Icon, Number)', 'king-addons'), |
| 2768 |
'type' => Controls_Manager::COLOR, |
| 2769 |
'default' => '#FFFFFF', |
| 2770 |
'selectors' => [ |
| 2771 |
'{{WRAPPER}} .king-addons-fb-step-finish .king-addons-fb-step-content i' => 'color: {{VALUE}};', |
| 2772 |
'{{WRAPPER}} .king-addons-fb-step-finish .king-addons-fb-step-content svg' => 'fill: {{VALUE}};', |
| 2773 |
'{{WRAPPER}} .king-addons-fb-step-finish .king-addons-fb-step-content' => 'color: {{VALUE}};' |
| 2774 |
] |
| 2775 |
] |
| 2776 |
); |
| 2777 |
|
| 2778 |
$this->add_control( |
| 2779 |
'step_inner_bg_color_finish', |
| 2780 |
[ |
| 2781 |
'label' => esc_html__('Background Color', 'king-addons'), |
| 2782 |
'type' => Controls_Manager::COLOR, |
| 2783 |
'default' => '#5B03FF', |
| 2784 |
'selectors' => [ |
| 2785 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish .king-addons-fb-step-content' => 'background-color: {{VALUE}};', |
| 2786 |
] |
| 2787 |
] |
| 2788 |
); |
| 2789 |
|
| 2790 |
$this->add_control( |
| 2791 |
'step_inner_border_color_finish', |
| 2792 |
[ |
| 2793 |
'label' => esc_html__('Border Color', 'king-addons'), |
| 2794 |
'type' => Controls_Manager::COLOR, |
| 2795 |
'default' => '#5B03FF', |
| 2796 |
'selectors' => [ |
| 2797 |
'{{WRAPPER}} .king-addons-fb-step.king-addons-fb-step-finish .king-addons-fb-step-content' => 'border-color: {{VALUE}};' |
| 2798 |
] |
| 2799 |
] |
| 2800 |
); |
| 2801 |
|
| 2802 |
$this->end_controls_tab(); |
| 2803 |
|
| 2804 |
$this->end_controls_tabs(); |
| 2805 |
|
| 2806 |
$this->add_control( |
| 2807 |
'step_inner_border_type', |
| 2808 |
[ |
| 2809 |
'label' => esc_html__('Border Type', 'king-addons'), |
| 2810 |
'type' => Controls_Manager::SELECT, |
| 2811 |
'options' => [ |
| 2812 |
'none' => esc_html__('None', 'king-addons'), |
| 2813 |
'solid' => esc_html__('Solid', 'king-addons'), |
| 2814 |
'double' => esc_html__('Double', 'king-addons'), |
| 2815 |
'dotted' => esc_html__('Dotted', 'king-addons'), |
| 2816 |
'dashed' => esc_html__('Dashed', 'king-addons'), |
| 2817 |
'groove' => esc_html__('Groove', 'king-addons'), |
| 2818 |
], |
| 2819 |
'default' => 'solid', |
| 2820 |
'selectors' => [ |
| 2821 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'border-style: {{VALUE}};', |
| 2822 |
], |
| 2823 |
'separator' => 'before', |
| 2824 |
] |
| 2825 |
); |
| 2826 |
|
| 2827 |
$this->add_responsive_control( |
| 2828 |
'step_inner_border_width', |
| 2829 |
[ |
| 2830 |
'label' => esc_html__('Border Width', 'king-addons'), |
| 2831 |
'type' => Controls_Manager::DIMENSIONS, |
| 2832 |
'size_units' => ['px'], |
| 2833 |
'default' => [ |
| 2834 |
'top' => 1, |
| 2835 |
'right' => 1, |
| 2836 |
'bottom' => 1, |
| 2837 |
'left' => 1, |
| 2838 |
], |
| 2839 |
'selectors' => [ |
| 2840 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2841 |
], |
| 2842 |
'condition' => [ |
| 2843 |
'step_inner_border_type!' => 'none', |
| 2844 |
], |
| 2845 |
] |
| 2846 |
); |
| 2847 |
|
| 2848 |
$this->add_control( |
| 2849 |
'step_inner_border_radius', |
| 2850 |
[ |
| 2851 |
'label' => esc_html__('Border Radius', 'king-addons'), |
| 2852 |
'type' => Controls_Manager::DIMENSIONS, |
| 2853 |
'size_units' => ['px', '%', 'em'], |
| 2854 |
'selectors' => [ |
| 2855 |
'{{WRAPPER}} .king-addons-fb-step-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2856 |
], |
| 2857 |
'separator' => 'before', |
| 2858 |
] |
| 2859 |
); |
| 2860 |
|
| 2861 |
|
| 2862 |
$this->add_responsive_control( |
| 2863 |
'step_inner_padding', |
| 2864 |
[ |
| 2865 |
'label' => esc_html__('Box Size', 'king-addons'), |
| 2866 |
'type' => Controls_Manager::SLIDER, |
| 2867 |
'size_units' => ['px'], |
| 2868 |
'range' => [ |
| 2869 |
'px' => [ |
| 2870 |
'min' => 0, |
| 2871 |
'max' => 200, |
| 2872 |
], |
| 2873 |
], |
| 2874 |
'default' => [ |
| 2875 |
'unit' => 'px', |
| 2876 |
'size' => 20, |
| 2877 |
], |
| 2878 |
'selectors' => [ |
| 2879 |
'{{WRAPPER}}' => '--king-addons-fb-steps-indicator-padding: {{SIZE}}{{UNIT}};', |
| 2880 |
], |
| 2881 |
'separator' => 'before' |
| 2882 |
] |
| 2883 |
); |
| 2884 |
|
| 2885 |
$this->add_responsive_control( |
| 2886 |
'step_icon_size', |
| 2887 |
[ |
| 2888 |
'label' => esc_html__('Icon Size', 'king-addons'), |
| 2889 |
'type' => Controls_Manager::SLIDER, |
| 2890 |
'size_units' => ['px'], |
| 2891 |
'range' => [ |
| 2892 |
'px' => [ |
| 2893 |
'min' => 0, |
| 2894 |
'max' => 25, |
| 2895 |
], |
| 2896 |
], |
| 2897 |
'default' => [ |
| 2898 |
'unit' => 'px', |
| 2899 |
'size' => 12, |
| 2900 |
], |
| 2901 |
'selectors' => [ |
| 2902 |
'{{WRAPPER}} .king-addons-fb-step' => 'font-size: {{SIZE}}{{UNIT}};', |
| 2903 |
'{{WRAPPER}} .king-addons-fb-step svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2904 |
], |
| 2905 |
'condition' => [ |
| 2906 |
'step_type' => ['icon', 'icon_text'] |
| 2907 |
] |
| 2908 |
] |
| 2909 |
); |
| 2910 |
|
| 2911 |
$this->add_responsive_control( |
| 2912 |
'step_label_distance', |
| 2913 |
[ |
| 2914 |
'label' => esc_html__('Distance', 'king-addons'), |
| 2915 |
'type' => Controls_Manager::SLIDER, |
| 2916 |
'size_units' => ['px'], |
| 2917 |
'range' => [ |
| 2918 |
'px' => [ |
| 2919 |
'min' => 0, |
| 2920 |
'max' => 50, |
| 2921 |
], |
| 2922 |
], |
| 2923 |
'default' => [ |
| 2924 |
'unit' => 'px', |
| 2925 |
'size' => 5, |
| 2926 |
], |
| 2927 |
'selectors' => [ |
| 2928 |
'{{WRAPPER}}.king-addons-fb-step-content-layout-horizontal .king-addons-fb-step-label' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 2929 |
'{{WRAPPER}}.king-addons-fb-step-content-layout-vertical .king-addons-fb-step-label' => 'margin-top: {{SIZE}}{{UNIT}};' |
| 2930 |
], |
| 2931 |
'separator' => 'before', |
| 2932 |
'condition' => [ |
| 2933 |
'step_type' => ['number_text', 'icon_text'] |
| 2934 |
] |
| 2935 |
] |
| 2936 |
); |
| 2937 |
|
| 2938 |
$this->add_control( |
| 2939 |
'step_divider', |
| 2940 |
[ |
| 2941 |
'label' => esc_html__('Divider', 'king-addons'), |
| 2942 |
'type' => Controls_Manager::HEADING, |
| 2943 |
'separator' => 'before', |
| 2944 |
'condition' => [ |
| 2945 |
'step_type!' => 'progress_bar' |
| 2946 |
] |
| 2947 |
] |
| 2948 |
); |
| 2949 |
|
| 2950 |
$this->add_control( |
| 2951 |
'step_progressbar', |
| 2952 |
[ |
| 2953 |
'label' => esc_html__('Progressbar', 'king-addons'), |
| 2954 |
'type' => Controls_Manager::HEADING, |
| 2955 |
'separator' => 'before', |
| 2956 |
'condition' => [ |
| 2957 |
'step_type' => 'progress_bar' |
| 2958 |
] |
| 2959 |
] |
| 2960 |
); |
| 2961 |
|
| 2962 |
$this->add_control( |
| 2963 |
'step_divider_color', |
| 2964 |
[ |
| 2965 |
'label' => esc_html__('Color', 'king-addons'), |
| 2966 |
'type' => Controls_Manager::COLOR, |
| 2967 |
'default' => '#000000', |
| 2968 |
'selectors' => [ |
| 2969 |
'{{WRAPPER}} .king-addons-fb-step-sep' => 'background-color: {{VALUE}};', |
| 2970 |
'{{WRAPPER}} .king-addons-fb-step-progress' => 'background-color: {{VALUE}};', |
| 2971 |
] |
| 2972 |
] |
| 2973 |
); |
| 2974 |
|
| 2975 |
$this->add_control( |
| 2976 |
'step_progress_text_color', |
| 2977 |
[ |
| 2978 |
'label' => esc_html__('Text Color', 'king-addons'), |
| 2979 |
'type' => Controls_Manager::COLOR, |
| 2980 |
'default' => '#FFF', |
| 2981 |
'selectors' => [ |
| 2982 |
'{{WRAPPER}} .king-addons-fb-step-progress-fill' => 'color: {{VALUE}};', |
| 2983 |
], |
| 2984 |
'condition' => [ |
| 2985 |
'step_type' => 'progress_bar' |
| 2986 |
] |
| 2987 |
] |
| 2988 |
); |
| 2989 |
|
| 2990 |
$this->add_control( |
| 2991 |
'step_progress_fill_color', |
| 2992 |
[ |
| 2993 |
'label' => esc_html__('Fill Color', 'king-addons'), |
| 2994 |
'type' => Controls_Manager::COLOR, |
| 2995 |
'default' => '#5B03FF', |
| 2996 |
'selectors' => [ |
| 2997 |
'{{WRAPPER}} .king-addons-fb-step-progress-fill' => 'background-color: {{VALUE}};', |
| 2998 |
], |
| 2999 |
'condition' => [ |
| 3000 |
'step_type' => 'progress_bar' |
| 3001 |
] |
| 3002 |
] |
| 3003 |
); |
| 3004 |
|
| 3005 |
$this->add_group_control( |
| 3006 |
Group_Control_Typography::get_type(), |
| 3007 |
[ |
| 3008 |
'name' => 'step_percent_typo', |
| 3009 |
'selector' => '{{WRAPPER}} .king-addons-fb-step-progress-fill', |
| 3010 |
'condition' => [ |
| 3011 |
'step_type' => 'progress_bar' |
| 3012 |
] |
| 3013 |
] |
| 3014 |
); |
| 3015 |
|
| 3016 |
$this->add_responsive_control( |
| 3017 |
'step_divider_height', |
| 3018 |
[ |
| 3019 |
'label' => esc_html__('Divider Height', 'king-addons'), |
| 3020 |
'type' => Controls_Manager::SLIDER, |
| 3021 |
'size_units' => ['px'], |
| 3022 |
'range' => [ |
| 3023 |
'px' => [ |
| 3024 |
'min' => 0, |
| 3025 |
'max' => 10, |
| 3026 |
], |
| 3027 |
], |
| 3028 |
'default' => [ |
| 3029 |
'unit' => 'px', |
| 3030 |
'size' => 2, |
| 3031 |
], |
| 3032 |
'selectors' => [ |
| 3033 |
'{{WRAPPER}}' => '--king-addons-fb-steps-divider-width: {{SIZE}}{{UNIT}};' |
| 3034 |
], |
| 3035 |
'condition' => [ |
| 3036 |
'step_type!' => 'progress_bar' |
| 3037 |
] |
| 3038 |
] |
| 3039 |
); |
| 3040 |
|
| 3041 |
$this->add_responsive_control( |
| 3042 |
'step_progress_text_distance', |
| 3043 |
[ |
| 3044 |
'label' => esc_html__('Text Distance', 'king-addons'), |
| 3045 |
'type' => Controls_Manager::SLIDER, |
| 3046 |
'size_units' => ['px'], |
| 3047 |
'range' => [ |
| 3048 |
'px' => [ |
| 3049 |
'min' => 0, |
| 3050 |
'max' => 50, |
| 3051 |
], |
| 3052 |
], |
| 3053 |
'default' => [ |
| 3054 |
'unit' => 'px', |
| 3055 |
'size' => 10, |
| 3056 |
], |
| 3057 |
'selectors' => [ |
| 3058 |
'{{WRAPPER}} .king-addons-fb-step-progress-fill' => 'padding-right: {{SIZE}}{{UNIT}};' |
| 3059 |
], |
| 3060 |
'condition' => [ |
| 3061 |
'step_type' => 'progress_bar' |
| 3062 |
] |
| 3063 |
] |
| 3064 |
); |
| 3065 |
|
| 3066 |
$this->add_responsive_control( |
| 3067 |
'step_progress_border_radius', |
| 3068 |
[ |
| 3069 |
'label' => esc_html__('Border Radius', 'king-addons'), |
| 3070 |
'type' => Controls_Manager::SLIDER, |
| 3071 |
'size_units' => ['px'], |
| 3072 |
'range' => [ |
| 3073 |
'px' => [ |
| 3074 |
'min' => 0, |
| 3075 |
'max' => 100, |
| 3076 |
], |
| 3077 |
], |
| 3078 |
'default' => [ |
| 3079 |
'unit' => 'px', |
| 3080 |
'size' => 0, |
| 3081 |
], |
| 3082 |
'selectors' => [ |
| 3083 |
'{{WRAPPER}} .king-addons-fb-step-progress' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3084 |
'{{WRAPPER}} .king-addons-fb-step-progress-fill' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 3085 |
], |
| 3086 |
'condition' => [ |
| 3087 |
'step_type' => 'progress_bar' |
| 3088 |
] |
| 3089 |
] |
| 3090 |
); |
| 3091 |
|
| 3092 |
$this->add_control( |
| 3093 |
'step_main_label', |
| 3094 |
[ |
| 3095 |
'label' => esc_html__('Main Label', 'king-addons'), |
| 3096 |
'type' => Controls_Manager::HEADING, |
| 3097 |
'separator' => 'before', |
| 3098 |
] |
| 3099 |
); |
| 3100 |
|
| 3101 |
$this->add_group_control( |
| 3102 |
Group_Control_Typography::get_type(), |
| 3103 |
[ |
| 3104 |
'name' => 'main_label_typography', |
| 3105 |
'selector' => '{{WRAPPER}} .king-addons-fb-step-main-label', |
| 3106 |
'fields_options' => [ |
| 3107 |
'typography' => [ |
| 3108 |
'default' => 'custom', |
| 3109 |
], |
| 3110 |
'font_size' => [ |
| 3111 |
'default' => [ |
| 3112 |
'size' => '12', |
| 3113 |
'unit' => 'px', |
| 3114 |
], |
| 3115 |
] |
| 3116 |
] |
| 3117 |
] |
| 3118 |
); |
| 3119 |
|
| 3120 |
$this->add_control( |
| 3121 |
'step_sub_label', |
| 3122 |
[ |
| 3123 |
'label' => esc_html__('Sub Label', 'king-addons'), |
| 3124 |
'type' => Controls_Manager::HEADING, |
| 3125 |
'separator' => 'before', |
| 3126 |
] |
| 3127 |
); |
| 3128 |
|
| 3129 |
$this->add_group_control( |
| 3130 |
Group_Control_Typography::get_type(), |
| 3131 |
[ |
| 3132 |
'name' => 'sub_label_typography', |
| 3133 |
'selector' => '{{WRAPPER}} .king-addons-fb-step-sub-label', |
| 3134 |
'fields_options' => [ |
| 3135 |
'typography' => [ |
| 3136 |
'default' => 'custom', |
| 3137 |
], |
| 3138 |
'font_size' => [ |
| 3139 |
'default' => [ |
| 3140 |
'size' => '12', |
| 3141 |
'unit' => 'px', |
| 3142 |
], |
| 3143 |
] |
| 3144 |
] |
| 3145 |
] |
| 3146 |
); |
| 3147 |
|
| 3148 |
$this->add_control( |
| 3149 |
'step_number_heading', |
| 3150 |
[ |
| 3151 |
'label' => esc_html__('Number', 'king-addons'), |
| 3152 |
'type' => Controls_Manager::HEADING, |
| 3153 |
'separator' => 'before', |
| 3154 |
'condition' => [ |
| 3155 |
'step_type' => ['number', 'number_text'] |
| 3156 |
] |
| 3157 |
] |
| 3158 |
); |
| 3159 |
|
| 3160 |
$this->add_group_control( |
| 3161 |
Group_Control_Typography::get_type(), |
| 3162 |
[ |
| 3163 |
'name' => 'step_number', |
| 3164 |
'selector' => '{{WRAPPER}} .king-addons-fb-step-number', |
| 3165 |
'fields_options' => [ |
| 3166 |
'typography' => [ |
| 3167 |
'default' => 'custom', |
| 3168 |
], |
| 3169 |
'font_size' => [ |
| 3170 |
'default' => [ |
| 3171 |
'size' => '12', |
| 3172 |
'unit' => 'px', |
| 3173 |
], |
| 3174 |
] |
| 3175 |
], |
| 3176 |
'condition' => [ |
| 3177 |
'step_type' => ['number', 'number_text'] |
| 3178 |
] |
| 3179 |
] |
| 3180 |
); |
| 3181 |
|
| 3182 |
$this->end_controls_section(); |
| 3183 |
|
| 3184 |
$this->start_controls_section( |
| 3185 |
'section_results_style', |
| 3186 |
[ |
| 3187 |
'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Results', 'king-addons'), |
| 3188 |
'tab' => Controls_Manager::TAB_STYLE, |
| 3189 |
] |
| 3190 |
); |
| 3191 |
|
| 3192 |
$this->add_group_control( |
| 3193 |
Group_Control_Typography::get_type(), |
| 3194 |
[ |
| 3195 |
'name' => 'results_typography', |
| 3196 |
'selector' => '{{WRAPPER}} .king-addons-submit-success, {{WRAPPER}} .king-addons-submit-error', |
| 3197 |
'fields_options' => [ |
| 3198 |
'typography' => [ |
| 3199 |
'default' => 'custom', |
| 3200 |
], |
| 3201 |
'font_size' => [ |
| 3202 |
'default' => [ |
| 3203 |
'size' => '12', |
| 3204 |
'unit' => 'px', |
| 3205 |
], |
| 3206 |
] |
| 3207 |
] |
| 3208 |
] |
| 3209 |
); |
| 3210 |
|
| 3211 |
$this->add_control( |
| 3212 |
'success_result_color', |
| 3213 |
[ |
| 3214 |
'label' => esc_html__('Success Color', 'king-addons'), |
| 3215 |
'type' => Controls_Manager::COLOR, |
| 3216 |
'default' => '#30CBCB', |
| 3217 |
'selectors' => [ |
| 3218 |
'{{WRAPPER}} .king-addons-submit-success' => 'color: {{VALUE}};', |
| 3219 |
], |
| 3220 |
] |
| 3221 |
); |
| 3222 |
|
| 3223 |
$this->add_control( |
| 3224 |
'error_message_color', |
| 3225 |
[ |
| 3226 |
'label' => esc_html__('Error Color', 'king-addons'), |
| 3227 |
'type' => Controls_Manager::COLOR, |
| 3228 |
'default' => '#CB3030', |
| 3229 |
'selectors' => [ |
| 3230 |
'{{WRAPPER}} .king-addons-submit-error' => 'color: {{VALUE}};', |
| 3231 |
], |
| 3232 |
] |
| 3233 |
); |
| 3234 |
|
| 3235 |
$this->add_responsive_control( |
| 3236 |
'finish_message_align', |
| 3237 |
[ |
| 3238 |
'label' => esc_html__('Alignment', 'king-addons'), |
| 3239 |
'type' => Controls_Manager::CHOOSE, |
| 3240 |
'options' => [ |
| 3241 |
'left' => [ |
| 3242 |
'title' => esc_html__('Left', 'king-addons'), |
| 3243 |
'icon' => 'eicon-text-align-left', |
| 3244 |
], |
| 3245 |
'center' => [ |
| 3246 |
'title' => esc_html__('Center', 'king-addons'), |
| 3247 |
'icon' => 'eicon-text-align-center', |
| 3248 |
], |
| 3249 |
'right' => [ |
| 3250 |
'title' => esc_html__('Right', 'king-addons'), |
| 3251 |
'icon' => 'eicon-text-align-right', |
| 3252 |
], |
| 3253 |
], |
| 3254 |
'default' => 'center', |
| 3255 |
'selectors' => [ |
| 3256 |
'{{WRAPPER}} .king-addons-submit-success' => 'text-align: {{VALUE}}', |
| 3257 |
'{{WRAPPER}} .king-addons-submit-error' => 'text-align: {{VALUE}}' |
| 3258 |
], |
| 3259 |
] |
| 3260 |
); |
| 3261 |
|
| 3262 |
$this->end_controls_section(); |
| 3263 |
|
| 3264 |
|
| 3265 |
Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'king-addons-form-builder', [ |
| 3266 |
'Unlimited number of fields', |
| 3267 |
'Submission action', |
| 3268 |
'Mailchimp action', |
| 3269 |
'Webhook action' |
| 3270 |
]); |
| 3271 |
} |
| 3272 |
|
| 3273 |
private function add_required_attribute($element) |
| 3274 |
{ |
| 3275 |
$this->add_render_attribute($element, 'required', 'required'); |
| 3276 |
$this->add_render_attribute($element, 'aria-required', 'true'); |
| 3277 |
} |
| 3278 |
|
| 3279 |
public function get_attribute_name($item) |
| 3280 |
{ |
| 3281 |
return "form_fields[{$item['field_id']}]"; |
| 3282 |
} |
| 3283 |
|
| 3284 |
public function get_attribute_id($item) |
| 3285 |
{ |
| 3286 |
|
| 3287 |
$id_suffix = !empty($item['field_id']) ? $item['field_id'] : $item['_id']; |
| 3288 |
return 'form-field-' . $id_suffix; |
| 3289 |
} |
| 3290 |
|
| 3291 |
protected function make_textarea_field($item, $item_index) |
| 3292 |
{ |
| 3293 |
$this->add_render_attribute('textarea' . $item_index, [ |
| 3294 |
'class' => [ |
| 3295 |
'king-addons-form-field-textual', |
| 3296 |
'king-addons-form-field', |
| 3297 |
esc_attr($item['css_classes']) |
| 3298 |
], |
| 3299 |
'name' => $this->get_attribute_name($item), |
| 3300 |
'id' => $this->get_attribute_id($item), |
| 3301 |
'rows' => $item['rows'], |
| 3302 |
]); |
| 3303 |
|
| 3304 |
if ('true' == $this->get_settings_for_display()['show_placeholders'] && $item['placeholder']) { |
| 3305 |
$this->add_render_attribute('textarea' . $item_index, 'placeholder', $item['placeholder']); |
| 3306 |
} |
| 3307 |
|
| 3308 |
if ($item['required']) { |
| 3309 |
$this->add_required_attribute('textarea' . $item_index); |
| 3310 |
} |
| 3311 |
|
| 3312 |
$value = empty($item['field_value']) ? '' : $item['field_value']; |
| 3313 |
|
| 3314 |
return '<textarea ' . $this->get_render_attribute_string('textarea' . $item_index) . '>' . $value . '</textarea>'; |
| 3315 |
} |
| 3316 |
|
| 3317 |
protected function make_select_field($item, $i) |
| 3318 |
{ |
| 3319 |
$this->add_render_attribute( |
| 3320 |
[ |
| 3321 |
'select-wrapper' . $i => [ |
| 3322 |
'class' => [ |
| 3323 |
'king-addons-form-field', |
| 3324 |
'king-addons-select-wrap', |
| 3325 |
'king-addons-fi-svg-' . (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg') ? 'yes' : 'no'), |
| 3326 |
'remove-before', |
| 3327 |
esc_attr($item['css_classes']), |
| 3328 |
], |
| 3329 |
], |
| 3330 |
'select' . $i => [ |
| 3331 |
'name' => $this->get_attribute_name($item) . (!empty($item['allow_multiple']) ? '[]' : ''), |
| 3332 |
'id' => $this->get_attribute_id($item), |
| 3333 |
'class' => [ |
| 3334 |
'king-addons-form-field-textual' |
| 3335 |
], |
| 3336 |
], |
| 3337 |
] |
| 3338 |
); |
| 3339 |
|
| 3340 |
if ($item['required']) { |
| 3341 |
$this->add_required_attribute('select' . $i); |
| 3342 |
} |
| 3343 |
|
| 3344 |
if ($item['allow_multiple']) { |
| 3345 |
$this->add_render_attribute('select' . $i, 'multiple'); |
| 3346 |
if (!empty($item['select_size'])) { |
| 3347 |
$this->add_render_attribute('select' . $i, 'size', $item['select_size']); |
| 3348 |
} |
| 3349 |
} |
| 3350 |
|
| 3351 |
$options = preg_split("/\\r\\n|\\r|\\n/", $item['field_options']); |
| 3352 |
|
| 3353 |
if (!$options) { |
| 3354 |
return ''; |
| 3355 |
} |
| 3356 |
|
| 3357 |
ob_start(); |
| 3358 |
?> |
| 3359 |
<div <?php $this->print_render_attribute_string('select-wrapper' . $i); ?>> |
| 3360 |
|
| 3361 |
<?php if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')) { ?> |
| 3362 |
<svg class="e-font-icon-svg e-eicon-caret-up" viewBox="0 0 1000 500"> |
| 3363 |
<path d="M763 279c8-8 8-12 8-25 0-8-4-16-8-25-9-8-13-8-25-8h-459c-8 0-16 4-25 8 0 9-4 17-4 25 0 9 4 17 8 25l230 229c8 5 16 9 25 9 8 0 16-4 25-9l225-229z"/> |
| 3364 |
</svg> |
| 3365 |
<?php } ?> |
| 3366 |
<!--suppress HtmlFormInputWithoutLabel --> |
| 3367 |
<select <?php $this->print_render_attribute_string('select' . $i); ?>> |
| 3368 |
<?php |
| 3369 |
foreach ($options as $key => $option) : |
| 3370 |
$option_id = $item['field_id'] . $key; |
| 3371 |
$option_value = esc_attr($option); |
| 3372 |
$option_label = esc_html($option); |
| 3373 |
|
| 3374 |
if (false !== strpos($option, '|')) { |
| 3375 |
list($label, $value) = explode('|', $option); |
| 3376 |
$option_value = esc_attr($value); |
| 3377 |
$option_label = esc_html($label); |
| 3378 |
} |
| 3379 |
|
| 3380 |
$this->add_render_attribute($option_id, 'value', $option_value); |
| 3381 |
|
| 3382 |
|
| 3383 |
if (!empty($item['field_value']) && in_array($option_value, explode(',', $item['field_value']))) { |
| 3384 |
$this->add_render_attribute($option_id, 'selected', 'selected'); |
| 3385 |
} ?> |
| 3386 |
<option <?php $this->print_render_attribute_string($option_id); ?>> |
| 3387 |
<?php |
| 3388 |
|
| 3389 |
echo $option_label; |
| 3390 |
?> |
| 3391 |
</option> |
| 3392 |
<?php endforeach; ?> |
| 3393 |
</select> |
| 3394 |
</div> |
| 3395 |
<?php |
| 3396 |
|
| 3397 |
$select = ob_get_clean(); |
| 3398 |
return $select; |
| 3399 |
} |
| 3400 |
|
| 3401 |
protected function make_radio_checkbox_field($item, $item_index, $type) |
| 3402 |
{ |
| 3403 |
$options = preg_split("/\\r\\n|\\r|\\n/", $item['field_options']); |
| 3404 |
$html = ''; |
| 3405 |
if ($options) { |
| 3406 |
$html .= '<div class="king-addons-field-sub-group ' . esc_attr($item['css_classes']) . ' ' . esc_attr($item['inline_list']) . '">'; |
| 3407 |
foreach ($options as $key => $option) { |
| 3408 |
$element_id = ($item['field_id'] ? esc_attr($item['field_id']) : $item['field_type']) . $key; |
| 3409 |
$html_id = $this->get_attribute_id($item) . '-' . $key; |
| 3410 |
$option_label = $option; |
| 3411 |
$option_value = $option; |
| 3412 |
|
| 3413 |
if (false !== strpos($option, '|')) { |
| 3414 |
list($option_label, $option_value) = explode('|', $option); |
| 3415 |
} |
| 3416 |
|
| 3417 |
$this->add_render_attribute( |
| 3418 |
$element_id, |
| 3419 |
[ |
| 3420 |
'type' => $type, |
| 3421 |
'value' => $option_value, |
| 3422 |
'id' => $html_id, |
| 3423 |
'name' => $this->get_attribute_name($item) . (('checkbox' === $type && count($options) > 1) ? '[]' : ''), |
| 3424 |
] |
| 3425 |
); |
| 3426 |
|
| 3427 |
if (!empty($item['field_value']) && $option_value === $item['field_value']) { |
| 3428 |
$this->add_render_attribute($element_id, 'checked', 'checked'); |
| 3429 |
} |
| 3430 |
|
| 3431 |
if ($item['required'] && ('radio' === $type || 'checkbox' === $type)) { |
| 3432 |
$this->add_required_attribute($element_id); |
| 3433 |
} |
| 3434 |
|
| 3435 |
$html .= '<span class="king-addons-form-field-option" data-key="form-field-' . esc_attr($item['field_id']) . '"><input ' . $this->get_render_attribute_string($element_id) . '> <label for="' . esc_attr($html_id) . '">' . $option_label . '</label></span>'; |
| 3436 |
} |
| 3437 |
$html .= '</div>'; |
| 3438 |
} |
| 3439 |
|
| 3440 |
return $html; |
| 3441 |
} |
| 3442 |
|
| 3443 |
protected function form_fields_render_attributes($i, $instance, $item) |
| 3444 |
{ |
| 3445 |
$this->add_render_attribute( |
| 3446 |
[ |
| 3447 |
'field-group' . $i => [ |
| 3448 |
'class' => [ |
| 3449 |
'king-addons-form-field-type-' . $item['field_type'], |
| 3450 |
'king-addons-field-group', |
| 3451 |
'king-addons-column', |
| 3452 |
'king-addons-field-group-' . esc_attr($item['field_id']), |
| 3453 |
], |
| 3454 |
], |
| 3455 |
'input' . $i => [ |
| 3456 |
'type' => ('acceptance' === $item['field_type']) ? 'checkbox' : (('upload' === $item['field_type']) ? 'file' : $item['field_type']), |
| 3457 |
'name' => $this->get_attribute_name($item), |
| 3458 |
'id' => $this->get_attribute_id($item), |
| 3459 |
'class' => [ |
| 3460 |
'king-addons-form-field', |
| 3461 |
empty($item['css_classes']) ? '' : esc_attr($item['css_classes']), |
| 3462 |
], |
| 3463 |
], |
| 3464 |
'label' . $i => [ |
| 3465 |
'for' => $this->get_attribute_id($item), |
| 3466 |
'class' => 'king-addons-form-field-label', |
| 3467 |
], |
| 3468 |
] |
| 3469 |
); |
| 3470 |
|
| 3471 |
if (empty($item['width'])) { |
| 3472 |
$item['width'] = '100'; |
| 3473 |
} |
| 3474 |
|
| 3475 |
|
| 3476 |
if ($item['allow_multiple']) { |
| 3477 |
$this->add_render_attribute('field-group' . $i, 'class', 'king-addons-form-field-type-' . $item['field_type'] . '-multiple'); |
| 3478 |
} |
| 3479 |
|
| 3480 |
|
| 3481 |
$this->add_render_attribute('field-group' . $i, 'class', 'elementor-repeater-item-' . esc_attr($item['_id'])); |
| 3482 |
|
| 3483 |
|
| 3484 |
if ('true' == $instance['show_placeholders'] && !Utils::is_empty($item['placeholder'])) { |
| 3485 |
$this->add_render_attribute('input' . $i, 'placeholder', $item['placeholder']); |
| 3486 |
} |
| 3487 |
|
| 3488 |
if (!empty($item['field_value'])) { |
| 3489 |
$this->add_render_attribute('input' . $i, 'value', $item['field_value']); |
| 3490 |
} |
| 3491 |
|
| 3492 |
if (!$instance['show_labels']) { |
| 3493 |
$this->add_render_attribute('label' . $i, 'class', 'king-addons-hidden-element'); |
| 3494 |
} |
| 3495 |
|
| 3496 |
if (!empty($item['required'])) { |
| 3497 |
$class = 'king-addons-form-field-required'; |
| 3498 |
if (!empty($instance['mark_required'])) { |
| 3499 |
$class .= ' king-addons-required-mark'; |
| 3500 |
} |
| 3501 |
$this->add_render_attribute('field-group' . $i, 'class', $class); |
| 3502 |
$this->add_required_attribute('input' . $i); |
| 3503 |
} |
| 3504 |
} |
| 3505 |
|
| 3506 |
private function render_form_icon($settings) |
| 3507 |
{ ?> |
| 3508 |
<span <?php echo $this->get_render_attribute_string('icon-align'); ?>> |
| 3509 |
<?php Icons_Manager::render_icon($settings['selected_button_icon'], ['aria-hidden' => 'true']); ?> |
| 3510 |
<?php if (empty($instance['button_text'])) : ?> |
| 3511 |
<span class="king-addons-hidden-element"><?php echo esc_html__('Submit', 'king-addons'); ?></span> |
| 3512 |
<?php endif; ?> |
| 3513 |
</span> |
| 3514 |
<?php } |
| 3515 |
|
| 3516 |
public function render_submit_button($instance) |
| 3517 |
{ |
| 3518 |
?> |
| 3519 |
<button type="submit" <?php echo $this->get_render_attribute_string('button'); ?>> |
| 3520 |
<span <?php echo $this->get_render_attribute_string('content-wrapper'); ?>> |
| 3521 |
<?php if (!empty($instance['selected_button_icon']) && 'left' === $instance['button_icon_align']) : ?> |
| 3522 |
<?php $this->render_form_icon($instance); ?> |
| 3523 |
<?php endif; ?> |
| 3524 |
<?php if (!empty($instance['button_text'])) : ?> |
| 3525 |
<span><?php $this->print_unescaped_setting('button_text'); ?></span> |
| 3526 |
<?php endif; ?> |
| 3527 |
<?php if (!empty($instance['selected_button_icon']) && 'right' === $instance['button_icon_align']) : ?> |
| 3528 |
<?php $this->render_form_icon($instance); ?> |
| 3529 |
<?php endif; ?> |
| 3530 |
</span> |
| 3531 |
<div class="king-addons-double-bounce king-addons-loader-hidden"> |
| 3532 |
<div class="king-addons-child king-addons-double-bounce1"></div> |
| 3533 |
<div class="king-addons-child king-addons-double-bounce2"></div> |
| 3534 |
</div> |
| 3535 |
</button> |
| 3536 |
<?php |
| 3537 |
} |
| 3538 |
|
| 3539 |
protected function render() |
| 3540 |
{ |
| 3541 |
global $post; |
| 3542 |
$instance = $this->get_settings_for_display(); |
| 3543 |
|
| 3544 |
$form_fields_length = sizeof($instance['form_fields']); |
| 3545 |
$thisId = $this->get_id(); |
| 3546 |
|
| 3547 |
update_option('king_addons_email_content_type_' . $this->get_id(), $instance['email_content_type']); |
| 3548 |
update_option('king_addons_email_to_' . $this->get_id(), $instance['email_to']); |
| 3549 |
update_option('king_addons_email_subject_' . $this->get_id(), $instance['email_subject']); |
| 3550 |
update_option('king_addons_email_fields_' . $this->get_id(), $instance['email_content']); |
| 3551 |
update_option('king_addons_cc_header_' . $this->get_id(), $instance['email_to_cc']); |
| 3552 |
update_option('king_addons_bcc_header_' . $this->get_id(), $instance['email_to_bcc']); |
| 3553 |
update_option('king_addons_email_from_' . $this->get_id(), $instance['email_from']); |
| 3554 |
update_option('king_addons_email_from_name_' . $this->get_id(), $instance['email_from_name']); |
| 3555 |
update_option('king_addons_reply_to_' . $this->get_id(), $instance['email_reply_to']); |
| 3556 |
update_option('king_addons_meta_keys_' . $this->get_id(), $instance['form_metadata']); |
| 3557 |
update_option('king_addons_referrer_' . $this->get_id(), home_url($_SERVER['REQUEST_URI'])); |
| 3558 |
update_option('king_addons_referrer_title_' . $this->get_id(), get_the_title($post->ID)); |
| 3559 |
update_option('king_addons_webhook_url_' . $this->get_id(), $instance['webhook_url']); |
| 3560 |
|
| 3561 |
$emailField = isset($instance['email_field']) ? $instance['email_field'] : ''; |
| 3562 |
$firstNameField = isset($instance['first_name_field']) ? $instance['first_name_field'] : ''; |
| 3563 |
$lastNameField = isset($instance['last_name_field']) ? $instance['last_name_field'] : ''; |
| 3564 |
$addressField = isset($instance['address_field']) ? $instance['address_field'] : ''; |
| 3565 |
$phoneField = isset($instance['phone_field']) ? $instance['phone_field'] : ''; |
| 3566 |
$birthdayField = isset($instance['birthday_field']) ? $instance['birthday_field'] : ''; |
| 3567 |
$groupId = isset($instance['mailchimp_groups']) ? $instance['mailchimp_groups'] : ''; |
| 3568 |
|
| 3569 |
$fieldsArray = [ |
| 3570 |
'email_field' => $emailField, |
| 3571 |
'first_name_field' => $firstNameField, |
| 3572 |
'last_name_field' => $lastNameField, |
| 3573 |
'address_field' => $addressField, |
| 3574 |
'phone_field' => $phoneField, |
| 3575 |
'birthday_field' => $birthdayField, |
| 3576 |
'group_id' => $groupId |
| 3577 |
]; |
| 3578 |
|
| 3579 |
$submit_actions = array_filter($instance['submit_actions'], function ($value) { |
| 3580 |
return $value !== 'pro-sb' && $value !== 'pro-mch' && $value !== 'pro-wh'; |
| 3581 |
}); |
| 3582 |
$submit_actions = array_values($submit_actions); |
| 3583 |
|
| 3584 |
$this->add_render_attribute( |
| 3585 |
[ |
| 3586 |
'wrapper' => [ |
| 3587 |
'class' => [ |
| 3588 |
'king-addons-form-fields-wrap', |
| 3589 |
'king-addons-labels-' . $instance['label_position'], |
| 3590 |
], |
| 3591 |
], |
| 3592 |
'submit-group' => [ |
| 3593 |
'class' => [ |
| 3594 |
'king-addons-field-group', |
| 3595 |
'king-addons-step-buttons-wrap', |
| 3596 |
'king-addons-column', |
| 3597 |
'king-addons-form-field-type-submit', |
| 3598 |
], |
| 3599 |
'data-actions' => [ |
| 3600 |
json_encode($submit_actions) |
| 3601 |
], |
| 3602 |
'data-redirect-url' => [ |
| 3603 |
in_array('redirect', $submit_actions) ? esc_url($instance['redirect_to']) : '' |
| 3604 |
], |
| 3605 |
'data-mailchimp-fields' => [ |
| 3606 |
json_encode($fieldsArray) |
| 3607 |
], |
| 3608 |
'data-list-id' => [ |
| 3609 |
isset($instance['mailchimp_audience']) ? esc_attr($instance['mailchimp_audience']) : '' |
| 3610 |
] |
| 3611 |
], |
| 3612 |
'button' => [ |
| 3613 |
'class' => 'king-addons-button', |
| 3614 |
], |
| 3615 |
'icon-align' => [ |
| 3616 |
'class' => [ |
| 3617 |
empty($instance['button_icon_align']) ? '' : |
| 3618 |
'king-addons-align-icon-' . $instance['button_icon_align'], |
| 3619 |
'elementor-button-icon', |
| 3620 |
], |
| 3621 |
], |
| 3622 |
] |
| 3623 |
); |
| 3624 |
|
| 3625 |
if (!empty($instance['form_id'])) { |
| 3626 |
$this->add_render_attribute('form', 'id', $instance['form_id']); |
| 3627 |
} |
| 3628 |
|
| 3629 |
if (!empty($instance['form_name'])) { |
| 3630 |
$this->add_render_attribute('form', 'name', $instance['form_name']); |
| 3631 |
} |
| 3632 |
|
| 3633 |
$this->add_render_attribute('form', 'page', get_post()->post_title); |
| 3634 |
$this->add_render_attribute('form', 'page_id', get_post()->ID); |
| 3635 |
|
| 3636 |
if (!empty($instance['button_css_id'])) { |
| 3637 |
$this->add_render_attribute('button', 'id', $instance['button_css_id']); |
| 3638 |
} |
| 3639 |
|
| 3640 |
$referer_title = trim(wp_title('', false)); |
| 3641 |
|
| 3642 |
if (!$referer_title && is_home()) { |
| 3643 |
$referer_title = get_option('blogname'); |
| 3644 |
} |
| 3645 |
|
| 3646 |
?> |
| 3647 |
<form class="king-addons-form" method="post" <?php echo $this->get_render_attribute_string('form'); ?> |
| 3648 |
novalidate> |
| 3649 |
<input type="hidden" name="post_id" value="<?php |
| 3650 |
echo get_the_ID(); |
| 3651 |
?>"/> |
| 3652 |
<input type="hidden" name="form_id" value="<?php echo esc_attr($this->get_id()); ?>"/> |
| 3653 |
<input type="hidden" name="referer_title" value="<?php echo esc_attr($referer_title); ?>"/> |
| 3654 |
|
| 3655 |
<?php if (is_singular()) { |
| 3656 |
|
| 3657 |
?> |
| 3658 |
<input type="hidden" name="queried_id" value="<?php echo get_the_ID(); ?>"/> |
| 3659 |
<?php } |
| 3660 |
|
| 3661 |
$step_count1 = 0; |
| 3662 |
$step_exists = ''; |
| 3663 |
$step_icon = []; |
| 3664 |
$step_label = []; |
| 3665 |
$step_sub_label = []; |
| 3666 |
$whitelist = ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'doc', 'docx', 'ppt', 'pptx', 'odt', 'avi', 'ogg', 'm4a', 'mov', 'mp3', 'mp4', 'mpg', 'wav', 'wmv', 'txt']; |
| 3667 |
|
| 3668 |
foreach ($instance['form_fields'] as $key => $value) { |
| 3669 |
if ('king-addons-fb-step' === $value['field_type']) { |
| 3670 |
$step_exists = 'exists'; |
| 3671 |
$step_count1++; |
| 3672 |
|
| 3673 |
ob_start(); |
| 3674 |
Icons_Manager::render_icon($value['step_icon'], ['aria-hidden' => 'true']); |
| 3675 |
$step_icon[] = ob_get_clean(); |
| 3676 |
|
| 3677 |
$step_label[] = '<span class="king-addons-fb-step-main-label">' . $value['field_label'] . '</span>'; |
| 3678 |
|
| 3679 |
$step_sub_label[] = '<span class="king-addons-fb-step-sub-label">' . $value['field_sub_label'] . '</span>'; |
| 3680 |
} |
| 3681 |
} |
| 3682 |
|
| 3683 |
|
| 3684 |
$step_wrap_class = 'yes' !== $instance['show_separator'] ? 'king-addons-fb-step-wrap king-addons-separator-off' : 'king-addons-fb-step-wrap'; |
| 3685 |
|
| 3686 |
echo '<div class="' . $step_wrap_class . '">'; |
| 3687 |
if ('progress_bar' == $instance['step_type']) { |
| 3688 |
echo '<div class="king-addons-fb-step-progress">'; |
| 3689 |
echo '<div class="king-addons-fb-step-progress-fill"></div>'; |
| 3690 |
echo '</div>'; |
| 3691 |
} else { |
| 3692 |
$i = 0; |
| 3693 |
|
| 3694 |
while ($i < $step_count1) : |
| 3695 |
|
| 3696 |
if ('none' == $instance['step_type']) { |
| 3697 |
$step_html = '<span class="king-addons-fb-step"></span>'; |
| 3698 |
} else if ('text' == $instance['step_type']) { |
| 3699 |
$step_html = '<span class="king-addons-fb-step">' . $step_label[$i] . $step_sub_label[$i] . '</span>'; |
| 3700 |
} else if ('icon' == $instance['step_type']) { |
| 3701 |
$step_html = '<span class="king-addons-fb-step"><span class="king-addons-fb-step-content">' . $step_icon[$i] . '</span></span>'; |
| 3702 |
} else if ('number' == $instance['step_type']) { |
| 3703 |
$step_html = '<span class="king-addons-fb-step"><span class="king-addons-fb-step-content"><span class="king-addons-fb-step-number">' . ($i + 1) . '</span></span></span>'; |
| 3704 |
} else if ('number_text' == $instance['step_type']) { |
| 3705 |
$step_html = '<span class="king-addons-fb-step"><span class="king-addons-fb-step-content"><span class="king-addons-fb-step-number">' . ($i + 1) . '</span></span><span class="king-addons-fb-step-label">' . $step_label[$i] . $step_sub_label[$i] . '</span></span>'; |
| 3706 |
} else if ('icon_text' == $instance['step_type']) { |
| 3707 |
$step_html = '<span class="king-addons-fb-step"><span class="king-addons-fb-step-content">' . $step_icon[$i] . '</span><span class="king-addons-fb-step-label">' . $step_label[$i] . $step_sub_label[$i] . '</span></span>'; |
| 3708 |
} |
| 3709 |
|
| 3710 |
echo $step_html; |
| 3711 |
|
| 3712 |
|
| 3713 |
if ('yes' == $instance['show_separator']) { |
| 3714 |
echo '<span class="king-addons-fb-step-sep"></span>'; |
| 3715 |
} |
| 3716 |
|
| 3717 |
$i++; |
| 3718 |
endwhile; |
| 3719 |
} |
| 3720 |
echo '</div>'; |
| 3721 |
?> |
| 3722 |
|
| 3723 |
<div <?php echo $this->get_render_attribute_string('wrapper'); ?>> |
| 3724 |
<?php |
| 3725 |
|
| 3726 |
$step_count = 0; |
| 3727 |
$field_count = 0; |
| 3728 |
|
| 3729 |
foreach ($instance['form_fields'] as $item_index => $item) : |
| 3730 |
if ('king-addons-fb-step' !== $item['field_type']) { |
| 3731 |
$field_count++; |
| 3732 |
if (!king_addons_freemius()->can_use_premium_code__premium_only() && 3 < $field_count) { |
| 3733 |
continue; |
| 3734 |
} |
| 3735 |
} |
| 3736 |
|
| 3737 |
$this->form_fields_render_attributes($item_index, $instance, $item); |
| 3738 |
|
| 3739 |
$print_label = !in_array($item['field_type'], ['hidden', 'html', 'king-addons-fb-step'], true); |
| 3740 |
|
| 3741 |
if ('king-addons-fb-step' === $item['field_type']) { |
| 3742 |
if (isset($item['previous_button_text'])) { |
| 3743 |
$this->last_prev_btn_text = $item['previous_button_text']; |
| 3744 |
} |
| 3745 |
|
| 3746 |
if (0 === $step_count) { |
| 3747 |
echo '<div class="king-addons-fb-step-tab king-addons-fb-step-tab-hidden">'; |
| 3748 |
} else { |
| 3749 |
echo '<div class="king-addons-step-buttons-wrap">'; |
| 3750 |
echo '<button type="button" class="king-addons-fb-step-prev">' . $item['previous_button_text'] . '</button>'; |
| 3751 |
echo '<button type="button" class="king-addons-fb-step-next">' . $item['next_button_text'] . '</button>'; |
| 3752 |
echo '</div>'; |
| 3753 |
echo '</div>'; |
| 3754 |
echo '<div class="king-addons-fb-step-tab king-addons-fb-step-tab-hidden">'; |
| 3755 |
} |
| 3756 |
$step_count++; |
| 3757 |
} |
| 3758 |
|
| 3759 |
?> |
| 3760 |
<div <?php $this->print_render_attribute_string('field-group' . $item_index); ?>> |
| 3761 |
<?php |
| 3762 |
if ($print_label && $item['field_label']) { |
| 3763 |
?> |
| 3764 |
<label <?php echo $this->get_render_attribute_string('label' . $item_index); ?>> |
| 3765 |
<?php |
| 3766 |
echo $item['field_label']; ?> |
| 3767 |
</label> |
| 3768 |
<?php |
| 3769 |
} |
| 3770 |
|
| 3771 |
switch ($item['field_type']) : |
| 3772 |
case 'html': |
| 3773 |
echo do_shortcode($item['field_html']); |
| 3774 |
break; |
| 3775 |
case 'textarea': |
| 3776 |
|
| 3777 |
echo $this->make_textarea_field($item, $item_index); |
| 3778 |
break; |
| 3779 |
|
| 3780 |
case 'select': |
| 3781 |
|
| 3782 |
echo $this->make_select_field($item, $item_index); |
| 3783 |
break; |
| 3784 |
|
| 3785 |
case 'radio': |
| 3786 |
case 'checkbox': |
| 3787 |
|
| 3788 |
echo $this->make_radio_checkbox_field($item, $item_index, $item['field_type']); |
| 3789 |
break; |
| 3790 |
case 'recaptcha-v3': |
| 3791 |
echo '<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response" data-site-key="' . get_option('king_addons_recaptcha_v3_site_key') . '" />'; |
| 3792 |
case 'text': |
| 3793 |
case 'email': |
| 3794 |
case 'url': |
| 3795 |
case 'tel': |
| 3796 |
case 'password': |
| 3797 |
case 'hidden': |
| 3798 |
case 'search': |
| 3799 |
case 'number': |
| 3800 |
case 'date': |
| 3801 |
case 'time': |
| 3802 |
$this->add_render_attribute('input' . $item_index, 'class', 'king-addons-form-field-textual'); |
| 3803 |
echo '<input size="1 "' . $this->get_render_attribute_string('input' . $item_index) . '>'; |
| 3804 |
break; |
| 3805 |
case 'upload': |
| 3806 |
if ('yes' === $item['allow_multiple_upload']) { |
| 3807 |
$this->add_render_attribute('input' . $item_index, 'multiple', 'multiple'); |
| 3808 |
} |
| 3809 |
|
| 3810 |
if (!empty($item['file_size'])) { |
| 3811 |
$this->add_render_attribute( |
| 3812 |
'input' . $item_index, |
| 3813 |
[ |
| 3814 |
'data-maxfs' => $item['file_size'], |
| 3815 |
'data-maxfs-notice' => esc_html__('File size is more than allowed.', 'king-addons'), |
| 3816 |
] |
| 3817 |
); |
| 3818 |
} |
| 3819 |
|
| 3820 |
if (!empty($item['file_types'])) { |
| 3821 |
|
| 3822 |
|
| 3823 |
$file_types = explode(',', $item['file_types']); |
| 3824 |
|
| 3825 |
|
| 3826 |
$non_whitelisted = array_diff($file_types, $whitelist); |
| 3827 |
|
| 3828 |
if (!empty($non_whitelisted)) { |
| 3829 |
$item['file_types'] = 'jpg,jpeg,png,gif,pdf,doc,docx,ppt,pptx,odt,avi,ogg,m4a,mov,mp3,mp4,mpg,wav,wmv,txt'; |
| 3830 |
if (is_admin()) { |
| 3831 |
echo '<br>'; |
| 3832 |
echo '<ul class="king-addons-file-type-error">'; |
| 3833 |
echo esc_html__('Please remove unsupported file type(s):', 'king-addons'); |
| 3834 |
foreach ($non_whitelisted as $type) { |
| 3835 |
if (!empty($type)) { |
| 3836 |
echo '<li>' . $type . ' <li/>'; |
| 3837 |
} |
| 3838 |
} |
| 3839 |
echo '</ul>'; |
| 3840 |
} |
| 3841 |
} |
| 3842 |
|
| 3843 |
$this->add_render_attribute( |
| 3844 |
'input' . $item_index, |
| 3845 |
[ |
| 3846 |
'data-allft' => $item['file_types'] |
| 3847 |
] |
| 3848 |
); |
| 3849 |
} |
| 3850 |
|
| 3851 |
echo '<input size="1 "' . $this->get_render_attribute_string('input' . $item_index) . '>'; |
| 3852 |
break; |
| 3853 |
case 'king-addons-fb-step': |
| 3854 |
echo '<input type="hidden" class="king-addons-fb-step-input" id=form-field-' . esc_attr($item['field_id']) . ' value=' . $item['field_label'] . '>'; |
| 3855 |
break; |
| 3856 |
default: |
| 3857 |
$field_type = $item['field_type']; |
| 3858 |
endswitch; |
| 3859 |
?> |
| 3860 |
</div> |
| 3861 |
<?php |
| 3862 |
endforeach; |
| 3863 |
|
| 3864 |
echo '<div ' . $this->get_render_attribute_string('submit-group') . '>'; |
| 3865 |
if ('exists' === $step_exists) { |
| 3866 |
if (2 <= $step_count) { |
| 3867 |
echo '<button type="button" class="king-addons-fb-step-prev">' . $this->last_prev_btn_text . '</button>'; |
| 3868 |
} |
| 3869 |
|
| 3870 |
$this->render_submit_button($instance); |
| 3871 |
|
| 3872 |
echo '</div>'; |
| 3873 |
} else { |
| 3874 |
|
| 3875 |
$this->render_submit_button($instance); |
| 3876 |
|
| 3877 |
} |
| 3878 |
echo '</div>'; ?> |
| 3879 |
|
| 3880 |
</div> |
| 3881 |
</form> |
| 3882 |
<?php |
| 3883 |
} |
| 3884 |
} |