contact-form7.php
891 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | use \Elementor\ElementsKit_Widget_Contact_Form7_Handler as Handler; |
| 5 | |
| 6 | if (! defined( 'ABSPATH' ) ) exit; |
| 7 | |
| 8 | class ElementsKit_Widget_Contact_Form7 extends Widget_Base { |
| 9 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 10 | |
| 11 | public $base; |
| 12 | |
| 13 | public function get_name() { |
| 14 | return Handler::get_name(); |
| 15 | } |
| 16 | |
| 17 | public function get_title() { |
| 18 | return Handler::get_title(); |
| 19 | } |
| 20 | |
| 21 | public function get_icon() { |
| 22 | return Handler::get_icon(); |
| 23 | } |
| 24 | |
| 25 | public function get_categories() { |
| 26 | return Handler::get_categories(); |
| 27 | } |
| 28 | |
| 29 | public function get_keywords() { |
| 30 | return Handler::get_keywords(); |
| 31 | } |
| 32 | |
| 33 | public function get_help_url() { |
| 34 | return 'https://wpmet.com/doc/contact-form-7/'; |
| 35 | } |
| 36 | |
| 37 | function ekit_cf7form() { |
| 38 | $wpcf7_form_list = get_posts( array( |
| 39 | 'post_type' => 'wpcf7_contact_form', |
| 40 | 'showposts' => 999, |
| 41 | ) ); |
| 42 | $posts = array(); |
| 43 | if ( !empty( $wpcf7_form_list ) && !is_wp_error( $wpcf7_form_list ) ) { |
| 44 | foreach ( $wpcf7_form_list as $post ) { |
| 45 | $options[ $post->ID ] = $post->post_title; |
| 46 | } |
| 47 | return $options; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | protected function register_controls() { |
| 52 | $this->start_controls_section( |
| 53 | 'section_tab', [ |
| 54 | 'label' =>esc_html__( 'Contact Form 7', 'elementskit-lite' ), |
| 55 | ] |
| 56 | ); |
| 57 | |
| 58 | |
| 59 | |
| 60 | $this->add_control( |
| 61 | 'ekit_contact_form7', |
| 62 | [ |
| 63 | 'label' =>esc_html__( 'Style', 'elementskit-lite' ), |
| 64 | 'type' => Controls_Manager::SELECT, |
| 65 | 'default' => 'accoedion-primary', |
| 66 | 'options' => $this->ekit_cf7form() |
| 67 | ] |
| 68 | ); |
| 69 | |
| 70 | $this->end_controls_section(); |
| 71 | |
| 72 | // label |
| 73 | $this->start_controls_section( |
| 74 | 'ekit_contact_form_input_label_style', |
| 75 | [ |
| 76 | 'label' => esc_html__( 'Label', 'elementskit-lite' ), |
| 77 | 'tab' => Controls_Manager::TAB_STYLE, |
| 78 | ] |
| 79 | ); |
| 80 | |
| 81 | $this->add_group_control( |
| 82 | Group_Control_Typography::get_type(), |
| 83 | [ |
| 84 | 'name' => 'ekit_contact_form_input_label_typography', |
| 85 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 86 | 'selector' => '{{WRAPPER}} .ekit-form form label', |
| 87 | ] |
| 88 | ); |
| 89 | |
| 90 | $this->add_responsive_control( |
| 91 | 'ekit_contact_form_input_label_color', |
| 92 | [ |
| 93 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 94 | 'type' => Controls_Manager::COLOR, |
| 95 | 'default' => '#000000', |
| 96 | 'selectors' => [ |
| 97 | '{{WRAPPER}} .ekit-form form label' => 'color: {{VALUE}}', |
| 98 | ], |
| 99 | ] |
| 100 | ); |
| 101 | |
| 102 | $this->add_responsive_control( |
| 103 | 'ekit_contact_form_input_label_margin', |
| 104 | [ |
| 105 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 106 | 'type' => Controls_Manager::DIMENSIONS, |
| 107 | 'size_units' => [ 'px', '%', 'em' ], |
| 108 | 'selectors' => [ |
| 109 | '{{WRAPPER}} .ekit-form form label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 110 | ], |
| 111 | ] |
| 112 | ); |
| 113 | |
| 114 | $this->add_control( |
| 115 | 'ekit_contact_form_input_label_hint_heading', |
| 116 | [ |
| 117 | 'label' => esc_html__( 'Hint', 'elementskit-lite' ), |
| 118 | 'type' => Controls_Manager::HEADING, |
| 119 | 'separator' => 'before', |
| 120 | ] |
| 121 | ); |
| 122 | |
| 123 | $this->add_group_control( |
| 124 | Group_Control_Typography::get_type(), |
| 125 | [ |
| 126 | 'name' => 'ekit_contact_form_input_label_hint_typography', |
| 127 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 128 | 'selector' => '{{WRAPPER}} .ekit-form form label span', |
| 129 | ] |
| 130 | ); |
| 131 | |
| 132 | $this->add_responsive_control( |
| 133 | 'ekit_contact_form_input_label_hint_color', |
| 134 | [ |
| 135 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 136 | 'type' => Controls_Manager::COLOR, |
| 137 | 'default' => '#777777', |
| 138 | 'selectors' => [ |
| 139 | '{{WRAPPER}} .ekit-form form label span' => 'color: {{VALUE}}', |
| 140 | ], |
| 141 | ] |
| 142 | ); |
| 143 | |
| 144 | $this->end_controls_section(); |
| 145 | |
| 146 | // input style |
| 147 | $this->start_controls_section( |
| 148 | 'ekit_contact_form_input_style', |
| 149 | [ |
| 150 | 'label' => esc_html__( 'Input', 'elementskit-lite' ), |
| 151 | 'tab' => Controls_Manager::TAB_STYLE, |
| 152 | ] |
| 153 | ); |
| 154 | |
| 155 | $this->add_responsive_control( |
| 156 | 'ekit_contact_form_input_style_padding', |
| 157 | [ |
| 158 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 159 | 'type' => Controls_Manager::DIMENSIONS, |
| 160 | 'size_units' => [ 'px', '%', 'em' ], |
| 161 | 'selectors' => [ |
| 162 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 163 | ], |
| 164 | ] |
| 165 | ); |
| 166 | |
| 167 | $this->add_responsive_control( |
| 168 | 'ekit_contact_form_input_style_width', |
| 169 | [ |
| 170 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 171 | 'type' => Controls_Manager::SLIDER, |
| 172 | 'size_units' => [ 'px', '%' ], |
| 173 | 'range' => [ |
| 174 | 'px' => [ |
| 175 | 'min' => 0, |
| 176 | 'max' => 1000, |
| 177 | 'step' => 5, |
| 178 | ], |
| 179 | '%' => [ |
| 180 | 'min' => 0, |
| 181 | 'max' => 100, |
| 182 | ], |
| 183 | ], |
| 184 | 'default' => [ |
| 185 | 'unit' => '%', |
| 186 | 'size' => 100, |
| 187 | ], |
| 188 | 'selectors' => [ |
| 189 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form select' => 'width: {{SIZE}}{{UNIT}};', |
| 190 | '{{WRAPPER}} .ekit-form form textarea' => 'width: {{SIZE}}{{UNIT}};', |
| 191 | ], |
| 192 | ] |
| 193 | ); |
| 194 | |
| 195 | $this->add_responsive_control( |
| 196 | 'ekit_contact_form_input_style_height', |
| 197 | [ |
| 198 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 199 | 'type' => Controls_Manager::SLIDER, |
| 200 | 'size_units' => [ 'px' ], |
| 201 | 'range' => [ |
| 202 | 'px' => [ |
| 203 | 'min' => 0, |
| 204 | 'max' => 200, |
| 205 | 'step' => 1, |
| 206 | ], |
| 207 | ], |
| 208 | 'default' => [ |
| 209 | 'unit' => 'px', |
| 210 | 'size' => 50, |
| 211 | ], |
| 212 | 'selectors' => [ |
| 213 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form select' => 'height: {{SIZE}}px;', |
| 214 | '{{WRAPPER}} .ekit-form form textarea' => 'height: {{SIZE}}px;', |
| 215 | ], |
| 216 | ] |
| 217 | ); |
| 218 | |
| 219 | $this->add_responsive_control( |
| 220 | 'ekit_contact_form_input_style_margin_bottom', |
| 221 | [ |
| 222 | 'label' => esc_html__( 'Margin Bottom', 'elementskit-lite' ), |
| 223 | 'type' => Controls_Manager::SLIDER, |
| 224 | 'size_units' => [ 'px' ], |
| 225 | 'range' => [ |
| 226 | 'px' => [ |
| 227 | 'min' => 0, |
| 228 | 'max' => 100, |
| 229 | 'step' => 1, |
| 230 | ], |
| 231 | ], |
| 232 | 'default' => [ |
| 233 | 'unit' => 'px', |
| 234 | 'size' => 20, |
| 235 | ], |
| 236 | 'selectors' => [ |
| 237 | '{{WRAPPER}} .ekit-form form .ekit-form-input, {{WRAPPER}} .ekit-form form select, {{WRAPPER}} .ekit-form form input' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 238 | '{{WRAPPER}} .ekit-form form textarea' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 239 | ], |
| 240 | ] |
| 241 | ); |
| 242 | |
| 243 | $this->add_control( |
| 244 | 'ekit_contact_form_input_style_textarea_heading', |
| 245 | [ |
| 246 | 'label' => esc_html__( 'Textarea', 'elementskit-lite' ), |
| 247 | 'type' => Controls_Manager::HEADING, |
| 248 | 'separator' => 'before', |
| 249 | ] |
| 250 | ); |
| 251 | |
| 252 | $this->add_responsive_control( |
| 253 | 'ekit_contact_form_input_style_textarea_height', |
| 254 | [ |
| 255 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 256 | 'type' => Controls_Manager::SLIDER, |
| 257 | 'size_units' => [ 'px', '%' ], |
| 258 | 'range' => [ |
| 259 | 'px' => [ |
| 260 | 'min' => 176, |
| 261 | 'max' => 300, |
| 262 | 'step' => 1, |
| 263 | ], |
| 264 | '%' => [ |
| 265 | 'min' => 0, |
| 266 | 'max' => 100, |
| 267 | ], |
| 268 | ], |
| 269 | 'default' => [ |
| 270 | 'unit' => 'px', |
| 271 | 'size' => 176, |
| 272 | ], |
| 273 | 'selectors' => [ |
| 274 | '{{WRAPPER}} .ekit-form form textarea' => 'height: {{SIZE}}{{UNIT}};', |
| 275 | ], |
| 276 | ] |
| 277 | ); |
| 278 | |
| 279 | $this->add_responsive_control( |
| 280 | 'ekit_contact_form_input_style_padding_textarea', |
| 281 | [ |
| 282 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 283 | 'type' => Controls_Manager::DIMENSIONS, |
| 284 | 'size_units' => [ 'px', '%', 'em' ], |
| 285 | 'selectors' => [ |
| 286 | '{{WRAPPER}} .ekit-form form textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 287 | ], |
| 288 | ] |
| 289 | ); |
| 290 | |
| 291 | $this->add_control( |
| 292 | 'ekit_contact_form_input_style_padding_textarea_hr', |
| 293 | [ |
| 294 | 'type' => Controls_Manager::DIVIDER, |
| 295 | ] |
| 296 | ); |
| 297 | |
| 298 | $this->start_controls_tabs( |
| 299 | 'ekit_contact_form_input_normal_and_hover_tabs' |
| 300 | ); |
| 301 | $this->start_controls_tab( |
| 302 | 'ekit_contact_form_input_normal_tab', |
| 303 | [ |
| 304 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 305 | ] |
| 306 | ); |
| 307 | |
| 308 | $this->add_group_control( |
| 309 | Group_Control_Background::get_type(), |
| 310 | [ |
| 311 | 'name' => 'ekit_contact_form_input_style_background', |
| 312 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 313 | 'types' => [ 'classic', 'gradient' ], |
| 314 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]) ,{{WRAPPER}} .ekit-form form textarea, {{WRAPPER}} .ekit-form form select', |
| 315 | 'exclude' => [ |
| 316 | 'image' |
| 317 | ] |
| 318 | ] |
| 319 | ); |
| 320 | |
| 321 | $this->add_responsive_control( |
| 322 | 'ekit_contact_form_input_style_radius', |
| 323 | [ |
| 324 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 325 | 'type' => Controls_Manager::DIMENSIONS, |
| 326 | 'size_units' => [ 'px', '%' ], |
| 327 | 'selectors' => [ |
| 328 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 329 | '{{WRAPPER}} .ekit-form form textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 330 | ], |
| 331 | ] |
| 332 | ); |
| 333 | |
| 334 | $this->add_group_control( |
| 335 | Group_Control_Border::get_type(), |
| 336 | [ |
| 337 | 'name' => 'ekit_contact_form_input_style_border', |
| 338 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 339 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form textarea, {{WRAPPER}} .ekit-form form select', |
| 340 | ] |
| 341 | ); |
| 342 | |
| 343 | $this->add_group_control( |
| 344 | Group_Control_Box_Shadow::get_type(), |
| 345 | [ |
| 346 | 'name' => 'ekit_contact_form_input_style_box_shadow', |
| 347 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 348 | 'selector' => ' |
| 349 | {{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), |
| 350 | {{WRAPPER}} .ekit-form form textarea, {{WRAPPER}} .ekit-form form select' |
| 351 | , |
| 352 | ] |
| 353 | ); |
| 354 | |
| 355 | $this->end_controls_tab(); |
| 356 | $this->start_controls_tab( |
| 357 | 'ekit_contact_form_input_hover_tab', |
| 358 | [ |
| 359 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 360 | ] |
| 361 | ); |
| 362 | |
| 363 | $this->add_group_control( |
| 364 | Group_Control_Background::get_type(), |
| 365 | [ |
| 366 | 'name' => 'ekit_contact_form_input_hover_style_background', |
| 367 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 368 | 'types' => [ 'classic', 'gradient' ], |
| 369 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):hover ,{{WRAPPER}} .ekit-form form textarea:hover, {{WRAPPER}} .ekit-form form select:hover', |
| 370 | 'exclude' => [ |
| 371 | 'image' |
| 372 | ] |
| 373 | ] |
| 374 | ); |
| 375 | |
| 376 | $this->add_responsive_control( |
| 377 | 'ekit_contact_form_input_hover_style_radius', |
| 378 | [ |
| 379 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 380 | 'type' => Controls_Manager::DIMENSIONS, |
| 381 | 'size_units' => [ 'px', '%' ], |
| 382 | 'selectors' => [ |
| 383 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):hover, {{WRAPPER}} .ekit-form form select:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 384 | '{{WRAPPER}} .ekit-form form textarea:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 385 | ], |
| 386 | ] |
| 387 | ); |
| 388 | |
| 389 | $this->add_group_control( |
| 390 | Group_Control_Border::get_type(), |
| 391 | [ |
| 392 | 'name' => 'ekit_contact_form_input_hover_style_border', |
| 393 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 394 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):hover, {{WRAPPER}} .ekit-form form textarea:hover, {{WRAPPER}} .ekit-form form select:hover', |
| 395 | ] |
| 396 | ); |
| 397 | |
| 398 | $this->add_group_control( |
| 399 | Group_Control_Box_Shadow::get_type(), |
| 400 | [ |
| 401 | 'name' => 'ekit_contact_form_input_hover_style_box_shadow', |
| 402 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 403 | 'selector' => ' |
| 404 | {{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):hover, |
| 405 | {{WRAPPER}} .ekit-form form textarea:hover, {{WRAPPER}} .ekit-form form select:hover' |
| 406 | , |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $this->end_controls_tab(); |
| 411 | $this->start_controls_tab( |
| 412 | 'ekit_contact_form_input_focus_tab', |
| 413 | [ |
| 414 | 'label' => esc_html__( 'Focus', 'elementskit-lite' ), |
| 415 | ] |
| 416 | ); |
| 417 | |
| 418 | $this->add_group_control( |
| 419 | Group_Control_Background::get_type(), |
| 420 | [ |
| 421 | 'name' => 'ekit_contact_form_input_focus_style_background', |
| 422 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 423 | 'types' => [ 'classic', 'gradient' ], |
| 424 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):focus ,{{WRAPPER}} .ekit-form form textarea:focus, {{WRAPPER}} .ekit-form form select:focus', |
| 425 | 'exclude' => [ |
| 426 | 'image' |
| 427 | ] |
| 428 | ] |
| 429 | ); |
| 430 | |
| 431 | $this->add_responsive_control( |
| 432 | 'ekit_contact_form_input_focus_style_radius', |
| 433 | [ |
| 434 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 435 | 'type' => Controls_Manager::DIMENSIONS, |
| 436 | 'size_units' => [ 'px', '%' ], |
| 437 | 'selectors' => [ |
| 438 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):focus, {{WRAPPER}} .ekit-form form select:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 439 | '{{WRAPPER}} .ekit-form form textarea:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 440 | ], |
| 441 | ] |
| 442 | ); |
| 443 | |
| 444 | $this->add_group_control( |
| 445 | Group_Control_Border::get_type(), |
| 446 | [ |
| 447 | 'name' => 'ekit_contact_form_input_focus_style_border', |
| 448 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 449 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):focus, {{WRAPPER}} .ekit-form form textarea:focus, {{WRAPPER}} .ekit-form form select:focus', |
| 450 | ] |
| 451 | ); |
| 452 | |
| 453 | $this->add_group_control( |
| 454 | Group_Control_Box_Shadow::get_type(), |
| 455 | [ |
| 456 | 'name' => 'ekit_contact_form_input_focus_style_box_shadow', |
| 457 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 458 | 'selector' => ' |
| 459 | {{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):focus, |
| 460 | {{WRAPPER}} .ekit-form form textarea:focus, {{WRAPPER}} .ekit-form form select:focus' |
| 461 | , |
| 462 | ] |
| 463 | ); |
| 464 | |
| 465 | $this->end_controls_tab(); |
| 466 | |
| 467 | $this->end_controls_tabs(); |
| 468 | |
| 469 | $this->add_control( |
| 470 | 'ekit_contact_form_input_style_typography_heading', |
| 471 | [ |
| 472 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 473 | 'type' => Controls_Manager::HEADING, |
| 474 | 'separator' => 'before', |
| 475 | ] |
| 476 | ); |
| 477 | |
| 478 | $this->add_group_control( |
| 479 | Group_Control_Typography::get_type(), |
| 480 | [ |
| 481 | 'name' => 'ekit_contact_form_input_typography', |
| 482 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 483 | 'selector' => '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), .wpcf7-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), .wpcf7-form textarea, .ekit-wid-con .ekit-form form textarea, {{WRAPPER}} .ekit-form form select', |
| 484 | ] |
| 485 | ); |
| 486 | |
| 487 | $this->add_responsive_control( |
| 488 | 'ekit_contact_form_input_style_font_color', |
| 489 | [ |
| 490 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 491 | 'type' => Controls_Manager::COLOR, |
| 492 | 'default' => '#000000', |
| 493 | 'selectors' => [ |
| 494 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), {{WRAPPER}} .ekit-form form select' => 'color: {{VALUE}}', |
| 495 | '{{WRAPPER}} .wpcf7-form textarea' => 'color: {{VALUE}}', |
| 496 | '{{WRAPPER}} ..ekit-wid-con .ekit-form form textarea' => 'color: {{VALUE}}', |
| 497 | ], |
| 498 | ] |
| 499 | ); |
| 500 | |
| 501 | $this->add_control( |
| 502 | 'ekit_contact_form_input_style_placeholder_heading', |
| 503 | [ |
| 504 | 'label' => esc_html__( 'Placeholder', 'elementskit-lite' ), |
| 505 | 'type' => Controls_Manager::HEADING, |
| 506 | 'separator' => 'before', |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_responsive_control( |
| 511 | 'ekit_contact_form_input_style_placeholder_font_size', |
| 512 | [ |
| 513 | 'label' => esc_html__( 'Font Size', 'elementskit-lite' ), |
| 514 | 'type' => Controls_Manager::SLIDER, |
| 515 | 'size_units' => [ 'px' ], |
| 516 | 'range' => [ |
| 517 | 'px' => [ |
| 518 | 'min' => 0, |
| 519 | 'max' => 100, |
| 520 | 'step' => 1, |
| 521 | ], |
| 522 | ], |
| 523 | 'default' => [ |
| 524 | 'unit' => 'px', |
| 525 | 'size' => 14, |
| 526 | ], |
| 527 | 'selectors' => [ |
| 528 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-webkit-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 529 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 530 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-ms-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 531 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 532 | |
| 533 | '{{WRAPPER}} .ekit-form form textarea::-webkit-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 534 | '{{WRAPPER}} .ekit-form form textarea::-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 535 | '{{WRAPPER}} .ekit-form form textarea:-ms-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 536 | '{{WRAPPER}} .ekit-form form textarea:-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};', |
| 537 | ], |
| 538 | ] |
| 539 | ); |
| 540 | $this->add_responsive_control( |
| 541 | 'ekit_contact_form_input_placeholder_font_color', |
| 542 | [ |
| 543 | 'label' => esc_html__( 'Placeholder Color', 'elementskit-lite' ), |
| 544 | 'type' => Controls_Manager::COLOR, |
| 545 | 'default' => '#000000', |
| 546 | 'selectors' => [ |
| 547 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-webkit-input-placeholder' => 'color: {{VALUE}}', |
| 548 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-moz-placeholder' => 'color: {{VALUE}}', |
| 549 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-ms-input-placeholder' => 'color: {{VALUE}}', |
| 550 | '{{WRAPPER}} .ekit-form form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-moz-placeholder' => 'color: {{VALUE}}', |
| 551 | |
| 552 | '{{WRAPPER}} .ekit-form form textarea::-webkit-input-placeholder' => 'color: {{VALUE}}', |
| 553 | '{{WRAPPER}} .ekit-form form textarea::-moz-placeholder' => 'color: {{VALUE}}', |
| 554 | '{{WRAPPER}} .ekit-form form textarea:-ms-input-placeholder' => 'color: {{VALUE}}', |
| 555 | '{{WRAPPER}} .ekit-form form textarea:-moz-placeholder' => 'color: {{VALUE}}', |
| 556 | ], |
| 557 | ] |
| 558 | ); |
| 559 | |
| 560 | |
| 561 | $this->end_controls_section(); |
| 562 | |
| 563 | |
| 564 | |
| 565 | $this->start_controls_section( |
| 566 | 'ekit_contact_form_button_style_holder', |
| 567 | [ |
| 568 | 'label' => esc_html__( 'Button', 'elementskit-lite' ), |
| 569 | 'tab' => Controls_Manager::TAB_STYLE, |
| 570 | ] |
| 571 | ); |
| 572 | |
| 573 | $this->add_responsive_control( |
| 574 | 'ekit_contact_form_button_alignment', |
| 575 | [ |
| 576 | 'label' => esc_html__( 'Alignment', 'elementskit-lite' ), |
| 577 | 'type' => Controls_Manager::CHOOSE, |
| 578 | 'options' => [ |
| 579 | 'left' => [ |
| 580 | 'title' => esc_html__( 'Left', 'elementskit-lite' ), |
| 581 | 'icon' => 'eicon-text-align-left', |
| 582 | ], |
| 583 | 'center' => [ |
| 584 | 'title' => esc_html__( 'Center', 'elementskit-lite' ), |
| 585 | 'icon' => 'eicon-text-align-center', |
| 586 | ], |
| 587 | 'right' => [ |
| 588 | 'title' => esc_html__( 'Right', 'elementskit-lite' ), |
| 589 | 'icon' => 'eicon-text-align-right', |
| 590 | ], |
| 591 | ], |
| 592 | 'default' => 'left', |
| 593 | 'selectors'=> [ |
| 594 | '{{WRAPPER}} .ekit-form form > p' => 'text-align: {{VALUE}};', |
| 595 | ], |
| 596 | ] |
| 597 | ); |
| 598 | |
| 599 | $this->add_group_control( |
| 600 | Group_Control_Typography::get_type(), |
| 601 | [ |
| 602 | 'name' => 'ekit_contact_form_button_typography', |
| 603 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 604 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]', |
| 605 | ] |
| 606 | ); |
| 607 | |
| 608 | $this->add_responsive_control( |
| 609 | 'ekit_contact_form_button_border_radius', |
| 610 | [ |
| 611 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 612 | 'type' => Controls_Manager::DIMENSIONS, |
| 613 | 'size_units' => [ 'px', '%', 'em' ], |
| 614 | 'selectors' => [ |
| 615 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 616 | ], |
| 617 | ] |
| 618 | ); |
| 619 | |
| 620 | $this->add_responsive_control( |
| 621 | 'ekit_contact_form_button_border_padding', |
| 622 | [ |
| 623 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 624 | 'type' => Controls_Manager::DIMENSIONS, |
| 625 | 'size_units' => [ 'px', '%', 'em' ], |
| 626 | 'selectors' => [ |
| 627 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 628 | ], |
| 629 | ] |
| 630 | ); |
| 631 | |
| 632 | $this->add_responsive_control( |
| 633 | 'ekit_contact_form_button_style_margin', |
| 634 | [ |
| 635 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 636 | 'type' => Controls_Manager::DIMENSIONS, |
| 637 | 'size_units' => [ 'px', '%', 'em' ], |
| 638 | 'selectors' => [ |
| 639 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 640 | ], |
| 641 | ] |
| 642 | ); |
| 643 | |
| 644 | |
| 645 | $this->add_control( |
| 646 | 'ekit_contact_form_button_style_use_width_height', |
| 647 | [ |
| 648 | 'label' => esc_html__( 'Use Height Width', 'elementskit-lite' ), |
| 649 | 'type' => Controls_Manager::SWITCHER, |
| 650 | 'label_on' => esc_html__( 'Show', 'elementskit-lite' ), |
| 651 | 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ), |
| 652 | 'return_value' => 'yes', |
| 653 | 'default' => 'no', |
| 654 | ] |
| 655 | ); |
| 656 | |
| 657 | $this->add_responsive_control( |
| 658 | 'ekit_contact_form_button_width', |
| 659 | [ |
| 660 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 661 | 'type' => Controls_Manager::SLIDER, |
| 662 | 'size_units' => [ 'px', '%' ], |
| 663 | 'range' => [ |
| 664 | 'px' => [ |
| 665 | 'min' => 50, |
| 666 | 'max' => 200, |
| 667 | 'step' => 1, |
| 668 | ], |
| 669 | '%' => [ |
| 670 | 'min' => 10, |
| 671 | 'max' => 100, |
| 672 | ], |
| 673 | ], |
| 674 | 'default' => [ |
| 675 | 'unit' => 'px', |
| 676 | 'size' => 50, |
| 677 | ], |
| 678 | 'selectors' => [ |
| 679 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'width: {{SIZE}}{{UNIT}};', |
| 680 | ], |
| 681 | 'condition' => [ |
| 682 | 'ekit_contact_form_button_style_use_width_height' => 'yes' |
| 683 | ] |
| 684 | ] |
| 685 | ); |
| 686 | |
| 687 | $this->add_responsive_control( |
| 688 | 'ekit_contact_form_button_style_height', |
| 689 | [ |
| 690 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 691 | 'type' => Controls_Manager::SLIDER, |
| 692 | 'size_units' => [ 'px' ], |
| 693 | 'range' => [ |
| 694 | 'px' => [ |
| 695 | 'min' => 50, |
| 696 | 'max' => 200, |
| 697 | 'step' => 1, |
| 698 | ], |
| 699 | '%' => [ |
| 700 | 'min' => 10, |
| 701 | 'max' => 100, |
| 702 | ], |
| 703 | ], |
| 704 | 'default' => [ |
| 705 | 'unit' => 'px', |
| 706 | 'size' => 50, |
| 707 | ], |
| 708 | 'selectors' => [ |
| 709 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'height: {{SIZE}}{{UNIT}};', |
| 710 | ], |
| 711 | 'condition' => [ |
| 712 | 'ekit_contact_form_button_style_use_width_height' => 'yes' |
| 713 | ] |
| 714 | ] |
| 715 | ); |
| 716 | |
| 717 | $this->add_responsive_control( |
| 718 | 'ekit_contact_form_button_style_line_height', |
| 719 | [ |
| 720 | 'label' => esc_html__( 'Line Height', 'elementskit-lite' ), |
| 721 | 'type' => Controls_Manager::SLIDER, |
| 722 | 'size_units' => [ 'px' ], |
| 723 | 'range' => [ |
| 724 | 'px' => [ |
| 725 | 'min' => 50, |
| 726 | 'max' => 200, |
| 727 | 'step' => 1, |
| 728 | ], |
| 729 | '%' => [ |
| 730 | 'min' => 10, |
| 731 | 'max' => 100, |
| 732 | ], |
| 733 | ], |
| 734 | 'default' => [ |
| 735 | 'unit' => 'px', |
| 736 | 'size' => 50, |
| 737 | ], |
| 738 | 'selectors' => [ |
| 739 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'line-height: {{SIZE}}{{UNIT}};', |
| 740 | ], |
| 741 | 'condition' => [ |
| 742 | 'ekit_contact_form_button_style_use_width_height' => 'yes' |
| 743 | ] |
| 744 | ] |
| 745 | ); |
| 746 | |
| 747 | $this->start_controls_tabs( |
| 748 | 'ekit_contact_form_button_normal_and_hover_tabs' |
| 749 | ); |
| 750 | $this->start_controls_tab( |
| 751 | 'ekit_contact_form_button_normal_tab', |
| 752 | [ |
| 753 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->add_responsive_control( |
| 758 | 'ekit_contact_form_button_color', |
| 759 | [ |
| 760 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 761 | 'type' => Controls_Manager::COLOR, |
| 762 | 'default' => '#ffffff', |
| 763 | 'selectors' => [ |
| 764 | '{{WRAPPER}} .ekit-form form input[type="submit"]' => 'color: {{VALUE}}', |
| 765 | ], |
| 766 | ] |
| 767 | ); |
| 768 | |
| 769 | $this->add_group_control( |
| 770 | Group_Control_Background::get_type(), |
| 771 | [ |
| 772 | 'name' => 'ekit_contact_form_button_background', |
| 773 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 774 | 'types' => [ 'classic', 'gradient', ], |
| 775 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]', |
| 776 | 'exclude' => [ |
| 777 | 'image' |
| 778 | ] |
| 779 | ] |
| 780 | ); |
| 781 | |
| 782 | $this->add_group_control( |
| 783 | Group_Control_Box_Shadow::get_type(), |
| 784 | [ |
| 785 | 'name' => 'ekit_contact_form_button_box_shadow', |
| 786 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 787 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]', |
| 788 | ] |
| 789 | ); |
| 790 | |
| 791 | $this->add_group_control( |
| 792 | Group_Control_Border::get_type(), |
| 793 | [ |
| 794 | 'name' => 'ekit_contact_form_button_border', |
| 795 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 796 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]', |
| 797 | ] |
| 798 | ); |
| 799 | |
| 800 | $this->add_group_control( |
| 801 | Group_Control_Text_Shadow::get_type(), |
| 802 | [ |
| 803 | 'name' => 'ekit_contact_form_button_title_shadow', |
| 804 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]' , |
| 805 | ] |
| 806 | ); |
| 807 | |
| 808 | $this->end_controls_tab(); |
| 809 | $this->start_controls_tab( |
| 810 | 'ekit_contact_form_button_hover_tab', |
| 811 | [ |
| 812 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 813 | ] |
| 814 | ); |
| 815 | |
| 816 | $this->add_responsive_control( |
| 817 | 'ekit_contact_form_button_color_hover', |
| 818 | [ |
| 819 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 820 | 'type' => Controls_Manager::COLOR, |
| 821 | 'default' => '#ffffff', |
| 822 | 'selectors' => [ |
| 823 | '{{WRAPPER}} .ekit-form form input[type="submit"]:hover' => 'color: {{VALUE}}', |
| 824 | ], |
| 825 | ] |
| 826 | ); |
| 827 | |
| 828 | $this->add_group_control( |
| 829 | Group_Control_Background::get_type(), |
| 830 | [ |
| 831 | 'name' => 'ekit_contact_form_button_hover_background', |
| 832 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 833 | 'types' => [ 'classic', 'gradient', ], |
| 834 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]:hover', |
| 835 | 'exclude' => [ |
| 836 | 'image' |
| 837 | ] |
| 838 | ] |
| 839 | ); |
| 840 | |
| 841 | $this->add_group_control( |
| 842 | Group_Control_Box_Shadow::get_type(), |
| 843 | [ |
| 844 | 'name' => 'ekit_contact_form_button_box_shadow_hover', |
| 845 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 846 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]:hover', |
| 847 | ] |
| 848 | ); |
| 849 | |
| 850 | $this->add_group_control( |
| 851 | Group_Control_Border::get_type(), |
| 852 | [ |
| 853 | 'name' => 'ekit_contact_form_button_border_hover', |
| 854 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 855 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]:hover', |
| 856 | ] |
| 857 | ); |
| 858 | |
| 859 | $this->add_group_control( |
| 860 | Group_Control_Text_Shadow::get_type(), |
| 861 | [ |
| 862 | 'name' => 'ekit_contact_form_button_title_shadow_hover', |
| 863 | 'selector' => '{{WRAPPER}} .ekit-form form input[type="submit"]:hover' , |
| 864 | ] |
| 865 | ); |
| 866 | |
| 867 | $this->end_controls_tab(); |
| 868 | |
| 869 | $this->end_controls_tabs(); |
| 870 | |
| 871 | $this->end_controls_section(); |
| 872 | |
| 873 | $this->insert_pro_message(); |
| 874 | } |
| 875 | |
| 876 | protected function render( ) { |
| 877 | echo '<div class="ekit-wid-con" >'; |
| 878 | $this->render_raw(); |
| 879 | echo '</div>'; |
| 880 | } |
| 881 | |
| 882 | protected function render_raw( ) { |
| 883 | |
| 884 | $settings = $this->get_settings(); |
| 885 | |
| 886 | echo '<div class="ekit-form">'; |
| 887 | echo do_shortcode('[contact-form-7 id="'.intval($settings['ekit_contact_form7']).'"]' ); |
| 888 | echo '</div>'; |
| 889 | } |
| 890 | } |
| 891 |