Adv_Accordion.php
1 year ago
Adv_Tabs.php
1 year ago
Advanced_Data_Table.php
1 year ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
1 year ago
Betterdocs_Category_Grid.php
1 year ago
Betterdocs_Search_Form.php
1 year ago
Business_Reviews.php
1 year ago
Caldera_Forms.php
1 year ago
Career_Page.php
4 years ago
Contact_Form_7.php
1 year ago
Content_Ticker.php
1 year ago
Countdown.php
1 year ago
Creative_Button.php
1 year ago
Cta_Box.php
1 year ago
Data_Table.php
1 year ago
Dual_Color_Header.php
1 year ago
EmbedPress.php
4 years ago
Event_Calendar.php
1 year ago
Facebook_Feed.php
1 year ago
Fancy_Text.php
1 year ago
Feature_List.php
1 year ago
Filterable_Gallery.php
1 year ago
Flip_Box.php
1 year ago
FluentForm.php
1 year ago
Formstack.php
1 year ago
GravityForms.php
1 year ago
Image_Accordion.php
1 year ago
Info_Box.php
1 year ago
Interactive_Circle.php
1 year ago
Login_Register.php
1 year ago
NFT_Gallery.php
1 year ago
NinjaForms.php
1 year ago
Post_Grid.php
1 year ago
Post_Timeline.php
1 year ago
Pricing_Table.php
1 year ago
Product_Grid.php
1 year ago
Progress_Bar.php
1 year ago
SVG_Draw.php
1 year ago
Simple_Menu.php
1 year ago
Sticky_Video.php
1 year ago
Team_Member.php
1 year ago
Testimonial.php
1 year ago
Tooltip.php
1 year ago
Twitter_Feed.php
1 year ago
TypeForm.php
1 year ago
WeForms.php
2 years ago
Woo_Cart.php
1 year ago
Woo_Checkout.php
1 year ago
Woo_Product_Carousel.php
1 year ago
Woo_Product_Compare.php
2 years ago
Woo_Product_Gallery.php
1 year ago
Woo_Product_List.php
1 year ago
WpForms.php
1 year ago
index.php
3 years ago
WeForms.php
804 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use \Elementor\Group_Control_Border; |
| 12 | use \Elementor\Group_Control_Box_Shadow; |
| 13 | use \Elementor\Group_Control_Typography; |
| 14 | use \Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 15 | use \Elementor\Widget_Base; |
| 16 | use \Essential_Addons_Elementor\Classes\Helper; |
| 17 | |
| 18 | class WeForms extends Widget_Base |
| 19 | { |
| 20 | |
| 21 | public function get_name() |
| 22 | { |
| 23 | return 'eael-weform'; |
| 24 | } |
| 25 | |
| 26 | public function get_title() |
| 27 | { |
| 28 | return esc_html__('weForm', 'essential-addons-for-elementor-lite'); |
| 29 | } |
| 30 | |
| 31 | public function get_icon() |
| 32 | { |
| 33 | return 'eaicon-weforms'; |
| 34 | } |
| 35 | |
| 36 | public function get_categories() |
| 37 | { |
| 38 | return ['essential-addons-elementor']; |
| 39 | } |
| 40 | |
| 41 | public function get_keywords() |
| 42 | { |
| 43 | return [ |
| 44 | 'contact form', |
| 45 | 'ea contact form', |
| 46 | 'ea we form', |
| 47 | 'ea weform', |
| 48 | 'ea weforms', |
| 49 | 'form styler', |
| 50 | 'ea form styler', |
| 51 | 'elementor form', |
| 52 | 'feedback', |
| 53 | 'ea', |
| 54 | 'essential addons' |
| 55 | ]; |
| 56 | } |
| 57 | |
| 58 | public function get_custom_help_url() |
| 59 | { |
| 60 | return 'https://essential-addons.com/elementor/docs/weforms/'; |
| 61 | } |
| 62 | |
| 63 | protected function register_controls() |
| 64 | { |
| 65 | |
| 66 | if (!function_exists('WeForms')) { |
| 67 | $this->start_controls_section( |
| 68 | 'eael_global_warning', |
| 69 | [ |
| 70 | 'label' => __('Warning!', 'essential-addons-for-elementor-lite'), |
| 71 | ] |
| 72 | ); |
| 73 | |
| 74 | $this->add_control( |
| 75 | 'eael_global_warning_text', |
| 76 | [ |
| 77 | 'type' => Controls_Manager::RAW_HTML, |
| 78 | 'raw' => __('<strong>WeForms</strong> is not installed/activated on your site. Please install and activate <strong>WeForms</strong> first.', 'essential-addons-for-elementor-lite'), |
| 79 | 'content_classes' => 'eael-warning', |
| 80 | ] |
| 81 | ); |
| 82 | |
| 83 | $this->end_controls_section(); |
| 84 | } else { |
| 85 | $this->start_controls_section( |
| 86 | 'eael_section_weform', |
| 87 | [ |
| 88 | 'label' => esc_html__('Select Form', 'essential-addons-for-elementor-lite'), |
| 89 | ] |
| 90 | ); |
| 91 | |
| 92 | $this->add_control( |
| 93 | 'wpuf_contact_form', |
| 94 | [ |
| 95 | 'label' => esc_html__('Select weForm', 'essential-addons-for-elementor-lite'), |
| 96 | 'description' => esc_html__('Please save and refresh the page after selecting the form', 'essential-addons-for-elementor-lite'), |
| 97 | 'label_block' => true, |
| 98 | 'type' => Controls_Manager::SELECT, |
| 99 | 'options' => Helper::get_weform_list(), |
| 100 | 'default' => '0', |
| 101 | ] |
| 102 | ); |
| 103 | |
| 104 | $this->end_controls_section(); |
| 105 | |
| 106 | if (!apply_filters('eael/pro_enabled', false)) { |
| 107 | $this->start_controls_section( |
| 108 | 'eael_section_pro', |
| 109 | [ |
| 110 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 111 | ] |
| 112 | ); |
| 113 | |
| 114 | $this->add_control( |
| 115 | 'eael_control_get_pro', |
| 116 | [ |
| 117 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 118 | 'type' => Controls_Manager::CHOOSE, |
| 119 | 'options' => [ |
| 120 | '1' => [ |
| 121 | 'title' => '', |
| 122 | 'icon' => 'fa fa-unlock-alt', |
| 123 | ], |
| 124 | ], |
| 125 | 'default' => '1', |
| 126 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 127 | ] |
| 128 | ); |
| 129 | |
| 130 | $this->end_controls_section(); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | $this->start_controls_section( |
| 135 | 'eael_section_weform_styles', |
| 136 | [ |
| 137 | 'label' => esc_html__('Form Container Styles', 'essential-addons-for-elementor-lite'), |
| 138 | 'tab' => Controls_Manager::TAB_STYLE, |
| 139 | ] |
| 140 | ); |
| 141 | |
| 142 | $this->add_control( |
| 143 | 'eael_weform_background', |
| 144 | [ |
| 145 | 'label' => esc_html__('Form Background Color', 'essential-addons-for-elementor-lite'), |
| 146 | 'type' => Controls_Manager::COLOR, |
| 147 | 'selectors' => [ |
| 148 | '{{WRAPPER}} .eael-weform-container' => 'background-color: {{VALUE}};', |
| 149 | ], |
| 150 | ] |
| 151 | ); |
| 152 | |
| 153 | $this->add_responsive_control( |
| 154 | 'eael_weform_alignment', |
| 155 | [ |
| 156 | 'label' => esc_html__('Form Alignment', 'essential-addons-for-elementor-lite'), |
| 157 | 'type' => Controls_Manager::CHOOSE, |
| 158 | 'label_block' => true, |
| 159 | 'options' => [ |
| 160 | 'default' => [ |
| 161 | 'title' => __('Default', 'essential-addons-for-elementor-lite'), |
| 162 | 'icon' => 'fa fa-ban', |
| 163 | ], |
| 164 | 'left' => [ |
| 165 | 'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'), |
| 166 | 'icon' => 'eicon-text-align-left', |
| 167 | ], |
| 168 | 'center' => [ |
| 169 | 'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'), |
| 170 | 'icon' => 'eicon-text-align-center', |
| 171 | ], |
| 172 | 'right' => [ |
| 173 | 'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'), |
| 174 | 'icon' => 'eicon-text-align-right', |
| 175 | ], |
| 176 | ], |
| 177 | 'default' => 'default', |
| 178 | 'prefix_class' => 'eael-contact-form-align-', |
| 179 | ] |
| 180 | ); |
| 181 | |
| 182 | $this->add_responsive_control( |
| 183 | 'eael_weform_width', |
| 184 | [ |
| 185 | 'label' => esc_html__('Form Width', 'essential-addons-for-elementor-lite'), |
| 186 | 'type' => Controls_Manager::SLIDER, |
| 187 | 'size_units' => ['px', 'em', '%'], |
| 188 | 'range' => [ |
| 189 | 'px' => [ |
| 190 | 'min' => 10, |
| 191 | 'max' => 1500, |
| 192 | ], |
| 193 | 'em' => [ |
| 194 | 'min' => 1, |
| 195 | 'max' => 80, |
| 196 | ], |
| 197 | ], |
| 198 | 'selectors' => [ |
| 199 | '{{WRAPPER}} .eael-weform-container' => 'width: {{SIZE}}{{UNIT}};', |
| 200 | ], |
| 201 | ] |
| 202 | ); |
| 203 | |
| 204 | $this->add_responsive_control( |
| 205 | 'eael_weform_max_width', |
| 206 | [ |
| 207 | 'label' => esc_html__('Form Max Width', 'essential-addons-for-elementor-lite'), |
| 208 | 'type' => Controls_Manager::SLIDER, |
| 209 | 'size_units' => ['px', 'em', '%'], |
| 210 | 'range' => [ |
| 211 | 'px' => [ |
| 212 | 'min' => 10, |
| 213 | 'max' => 1500, |
| 214 | ], |
| 215 | 'em' => [ |
| 216 | 'min' => 1, |
| 217 | 'max' => 80, |
| 218 | ], |
| 219 | ], |
| 220 | 'selectors' => [ |
| 221 | '{{WRAPPER}} .eael-weform-container' => 'max-width: {{SIZE}}{{UNIT}};', |
| 222 | ], |
| 223 | ] |
| 224 | ); |
| 225 | |
| 226 | $this->add_responsive_control( |
| 227 | 'eael_weform_margin', |
| 228 | [ |
| 229 | 'label' => esc_html__('Form Margin', 'essential-addons-for-elementor-lite'), |
| 230 | 'type' => Controls_Manager::DIMENSIONS, |
| 231 | 'size_units' => ['px', 'em', '%'], |
| 232 | 'selectors' => [ |
| 233 | '{{WRAPPER}} .eael-weform-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 234 | ], |
| 235 | ] |
| 236 | ); |
| 237 | |
| 238 | $this->add_responsive_control( |
| 239 | 'eael_weform_padding', |
| 240 | [ |
| 241 | 'label' => esc_html__('Form Padding', 'essential-addons-for-elementor-lite'), |
| 242 | 'type' => Controls_Manager::DIMENSIONS, |
| 243 | 'size_units' => ['px', 'em', '%'], |
| 244 | 'selectors' => [ |
| 245 | '{{WRAPPER}} .eael-weform-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 246 | ], |
| 247 | ] |
| 248 | ); |
| 249 | |
| 250 | $this->add_control( |
| 251 | 'eael_weform_border_radius', |
| 252 | [ |
| 253 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 254 | 'type' => Controls_Manager::DIMENSIONS, |
| 255 | 'separator' => 'before', |
| 256 | 'size_units' => ['px'], |
| 257 | 'selectors' => [ |
| 258 | '{{WRAPPER}} .eael-weform-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 259 | ], |
| 260 | ] |
| 261 | ); |
| 262 | |
| 263 | $this->add_group_control( |
| 264 | Group_Control_Border::get_type(), |
| 265 | [ |
| 266 | 'name' => 'eael_weform_border', |
| 267 | 'selector' => '{{WRAPPER}} .eael-weform-container', |
| 268 | ] |
| 269 | ); |
| 270 | |
| 271 | $this->add_group_control( |
| 272 | Group_Control_Box_Shadow::get_type(), |
| 273 | [ |
| 274 | 'name' => 'eael_weform_box_shadow', |
| 275 | 'selector' => '{{WRAPPER}} .eael-weform-container', |
| 276 | ] |
| 277 | ); |
| 278 | |
| 279 | $this->end_controls_section(); |
| 280 | |
| 281 | $this->start_controls_section( |
| 282 | 'eael_section_weform_field_styles', |
| 283 | [ |
| 284 | 'label' => esc_html__('Form Fields Styles', 'essential-addons-for-elementor-lite'), |
| 285 | 'tab' => Controls_Manager::TAB_STYLE, |
| 286 | ] |
| 287 | ); |
| 288 | |
| 289 | $this->add_control( |
| 290 | 'eael_weform_input_background', |
| 291 | [ |
| 292 | 'label' => esc_html__('Input Field Background', 'essential-addons-for-elementor-lite'), |
| 293 | 'type' => Controls_Manager::COLOR, |
| 294 | 'selectors' => [ |
| 295 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 296 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 297 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 298 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 299 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 300 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 301 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'background-color: {{VALUE}};', |
| 302 | ], |
| 303 | ] |
| 304 | ); |
| 305 | |
| 306 | $this->add_responsive_control( |
| 307 | 'eael_weform_input_width', |
| 308 | [ |
| 309 | 'label' => esc_html__('Input Width', 'essential-addons-for-elementor-lite'), |
| 310 | 'type' => Controls_Manager::SLIDER, |
| 311 | 'size_units' => ['px', 'em', '%'], |
| 312 | 'range' => [ |
| 313 | 'px' => [ |
| 314 | 'min' => 10, |
| 315 | 'max' => 1500, |
| 316 | ], |
| 317 | 'em' => [ |
| 318 | 'min' => 1, |
| 319 | 'max' => 80, |
| 320 | ], |
| 321 | ], |
| 322 | 'selectors' => [ |
| 323 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 324 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 325 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 326 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 327 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 328 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]' => 'width: {{SIZE}}{{UNIT}};', |
| 329 | ], |
| 330 | ] |
| 331 | ); |
| 332 | |
| 333 | $this->add_responsive_control( |
| 334 | 'eael_weform_textarea_width', |
| 335 | [ |
| 336 | 'label' => esc_html__('Textarea Width', 'essential-addons-for-elementor-lite'), |
| 337 | 'type' => Controls_Manager::SLIDER, |
| 338 | 'size_units' => ['px', 'em', '%'], |
| 339 | 'range' => [ |
| 340 | 'px' => [ |
| 341 | 'min' => 10, |
| 342 | 'max' => 1500, |
| 343 | ], |
| 344 | 'em' => [ |
| 345 | 'min' => 1, |
| 346 | 'max' => 80, |
| 347 | ], |
| 348 | ], |
| 349 | 'selectors' => [ |
| 350 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'width: {{SIZE}}{{UNIT}};', |
| 351 | ], |
| 352 | ] |
| 353 | ); |
| 354 | |
| 355 | $this->add_responsive_control( |
| 356 | 'eael_weform_input_padding', |
| 357 | [ |
| 358 | 'label' => esc_html__('Fields Padding', 'essential-addons-for-elementor-lite'), |
| 359 | 'type' => Controls_Manager::DIMENSIONS, |
| 360 | 'size_units' => ['px', 'em', '%'], |
| 361 | 'selectors' => [ |
| 362 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 363 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 364 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 365 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 366 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 367 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 368 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 369 | ], |
| 370 | ] |
| 371 | ); |
| 372 | |
| 373 | $this->add_responsive_control( |
| 374 | 'eael_weform_input_margin', |
| 375 | [ |
| 376 | 'label' => esc_html__('Fields Margin', 'essential-addons-for-elementor-lite'), |
| 377 | 'type' => Controls_Manager::DIMENSIONS, |
| 378 | 'size_units' => ['px', 'em', '%'], |
| 379 | 'selectors' => [ |
| 380 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 381 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 382 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 383 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 384 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 385 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 386 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 387 | ], |
| 388 | ] |
| 389 | ); |
| 390 | |
| 391 | $this->add_control( |
| 392 | 'eael_weform_input_border_radius', |
| 393 | [ |
| 394 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 395 | 'type' => Controls_Manager::DIMENSIONS, |
| 396 | 'separator' => 'before', |
| 397 | 'size_units' => ['px'], |
| 398 | 'selectors' => [ |
| 399 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 400 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 401 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 402 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 403 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 404 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 405 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 406 | ], |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $this->add_group_control( |
| 411 | Group_Control_Border::get_type(), |
| 412 | [ |
| 413 | 'name' => 'eael_weform_input_border', |
| 414 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 415 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 416 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 417 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 418 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 419 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 420 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea', |
| 421 | ] |
| 422 | ); |
| 423 | |
| 424 | $this->add_group_control( |
| 425 | Group_Control_Box_Shadow::get_type(), |
| 426 | [ |
| 427 | 'name' => 'eael_weform_input_box_shadow', |
| 428 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 429 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 430 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 431 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 432 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 433 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 434 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea', |
| 435 | ] |
| 436 | ); |
| 437 | |
| 438 | $this->add_control( |
| 439 | 'eael_weform_focus_heading', |
| 440 | [ |
| 441 | 'type' => Controls_Manager::HEADING, |
| 442 | 'label' => esc_html__('Focus State Style', 'essential-addons-for-elementor-lite'), |
| 443 | 'separator' => 'before', |
| 444 | ] |
| 445 | ); |
| 446 | |
| 447 | $this->add_group_control( |
| 448 | Group_Control_Box_Shadow::get_type(), |
| 449 | [ |
| 450 | 'name' => 'eael_weform_input_focus_box_shadow', |
| 451 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus, |
| 452 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus, |
| 453 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus, |
| 454 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus, |
| 455 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus, |
| 456 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus, |
| 457 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus', |
| 458 | ] |
| 459 | ); |
| 460 | |
| 461 | $this->add_control( |
| 462 | 'eael_weform_input_focus_border', |
| 463 | [ |
| 464 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 465 | 'type' => Controls_Manager::COLOR, |
| 466 | 'selectors' => [ |
| 467 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus, |
| 468 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus, |
| 469 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus, |
| 470 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus, |
| 471 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus, |
| 472 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus, |
| 473 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus' => 'border-color: {{VALUE}};', |
| 474 | ], |
| 475 | ] |
| 476 | ); |
| 477 | |
| 478 | $this->add_control( |
| 479 | 'eael_weform_label_style_heading', |
| 480 | [ |
| 481 | 'type' => Controls_Manager::HEADING, |
| 482 | 'label' => esc_html__('Label Style', 'essential-addons-for-elementor-lite'), |
| 483 | 'separator' => 'before', |
| 484 | ] |
| 485 | ); |
| 486 | |
| 487 | $this->add_control( |
| 488 | 'eael_weform_label_margin', |
| 489 | [ |
| 490 | 'label' => __('Margin', 'essential-addons-for-elementor-lite'), |
| 491 | 'type' => Controls_Manager::DIMENSIONS, |
| 492 | 'size_units' => ['px', '%', 'em'], |
| 493 | 'selectors' => [ |
| 494 | '{{WRAPPER}} .eael-weform-container .wpuf-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 495 | ], |
| 496 | ] |
| 497 | ); |
| 498 | |
| 499 | |
| 500 | $this->end_controls_section(); |
| 501 | |
| 502 | $this->start_controls_section( |
| 503 | 'eael_section_weform_typography', |
| 504 | [ |
| 505 | 'label' => esc_html__('Color & Typography', 'essential-addons-for-elementor-lite'), |
| 506 | 'tab' => Controls_Manager::TAB_STYLE, |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_control( |
| 511 | 'eael_weform_label_color', |
| 512 | [ |
| 513 | 'label' => esc_html__('Label Color', 'essential-addons-for-elementor-lite'), |
| 514 | 'type' => Controls_Manager::COLOR, |
| 515 | 'selectors' => [ |
| 516 | '{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label' => 'color: {{VALUE}};', |
| 517 | ], |
| 518 | ] |
| 519 | ); |
| 520 | |
| 521 | $this->add_control( |
| 522 | 'eael_weform_field_color', |
| 523 | [ |
| 524 | 'label' => esc_html__('Field Font Color', 'essential-addons-for-elementor-lite'), |
| 525 | 'type' => Controls_Manager::COLOR, |
| 526 | 'selectors' => [ |
| 527 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 528 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 529 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 530 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 531 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 532 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 533 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'color: {{VALUE}};', |
| 534 | ], |
| 535 | ] |
| 536 | ); |
| 537 | |
| 538 | $this->add_control( |
| 539 | 'eael_weform_placeholder_color', |
| 540 | [ |
| 541 | 'label' => esc_html__('Placeholder Font Color', 'essential-addons-for-elementor-lite'), |
| 542 | 'type' => Controls_Manager::COLOR, |
| 543 | 'selectors' => [ |
| 544 | '{{WRAPPER}} .eael-weform-container ::-webkit-input-placeholder' => 'color: {{VALUE}};', |
| 545 | '{{WRAPPER}} .eael-weform-container ::-moz-placeholder' => 'color: {{VALUE}};', |
| 546 | '{{WRAPPER}} .eael-weform-container ::-ms-input-placeholder' => 'color: {{VALUE}};', |
| 547 | ], |
| 548 | ] |
| 549 | ); |
| 550 | |
| 551 | $this->add_control( |
| 552 | 'eael_weform_label_heading', |
| 553 | [ |
| 554 | 'type' => Controls_Manager::HEADING, |
| 555 | 'label' => esc_html__('Label Typography', 'essential-addons-for-elementor-lite'), |
| 556 | 'separator' => 'before', |
| 557 | ] |
| 558 | ); |
| 559 | |
| 560 | $this->add_group_control( |
| 561 | Group_Control_Typography::get_type(), |
| 562 | [ |
| 563 | 'name' => 'eael_weform_label_typography', |
| 564 | 'selector' => '{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label', |
| 565 | ] |
| 566 | ); |
| 567 | |
| 568 | $this->add_control( |
| 569 | 'eael_weform_heading_input_field', |
| 570 | [ |
| 571 | 'type' => Controls_Manager::HEADING, |
| 572 | 'label' => esc_html__('Input Fields Typography', 'essential-addons-for-elementor-lite'), |
| 573 | 'separator' => 'before', |
| 574 | ] |
| 575 | ); |
| 576 | |
| 577 | $this->add_group_control( |
| 578 | Group_Control_Typography::get_type(), |
| 579 | [ |
| 580 | 'name' => 'eael_weform_input_field_typography', |
| 581 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"], |
| 582 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"], |
| 583 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"], |
| 584 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 585 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"], |
| 586 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"], |
| 587 | {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea', |
| 588 | ] |
| 589 | ); |
| 590 | |
| 591 | $this->end_controls_section(); |
| 592 | |
| 593 | $this->start_controls_section( |
| 594 | 'eael_section_weform_submit_button_styles', |
| 595 | [ |
| 596 | 'label' => esc_html__('Submit Button Styles', 'essential-addons-for-elementor-lite'), |
| 597 | 'tab' => Controls_Manager::TAB_STYLE, |
| 598 | ] |
| 599 | ); |
| 600 | |
| 601 | $this->add_responsive_control( |
| 602 | 'eael_weform_submit_btn_width', |
| 603 | [ |
| 604 | 'label' => esc_html__('Button Width', 'essential-addons-for-elementor-lite'), |
| 605 | 'type' => Controls_Manager::SLIDER, |
| 606 | 'size_units' => ['px', 'em', '%'], |
| 607 | 'range' => [ |
| 608 | 'px' => [ |
| 609 | 'min' => 10, |
| 610 | 'max' => 1500, |
| 611 | ], |
| 612 | 'em' => [ |
| 613 | 'min' => 1, |
| 614 | 'max' => 80, |
| 615 | ], |
| 616 | ], |
| 617 | 'selectors' => [ |
| 618 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'width: {{SIZE}}{{UNIT}};', |
| 619 | ], |
| 620 | ] |
| 621 | ); |
| 622 | |
| 623 | $this->add_responsive_control( |
| 624 | 'eael_weform_submit_btn_alignment', |
| 625 | [ |
| 626 | 'label' => esc_html__('Button Alignment', 'essential-addons-for-elementor-lite'), |
| 627 | 'type' => Controls_Manager::CHOOSE, |
| 628 | 'label_block' => true, |
| 629 | 'options' => [ |
| 630 | 'default' => [ |
| 631 | 'title' => __('Default', 'essential-addons-for-elementor-lite'), |
| 632 | 'icon' => 'fa fa-ban', |
| 633 | ], |
| 634 | 'left' => [ |
| 635 | 'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'), |
| 636 | 'icon' => 'eicon-text-align-left', |
| 637 | ], |
| 638 | 'center' => [ |
| 639 | 'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'), |
| 640 | 'icon' => 'eicon-text-align-center', |
| 641 | ], |
| 642 | 'right' => [ |
| 643 | 'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'), |
| 644 | 'icon' => 'eicon-text-align-right', |
| 645 | ], |
| 646 | ], |
| 647 | 'default' => 'default', |
| 648 | 'prefix_class' => 'eael-contact-form-btn-align-', |
| 649 | ] |
| 650 | ); |
| 651 | |
| 652 | $this->add_group_control( |
| 653 | Group_Control_Typography::get_type(), |
| 654 | [ |
| 655 | 'name' => 'eael_weform_submit_btn_typography', |
| 656 | 'global' => [ |
| 657 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY |
| 658 | ], |
| 659 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]', |
| 660 | ] |
| 661 | ); |
| 662 | |
| 663 | $this->add_responsive_control( |
| 664 | 'eael_weform_submit_btn_margin', |
| 665 | [ |
| 666 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 667 | 'type' => Controls_Manager::DIMENSIONS, |
| 668 | 'size_units' => ['px', 'em', '%'], |
| 669 | 'selectors' => [ |
| 670 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 671 | ], |
| 672 | ] |
| 673 | ); |
| 674 | |
| 675 | $this->add_responsive_control( |
| 676 | 'eael_weform_submit_btn_padding', |
| 677 | [ |
| 678 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 679 | 'type' => Controls_Manager::DIMENSIONS, |
| 680 | 'size_units' => ['px', 'em', '%'], |
| 681 | 'selectors' => [ |
| 682 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 683 | ], |
| 684 | ] |
| 685 | ); |
| 686 | |
| 687 | $this->start_controls_tabs('eael_weform_submit_button_tabs'); |
| 688 | |
| 689 | $this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]); |
| 690 | |
| 691 | $this->add_control( |
| 692 | 'eael_weform_submit_btn_text_color', |
| 693 | [ |
| 694 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 695 | 'type' => Controls_Manager::COLOR, |
| 696 | 'selectors' => [ |
| 697 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'color: {{VALUE}};', |
| 698 | ], |
| 699 | ] |
| 700 | ); |
| 701 | |
| 702 | $this->add_control( |
| 703 | 'eael_weform_submit_btn_background_color', |
| 704 | [ |
| 705 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 706 | 'type' => Controls_Manager::COLOR, |
| 707 | 'selectors' => [ |
| 708 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'background-color: {{VALUE}};', |
| 709 | ], |
| 710 | ] |
| 711 | ); |
| 712 | |
| 713 | $this->add_group_control( |
| 714 | Group_Control_Border::get_type(), |
| 715 | [ |
| 716 | 'name' => 'eael_weform_submit_btn_border', |
| 717 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]', |
| 718 | ] |
| 719 | ); |
| 720 | |
| 721 | $this->add_control( |
| 722 | 'eael_weform_submit_btn_border_radius', |
| 723 | [ |
| 724 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 725 | 'type' => Controls_Manager::SLIDER, |
| 726 | 'range' => [ |
| 727 | 'px' => [ |
| 728 | 'max' => 100, |
| 729 | ], |
| 730 | ], |
| 731 | 'selectors' => [ |
| 732 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'border-radius: {{SIZE}}px;', |
| 733 | ], |
| 734 | ] |
| 735 | ); |
| 736 | |
| 737 | $this->end_controls_tab(); |
| 738 | |
| 739 | $this->start_controls_tab('eael_weform_submit_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]); |
| 740 | |
| 741 | $this->add_control( |
| 742 | 'eael_weform_submit_btn_hover_text_color', |
| 743 | [ |
| 744 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 745 | 'type' => Controls_Manager::COLOR, |
| 746 | 'selectors' => [ |
| 747 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'color: {{VALUE}};', |
| 748 | ], |
| 749 | ] |
| 750 | ); |
| 751 | |
| 752 | $this->add_control( |
| 753 | 'eael_weform_submit_btn_hover_background_color', |
| 754 | [ |
| 755 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 756 | 'type' => Controls_Manager::COLOR, |
| 757 | 'selectors' => [ |
| 758 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'background-color: {{VALUE}};', |
| 759 | ], |
| 760 | ] |
| 761 | ); |
| 762 | |
| 763 | $this->add_control( |
| 764 | 'eael_weform_submit_btn_hover_border_color', |
| 765 | [ |
| 766 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 767 | 'type' => Controls_Manager::COLOR, |
| 768 | 'selectors' => [ |
| 769 | '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'border-color: {{VALUE}};', |
| 770 | ], |
| 771 | ] |
| 772 | ); |
| 773 | |
| 774 | $this->end_controls_tab(); |
| 775 | |
| 776 | $this->end_controls_tabs(); |
| 777 | |
| 778 | $this->add_group_control( |
| 779 | Group_Control_Box_Shadow::get_type(), |
| 780 | [ |
| 781 | 'name' => 'eael_weform_submit_btn_box_shadow', |
| 782 | 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]', |
| 783 | ] |
| 784 | ); |
| 785 | |
| 786 | $this->end_controls_section(); |
| 787 | } |
| 788 | |
| 789 | protected function render() |
| 790 | { |
| 791 | if (!function_exists('WeForms')) { |
| 792 | return; |
| 793 | } |
| 794 | |
| 795 | $settings = $this->get_settings_for_display(); |
| 796 | |
| 797 | if (!empty($settings['wpuf_contact_form'])) { |
| 798 | echo '<div class="eael-weform-container"> |
| 799 | ' . do_shortcode('[weforms id="' . esc_attr( $settings['wpuf_contact_form'] ) . '" ]') . ' |
| 800 | </div>'; |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 |