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