we-forms.php
591 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | use \Elementor\ElementsKit_Widget_We_Forms_Handler as Handler; |
| 5 | use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager; |
| 6 | |
| 7 | if (! defined( 'ABSPATH' ) ) exit; |
| 8 | |
| 9 | class ElementsKit_Widget_We_Forms extends Widget_Base { |
| 10 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 11 | |
| 12 | public $base; |
| 13 | |
| 14 | public function __construct( $data = [], $args = null ) { |
| 15 | parent::__construct( $data, $args ); |
| 16 | $this->add_script_depends('weforms'); |
| 17 | } |
| 18 | |
| 19 | public function get_name() { |
| 20 | return Handler::get_name(); |
| 21 | } |
| 22 | |
| 23 | public function get_title() { |
| 24 | return Handler::get_title(); |
| 25 | } |
| 26 | |
| 27 | public function get_icon() { |
| 28 | return Handler::get_icon(); |
| 29 | } |
| 30 | |
| 31 | public function get_categories() { |
| 32 | return Handler::get_categories(); |
| 33 | } |
| 34 | |
| 35 | public function get_keywords() { |
| 36 | return Handler::get_keywords(); |
| 37 | } |
| 38 | |
| 39 | public function get_help_url() { |
| 40 | return 'https://wpmet.com/doc/we-forms/'; |
| 41 | } |
| 42 | protected function is_dynamic_content(): bool { |
| 43 | return false; |
| 44 | } |
| 45 | protected function register_controls() { |
| 46 | $this->start_controls_section( |
| 47 | 'ekit_weform_section_tab', [ |
| 48 | 'label' =>esc_html__( 'weForm', 'elementskit-lite' ), |
| 49 | ] |
| 50 | ); |
| 51 | |
| 52 | $this->add_control( |
| 53 | 'ekit_weform_form_id', |
| 54 | [ |
| 55 | 'label' => __( 'Select Your Form', 'elementskit-lite' ), |
| 56 | 'type' => Controls_Manager::SELECT, |
| 57 | 'label_block' => true, |
| 58 | 'default' => '0', |
| 59 | 'options' => \ElementsKit_Lite\Utils::ekit_get__forms('wpuf_contact_form'), |
| 60 | ] |
| 61 | ); |
| 62 | |
| 63 | $this->end_controls_section(); |
| 64 | |
| 65 | $this->start_controls_section( |
| 66 | 'ekit_weform__section_fields_style', |
| 67 | [ |
| 68 | 'label' => __( 'Fields', 'elementskit-lite' ), |
| 69 | 'tab' => Controls_Manager::TAB_STYLE, |
| 70 | ] |
| 71 | ); |
| 72 | |
| 73 | $this->add_responsive_control( |
| 74 | 'ekit_weform_large_field_width', |
| 75 | [ |
| 76 | 'label' => __( 'Input Width', 'elementskit-lite' ), |
| 77 | 'type' => Controls_Manager::SLIDER, |
| 78 | 'size_units' => [ 'px', '%' ], |
| 79 | 'default' => [ |
| 80 | 'unit' => '%', |
| 81 | 'size' => 99 |
| 82 | ], |
| 83 | 'range' => [ |
| 84 | '%' => [ |
| 85 | 'min' => 1, |
| 86 | 'max' => 100, |
| 87 | ], |
| 88 | 'px' => [ |
| 89 | 'min' => 1, |
| 90 | 'max' => 800, |
| 91 | ], |
| 92 | ], |
| 93 | 'selectors' => [ |
| 94 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="text"], |
| 95 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="password"], |
| 96 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="email"], |
| 97 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="url"], |
| 98 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="url"], |
| 99 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form li .wpuf-fields input[type="number"], |
| 100 | {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea' => 'width: {{SIZE}}{{UNIT}};', |
| 101 | ], |
| 102 | ] |
| 103 | ); |
| 104 | |
| 105 | $this->add_responsive_control( |
| 106 | 'ekit_weform_field_margin', |
| 107 | [ |
| 108 | 'label' => __( 'Input Spacing', 'elementskit-lite' ), |
| 109 | 'type' => Controls_Manager::DIMENSIONS, |
| 110 | 'size_units' => [ 'px', '%' ], |
| 111 | 'selectors' => [ |
| 112 | '{{WRAPPER}} .wpuf-el:not(.wpuf-submit)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 113 | ], |
| 114 | ] |
| 115 | ); |
| 116 | |
| 117 | $this->add_responsive_control( |
| 118 | 'ekit_weform_field_padding', |
| 119 | [ |
| 120 | 'label' => __( 'Padding', 'elementskit-lite' ), |
| 121 | 'type' => Controls_Manager::DIMENSIONS, |
| 122 | 'size_units' => [ 'px', '%' ], |
| 123 | 'selectors' => [ |
| 124 | '{{WRAPPER}} .wpuf-fields input:not(.weforms_submit_btn)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 125 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 126 | ], |
| 127 | ] |
| 128 | ); |
| 129 | |
| 130 | $this->add_responsive_control( |
| 131 | 'ekit_weform_field_border_radius', |
| 132 | [ |
| 133 | 'label' => __( 'Border Radius', 'elementskit-lite' ), |
| 134 | 'type' => Controls_Manager::DIMENSIONS, |
| 135 | 'size_units' => [ 'px', '%' ], |
| 136 | 'selectors' => [ |
| 137 | '{{WRAPPER}} .wpuf-fields input:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-fields textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 138 | ], |
| 139 | ] |
| 140 | ); |
| 141 | |
| 142 | $this->add_group_control( |
| 143 | Group_Control_Typography::get_type(), |
| 144 | [ |
| 145 | 'name' => 'ekit_weform_field_typography', |
| 146 | 'label' => __( 'Typography', 'elementskit-lite' ), |
| 147 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:not(.weforms_submit_btn), .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea', |
| 148 | ] |
| 149 | ); |
| 150 | |
| 151 | $this->add_control( |
| 152 | 'ekit_weform_field_textcolor', |
| 153 | [ |
| 154 | 'label' => __( 'Input Text Color', 'elementskit-lite' ), |
| 155 | 'type' => Controls_Manager::COLOR, |
| 156 | 'selectors' => [ |
| 157 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea' => 'color: {{VALUE}};', |
| 158 | ], |
| 159 | ] |
| 160 | ); |
| 161 | |
| 162 | $this->add_control( |
| 163 | 'ekit_weform_field_placeholder_color', |
| 164 | [ |
| 165 | 'label' => __( 'Input Placeholder Color', 'elementskit-lite' ), |
| 166 | 'type' => Controls_Manager::COLOR, |
| 167 | 'selectors' => [ |
| 168 | '{{WRAPPER}} ::-webkit-input-placeholder' => 'color: {{VALUE}};', |
| 169 | '{{WRAPPER}} ::-moz-placeholder' => 'color: {{VALUE}};', |
| 170 | '{{WRAPPER}} ::-ms-input-placeholder' => 'color: {{VALUE}};', |
| 171 | ], |
| 172 | ] |
| 173 | ); |
| 174 | |
| 175 | $this->start_controls_tabs( 'ekit_weform_tabs_field_state' ); |
| 176 | |
| 177 | $this->start_controls_tab( |
| 178 | 'ekit_weform_tab_field_normal', |
| 179 | [ |
| 180 | 'label' => __( 'Normal', 'elementskit-lite' ), |
| 181 | ] |
| 182 | ); |
| 183 | |
| 184 | $this->add_group_control( |
| 185 | Group_Control_Border::get_type(), |
| 186 | [ |
| 187 | 'name' => 'ekit_weform_field_border', |
| 188 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea', |
| 189 | ] |
| 190 | ); |
| 191 | |
| 192 | $this->add_group_control( |
| 193 | Group_Control_Box_Shadow::get_type(), |
| 194 | [ |
| 195 | 'name' => 'ekit_weform_field_box_shadow', |
| 196 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea', |
| 197 | ] |
| 198 | ); |
| 199 | |
| 200 | $this->add_control( |
| 201 | 'ekit_weform_field_bg_color', |
| 202 | [ |
| 203 | 'label' => __( 'Background Color', 'elementskit-lite' ), |
| 204 | 'type' => Controls_Manager::COLOR, |
| 205 | 'selectors' => [ |
| 206 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea' => 'background-color: {{VALUE}}', |
| 207 | ], |
| 208 | ] |
| 209 | ); |
| 210 | |
| 211 | $this->end_controls_tab(); |
| 212 | |
| 213 | $this->start_controls_tab( |
| 214 | 'ekit_weform_tab_field_focus', |
| 215 | [ |
| 216 | 'label' => __( 'Focus', 'elementskit-lite' ), |
| 217 | ] |
| 218 | ); |
| 219 | |
| 220 | $this->add_group_control( |
| 221 | Group_Control_Border::get_type(), |
| 222 | [ |
| 223 | 'name' => 'ekit_weform_field_focus_border', |
| 224 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:focus:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea:focus', |
| 225 | ] |
| 226 | ); |
| 227 | |
| 228 | $this->add_group_control( |
| 229 | Group_Control_Box_Shadow::get_type(), |
| 230 | [ |
| 231 | 'name' => 'ekit_weform_field_focus_box_shadow', |
| 232 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:focus:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea:focus', |
| 233 | ] |
| 234 | ); |
| 235 | |
| 236 | $this->add_control( |
| 237 | 'ekit_weform_field_focus_bg_color', |
| 238 | [ |
| 239 | 'label' => __( 'Background Color', 'elementskit-lite' ), |
| 240 | 'type' => Controls_Manager::COLOR, |
| 241 | 'selectors' => [ |
| 242 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields input:focus:not(.weforms_submit_btn), {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-fields textarea:focus' => 'background-color: {{VALUE}}', |
| 243 | ], |
| 244 | ] |
| 245 | ); |
| 246 | |
| 247 | $this->end_controls_tab(); |
| 248 | $this->end_controls_tabs(); |
| 249 | |
| 250 | $this->end_controls_section(); |
| 251 | |
| 252 | |
| 253 | $this->start_controls_section( |
| 254 | 'ekit_weform_form-label', |
| 255 | [ |
| 256 | 'label' => __( 'Label', 'elementskit-lite' ), |
| 257 | 'tab' => Controls_Manager::TAB_STYLE, |
| 258 | ] |
| 259 | ); |
| 260 | |
| 261 | $this->add_responsive_control( |
| 262 | 'ekit_weform_label_margin', |
| 263 | [ |
| 264 | 'label' => __( 'Margin', 'elementskit-lite' ), |
| 265 | 'type' => Controls_Manager::DIMENSIONS, |
| 266 | 'size_units' => [ 'px', '%' ], |
| 267 | 'selectors' => [ |
| 268 | '{{WRAPPER}} ul.wpuf-form.form-label-above li .wpuf-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 269 | ], |
| 270 | ] |
| 271 | ); |
| 272 | |
| 273 | $this->add_responsive_control( |
| 274 | 'ekit_weform_label_padding', |
| 275 | [ |
| 276 | 'label' => __( 'Padding', 'elementskit-lite' ), |
| 277 | 'type' => Controls_Manager::DIMENSIONS, |
| 278 | 'size_units' => [ 'px', 'em', '%' ], |
| 279 | 'selectors' => [ |
| 280 | '{{WRAPPER}} ul.wpuf-form.form-label-above li .wpuf-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 281 | ], |
| 282 | ] |
| 283 | ); |
| 284 | |
| 285 | $this->add_control( |
| 286 | 'ekit_weform_hr3', |
| 287 | [ |
| 288 | 'type' => Controls_Manager::DIVIDER, |
| 289 | 'style' => 'thick', |
| 290 | ] |
| 291 | ); |
| 292 | |
| 293 | $this->add_group_control( |
| 294 | Group_Control_Typography::get_type(), |
| 295 | [ |
| 296 | 'name' => 'ekit_weform_label_typography', |
| 297 | 'label' => __( 'Label Typography', 'elementskit-lite' ), |
| 298 | 'selector' => '{{WRAPPER}} .wpuf-label label, {{WRAPPER}} .wpuf-form-sub-label', |
| 299 | ] |
| 300 | ); |
| 301 | |
| 302 | $this->add_group_control( |
| 303 | Group_Control_Typography::get_type(), |
| 304 | [ |
| 305 | 'name' => 'ekit_weform_desc_typography', |
| 306 | 'label' => __( 'Help Text Typography', 'elementskit-lite' ), |
| 307 | 'selector' => '{{WRAPPER}} .wpuf-fields .wpuf-help', |
| 308 | ] |
| 309 | ); |
| 310 | |
| 311 | $this->add_control( |
| 312 | 'ekit_weform_label_color', |
| 313 | [ |
| 314 | 'label' => __( 'Label Text Color', 'elementskit-lite' ), |
| 315 | 'type' => Controls_Manager::COLOR, |
| 316 | 'selectors' => [ |
| 317 | '{{WRAPPER}} .wpuf-label label, {{WRAPPER}} .wpuf-form-sub-label' => 'color: {{VALUE}}', |
| 318 | ], |
| 319 | ] |
| 320 | ); |
| 321 | |
| 322 | $this->add_control( |
| 323 | 'ekit_weform_requered_label', |
| 324 | [ |
| 325 | 'label' => __( 'Required Label Color', 'elementskit-lite' ), |
| 326 | 'type' => Controls_Manager::COLOR, |
| 327 | 'selectors' => [ |
| 328 | '{{WRAPPER}} .wpuf-label .required' => 'color: {{VALUE}} !important', |
| 329 | ], |
| 330 | ] |
| 331 | ); |
| 332 | |
| 333 | $this->add_control( |
| 334 | 'ekit_weform_desc_color', |
| 335 | [ |
| 336 | 'label' => __( 'Help Text Color', 'elementskit-lite' ), |
| 337 | 'type' => Controls_Manager::COLOR, |
| 338 | 'selectors' => [ |
| 339 | '{{WRAPPER}} .wpuf-fields .wpuf-help' => 'color: {{VALUE}}', |
| 340 | ], |
| 341 | ] |
| 342 | ); |
| 343 | |
| 344 | $this->end_controls_section(); |
| 345 | |
| 346 | $this->start_controls_section( |
| 347 | 'ekit_weform_submit', |
| 348 | [ |
| 349 | 'label' => __( 'Button', 'elementskit-lite' ), |
| 350 | 'tab' => Controls_Manager::TAB_STYLE, |
| 351 | ] |
| 352 | ); |
| 353 | |
| 354 | $this->add_control( |
| 355 | 'ekit_weform_submit_btn_width', |
| 356 | [ |
| 357 | 'label' => __( 'Button Full Width?', 'elementskit-lite' ), |
| 358 | 'type' => Controls_Manager::SWITCHER, |
| 359 | 'label_on' => __( 'Yes', 'elementskit-lite' ), |
| 360 | 'label_off' => __( 'No', 'elementskit-lite' ), |
| 361 | 'return_value' => 'yes', |
| 362 | 'default' => 'yes', |
| 363 | ] |
| 364 | ); |
| 365 | |
| 366 | $this->add_responsive_control( |
| 367 | 'ekit_weform_button_width', |
| 368 | [ |
| 369 | 'label' => __( 'Button Width', 'elementskit-lite' ), |
| 370 | 'type' => Controls_Manager::SLIDER, |
| 371 | 'size_units' => [ 'px', '%' ], |
| 372 | 'condition' => [ |
| 373 | 'ekit_weform_submit_btn_width' => 'yes' |
| 374 | ], |
| 375 | 'default' => [ |
| 376 | 'unit' => '%', |
| 377 | 'size' => 100 |
| 378 | ], |
| 379 | 'range' => [ |
| 380 | '%' => [ |
| 381 | 'min' => 1, |
| 382 | 'max' => 100, |
| 383 | ], |
| 384 | 'px' => [ |
| 385 | 'min' => 1, |
| 386 | 'max' => 800, |
| 387 | ], |
| 388 | ], |
| 389 | 'selectors' => [ |
| 390 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit .weforms_submit_btn' => 'display: block; width: {{SIZE}}{{UNIT}};', |
| 391 | ], |
| 392 | ] |
| 393 | ); |
| 394 | |
| 395 | $this->add_responsive_control( |
| 396 | 'ekit_weform_submit_btn_position', |
| 397 | [ |
| 398 | 'label' => __( 'Button Position', 'elementskit-lite' ), |
| 399 | 'type' => Controls_Manager::CHOOSE, |
| 400 | 'options' => [ |
| 401 | 'left' => [ |
| 402 | 'title' => __( 'Left', 'elementskit-lite' ), |
| 403 | 'icon' => 'eicon-h-align-left', |
| 404 | ], |
| 405 | 'center' => [ |
| 406 | 'title' => __( 'Center', 'elementskit-lite' ), |
| 407 | 'icon' => 'eicon-h-align-center', |
| 408 | ], |
| 409 | 'right' => [ |
| 410 | 'title' => __( 'Right', 'elementskit-lite' ), |
| 411 | 'icon' => 'eicon-h-align-right', |
| 412 | ], |
| 413 | ], |
| 414 | 'condition' => [ |
| 415 | 'ekit_weform_submit_btn_width' => '' |
| 416 | ], |
| 417 | 'desktop_default' => 'left', |
| 418 | 'toggle' => false, |
| 419 | 'selectors' => [ |
| 420 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit' => 'text-align: {{Value}};', |
| 421 | ], |
| 422 | ] |
| 423 | ); |
| 424 | |
| 425 | $this->add_responsive_control( |
| 426 | 'ekit_weform_submit_margin', |
| 427 | [ |
| 428 | 'label' => __( 'Margin', 'elementskit-lite' ), |
| 429 | 'type' => Controls_Manager::DIMENSIONS, |
| 430 | 'size_units' => [ 'px', '%' ], |
| 431 | 'selectors' => [ |
| 432 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 433 | ], |
| 434 | ] |
| 435 | ); |
| 436 | |
| 437 | $this->add_responsive_control( |
| 438 | 'ekit_weform_submit_padding', |
| 439 | [ |
| 440 | 'label' => __( 'Padding', 'elementskit-lite' ), |
| 441 | 'type' => Controls_Manager::DIMENSIONS, |
| 442 | 'size_units' => [ 'px', 'em', '%' ], |
| 443 | 'selectors' => [ |
| 444 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 445 | ], |
| 446 | ] |
| 447 | ); |
| 448 | |
| 449 | $this->add_group_control( |
| 450 | Group_Control_Typography::get_type(), |
| 451 | [ |
| 452 | 'name' => 'ekit_weform_submit_typography', |
| 453 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]', |
| 454 | ] |
| 455 | ); |
| 456 | |
| 457 | $this->add_group_control( |
| 458 | Group_Control_Border::get_type(), |
| 459 | [ |
| 460 | 'name' => 'ekit_weform_submit_border', |
| 461 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]', |
| 462 | ] |
| 463 | ); |
| 464 | |
| 465 | $this->add_control( |
| 466 | 'ekit_weform_submit_border_radius', |
| 467 | [ |
| 468 | 'label' => __( 'Border Radius', 'elementskit-lite' ), |
| 469 | 'type' => Controls_Manager::DIMENSIONS, |
| 470 | 'size_units' => [ 'px', '%' ], |
| 471 | 'selectors' => [ |
| 472 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 473 | ], |
| 474 | ] |
| 475 | ); |
| 476 | |
| 477 | $this->add_group_control( |
| 478 | Group_Control_Box_Shadow::get_type(), |
| 479 | [ |
| 480 | 'name' => 'ekit_weform_submit_box_shadow', |
| 481 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]', |
| 482 | ] |
| 483 | ); |
| 484 | |
| 485 | $this->add_group_control( |
| 486 | Group_Control_Text_Shadow::get_type(), |
| 487 | [ |
| 488 | 'name' => 'ekit_weform_submit_text_shadow', |
| 489 | 'selector' => '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]', |
| 490 | ] |
| 491 | ); |
| 492 | |
| 493 | $this->add_control( |
| 494 | 'ekit_weform_hr4', |
| 495 | [ |
| 496 | 'type' => Controls_Manager::DIVIDER, |
| 497 | 'style' => 'thick', |
| 498 | ] |
| 499 | ); |
| 500 | |
| 501 | $this->start_controls_tabs( 'ekit_weform_tabs_button_style' ); |
| 502 | |
| 503 | $this->start_controls_tab( |
| 504 | 'ekit_weform_tab_button_normal', |
| 505 | [ |
| 506 | 'label' => __( 'Normal', 'elementskit-lite' ), |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_control( |
| 511 | 'ekit_weform_submit_color', |
| 512 | [ |
| 513 | 'label' => __( 'Text Color', 'elementskit-lite' ), |
| 514 | 'type' => Controls_Manager::COLOR, |
| 515 | 'default' => '', |
| 516 | 'selectors' => [ |
| 517 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]' => 'color: {{VALUE}};', |
| 518 | ], |
| 519 | ] |
| 520 | ); |
| 521 | |
| 522 | $this->add_control( |
| 523 | 'ekit_weform_submit_bg_color', |
| 524 | [ |
| 525 | 'label' => __( 'Background Color', 'elementskit-lite' ), |
| 526 | 'type' => Controls_Manager::COLOR, |
| 527 | 'selectors' => [ |
| 528 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]' => 'background-color: {{VALUE}};', |
| 529 | ], |
| 530 | ] |
| 531 | ); |
| 532 | |
| 533 | $this->end_controls_tab(); |
| 534 | |
| 535 | $this->start_controls_tab( |
| 536 | 'ekit_weform_tab_button_hover', |
| 537 | [ |
| 538 | 'label' => __( 'Hover', 'elementskit-lite' ), |
| 539 | ] |
| 540 | ); |
| 541 | |
| 542 | $this->add_control( |
| 543 | 'ekit_weform_submit_hover_color', |
| 544 | [ |
| 545 | 'label' => __( 'Text Color', 'elementskit-lite' ), |
| 546 | 'type' => Controls_Manager::COLOR, |
| 547 | 'selectors' => [ |
| 548 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:hover, {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:focus' => 'color: {{VALUE}};', |
| 549 | ], |
| 550 | ] |
| 551 | ); |
| 552 | |
| 553 | $this->add_control( |
| 554 | 'ekit_weform_submit_hover_bg_color', |
| 555 | [ |
| 556 | 'label' => __( 'Background Color', 'elementskit-lite' ), |
| 557 | 'type' => Controls_Manager::COLOR, |
| 558 | 'selectors' => [ |
| 559 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:hover, {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:focus' => 'background-color: {{VALUE}};', |
| 560 | ], |
| 561 | ] |
| 562 | ); |
| 563 | |
| 564 | $this->add_control( |
| 565 | 'ekit_weform_submit_hover_border_color', |
| 566 | [ |
| 567 | 'label' => __( 'Border Color', 'elementskit-lite' ), |
| 568 | 'type' => Controls_Manager::COLOR, |
| 569 | 'selectors' => [ |
| 570 | '{{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:hover, {{WRAPPER}} .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit]:focus' => 'border-color: {{VALUE}};', |
| 571 | ], |
| 572 | ] |
| 573 | ); |
| 574 | |
| 575 | $this->end_controls_tab(); |
| 576 | $this->end_controls_tabs(); |
| 577 | |
| 578 | $this->end_controls_section(); |
| 579 | |
| 580 | $this->insert_pro_message(); |
| 581 | } |
| 582 | |
| 583 | protected function render( ) { |
| 584 | $settings = $this->get_settings(); |
| 585 | |
| 586 | if ( ! empty( $settings['ekit_weform_form_id'] ) ) { |
| 587 | echo do_shortcode('[weforms id="'.intval($settings['ekit_weform_form_id']).'"]' ); |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 |