Adv_Accordion.php
2 years ago
Adv_Tabs.php
2 years ago
Advanced_Data_Table.php
2 years ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
2 years ago
Betterdocs_Category_Grid.php
2 years ago
Betterdocs_Search_Form.php
2 years ago
Business_Reviews.php
2 years ago
Caldera_Forms.php
2 years ago
Career_Page.php
4 years ago
Contact_Form_7.php
2 years ago
Content_Ticker.php
2 years ago
Countdown.php
2 years ago
Creative_Button.php
2 years ago
Crowdfundly_All_Campaign.php
4 years ago
Crowdfundly_Organization.php
4 years ago
Crowdfundly_Single_Campaign.php
4 years ago
Cta_Box.php
2 years ago
Data_Table.php
2 years ago
Dual_Color_Header.php
2 years ago
EmbedPress.php
4 years ago
Event_Calendar.php
2 years ago
Facebook_Feed.php
2 years ago
Fancy_Text.php
2 years ago
Feature_List.php
2 years ago
Filterable_Gallery.php
2 years ago
Flip_Box.php
2 years ago
FluentForm.php
2 years ago
Formstack.php
2 years ago
GravityForms.php
2 years ago
Image_Accordion.php
2 years ago
Info_Box.php
2 years ago
Interactive_Circle.php
2 years ago
Login_Register.php
2 years ago
NFT_Gallery.php
2 years ago
NinjaForms.php
2 years ago
Post_Grid.php
2 years ago
Post_Timeline.php
2 years ago
Pricing_Table.php
2 years ago
Product_Grid.php
2 years ago
Progress_Bar.php
2 years ago
SVG_Draw.php
3 years ago
Simple_Menu.php
2 years ago
Sticky_Video.php
2 years ago
Team_Member.php
2 years ago
Testimonial.php
2 years ago
Tooltip.php
2 years ago
Twitter_Feed.php
2 years ago
TypeForm.php
2 years ago
WeForms.php
2 years ago
Woo_Cart.php
2 years ago
Woo_Checkout.php
2 years ago
Woo_Product_Carousel.php
2 years ago
Woo_Product_Compare.php
4 years ago
Woo_Product_Gallery.php
2 years ago
Woocommerce_Review.php
4 years ago
WpForms.php
2 years ago
index.php
3 years ago
Login_Register.php
6826 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | use Elementor\Controls_Manager; |
| 6 | use Elementor\Group_Control_Background; |
| 7 | use Elementor\Group_Control_Border; |
| 8 | use Elementor\Group_Control_Box_Shadow; |
| 9 | use Elementor\Group_Control_Image_Size; |
| 10 | use Elementor\Group_Control_Typography; |
| 11 | use Elementor\Icons_Manager; |
| 12 | use Elementor\Plugin; |
| 13 | use Elementor\Repeater; |
| 14 | use Elementor\Utils; |
| 15 | use Elementor\Widget_Base; |
| 16 | use Essential_Addons_Elementor\Classes\Helper as HelperCLass; |
| 17 | use Essential_Addons_Elementor\Traits\Login_Registration; |
| 18 | use WP_Roles; |
| 19 | |
| 20 | if ( ! defined( 'ABSPATH' ) ) { |
| 21 | exit; |
| 22 | } // Exit if accessed directly |
| 23 | |
| 24 | /** |
| 25 | * Class Login_Register |
| 26 | * @package Essential_Addons_Elementor\Elements |
| 27 | */ |
| 28 | class Login_Register extends Widget_Base { |
| 29 | |
| 30 | use Login_Registration; |
| 31 | |
| 32 | /** |
| 33 | * Does the site allows new user registration? |
| 34 | * @var bool |
| 35 | */ |
| 36 | protected $user_can_register; |
| 37 | /** |
| 38 | * Login custom redirect url |
| 39 | * @var bool |
| 40 | */ |
| 41 | protected $login_custom_redirect_url; |
| 42 | /** |
| 43 | * Are you currently in Elementor Editor Screen? |
| 44 | * @var bool |
| 45 | */ |
| 46 | protected $in_editor; |
| 47 | /** |
| 48 | * Should login form be printed? |
| 49 | * @var bool |
| 50 | */ |
| 51 | protected $should_print_login_form; |
| 52 | /** |
| 53 | * Should registration form be printed? |
| 54 | * @var bool |
| 55 | */ |
| 56 | protected $should_print_register_form; |
| 57 | /** |
| 58 | * Should lost password form be printed? |
| 59 | * @var bool |
| 60 | */ |
| 61 | protected $should_print_lostpassword_form; |
| 62 | /** |
| 63 | * Should reset password form be printed? |
| 64 | * @var bool |
| 65 | */ |
| 66 | protected $should_print_resetpassword_form; |
| 67 | /** |
| 68 | * Should reset password form be printed in editor? |
| 69 | * @var bool |
| 70 | */ |
| 71 | protected $should_print_resetpassword_form_editor; |
| 72 | /** |
| 73 | * It contains an array of settings for the display |
| 74 | * @var array |
| 75 | */ |
| 76 | protected $ds; |
| 77 | /** |
| 78 | * @var bool|false|int |
| 79 | */ |
| 80 | protected $page_id; |
| 81 | /** |
| 82 | * @var bool|false|int |
| 83 | */ |
| 84 | protected $page_id_for_popup; |
| 85 | /** |
| 86 | * @var string |
| 87 | */ |
| 88 | protected $resetpassword_in_popup_selector; |
| 89 | /** |
| 90 | * @var bool|string |
| 91 | */ |
| 92 | protected $form_illustration_url; |
| 93 | /** |
| 94 | * @var bool|string |
| 95 | */ |
| 96 | protected $form_logo; |
| 97 | /** |
| 98 | * What form to show by default on initial page load. login or register ? |
| 99 | * @var string |
| 100 | */ |
| 101 | protected $default_form; |
| 102 | /** |
| 103 | * Form illustration position |
| 104 | * @var mixed|string |
| 105 | */ |
| 106 | protected $form_illustration_pos; |
| 107 | /** |
| 108 | * Form logo position |
| 109 | * @var mixed|string |
| 110 | */ |
| 111 | protected $form_logo_pos; |
| 112 | /** |
| 113 | * Google reCAPTCHA Site key |
| 114 | * @var string|false |
| 115 | */ |
| 116 | protected $recaptcha_sitekey; |
| 117 | |
| 118 | /** |
| 119 | * Google reCAPTCHA v3 Site key |
| 120 | * @var string|false |
| 121 | */ |
| 122 | protected $recaptcha_sitekey_v3; |
| 123 | |
| 124 | /** |
| 125 | * @var mixed|void |
| 126 | */ |
| 127 | protected $pro_enabled; |
| 128 | |
| 129 | /** |
| 130 | * Login_Register constructor. |
| 131 | * Initializing the Login_Register widget class. |
| 132 | * @inheritDoc |
| 133 | */ |
| 134 | public function __construct( $data = [], $args = null ) { |
| 135 | parent::__construct( $data, $args ); |
| 136 | $this->user_can_register = get_option( 'users_can_register' ); |
| 137 | $this->recaptcha_sitekey = get_option( 'eael_recaptcha_sitekey' ); |
| 138 | $this->recaptcha_sitekey_v3 = get_option( 'eael_recaptcha_sitekey_v3' ); |
| 139 | $this->in_editor = Plugin::instance()->editor->is_edit_mode(); |
| 140 | $this->pro_enabled = apply_filters( 'eael/pro_enabled', false ); |
| 141 | |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * @inheritDoc |
| 146 | */ |
| 147 | public function get_name() { |
| 148 | return 'eael-login-register'; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * @inheritDoc |
| 153 | */ |
| 154 | public function get_title() { |
| 155 | return esc_html__( 'Login | Register Form', 'essential-addons-for-elementor-lite' ); |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * @inheritDoc |
| 160 | */ |
| 161 | public function get_icon() { |
| 162 | return 'eaicon-login'; |
| 163 | } |
| 164 | |
| 165 | public function get_script_depends() { |
| 166 | $scripts = parent::get_script_depends(); |
| 167 | $scripts[] = 'eael-recaptcha'; |
| 168 | |
| 169 | return apply_filters( 'eael/login-register/scripts', $scripts ); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * @inheritDoc |
| 174 | */ |
| 175 | public function get_style_depends() { |
| 176 | $styles = parent::get_style_depends(); |
| 177 | $styles[] = 'dashicons'; |
| 178 | |
| 179 | return apply_filters( 'eael/login-register/styles', $styles ); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * @inheritDoc |
| 184 | */ |
| 185 | public function get_keywords() { |
| 186 | return [ |
| 187 | 'ea login register', |
| 188 | 'ea register login', |
| 189 | 'signin form', |
| 190 | 'signup form', |
| 191 | 'sign in form', |
| 192 | 'sign up form', |
| 193 | 'authentication', |
| 194 | 'google', |
| 195 | 'facebook', |
| 196 | 'ea', |
| 197 | 'essential addons', |
| 198 | ]; |
| 199 | } |
| 200 | |
| 201 | public function get_custom_help_url() { |
| 202 | return 'https://essential-addons.com/elementor/docs/login-register-form/'; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * @inheritDoc |
| 207 | */ |
| 208 | public function get_categories() { |
| 209 | return [ 'essential-addons-elementor' ]; |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Get an array of form field types. |
| 214 | * @return array |
| 215 | */ |
| 216 | protected function get_form_field_types() { |
| 217 | $eael_form_field_types = [ |
| 218 | 'user_name' => __( 'Username', 'essential-addons-for-elementor-lite' ), |
| 219 | 'email' => __( 'Email', 'essential-addons-for-elementor-lite' ), |
| 220 | 'password' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 221 | 'confirm_pass' => __( 'Confirm Password', 'essential-addons-for-elementor-lite' ), |
| 222 | 'first_name' => __( 'First Name', 'essential-addons-for-elementor-lite' ), |
| 223 | 'last_name' => __( 'Last Name', 'essential-addons-for-elementor-lite' ), |
| 224 | 'website' => __( 'Website', 'essential-addons-for-elementor-lite' ), |
| 225 | ]; |
| 226 | |
| 227 | if( 'on' === get_option( 'eael_custom_profile_fields' ) ){ |
| 228 | $eael_form_field_types['eael_phone_number'] = __( 'Phone', 'essential-addons-for-elementor-lite' ); |
| 229 | $eael_custom_profile_fields = $this->get_eael_custom_profile_fields( 'all' ); |
| 230 | $eael_form_field_types = array_merge( $eael_form_field_types, $eael_custom_profile_fields ); |
| 231 | } |
| 232 | |
| 233 | return apply_filters( 'eael/registration-form-fields', $eael_form_field_types ); |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * @inheritDoc |
| 238 | */ |
| 239 | protected function register_controls() { |
| 240 | /*----Content Tab----*/ |
| 241 | do_action( 'eael/login-register/before-content-controls', $this ); |
| 242 | $this->init_content_general_controls(); |
| 243 | $this->init_form_header_controls(); |
| 244 | // Login Form Related--- |
| 245 | $this->init_content_login_fields_controls(); |
| 246 | $this->init_content_login_options_controls(); |
| 247 | |
| 248 | if(!$this->pro_enabled){ |
| 249 | $this->social_login_promo(); |
| 250 | } |
| 251 | |
| 252 | do_action( 'eael/login-register/after-login-controls-section', $this ); |
| 253 | // Registration For Related--- |
| 254 | $this->init_content_register_fields_controls(); |
| 255 | $this->init_content_register_options_controls(); |
| 256 | $this->init_content_register_user_email_controls(); |
| 257 | $this->init_content_register_admin_email_controls(); |
| 258 | |
| 259 | // Lost Password Form Related--- |
| 260 | $this->init_content_lostpassword_fields_controls(); |
| 261 | $this->init_content_lostpassword_user_email_controls(); |
| 262 | |
| 263 | // Reset Password Form Related--- |
| 264 | $this->init_content_resetpassword_fields_controls(); |
| 265 | $this->init_content_resetpassword_options_controls(); |
| 266 | |
| 267 | //Terms & Conditions |
| 268 | $this->init_content_terms_controls(); |
| 269 | // Error Messages |
| 270 | $this->init_content_validation_messages_controls(); |
| 271 | do_action( 'eael/login-register/after-content-controls', $this ); |
| 272 | |
| 273 | if(!$this->pro_enabled){ |
| 274 | $this->show_pro_promotion(); |
| 275 | } |
| 276 | |
| 277 | /*----Style Tab----*/ |
| 278 | do_action( 'eael/login-register/before-style-controls', $this ); |
| 279 | $this->init_style_general_controls(); |
| 280 | $this->init_style_header_content_controls( 'login' ); |
| 281 | $this->init_style_header_content_controls( 'register' ); |
| 282 | $this->init_style_header_content_controls( 'lostpassword' ); |
| 283 | $this->init_style_header_content_controls( 'resetpassword' ); |
| 284 | $this->init_style_input_fields_controls(); |
| 285 | $this->init_style_input_labels_controls(); |
| 286 | $this->init_style_login_button_controls(); |
| 287 | $this->init_style_register_button_controls(); |
| 288 | $this->init_style_lostpassword_button_controls(); |
| 289 | $this->init_style_resetpassword_button_controls(); |
| 290 | $this->init_style_login_link_controls(); |
| 291 | $this->init_style_register_link_controls(); |
| 292 | $this->init_style_login_recaptcha_controls(); |
| 293 | $this->init_style_register_recaptcha_controls(); |
| 294 | do_action( 'eael/login-register/after-style-controls', $this ); |
| 295 | |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * It adds controls related to Login Form Types section to the Widget Content Tab |
| 300 | */ |
| 301 | protected function init_content_general_controls() { |
| 302 | $this->start_controls_section( 'section_content_general', [ |
| 303 | 'label' => __( 'General', 'essential-addons-for-elementor-lite' ), |
| 304 | ] ); |
| 305 | $this->add_control( 'default_form_type_notice', [ |
| 306 | 'type' => Controls_Manager::RAW_HTML, |
| 307 | 'raw' => __( 'Choose the type of form you want to show by default. Note: you can show both forms in a single page even if you select only login or registration from below.', 'essential-addons-for-elementor-lite' ), |
| 308 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 309 | ] ); |
| 310 | $this->add_control( 'default_form_type', [ |
| 311 | 'label' => __( 'Default Form Type', 'essential-addons-for-elementor-lite' ), |
| 312 | 'type' => Controls_Manager::SELECT, |
| 313 | 'options' => [ |
| 314 | 'login' => __( 'Login', 'essential-addons-for-elementor-lite' ), |
| 315 | 'register' => __( 'Registration', 'essential-addons-for-elementor-lite' ), |
| 316 | 'lostpassword' => __( 'Lost Password', 'essential-addons-for-elementor-lite' ), |
| 317 | ], |
| 318 | 'default' => 'login', |
| 319 | ] ); |
| 320 | |
| 321 | if ( ! $this->user_can_register ) { |
| 322 | $this->add_control( 'registration_off_notice', [ |
| 323 | 'type' => Controls_Manager::RAW_HTML, |
| 324 | /* translators: %1$s is settings page link open tag, %2$s is link closing tag */ |
| 325 | 'raw' => sprintf( __( 'Registration is disabled on your site. Please enable it to use registration form. You can enable it from Dashboard » Settings » General » %1$sMembership%2$s.', 'essential-addons-for-elementor-lite' ), '<a href="' . esc_attr( esc_url( admin_url( 'options-general.php' ) ) ) . '" target="_blank">', '</a>' ), |
| 326 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 327 | 'condition' => [ |
| 328 | 'default_form_type' => 'register', |
| 329 | ], |
| 330 | ] ); |
| 331 | } |
| 332 | |
| 333 | $this->add_control( 'enable_reset_password', [ |
| 334 | 'label' => __( 'Enable Reset Password Form', 'essential-addons-for-elementor-lite' ), |
| 335 | 'type' => Controls_Manager::SWITCHER, |
| 336 | 'default' => 'no', |
| 337 | 'conditions' => [ |
| 338 | 'relation' => 'or', |
| 339 | 'terms' => [ |
| 340 | [ |
| 341 | 'relation' => 'and', |
| 342 | 'terms' => [ |
| 343 | [ |
| 344 | 'name' => 'show_lost_password', |
| 345 | 'value' => 'yes' |
| 346 | ], |
| 347 | [ |
| 348 | 'name' => 'lost_password_link_type', |
| 349 | 'value' => 'form', |
| 350 | ] |
| 351 | ] |
| 352 | ], |
| 353 | [ |
| 354 | 'name' => 'default_form_type', |
| 355 | 'value' => 'lostpassword', |
| 356 | ] |
| 357 | ], |
| 358 | ], |
| 359 | ] ); |
| 360 | |
| 361 | // preview reset password form |
| 362 | $this->add_control( 'preview_reset_password', [ |
| 363 | 'label' => __( 'Preview Reset Password Form', 'essential-addons-for-elementor-lite' ), |
| 364 | 'description' => __( 'This will show a preview of the reset password form in the editor.', 'essential-addons-for-elementor-lite' ), |
| 365 | 'type' => Controls_Manager::SWITCHER, |
| 366 | 'default' => 'no', |
| 367 | 'condition' => [ |
| 368 | 'enable_reset_password' => 'yes' |
| 369 | ], |
| 370 | ] ); |
| 371 | |
| 372 | $this->add_control( 'hide_for_logged_in_user', [ |
| 373 | 'label' => __( 'Hide all Forms from Logged-in Users', 'essential-addons-for-elementor-lite' ), |
| 374 | 'type' => Controls_Manager::SWITCHER, |
| 375 | 'default' => 'yes', |
| 376 | ] ); |
| 377 | $this->add_control( 'redirect_for_logged_in_user', [ |
| 378 | 'label' => __( 'Redirect for Logged-in Users', 'essential-addons-for-elementor-lite' ), |
| 379 | 'type' => Controls_Manager::SWITCHER, |
| 380 | 'default' => 'no', |
| 381 | ] ); |
| 382 | $this->add_control( 'redirect_url_for_logged_in_user', [ |
| 383 | 'type' => Controls_Manager::URL, |
| 384 | 'show_label' => false, |
| 385 | 'show_external' => false, |
| 386 | 'placeholder' => site_url(), |
| 387 | 'description' => __( 'Please note that only your current domain is allowed here to keep your site secure.', 'essential-addons-for-elementor-lite' ), |
| 388 | 'condition' => [ |
| 389 | 'redirect_for_logged_in_user' => 'yes', |
| 390 | ], |
| 391 | 'default' => [ |
| 392 | 'url' => site_url(), |
| 393 | 'is_external' => false, |
| 394 | 'nofollow' => true, |
| 395 | ], |
| 396 | ] ); |
| 397 | $this->add_control( 'gen_lgn_content_po_toggle', [ |
| 398 | 'label' => __( 'Login Form General', 'essential-addons-for-elementor-lite' ), |
| 399 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 400 | 'label_off' => __( 'Controls', 'essential-addons-for-elementor-lite' ), |
| 401 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 402 | 'return_value' => 'yes', |
| 403 | 'default' => 'yes', |
| 404 | ] ); |
| 405 | $this->start_popover(); |
| 406 | $this->add_control( 'show_log_out_message', [ |
| 407 | 'label' => __( 'Show Logout Link', 'essential-addons-for-elementor-lite' ), |
| 408 | 'type' => Controls_Manager::SWITCHER, |
| 409 | 'default' => 'yes', |
| 410 | ] ); |
| 411 | $this->add_control( 'log_out_link_text', [ |
| 412 | 'label' => __( 'Logout Link Text', 'essential-addons-for-elementor-lite' ), |
| 413 | 'label_block' => true, |
| 414 | 'type' => Controls_Manager::TEXT, |
| 415 | 'dynamic' => [ |
| 416 | 'active' => true, |
| 417 | ], |
| 418 | 'default' => __( 'You are already logged in as [username]. ([logout_link])', 'essential-addons-for-elementor-lite' ), |
| 419 | 'condition' => [ |
| 420 | 'show_log_out_message' => 'yes', |
| 421 | ], |
| 422 | ] ); |
| 423 | $this->add_control( 'show_lost_password', [ |
| 424 | 'label' => __( 'Show Lost your password?', 'essential-addons-for-elementor-lite' ), |
| 425 | 'type' => Controls_Manager::SWITCHER, |
| 426 | 'default' => 'yes', |
| 427 | ] ); |
| 428 | $this->add_control( 'lost_password_text', [ |
| 429 | 'label' => __( 'Lost Password Text', 'essential-addons-for-elementor-lite' ), |
| 430 | 'label_block' => true, |
| 431 | 'type' => Controls_Manager::TEXT, |
| 432 | 'dynamic' => [ |
| 433 | 'active' => true, |
| 434 | ], |
| 435 | 'default' => __( 'Forgot Password?', 'essential-addons-for-elementor-lite' ), |
| 436 | 'condition' => [ |
| 437 | 'show_lost_password' => 'yes', |
| 438 | ], |
| 439 | 'ai' => [ |
| 440 | 'active' => false, |
| 441 | ], |
| 442 | ] ); |
| 443 | $this->add_control( 'lost_password_link_type', [ |
| 444 | 'label' => __( 'Lost Password Link to', 'essential-addons-for-elementor-lite' ), |
| 445 | 'label_block' => true, |
| 446 | 'type' => Controls_Manager::SELECT, |
| 447 | 'options' => [ |
| 448 | 'default' => __( 'Default WordPress Page', 'essential-addons-for-elementor-lite' ), |
| 449 | 'custom' => __( 'Custom URL', 'essential-addons-for-elementor-lite' ), |
| 450 | 'form' => __( 'Show Lost Password Form', 'essential-addons-for-elementor-lite' ), |
| 451 | ], |
| 452 | 'default' => 'default', |
| 453 | 'condition' => [ |
| 454 | 'show_lost_password' => 'yes', |
| 455 | ], |
| 456 | ] ); |
| 457 | $this->add_control( 'lost_password_link_type_notice', [ |
| 458 | 'type' => Controls_Manager::RAW_HTML, |
| 459 | 'raw' => __( "Note: To use the Reset Password Form enable it from Content » General » Enabled Reset Password Form.", 'essential-addons-for-elementor-lite' ), |
| 460 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 461 | 'condition' => [ |
| 462 | 'lost_password_link_type' => 'form' |
| 463 | ] |
| 464 | ] ); |
| 465 | $this->add_control( 'lost_password_url', [ |
| 466 | 'label' => __( 'Custom Lost Password URL', 'essential-addons-for-elementor-lite' ), |
| 467 | 'label_block' => true, |
| 468 | 'type' => Controls_Manager::URL, |
| 469 | 'show_external' => false, |
| 470 | 'dynamic' => [ |
| 471 | 'active' => true, |
| 472 | ], |
| 473 | 'condition' => [ |
| 474 | 'lost_password_link_type' => 'custom', |
| 475 | 'show_lost_password' => 'yes', |
| 476 | ], |
| 477 | ] ); |
| 478 | $this->add_control( 'login_show_remember_me', [ |
| 479 | 'label' => __( 'Remember Me Field', 'essential-addons-for-elementor-lite' ), |
| 480 | 'type' => Controls_Manager::SWITCHER, |
| 481 | 'default' => 'yes', |
| 482 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 483 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 484 | ] ); |
| 485 | $this->add_control( 'remember_text', [ |
| 486 | 'label' => __( 'Remember Me Field Text', 'essential-addons-for-elementor-lite' ), |
| 487 | 'label_block' => true, |
| 488 | 'type' => Controls_Manager::TEXT, |
| 489 | 'dynamic' => [ |
| 490 | 'active' => true, |
| 491 | ], |
| 492 | 'default' => __( 'Remember Me', 'essential-addons-for-elementor-lite' ), |
| 493 | 'condition' => [ |
| 494 | 'login_show_remember_me' => 'yes', |
| 495 | ], |
| 496 | 'ai' => [ |
| 497 | 'active' => false, |
| 498 | ], |
| 499 | ] ); |
| 500 | if ( $this->user_can_register ) { |
| 501 | $this->add_control( 'reg_hr', [ |
| 502 | 'type' => Controls_Manager::DIVIDER, |
| 503 | ] ); |
| 504 | $this->add_control( 'show_register_link', [ |
| 505 | 'label' => __( 'Show Register Link', 'essential-addons-for-elementor-lite' ), |
| 506 | 'type' => Controls_Manager::SWITCHER, |
| 507 | 'default' => 'yes', |
| 508 | 'separator' => 'before', |
| 509 | |
| 510 | ] ); |
| 511 | $this->add_control( 'registration_link_text', [ |
| 512 | 'label' => __( 'Register Link Text', 'essential-addons-for-elementor-lite' ), |
| 513 | 'label_block' => true, |
| 514 | 'description' => __( 'You can put text in two lines to make the last line linkable. Pro Tip: You can keep the first line empty and put the text only in the second line to get a link only.', 'essential-addons-for-elementor-lite' ), |
| 515 | 'type' => Controls_Manager::TEXTAREA, |
| 516 | 'rows' => 2, |
| 517 | 'dynamic' => [ |
| 518 | 'active' => true, |
| 519 | ], |
| 520 | 'default' => __( " \nRegister Now", 'essential-addons-for-elementor-lite' ), |
| 521 | 'condition' => [ |
| 522 | 'show_register_link' => 'yes', |
| 523 | ], |
| 524 | ] ); |
| 525 | $this->add_control( 'registration_link_action', [ |
| 526 | 'label' => __( 'Registration Link Action', 'essential-addons-for-elementor-lite' ), |
| 527 | 'label_block' => true, |
| 528 | 'type' => Controls_Manager::SELECT, |
| 529 | 'options' => [ |
| 530 | 'default' => __( 'WordPress Registration Page', 'essential-addons-for-elementor-lite' ), |
| 531 | 'custom' => __( 'Custom URL', 'essential-addons-for-elementor-lite' ), |
| 532 | 'form' => __( 'Show Register Form', 'essential-addons-for-elementor-lite' ), |
| 533 | ], |
| 534 | 'default' => 'form', |
| 535 | 'condition' => [ |
| 536 | 'show_register_link' => 'yes', |
| 537 | ], |
| 538 | ] ); |
| 539 | $this->add_control( 'custom_register_url', [ |
| 540 | 'label' => __( 'Custom Register URL', 'essential-addons-for-elementor-lite' ), |
| 541 | 'label_block' => true, |
| 542 | 'type' => Controls_Manager::URL, |
| 543 | 'show_external' => false, |
| 544 | 'dynamic' => [ |
| 545 | 'active' => true, |
| 546 | ], |
| 547 | 'condition' => [ |
| 548 | 'registration_link_action' => 'custom', |
| 549 | 'show_register_link' => 'yes', |
| 550 | ], |
| 551 | ] ); |
| 552 | } else { |
| 553 | $this->add_control( 'show_register_link', [ |
| 554 | 'label' => __( 'Show Register Link', 'essential-addons-for-elementor-lite' ), |
| 555 | 'type' => Controls_Manager::HIDDEN, |
| 556 | 'default' => 'no', |
| 557 | 'separator' => 'before', |
| 558 | ] ); |
| 559 | } |
| 560 | $this->end_popover(); |
| 561 | |
| 562 | |
| 563 | /*--show registration related control only if registration is enable on the site--*/ |
| 564 | if ( $this->user_can_register ) { |
| 565 | $this->add_control( 'gen_reg_content_po_toggle', [ |
| 566 | 'label' => __( 'Register Form General', 'essential-addons-for-elementor-lite' ), |
| 567 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 568 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 569 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 570 | 'return_value' => 'yes', |
| 571 | 'default' => 'yes', |
| 572 | ] ); |
| 573 | $this->start_popover(); |
| 574 | $this->add_control( 'show_login_link', [ |
| 575 | 'label' => __( 'Show Login Link', 'essential-addons-for-elementor-lite' ), |
| 576 | 'type' => Controls_Manager::SWITCHER, |
| 577 | 'default' => 'yes', |
| 578 | ] ); |
| 579 | $this->add_control( 'login_link_text', [ |
| 580 | 'label' => __( 'Login Link Text', 'essential-addons-for-elementor-lite' ), |
| 581 | 'label_block' => true, |
| 582 | 'description' => __( 'You can put text in two lines to make the last line linkable. Pro Tip: You can keep the first line empty and put the text only in the second line to get a link only.', 'essential-addons-for-elementor-lite' ), |
| 583 | 'type' => Controls_Manager::TEXTAREA, |
| 584 | 'rows' => 2, |
| 585 | 'dynamic' => [ |
| 586 | 'active' => true, |
| 587 | ], |
| 588 | 'default' => __( " \nSign In", 'essential-addons-for-elementor-lite' ), |
| 589 | 'condition' => [ |
| 590 | 'show_login_link' => 'yes', |
| 591 | ], |
| 592 | ] ); |
| 593 | $this->add_control( 'login_link_action', [ |
| 594 | 'label' => __( 'Login Link Action', 'essential-addons-for-elementor-lite' ), |
| 595 | 'label_block' => true, |
| 596 | 'type' => Controls_Manager::SELECT, |
| 597 | 'options' => [ |
| 598 | 'default' => __( 'Default WordPress Page', 'essential-addons-for-elementor-lite' ), |
| 599 | 'custom' => __( 'Custom URL', 'essential-addons-for-elementor-lite' ), |
| 600 | 'form' => __( 'Show Login Form', 'essential-addons-for-elementor-lite' ), |
| 601 | ], |
| 602 | 'default' => 'form', |
| 603 | 'condition' => [ |
| 604 | 'show_login_link' => 'yes', |
| 605 | ], |
| 606 | ] ); |
| 607 | $this->add_control( 'custom_login_url', [ |
| 608 | 'label' => __( 'Custom Login URL', 'essential-addons-for-elementor-lite' ), |
| 609 | 'label_block' => true, |
| 610 | 'show_external' => false, |
| 611 | 'type' => Controls_Manager::URL, |
| 612 | 'dynamic' => [ |
| 613 | 'active' => true, |
| 614 | ], |
| 615 | 'condition' => [ |
| 616 | 'login_link_action' => 'custom', |
| 617 | 'show_login_link' => 'yes', |
| 618 | ], |
| 619 | ] ); |
| 620 | do_action( 'eael/login-register/mailchimp-integration', $this ); |
| 621 | $this->end_popover(); |
| 622 | |
| 623 | } else { |
| 624 | $this->add_control( 'show_login_link', [ |
| 625 | 'label' => __( 'Show Login Link', 'essential-addons-for-elementor-lite' ), |
| 626 | 'type' => Controls_Manager::HIDDEN, |
| 627 | 'default' => 'no', |
| 628 | ] ); |
| 629 | } |
| 630 | |
| 631 | // Lost Password Form general settings starts |
| 632 | $this->add_control( 'gen_lostpassword_content_po_toggle', [ |
| 633 | 'label' => __( 'Lost Password Form General', 'essential-addons-for-elementor-lite' ), |
| 634 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 635 | 'label_off' => __( 'Controls', 'essential-addons-for-elementor-lite' ), |
| 636 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 637 | 'return_value' => 'yes', |
| 638 | 'default' => 'yes', |
| 639 | ] ); |
| 640 | $this->start_popover(); |
| 641 | $this->add_control( 'show_login_link_lostpassword', [ |
| 642 | 'label' => __( 'Show Login Link', 'essential-addons-for-elementor-lite' ), |
| 643 | 'type' => Controls_Manager::SWITCHER, |
| 644 | 'default' => 'yes', |
| 645 | ] ); |
| 646 | $this->add_control( 'login_link_text_lostpassword', [ |
| 647 | 'label' => __( 'Login Link Text', 'essential-addons-for-elementor-lite' ), |
| 648 | 'label_block' => true, |
| 649 | 'description' => __( 'You can put text in two lines to make the last line linkable. Pro Tip: You can keep the first line empty and put the text only in the second line to get a link only.', 'essential-addons-for-elementor-lite' ), |
| 650 | 'type' => Controls_Manager::TEXTAREA, |
| 651 | 'rows' => 2, |
| 652 | 'dynamic' => [ |
| 653 | 'active' => true, |
| 654 | ], |
| 655 | 'default' => __( " \nSign In", 'essential-addons-for-elementor-lite' ), |
| 656 | 'condition' => [ |
| 657 | 'show_login_link_lostpassword' => 'yes', |
| 658 | ], |
| 659 | ] ); |
| 660 | $this->add_control( 'login_link_action_lostpassword', [ |
| 661 | 'label' => __( 'Login Link Action', 'essential-addons-for-elementor-lite' ), |
| 662 | 'label_block' => true, |
| 663 | 'type' => Controls_Manager::SELECT, |
| 664 | 'options' => [ |
| 665 | 'default' => __( 'Default WordPress Page', 'essential-addons-for-elementor-lite' ), |
| 666 | 'custom' => __( 'Custom URL', 'essential-addons-for-elementor-lite' ), |
| 667 | 'form' => __( 'Show Login Form', 'essential-addons-for-elementor-lite' ), |
| 668 | ], |
| 669 | 'default' => 'form', |
| 670 | 'condition' => [ |
| 671 | 'show_login_link_lostpassword' => 'yes', |
| 672 | ], |
| 673 | ] ); |
| 674 | $this->add_control( 'custom_login_url_lostpass', [ |
| 675 | 'label' => __( 'Custom Login URL', 'essential-addons-for-elementor-lite' ), |
| 676 | 'label_block' => true, |
| 677 | 'show_external' => false, |
| 678 | 'type' => Controls_Manager::URL, |
| 679 | 'dynamic' => [ |
| 680 | 'active' => true, |
| 681 | ], |
| 682 | 'condition' => [ |
| 683 | 'login_link_action_lostpassword' => 'custom', |
| 684 | 'show_login_link_lostpassword' => 'yes', |
| 685 | ], |
| 686 | ] ); |
| 687 | $this->end_popover(); |
| 688 | // Lost Password Form general settings ends |
| 689 | $this->add_control( 'enable_login_register_recaptcha', [ |
| 690 | 'label' => __( 'Enable Google reCAPTCHA', 'essential-addons-for-elementor-lite' ), |
| 691 | 'description' => __( 'reCAPTCHA will prevent spam login from bots.', 'essential-addons-for-elementor-lite' ), |
| 692 | 'type' => Controls_Manager::SWITCHER, |
| 693 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 694 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 695 | 'return_value' => 'yes', |
| 696 | 'default' => 'yes', |
| 697 | ] ); |
| 698 | |
| 699 | $this->add_control( 'login_register_recaptcha_version', [ |
| 700 | 'label' => __( 'reCAPTCHA version', 'essential-addons-for-elementor-lite' ), |
| 701 | 'label_block' => false, |
| 702 | 'type' => Controls_Manager::SELECT, |
| 703 | 'options' => [ |
| 704 | 'v2' => __( 'v2', 'essential-addons-for-elementor-lite' ), |
| 705 | 'v3' => __( 'v3', 'essential-addons-for-elementor-lite' ), |
| 706 | ], |
| 707 | 'default' => 'v2', |
| 708 | 'condition' => [ |
| 709 | 'enable_login_register_recaptcha' => 'yes', |
| 710 | ], |
| 711 | ] ); |
| 712 | |
| 713 | $this->add_control( 'login_register_recaptcha_v3_description', [ |
| 714 | 'type' => Controls_Manager::RAW_HTML, |
| 715 | 'content_classes' => 'elementor-control-field-description', |
| 716 | 'raw' => __( '<p style="margin-top:-15px">v3 will be applied to both forms. After saving, reload the preview to see the changes.</p>', 'essential-addons-for-elementor-lite' ), |
| 717 | 'condition' => [ |
| 718 | 'login_register_recaptcha_version' => 'v3', |
| 719 | 'enable_login_register_recaptcha' => 'yes', |
| 720 | ], |
| 721 | ] ); |
| 722 | |
| 723 | $this->add_control( 'enable_login_recaptcha', [ |
| 724 | 'label' => __( 'Apply on Login Form', 'essential-addons-for-elementor-lite' ), |
| 725 | 'type' => Controls_Manager::SWITCHER, |
| 726 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 727 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 728 | 'return_value' => 'yes', |
| 729 | 'condition' => [ |
| 730 | 'enable_login_register_recaptcha' => 'yes', |
| 731 | 'login_register_recaptcha_version' => 'v2', |
| 732 | ], |
| 733 | ] ); |
| 734 | |
| 735 | if( $this->user_can_register ) { |
| 736 | $this->add_control( 'enable_register_recaptcha', [ |
| 737 | 'label' => __( 'Apply on Registration Form', 'essential-addons-for-elementor-lite' ), |
| 738 | 'type' => Controls_Manager::SWITCHER, |
| 739 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 740 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 741 | 'return_value' => 'yes', |
| 742 | 'condition' => [ |
| 743 | 'enable_login_register_recaptcha' => 'yes', |
| 744 | 'login_register_recaptcha_version' => 'v2', |
| 745 | ], |
| 746 | ] ); |
| 747 | } |
| 748 | |
| 749 | if ( empty( $this->recaptcha_sitekey ) ) { |
| 750 | $this->add_control( 'eael_recaptcha_keys_missing', [ |
| 751 | 'type' => Controls_Manager::RAW_HTML, |
| 752 | 'raw' => sprintf( __( 'reCAPTCHA v2 API keys are missing. Please add them from %sDashboard >> Essential Addons >> Elements >> Login | Register Form %sSettings', 'essential-addons-for-elementor-lite' ), '<strong>', '</strong>' ), |
| 753 | 'content_classes' => 'eael-warning', |
| 754 | 'condition' => [ |
| 755 | 'enable_login_register_recaptcha' => 'yes', |
| 756 | 'login_register_recaptcha_version' => 'v2', |
| 757 | ], |
| 758 | ] ); |
| 759 | } |
| 760 | |
| 761 | if ( empty( $this->recaptcha_sitekey_v3 ) ) { |
| 762 | $this->add_control( 'eael_recaptcha_keys_missing_v3', [ |
| 763 | 'type' => Controls_Manager::RAW_HTML, |
| 764 | 'raw' => sprintf( __( 'reCAPTCHA v3 API keys are missing. Please add them from %sDashboard >> Essential Addons >> Elements >> Login | Register Form %sSettings', 'essential-addons-for-elementor-lite' ), '<strong>', '</strong>' ), |
| 765 | 'content_classes' => 'eael-warning', |
| 766 | 'condition' => [ |
| 767 | 'enable_login_register_recaptcha' => 'yes', |
| 768 | 'login_register_recaptcha_version' => 'v3', |
| 769 | ], |
| 770 | ] ); |
| 771 | } |
| 772 | |
| 773 | do_action( 'eael/login-register/after-general-controls', $this ); |
| 774 | |
| 775 | if ( !$this->pro_enabled ) { |
| 776 | $this->add_control( 'enable_ajax', [ |
| 777 | 'label' => sprintf( __( 'Submit Form via AJAX %s', 'essential-addons-for-elementor-lite' ), '<i class="eael-pro-labe eicon-pro-icon"></i>' ), |
| 778 | 'type' => Controls_Manager::SWITCHER, |
| 779 | 'classes' => 'eael-pro-control', |
| 780 | ] ); |
| 781 | } |
| 782 | |
| 783 | $this->end_controls_section(); |
| 784 | } |
| 785 | |
| 786 | /** |
| 787 | * It adds controls related to Login Form Fields section to the Widget Content Tab |
| 788 | */ |
| 789 | protected function init_content_login_fields_controls() { |
| 790 | $this->start_controls_section( 'section_content_login_fields', [ |
| 791 | 'label' => __( 'Login Form Fields', 'essential-addons-for-elementor-lite' ), |
| 792 | 'conditions' => $this->get_form_controls_display_condition( 'login' ), |
| 793 | ] ); |
| 794 | |
| 795 | $this->add_control( 'login_label_types', [ |
| 796 | 'label' => __( 'Labels & Placeholders', 'essential-addons-for-elementor-lite' ), |
| 797 | 'type' => Controls_Manager::SELECT, |
| 798 | 'options' => [ |
| 799 | 'default' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 800 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 801 | 'none' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 802 | ], |
| 803 | 'default' => 'default', |
| 804 | ] ); |
| 805 | |
| 806 | $this->add_control( 'login_labels_heading', [ |
| 807 | 'label' => __( 'Labels', 'essential-addons-for-elementor-lite' ), |
| 808 | 'type' => Controls_Manager::HEADING, |
| 809 | 'separator' => 'before', |
| 810 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 811 | ] ); |
| 812 | |
| 813 | |
| 814 | $this->add_control( 'login_user_label', [ |
| 815 | 'label' => __( 'Username Label', 'essential-addons-for-elementor-lite' ), |
| 816 | 'placeholder' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 817 | 'default' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 818 | 'type' => Controls_Manager::TEXT, |
| 819 | 'dynamic' => [ 'active' => true, ], |
| 820 | 'label_block' => true, |
| 821 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 822 | 'ai' => [ |
| 823 | 'active' => false, |
| 824 | ], |
| 825 | ] ); |
| 826 | |
| 827 | $this->add_control( 'login_password_label', [ |
| 828 | 'label' => __( 'Password Label', 'essential-addons-for-elementor-lite' ), |
| 829 | 'placeholder' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 830 | 'default' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 831 | 'type' => Controls_Manager::TEXT, |
| 832 | 'dynamic' => [ 'active' => true, ], |
| 833 | 'label_block' => true, |
| 834 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 835 | 'ai' => [ |
| 836 | 'active' => false, |
| 837 | ], |
| 838 | ] ); |
| 839 | |
| 840 | $this->add_control( 'login_placeholders_heading', [ |
| 841 | 'label' => esc_html__( 'Placeholders', 'essential-addons-for-elementor-lite' ), |
| 842 | 'type' => Controls_Manager::HEADING, |
| 843 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 844 | 'separator' => 'before', |
| 845 | ] ); |
| 846 | |
| 847 | $this->add_control( 'login_user_placeholder', [ |
| 848 | 'label' => __( 'Username Placeholder', 'essential-addons-for-elementor-lite' ), |
| 849 | 'placeholder' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 850 | 'default' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 851 | 'type' => Controls_Manager::TEXT, |
| 852 | 'dynamic' => [ 'active' => true, ], |
| 853 | 'label_block' => true, |
| 854 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 855 | 'ai' => [ |
| 856 | 'active' => false, |
| 857 | ], |
| 858 | ] ); |
| 859 | |
| 860 | $this->add_control( 'login_password_placeholder', [ |
| 861 | 'label' => __( 'Password Placeholder', 'essential-addons-for-elementor-lite' ), |
| 862 | 'placeholder' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 863 | 'default' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 864 | 'type' => Controls_Manager::TEXT, |
| 865 | 'dynamic' => [ 'active' => true, ], |
| 866 | 'label_block' => true, |
| 867 | 'condition' => [ 'login_label_types' => 'custom', ], |
| 868 | 'ai' => [ |
| 869 | 'active' => false, |
| 870 | ], |
| 871 | ] ); |
| 872 | |
| 873 | $this->add_responsive_control( 'login_field_width', [ |
| 874 | 'label' => esc_html__( 'Input Fields width', 'essential-addons-for-elementor-lite' ), |
| 875 | 'type' => Controls_Manager::SLIDER, |
| 876 | 'size_units' => [ |
| 877 | 'px', |
| 878 | '%', |
| 879 | ], |
| 880 | 'range' => [ |
| 881 | 'px' => [ |
| 882 | 'min' => 0, |
| 883 | 'max' => 500, |
| 884 | 'step' => 5, |
| 885 | ], |
| 886 | '%' => [ |
| 887 | 'min' => 0, |
| 888 | 'max' => 100, |
| 889 | ], |
| 890 | ], |
| 891 | 'default' => [ |
| 892 | 'unit' => '%', |
| 893 | 'size' => 100, |
| 894 | ], |
| 895 | 'selectors' => [ |
| 896 | '{{WRAPPER}} .eael-login-form .eael-user-login' => 'width: {{SIZE}}{{UNIT}};', |
| 897 | '{{WRAPPER}} .eael-login-form .eael-user-password' => 'width: {{SIZE}}{{UNIT}};', |
| 898 | ], |
| 899 | 'separator' => 'before', |
| 900 | ] ); |
| 901 | |
| 902 | $this->add_control( 'password_toggle', [ |
| 903 | 'label' => __( 'Password Visibility Icon', 'essential-addons-for-elementor-lite' ), |
| 904 | 'type' => Controls_Manager::SWITCHER, |
| 905 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 906 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 907 | 'default' => 'yes', |
| 908 | ] ); |
| 909 | do_action( 'eael/login-register/after-pass-visibility-controls', $this ); |
| 910 | |
| 911 | $this->add_control( 'login_form_fields_remember_me_heading', [ |
| 912 | 'label' => esc_html__( 'Remember Me', 'essential-addons-for-elementor-lite' ), |
| 913 | 'type' => Controls_Manager::HEADING, |
| 914 | 'separator' => 'before', |
| 915 | 'condition' => [ |
| 916 | 'login_show_remember_me' => 'yes', |
| 917 | ] |
| 918 | ] ); |
| 919 | |
| 920 | $this->add_control( 'login_form_fields_remember_me_checked', [ |
| 921 | 'label' => __( 'Checked By Default', 'essential-addons-for-elementor-lite' ), |
| 922 | 'type' => Controls_Manager::SWITCHER, |
| 923 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 924 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 925 | 'default' => '', |
| 926 | 'condition' => [ |
| 927 | 'login_show_remember_me' => 'yes', |
| 928 | ] |
| 929 | ] ); |
| 930 | |
| 931 | /*--Login Fields Button--*/ |
| 932 | $this->add_control( 'login_button_heading', [ |
| 933 | 'label' => esc_html__( 'Login Button', 'essential-addons-for-elementor-lite' ), |
| 934 | 'type' => Controls_Manager::HEADING, |
| 935 | 'separator' => 'before', |
| 936 | ] ); |
| 937 | |
| 938 | $this->add_control( 'login_button_text', [ |
| 939 | 'label' => __( 'Button Text', 'essential-addons-for-elementor-lite' ), |
| 940 | 'type' => Controls_Manager::TEXT, |
| 941 | 'dynamic' => [ 'active' => true, ], |
| 942 | 'default' => __( 'Log In', 'essential-addons-for-elementor-lite' ), |
| 943 | 'placeholder' => __( 'Log In', 'essential-addons-for-elementor-lite' ), |
| 944 | 'ai' => [ |
| 945 | 'active' => false, |
| 946 | ], |
| 947 | ] ); |
| 948 | |
| 949 | $this->end_controls_section(); |
| 950 | } |
| 951 | |
| 952 | /** |
| 953 | * It adds controls related to Lost Password Form Fields section to the Widget Content Tab |
| 954 | */ |
| 955 | protected function init_content_lostpassword_fields_controls() { |
| 956 | $this->start_controls_section( 'section_content_lostpass_fields', [ |
| 957 | 'label' => __( 'Lost Password Form Fields', 'essential-addons-for-elementor-lite' ), |
| 958 | 'conditions' => [ |
| 959 | 'relation' => 'or', |
| 960 | 'terms' => [ |
| 961 | [ |
| 962 | 'relation' => 'and', |
| 963 | 'terms' => [ |
| 964 | [ |
| 965 | 'name' => 'show_lost_password', |
| 966 | 'value' => 'yes' |
| 967 | ], |
| 968 | [ |
| 969 | 'name' => 'lost_password_link_type', |
| 970 | 'value' => 'form', |
| 971 | ] |
| 972 | ] |
| 973 | ], |
| 974 | [ |
| 975 | 'name' => 'default_form_type', |
| 976 | 'value' => 'lostpassword', |
| 977 | ] |
| 978 | ], |
| 979 | ], |
| 980 | ] ); |
| 981 | |
| 982 | $this->add_control( 'lostpassword_label_types', [ |
| 983 | 'label' => __( 'Label & Placeholder', 'essential-addons-for-elementor-lite' ), |
| 984 | 'type' => Controls_Manager::SELECT, |
| 985 | 'options' => [ |
| 986 | 'default' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 987 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 988 | 'none' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 989 | ], |
| 990 | 'default' => 'default', |
| 991 | ] ); |
| 992 | |
| 993 | $this->add_control( 'lostpassword_labels_heading', [ |
| 994 | 'label' => __( 'Label', 'essential-addons-for-elementor-lite' ), |
| 995 | 'type' => Controls_Manager::HEADING, |
| 996 | 'separator' => 'before', |
| 997 | 'condition' => [ 'lostpassword_label_types' => 'custom', ], |
| 998 | ] ); |
| 999 | |
| 1000 | |
| 1001 | $this->add_control( 'lostpassword_user_label', [ |
| 1002 | 'label' => __( 'Username Label', 'essential-addons-for-elementor-lite' ), |
| 1003 | 'placeholder' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 1004 | 'default' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 1005 | 'type' => Controls_Manager::TEXT, |
| 1006 | 'dynamic' => [ 'active' => true, ], |
| 1007 | 'label_block' => true, |
| 1008 | 'condition' => [ 'lostpassword_label_types' => 'custom', ], |
| 1009 | 'ai' => [ |
| 1010 | 'active' => false, |
| 1011 | ], |
| 1012 | ] ); |
| 1013 | |
| 1014 | $this->add_control( 'lostpassword_placeholders_heading', [ |
| 1015 | 'label' => esc_html__( 'Placeholder', 'essential-addons-for-elementor-lite' ), |
| 1016 | 'type' => Controls_Manager::HEADING, |
| 1017 | 'condition' => [ 'lostpassword_label_types' => 'custom', ], |
| 1018 | 'separator' => 'before', |
| 1019 | ] ); |
| 1020 | |
| 1021 | $this->add_control( 'lostpassword_user_placeholder', [ |
| 1022 | 'label' => __( 'Username Placeholder', 'essential-addons-for-elementor-lite' ), |
| 1023 | 'placeholder' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 1024 | 'default' => __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ), |
| 1025 | 'type' => Controls_Manager::TEXT, |
| 1026 | 'dynamic' => [ 'active' => true, ], |
| 1027 | 'label_block' => true, |
| 1028 | 'condition' => [ 'lostpassword_label_types' => 'custom', ], |
| 1029 | 'ai' => [ |
| 1030 | 'active' => false, |
| 1031 | ], |
| 1032 | ] ); |
| 1033 | |
| 1034 | $this->add_responsive_control( 'lostpassword_field_width', [ |
| 1035 | 'label' => esc_html__( 'Input Field width', 'essential-addons-for-elementor-lite' ), |
| 1036 | 'type' => Controls_Manager::SLIDER, |
| 1037 | 'size_units' => [ |
| 1038 | 'px', |
| 1039 | '%', |
| 1040 | ], |
| 1041 | 'range' => [ |
| 1042 | 'px' => [ |
| 1043 | 'min' => 0, |
| 1044 | 'max' => 500, |
| 1045 | 'step' => 5, |
| 1046 | ], |
| 1047 | '%' => [ |
| 1048 | 'min' => 0, |
| 1049 | 'max' => 100, |
| 1050 | ], |
| 1051 | ], |
| 1052 | 'default' => [ |
| 1053 | 'unit' => '%', |
| 1054 | 'size' => 100, |
| 1055 | ], |
| 1056 | 'selectors' => [ |
| 1057 | '{{WRAPPER}} .eael-lostpassword-form .eael-lr-form-group' => 'width: {{SIZE}}{{UNIT}};', |
| 1058 | ], |
| 1059 | 'separator' => 'before', |
| 1060 | ] ); |
| 1061 | |
| 1062 | /*--Lost Password Fields Button--*/ |
| 1063 | $this->add_control( 'lostpassword_button_heading', [ |
| 1064 | 'label' => esc_html__( 'Lost Password Button', 'essential-addons-for-elementor-lite' ), |
| 1065 | 'type' => Controls_Manager::HEADING, |
| 1066 | 'separator' => 'before', |
| 1067 | ] ); |
| 1068 | |
| 1069 | $this->add_control( 'lostpassword_button_text', [ |
| 1070 | 'label' => __( 'Button Text', 'essential-addons-for-elementor-lite' ), |
| 1071 | 'type' => Controls_Manager::TEXT, |
| 1072 | 'dynamic' => [ 'active' => true, ], |
| 1073 | 'default' => __( 'Reset Password', 'essential-addons-for-elementor-lite' ), |
| 1074 | 'placeholder' => __( 'Reset Password', 'essential-addons-for-elementor-lite' ), |
| 1075 | 'ai' => [ |
| 1076 | 'active' => false, |
| 1077 | ], |
| 1078 | ] ); |
| 1079 | |
| 1080 | $this->end_controls_section(); |
| 1081 | } |
| 1082 | |
| 1083 | /** |
| 1084 | * It adds controls related to Reset Password Form Fields section to the Widget Content Tab |
| 1085 | */ |
| 1086 | protected function init_content_resetpassword_fields_controls() { |
| 1087 | $this->start_controls_section( 'section_content_resetpass_fields', [ |
| 1088 | 'label' => __( 'Reset Password Form Fields', 'essential-addons-for-elementor-lite' ), |
| 1089 | 'conditions' => [ |
| 1090 | 'relation' => 'or', |
| 1091 | 'terms' => [ |
| 1092 | [ |
| 1093 | 'relation' => 'and', |
| 1094 | 'terms' => [ |
| 1095 | [ |
| 1096 | 'name' => 'show_lost_password', |
| 1097 | 'value' => 'yes' |
| 1098 | ], |
| 1099 | [ |
| 1100 | 'name' => 'lost_password_link_type', |
| 1101 | 'value' => 'form', |
| 1102 | ] |
| 1103 | ] |
| 1104 | ], |
| 1105 | [ |
| 1106 | 'name' => 'default_form_type', |
| 1107 | 'value' => 'lostpassword', |
| 1108 | ] |
| 1109 | ], |
| 1110 | ], |
| 1111 | ] ); |
| 1112 | |
| 1113 | $this->add_control( 'resetpassword_label_types', [ |
| 1114 | 'label' => __( 'Labels & Placeholders', 'essential-addons-for-elementor-lite' ), |
| 1115 | 'type' => Controls_Manager::SELECT, |
| 1116 | 'options' => [ |
| 1117 | 'default' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 1118 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 1119 | 'none' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 1120 | ], |
| 1121 | 'default' => 'default', |
| 1122 | ] ); |
| 1123 | |
| 1124 | $this->add_control( 'resetpassword_labels_heading', [ |
| 1125 | 'label' => __( 'Labels', 'essential-addons-for-elementor-lite' ), |
| 1126 | 'type' => Controls_Manager::HEADING, |
| 1127 | 'separator' => 'before', |
| 1128 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1129 | ] ); |
| 1130 | |
| 1131 | $this->add_control( 'resetpassword_password_label', [ |
| 1132 | 'label' => __( 'Password Label', 'essential-addons-for-elementor-lite' ), |
| 1133 | 'placeholder' => __( 'New Password', 'essential-addons-for-elementor-lite' ), |
| 1134 | 'default' => __( 'New Password', 'essential-addons-for-elementor-lite' ), |
| 1135 | 'type' => Controls_Manager::TEXT, |
| 1136 | 'dynamic' => [ 'active' => true, ], |
| 1137 | 'label_block' => true, |
| 1138 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1139 | 'ai' => [ |
| 1140 | 'active' => false, |
| 1141 | ], |
| 1142 | ] ); |
| 1143 | |
| 1144 | $this->add_control( 'resetpassword_confirm_password_label', [ |
| 1145 | 'label' => __( 'Confirm Password Label', 'essential-addons-for-elementor-lite' ), |
| 1146 | 'placeholder' => __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ), |
| 1147 | 'default' => __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ), |
| 1148 | 'type' => Controls_Manager::TEXT, |
| 1149 | 'dynamic' => [ 'active' => true, ], |
| 1150 | 'label_block' => true, |
| 1151 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1152 | 'ai' => [ |
| 1153 | 'active' => false, |
| 1154 | ], |
| 1155 | ] ); |
| 1156 | |
| 1157 | $this->add_control( 'resetpassword_placeholders_heading', [ |
| 1158 | 'label' => esc_html__( 'Placeholders', 'essential-addons-for-elementor-lite' ), |
| 1159 | 'type' => Controls_Manager::HEADING, |
| 1160 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1161 | 'separator' => 'before', |
| 1162 | ] ); |
| 1163 | |
| 1164 | $this->add_control( 'resetpassword_password_placeholder', [ |
| 1165 | 'label' => __( 'Password Placeholder', 'essential-addons-for-elementor-lite' ), |
| 1166 | 'placeholder' => __( 'New Password', 'essential-addons-for-elementor-lite' ), |
| 1167 | 'default' => __( 'New Password', 'essential-addons-for-elementor-lite' ), |
| 1168 | 'type' => Controls_Manager::TEXT, |
| 1169 | 'dynamic' => [ 'active' => true, ], |
| 1170 | 'label_block' => true, |
| 1171 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1172 | 'ai' => [ |
| 1173 | 'active' => false, |
| 1174 | ], |
| 1175 | ] ); |
| 1176 | |
| 1177 | $this->add_control( 'resetpassword_confirm_password_placeholder', [ |
| 1178 | 'label' => __( 'Confirm Password Placeholder', 'essential-addons-for-elementor-lite' ), |
| 1179 | 'placeholder' => __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ), |
| 1180 | 'default' => __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ), |
| 1181 | 'type' => Controls_Manager::TEXT, |
| 1182 | 'dynamic' => [ 'active' => true, ], |
| 1183 | 'label_block' => true, |
| 1184 | 'condition' => [ 'resetpassword_label_types' => 'custom', ], |
| 1185 | 'ai' => [ |
| 1186 | 'active' => false, |
| 1187 | ], |
| 1188 | ] ); |
| 1189 | |
| 1190 | $this->add_responsive_control( 'resetpassword_field_width', [ |
| 1191 | 'label' => esc_html__( 'Input Fields width', 'essential-addons-for-elementor-lite' ), |
| 1192 | 'type' => Controls_Manager::SLIDER, |
| 1193 | 'size_units' => [ |
| 1194 | 'px', |
| 1195 | '%', |
| 1196 | ], |
| 1197 | 'range' => [ |
| 1198 | 'px' => [ |
| 1199 | 'min' => 0, |
| 1200 | 'max' => 500, |
| 1201 | 'step' => 5, |
| 1202 | ], |
| 1203 | '%' => [ |
| 1204 | 'min' => 0, |
| 1205 | 'max' => 100, |
| 1206 | ], |
| 1207 | ], |
| 1208 | 'default' => [ |
| 1209 | 'unit' => '%', |
| 1210 | 'size' => 100, |
| 1211 | ], |
| 1212 | 'selectors' => [ |
| 1213 | '{{WRAPPER}} .eael-resetpassword-form .eael-lr-form-group ' => 'width: {{SIZE}}{{UNIT}};', |
| 1214 | ], |
| 1215 | 'separator' => 'before', |
| 1216 | ] ); |
| 1217 | |
| 1218 | $this->add_control( 'password_toggle_resetpassword', [ |
| 1219 | 'label' => __( 'Password Visibility Icon', 'essential-addons-for-elementor-lite' ), |
| 1220 | 'type' => Controls_Manager::SWITCHER, |
| 1221 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 1222 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 1223 | 'default' => 'yes', |
| 1224 | ] ); |
| 1225 | |
| 1226 | /*--Reset Password Fields Button--*/ |
| 1227 | $this->add_control( 'resetpassword_button_heading', [ |
| 1228 | 'label' => esc_html__( 'Reset Password Button', 'essential-addons-for-elementor-lite' ), |
| 1229 | 'type' => Controls_Manager::HEADING, |
| 1230 | 'separator' => 'before', |
| 1231 | ] ); |
| 1232 | |
| 1233 | $this->add_control( 'resetpassword_button_text', [ |
| 1234 | 'label' => __( 'Button Text', 'essential-addons-for-elementor-lite' ), |
| 1235 | 'type' => Controls_Manager::TEXT, |
| 1236 | 'dynamic' => [ 'active' => true, ], |
| 1237 | 'default' => __( 'Save Password', 'essential-addons-for-elementor-lite' ), |
| 1238 | 'placeholder' => __( 'Save Password', 'essential-addons-for-elementor-lite' ), |
| 1239 | 'ai' => [ |
| 1240 | 'active' => false, |
| 1241 | ], |
| 1242 | ] ); |
| 1243 | |
| 1244 | $this->end_controls_section(); |
| 1245 | } |
| 1246 | |
| 1247 | protected function init_content_resetpassword_options_controls() { |
| 1248 | |
| 1249 | $this->start_controls_section( 'section_content_resetpassword_options', [ |
| 1250 | 'label' => __( 'Reset Password Form Options', 'essential-addons-for-elementor-lite' ), |
| 1251 | 'conditions' => $this->get_form_controls_display_condition( 'resetpassword' ), |
| 1252 | ] ); |
| 1253 | |
| 1254 | $this->add_control( 'redirect_after_resetpassword', [ |
| 1255 | 'label' => __( 'Redirect After Password Reset', 'essential-addons-for-elementor-lite' ), |
| 1256 | 'type' => Controls_Manager::SWITCHER, |
| 1257 | ] ); |
| 1258 | |
| 1259 | global $wp; |
| 1260 | $this->add_control( 'redirect_url_resetpassword', [ |
| 1261 | 'type' => Controls_Manager::URL, |
| 1262 | 'show_label' => false, |
| 1263 | 'show_external' => false, |
| 1264 | 'placeholder' => get_permalink( get_the_ID() ), |
| 1265 | 'description' => __( 'Please note that only your current domain is allowed here to keep your site secure.', 'essential-addons-for-elementor-lite' ), |
| 1266 | 'condition' => [ |
| 1267 | 'redirect_after_resetpassword' => 'yes', |
| 1268 | ], |
| 1269 | 'default' => [ |
| 1270 | 'url' => get_permalink( get_the_ID() ), |
| 1271 | 'is_external' => false, |
| 1272 | 'nofollow' => true, |
| 1273 | ], |
| 1274 | 'separator' => 'after', |
| 1275 | ] ); |
| 1276 | |
| 1277 | $this->end_controls_section(); |
| 1278 | } |
| 1279 | |
| 1280 | protected function init_form_header_controls() { |
| 1281 | $this->start_controls_section( 'section_content_lr_form_header', [ |
| 1282 | 'label' => __( 'Form Header Content', 'essential-addons-for-elementor-lite' ), |
| 1283 | ] ); |
| 1284 | |
| 1285 | $this->add_control( 'lr_form_image', [ |
| 1286 | 'label' => __( 'Form Header Image', 'essential-addons-for-elementor-lite' ), |
| 1287 | 'type' => Controls_Manager::MEDIA, |
| 1288 | 'dynamic' => [ |
| 1289 | 'active' => true, |
| 1290 | ], |
| 1291 | 'default' => [ |
| 1292 | 'url' => Utils::get_placeholder_image_src(), |
| 1293 | ], |
| 1294 | 'ai' => [ |
| 1295 | 'active' => false, |
| 1296 | ], |
| 1297 | ] ); |
| 1298 | |
| 1299 | $this->add_group_control( Group_Control_Image_Size::get_type(), [ |
| 1300 | 'name' => 'lr_form_image', |
| 1301 | // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_size` and `image_custom_dimension`. |
| 1302 | 'default' => 'full', |
| 1303 | 'separator' => 'none', |
| 1304 | ] ); |
| 1305 | |
| 1306 | $this->add_control( "lr_form_image_position", [ |
| 1307 | 'label' => __( 'Header Image Position', 'essential-addons-for-elementor-lite' ), |
| 1308 | 'type' => Controls_Manager::CHOOSE, |
| 1309 | 'options' => [ |
| 1310 | 'left' => [ |
| 1311 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 1312 | 'icon' => 'eicon-arrow-left', |
| 1313 | ], |
| 1314 | 'right' => [ |
| 1315 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 1316 | 'icon' => 'eicon-arrow-right', |
| 1317 | ], |
| 1318 | ], |
| 1319 | 'default' => 'left', |
| 1320 | ] ); |
| 1321 | |
| 1322 | $this->add_control( 'show_image_on_lostpassword_form', [ |
| 1323 | 'label' => __( 'Show on Lost Password Form', 'essential-addons-for-elementor-lite' ), |
| 1324 | 'type' => Controls_Manager::SWITCHER, |
| 1325 | 'default' => 'yes', |
| 1326 | 'conditions' => [ |
| 1327 | 'relation' => 'or', |
| 1328 | 'terms' => [ |
| 1329 | [ |
| 1330 | 'name' => "show_lost_password", |
| 1331 | 'value' => 'yes', |
| 1332 | ], |
| 1333 | [ |
| 1334 | 'name' => 'default_form_type', |
| 1335 | 'value' => 'lostpassword', |
| 1336 | ] |
| 1337 | ], |
| 1338 | ], |
| 1339 | 'separator' => 'after', |
| 1340 | ] ); |
| 1341 | |
| 1342 | $this->add_control( 'lr_form_logo', [ |
| 1343 | 'label' => __( 'Form Header Logo', 'essential-addons-for-elementor-lite' ), |
| 1344 | 'type' => Controls_Manager::MEDIA, |
| 1345 | 'dynamic' => [ |
| 1346 | 'active' => true, |
| 1347 | ], |
| 1348 | 'default' => [ |
| 1349 | 'url' => Utils::get_placeholder_image_src(), |
| 1350 | ], |
| 1351 | 'ai' => [ |
| 1352 | 'active' => false, |
| 1353 | ], |
| 1354 | ] ); |
| 1355 | |
| 1356 | $this->add_group_control( Group_Control_Image_Size::get_type(), [ |
| 1357 | 'name' => 'lr_form_logo', |
| 1358 | 'default' => 'full', |
| 1359 | 'separator' => 'none', |
| 1360 | ] ); |
| 1361 | $this->add_control( "lr_form_logo_position", [ |
| 1362 | 'label' => __( 'Form Logo Position', 'essential-addons-for-elementor-lite' ), |
| 1363 | 'type' => Controls_Manager::CHOOSE, |
| 1364 | 'options' => [ |
| 1365 | 'inline' => [ |
| 1366 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 1367 | 'icon' => 'eicon-arrow-left', |
| 1368 | ], |
| 1369 | 'block' => [ |
| 1370 | 'title' => __( 'Top', 'essential-addons-for-elementor-lite' ), |
| 1371 | 'icon' => 'eicon-arrow-up', |
| 1372 | ], |
| 1373 | ], |
| 1374 | 'default' => 'left', |
| 1375 | ] ); |
| 1376 | |
| 1377 | $this->add_control( 'show_logo_on_lostpassword_form', [ |
| 1378 | 'label' => __( 'Show on Lost Password Form', 'essential-addons-for-elementor-lite' ), |
| 1379 | 'type' => Controls_Manager::SWITCHER, |
| 1380 | 'default' => 'yes', |
| 1381 | 'conditions' => [ |
| 1382 | 'relation' => 'or', |
| 1383 | 'terms' => [ |
| 1384 | [ |
| 1385 | 'name' => "show_lost_password", |
| 1386 | 'value' => 'yes', |
| 1387 | ], |
| 1388 | [ |
| 1389 | 'name' => 'default_form_type', |
| 1390 | 'value' => 'lostpassword', |
| 1391 | ] |
| 1392 | ], |
| 1393 | ], |
| 1394 | 'separator' => 'after', |
| 1395 | ] ); |
| 1396 | |
| 1397 | $this->add_control( 'login_form_title', [ |
| 1398 | 'label' => __( 'Login Form Title', 'essential-addons-for-elementor-lite' ), |
| 1399 | 'type' => Controls_Manager::TEXT, |
| 1400 | 'dynamic' => [ 'active' => true, ], |
| 1401 | 'placeholder' => __( 'Welcome Back!', 'essential-addons-for-elementor-lite' ), |
| 1402 | 'separator' => 'before', |
| 1403 | 'ai' => [ |
| 1404 | 'active' => false, |
| 1405 | ], |
| 1406 | ] ); |
| 1407 | $this->add_control( 'login_form_subtitle', [ |
| 1408 | 'label' => __( 'Login Form Sub Title', 'essential-addons-for-elementor-lite' ), |
| 1409 | 'type' => Controls_Manager::TEXTAREA, |
| 1410 | 'dynamic' => [ 'active' => true, ], |
| 1411 | 'placeholder' => __( 'Please login to your account', 'essential-addons-for-elementor-lite' ), |
| 1412 | ] ); |
| 1413 | |
| 1414 | $this->add_control( 'register_form_title', [ |
| 1415 | 'label' => __( 'Register Form Title', 'essential-addons-for-elementor-lite' ), |
| 1416 | 'type' => Controls_Manager::TEXT, |
| 1417 | 'dynamic' => [ 'active' => true, ], |
| 1418 | 'placeholder' => __( 'Create a New Account', 'essential-addons-for-elementor-lite' ), |
| 1419 | 'separator' => 'before', |
| 1420 | 'ai' => [ |
| 1421 | 'active' => false, |
| 1422 | ], |
| 1423 | ] ); |
| 1424 | $this->add_control( 'register_form_subtitle', [ |
| 1425 | 'label' => __( 'Register Form Sub Title', 'essential-addons-for-elementor-lite' ), |
| 1426 | 'type' => Controls_Manager::TEXTAREA, |
| 1427 | 'dynamic' => [ 'active' => true, ], |
| 1428 | 'placeholder' => __( 'Create an account to enjoy awesome features.', 'essential-addons-for-elementor-lite' ), |
| 1429 | ] ); |
| 1430 | |
| 1431 | $this->add_control( 'lostpassword_form_title', [ |
| 1432 | 'label' => __( 'Lost Password Form Title', 'essential-addons-for-elementor-lite' ), |
| 1433 | 'type' => Controls_Manager::TEXT, |
| 1434 | 'dynamic' => [ 'active' => true, ], |
| 1435 | 'placeholder' => __( 'Get New Password', 'essential-addons-for-elementor-lite' ), |
| 1436 | 'separator' => 'before', |
| 1437 | 'ai' => [ |
| 1438 | 'active' => false, |
| 1439 | ], |
| 1440 | ] ); |
| 1441 | $this->add_control( 'lostpassword_form_subtitle', [ |
| 1442 | 'label' => __( 'Lost Password Form Sub Title', 'essential-addons-for-elementor-lite' ), |
| 1443 | 'type' => Controls_Manager::TEXTAREA, |
| 1444 | 'dynamic' => [ 'active' => true, ], |
| 1445 | 'placeholder' => __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.', 'essential-addons-for-elementor-lite' ), |
| 1446 | ] ); |
| 1447 | |
| 1448 | $this->add_control( 'resetpassword_form_title', [ |
| 1449 | 'label' => __( 'Reset Password Form Title', 'essential-addons-for-elementor-lite' ), |
| 1450 | 'type' => Controls_Manager::TEXT, |
| 1451 | 'dynamic' => [ 'active' => true, ], |
| 1452 | 'placeholder' => __( 'Reset Password', 'essential-addons-for-elementor-lite' ), |
| 1453 | 'separator' => 'before', |
| 1454 | 'ai' => [ |
| 1455 | 'active' => false, |
| 1456 | ], |
| 1457 | ] ); |
| 1458 | $this->add_control( 'resetpassword_form_subtitle', [ |
| 1459 | 'label' => __( 'Reset Password Form Sub Title', 'essential-addons-for-elementor-lite' ), |
| 1460 | 'type' => Controls_Manager::TEXTAREA, |
| 1461 | 'dynamic' => [ 'active' => true, ], |
| 1462 | 'placeholder' => __( 'Enter your new password below.', 'essential-addons-for-elementor-lite' ), |
| 1463 | ] ); |
| 1464 | |
| 1465 | $this->end_controls_section(); |
| 1466 | } |
| 1467 | |
| 1468 | protected function init_content_login_options_controls() { |
| 1469 | |
| 1470 | $this->start_controls_section( 'section_content_login_options', [ |
| 1471 | 'label' => __( 'Login Form Options', 'essential-addons-for-elementor-lite' ), |
| 1472 | 'conditions' => $this->get_form_controls_display_condition( 'login' ), |
| 1473 | ] ); |
| 1474 | |
| 1475 | $this->add_control( 'redirect_after_login', [ |
| 1476 | 'label' => __( 'Redirect After Login', 'essential-addons-for-elementor-lite' ), |
| 1477 | 'type' => Controls_Manager::SWITCHER, |
| 1478 | ] ); |
| 1479 | |
| 1480 | $this->add_control( 'redirect_url', [ |
| 1481 | 'type' => Controls_Manager::URL, |
| 1482 | 'show_label' => false, |
| 1483 | 'show_external' => false, |
| 1484 | 'placeholder' => admin_url(), |
| 1485 | 'description' => __( 'Please note that only your current domain is allowed here to keep your site secure.', 'essential-addons-for-elementor-lite' ), |
| 1486 | 'condition' => [ |
| 1487 | 'redirect_after_login' => 'yes', |
| 1488 | ], |
| 1489 | 'default' => [ |
| 1490 | 'url' => admin_url(), |
| 1491 | 'is_external' => false, |
| 1492 | 'nofollow' => true, |
| 1493 | ], |
| 1494 | ] ); |
| 1495 | |
| 1496 | $this->add_control( 'redirect_based_on_roles', [ |
| 1497 | 'label' => __( 'Redirect Based On User Roles', 'essential-addons-for-elementor-lite' ), |
| 1498 | 'type' => Controls_Manager::SWITCHER, |
| 1499 | 'condition' => [ |
| 1500 | 'redirect_after_login' => 'yes', |
| 1501 | ] |
| 1502 | ] ); |
| 1503 | |
| 1504 | $user_roles = $this->eael_get_role_names(); |
| 1505 | |
| 1506 | if( ! empty( $user_roles ) && is_array( $user_roles ) && count( $user_roles ) ){ |
| 1507 | foreach( $user_roles as $user_role_key => $user_role_value ){ |
| 1508 | $this->add_control( 'redirect_url_' . esc_html( $user_role_key ), [ |
| 1509 | 'type' => Controls_Manager::URL, |
| 1510 | 'label' => esc_html( __( $user_role_value, 'essential-addons-for-elementor-lite' ) ), |
| 1511 | 'show_external' => false, |
| 1512 | 'placeholder' => admin_url(), |
| 1513 | 'condition' => [ |
| 1514 | 'redirect_after_login' => 'yes', |
| 1515 | 'redirect_based_on_roles' => 'yes', |
| 1516 | ], |
| 1517 | ] ); |
| 1518 | } |
| 1519 | } |
| 1520 | |
| 1521 | $this->end_controls_section(); |
| 1522 | } |
| 1523 | |
| 1524 | public function eael_get_role_names() { |
| 1525 | |
| 1526 | global $wp_roles; |
| 1527 | |
| 1528 | if ( ! isset( $wp_roles ) ) |
| 1529 | $wp_roles = new WP_Roles(); |
| 1530 | |
| 1531 | return $wp_roles->get_names(); |
| 1532 | } |
| 1533 | |
| 1534 | protected function social_login_promo() { |
| 1535 | |
| 1536 | $this->start_controls_section( 'section_content_social_login', [ |
| 1537 | 'label' => __( 'Social Login', 'essential-addons-for-elementor-lite' ), |
| 1538 | 'conditions' => $this->get_form_controls_display_condition( 'login' ), |
| 1539 | ] ); |
| 1540 | |
| 1541 | $this->add_control( 'enable_google_login', [ |
| 1542 | 'label' => sprintf( __( 'Enable Login with Google %s', 'essential-addons-for-elementor-lite' ), '<i class="eael-pro-labe eicon-pro-icon"></i>' ), |
| 1543 | 'type' => Controls_Manager::SWITCHER, |
| 1544 | 'classes' => 'eael-pro-control', |
| 1545 | ] ); |
| 1546 | |
| 1547 | $this->add_control( 'enable_fb_login', [ |
| 1548 | 'label' => sprintf( __( 'Enable Login with Facebook %s', 'essential-addons-for-elementor-lite' ), '<i class="eael-pro-labe eicon-pro-icon"></i>' ), |
| 1549 | 'type' => Controls_Manager::SWITCHER, |
| 1550 | 'classes' => 'eael-pro-control', |
| 1551 | ] ); |
| 1552 | |
| 1553 | $this->end_controls_section(); |
| 1554 | } |
| 1555 | |
| 1556 | protected function init_content_terms_controls() { |
| 1557 | $this->start_controls_section( 'section_content_terms_conditions', [ |
| 1558 | 'label' => __( 'Terms & Conditions', 'essential-addons-for-elementor-lite' ), |
| 1559 | 'conditions' => $this->get_form_controls_display_condition( 'register' ), |
| 1560 | ] ); |
| 1561 | |
| 1562 | $this->add_control( 'show_terms_conditions', [ |
| 1563 | 'label' => __( 'Enforce Terms & Conditions', 'essential-addons-for-elementor-lite' ), |
| 1564 | 'type' => Controls_Manager::SWITCHER, |
| 1565 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 1566 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 1567 | 'default' => 'no', |
| 1568 | 'return_value' => 'yes', |
| 1569 | ] ); |
| 1570 | |
| 1571 | $this->add_control( 'eael_terms_conditions_field_type', [ |
| 1572 | 'label' => __( 'Field Type', 'essential-addons-for-elementor-lite' ), |
| 1573 | 'type' => Controls_Manager::SELECT, |
| 1574 | 'default' => 'toggle', |
| 1575 | 'options' => [ |
| 1576 | 'toggle' => __( 'Toggle', 'essential-addons-for-elementor-lite' ), |
| 1577 | 'checkbox' => __( 'Checkbox', 'essential-addons-for-elementor-lite' ), |
| 1578 | ], |
| 1579 | 'condition' => [ |
| 1580 | 'show_terms_conditions' => 'yes', |
| 1581 | ], |
| 1582 | ] ); |
| 1583 | |
| 1584 | $this->add_control( 'acceptance_label', [ |
| 1585 | 'label' => __( 'Acceptance Label', 'essential-addons-for-elementor-lite' ), |
| 1586 | 'description' => __( 'Eg. I accept the terms & conditions. Note: First line is checkbox label & Last line will be used as link text.', 'essential-addons-for-elementor-lite' ), |
| 1587 | 'type' => Controls_Manager::TEXTAREA, |
| 1588 | 'rows' => 2, |
| 1589 | 'label_block' => true, |
| 1590 | 'placeholder' => __( 'I Accept the Terms and Conditions.', 'essential-addons-for-elementor-lite' ), |
| 1591 | /* translators: \n means new line. So, Don't translate this*/ |
| 1592 | 'default' => __( "I Accept\n the Terms and Conditions.", 'essential-addons-for-elementor-lite' ), |
| 1593 | 'condition' => [ |
| 1594 | 'show_terms_conditions' => 'yes', |
| 1595 | ], |
| 1596 | ] ); |
| 1597 | |
| 1598 | $this->add_control( 'acceptance_text_source', [ |
| 1599 | 'label' => __( 'Content Source', 'essential-addons-for-elementor-lite' ), |
| 1600 | 'type' => Controls_Manager::SELECT, |
| 1601 | 'options' => [ |
| 1602 | 'editor' => __( 'Editor', 'essential-addons-for-elementor-lite' ), |
| 1603 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 1604 | ], |
| 1605 | 'default' => 'custom', |
| 1606 | 'condition' => [ |
| 1607 | 'show_terms_conditions' => 'yes', |
| 1608 | ], |
| 1609 | ] ); |
| 1610 | |
| 1611 | $this->add_control( 'acceptance_text', [ |
| 1612 | 'label' => __( 'Terms and Conditions', 'essential-addons-for-elementor-lite' ), |
| 1613 | 'type' => Controls_Manager::WYSIWYG, |
| 1614 | 'rows' => 3, |
| 1615 | 'default' => __( 'Please go through the following terms and conditions carefully.', 'essential-addons-for-elementor-lite' ), |
| 1616 | 'condition' => [ |
| 1617 | 'show_terms_conditions' => 'yes', |
| 1618 | 'acceptance_text_source' => 'editor', |
| 1619 | ], |
| 1620 | ] ); |
| 1621 | |
| 1622 | $terms_conditions_url = get_the_permalink( get_option( 'wp_page_for_privacy_policy' ) ); |
| 1623 | |
| 1624 | $this->add_control( 'acceptance_text_url', [ |
| 1625 | 'label' => __( 'Terms & Conditions URL', 'essential-addons-for-elementor-lite' ), |
| 1626 | 'description' => __( 'Enter the link where your terms & condition or privacy policy is found.', 'essential-addons-for-elementor-lite' ), |
| 1627 | 'type' => Controls_Manager::URL, |
| 1628 | 'dynamic' => [ |
| 1629 | 'active' => true, |
| 1630 | ], |
| 1631 | 'default' => [ |
| 1632 | 'url' => ! empty( $terms_conditions_url ) && 'false' !== $terms_conditions_url ? $terms_conditions_url : '', |
| 1633 | 'is_external' => true, |
| 1634 | 'nofollow' => true, |
| 1635 | ], |
| 1636 | 'condition' => [ |
| 1637 | 'show_terms_conditions' => 'yes', |
| 1638 | 'acceptance_text_source' => 'custom', |
| 1639 | ], |
| 1640 | ] ); |
| 1641 | |
| 1642 | $this->end_controls_section(); |
| 1643 | } |
| 1644 | |
| 1645 | protected function init_content_validation_messages_controls() { |
| 1646 | $this->start_controls_section( 'section_content_errors', [ |
| 1647 | 'label' => __( 'Validation Messages', 'essential-addons-for-elementor-lite' ), |
| 1648 | ] ); |
| 1649 | |
| 1650 | $this->add_control( 'err_message_heading', [ |
| 1651 | 'label' => esc_html__( 'Error Messages', 'essential-addons-for-elementor-lite' ), |
| 1652 | 'type' => Controls_Manager::HEADING, |
| 1653 | ] ); |
| 1654 | |
| 1655 | $this->add_control( 'err_email', [ |
| 1656 | 'label' => __( 'Invalid Email', 'essential-addons-for-elementor-lite' ), |
| 1657 | 'type' => Controls_Manager::TEXT, |
| 1658 | 'label_block' => true, |
| 1659 | 'placeholder' => __( 'Eg. Your email is invalid.', 'essential-addons-for-elementor-lite' ), |
| 1660 | 'default' => __( "You have used an invalid email", 'essential-addons-for-elementor-lite' ), |
| 1661 | 'ai' => [ |
| 1662 | 'active' => false, |
| 1663 | ], |
| 1664 | ] ); |
| 1665 | $this->add_control( 'err_email_missing', [ |
| 1666 | 'label' => __( 'Email is missing', 'essential-addons-for-elementor-lite' ), |
| 1667 | 'type' => Controls_Manager::TEXT, |
| 1668 | 'label_block' => true, |
| 1669 | 'placeholder' => __( 'Eg. Email is missing or Invalid', 'essential-addons-for-elementor-lite' ), |
| 1670 | 'default' => __( 'Email is missing or Invalid', 'essential-addons-for-elementor-lite' ), |
| 1671 | 'ai' => [ |
| 1672 | 'active' => false, |
| 1673 | ], |
| 1674 | ] ); |
| 1675 | $this->add_control( 'err_email_used', [ |
| 1676 | 'label' => __( 'Already Used Email', 'essential-addons-for-elementor-lite' ), |
| 1677 | 'type' => Controls_Manager::TEXT, |
| 1678 | 'label_block' => true, |
| 1679 | 'placeholder' => __( 'Eg. Your email is already in use..', 'essential-addons-for-elementor-lite' ), |
| 1680 | 'default' => __( 'The provided email is already registered with other account. Please login or reset password or use another email.', 'essential-addons-for-elementor-lite' ), |
| 1681 | 'ai' => [ |
| 1682 | 'active' => false, |
| 1683 | ], |
| 1684 | ] ); |
| 1685 | $this->add_control( 'err_username', [ |
| 1686 | 'label' => __( 'Invalid Username', 'essential-addons-for-elementor-lite' ), |
| 1687 | 'type' => Controls_Manager::TEXT, |
| 1688 | 'label_block' => true, |
| 1689 | 'placeholder' => __( 'Eg. Your username is invalid.', 'essential-addons-for-elementor-lite' ), |
| 1690 | 'default' => __( "You have used an invalid username", 'essential-addons-for-elementor-lite' ), |
| 1691 | 'ai' => [ |
| 1692 | 'active' => false, |
| 1693 | ], |
| 1694 | ] ); |
| 1695 | $this->add_control( 'err_username_used', [ |
| 1696 | 'label' => __( 'Username already in use', 'essential-addons-for-elementor-lite' ), |
| 1697 | 'type' => Controls_Manager::TEXT, |
| 1698 | 'label_block' => true, |
| 1699 | 'placeholder' => __( 'Eg. Your username is already registered.', 'essential-addons-for-elementor-lite' ), |
| 1700 | 'default' => __( 'Invalid username provided or the username already registered.', 'essential-addons-for-elementor-lite' ), |
| 1701 | 'ai' => [ |
| 1702 | 'active' => false, |
| 1703 | ], |
| 1704 | ] ); |
| 1705 | $this->add_control( 'err_pass', [ |
| 1706 | 'label' => __( 'Invalid Password', 'essential-addons-for-elementor-lite' ), |
| 1707 | 'type' => Controls_Manager::TEXT, |
| 1708 | 'label_block' => true, |
| 1709 | 'placeholder' => __( 'Eg. Your password is invalid', 'essential-addons-for-elementor-lite' ), |
| 1710 | 'default' => __( "Your password is invalid.", 'essential-addons-for-elementor-lite' ), |
| 1711 | 'ai' => [ |
| 1712 | 'active' => false, |
| 1713 | ], |
| 1714 | ] ); |
| 1715 | |
| 1716 | $this->add_control( 'err_conf_pass', [ |
| 1717 | 'label' => __( 'Invalid Password Confirmed', 'essential-addons-for-elementor-lite' ), |
| 1718 | 'type' => Controls_Manager::TEXT, |
| 1719 | 'label_block' => true, |
| 1720 | 'placeholder' => __( 'Eg. Password did not matched', 'essential-addons-for-elementor-lite' ), |
| 1721 | 'default' => __( "Your confirmed password did not match", 'essential-addons-for-elementor-lite' ), |
| 1722 | 'ai' => [ |
| 1723 | 'active' => false, |
| 1724 | ], |
| 1725 | ] ); |
| 1726 | |
| 1727 | $this->add_control( 'err_loggedin', [ |
| 1728 | 'label' => __( 'Already Logged In', 'essential-addons-for-elementor-lite' ), |
| 1729 | 'type' => Controls_Manager::TEXT, |
| 1730 | 'label_block' => true, |
| 1731 | 'placeholder' => __( 'Eg. You are already logged in', 'essential-addons-for-elementor-lite' ), |
| 1732 | 'default' => __( "You are already logged in", 'essential-addons-for-elementor-lite' ), |
| 1733 | 'ai' => [ |
| 1734 | 'active' => false, |
| 1735 | ], |
| 1736 | ] ); |
| 1737 | |
| 1738 | $this->add_control( 'err_recaptcha', [ |
| 1739 | 'label' => __( 'reCAPTCHA Failed', 'essential-addons-for-elementor-lite' ), |
| 1740 | 'type' => Controls_Manager::TEXT, |
| 1741 | 'label_block' => true, |
| 1742 | 'placeholder' => __( 'Eg. reCAPTCHA Validation Failed', 'essential-addons-for-elementor-lite' ), |
| 1743 | 'default' => __( "You did not pass reCAPTCHA challenge.", 'essential-addons-for-elementor-lite' ), |
| 1744 | 'ai' => [ |
| 1745 | 'active' => false, |
| 1746 | ], |
| 1747 | ] ); |
| 1748 | |
| 1749 | $this->add_control( 'err_reset_password_key_expired', [ |
| 1750 | 'label' => __( 'Reset Password Expired Error', 'essential-addons-for-elementor-lite' ), |
| 1751 | 'type' => Controls_Manager::TEXT, |
| 1752 | 'label_block' => true, |
| 1753 | 'placeholder' => __( 'Eg. Your password reset link appears to be invalid. Please request a new link.', 'essential-addons-for-elementor-lite' ), |
| 1754 | 'default' => __( 'Your password reset link appears to be invalid. Please request a new link.', 'essential-addons-for-elementor-lite' ), |
| 1755 | 'ai' => [ |
| 1756 | 'active' => false, |
| 1757 | ], |
| 1758 | ] ); |
| 1759 | |
| 1760 | $this->add_control( 'err_tc', [ |
| 1761 | 'label' => __( 'Terms & Condition Error', 'essential-addons-for-elementor-lite' ), |
| 1762 | 'type' => Controls_Manager::TEXT, |
| 1763 | 'label_block' => true, |
| 1764 | 'placeholder' => __( 'Eg. You must accept the Terms & Conditions', 'essential-addons-for-elementor-lite' ), |
| 1765 | 'default' => __( 'You did not accept the Terms and Conditions. Please accept it and try again.', 'essential-addons-for-elementor-lite' ), |
| 1766 | 'ai' => [ |
| 1767 | 'active' => false, |
| 1768 | ], |
| 1769 | ] ); |
| 1770 | |
| 1771 | $this->add_control( 'err_unknown', [ |
| 1772 | 'label' => __( 'Other Errors', 'essential-addons-for-elementor-lite' ), |
| 1773 | 'type' => Controls_Manager::TEXT, |
| 1774 | 'label_block' => true, |
| 1775 | 'placeholder' => __( 'Eg. Something went wrong', 'essential-addons-for-elementor-lite' ), |
| 1776 | 'default' => __( "Something went wrong!", 'essential-addons-for-elementor-lite' ), |
| 1777 | 'ai' => [ |
| 1778 | 'active' => false, |
| 1779 | ], |
| 1780 | ] ); |
| 1781 | |
| 1782 | $this->add_control( 'err_phone_number_missing', [ |
| 1783 | 'label' => __( 'Phone number is missing', 'essential-addons-for-elementor-lite' ), |
| 1784 | 'type' => Controls_Manager::TEXT, |
| 1785 | 'label_block' => true, |
| 1786 | 'placeholder' => __( 'Phone number is missing', 'essential-addons-for-elementor-lite' ), |
| 1787 | 'default' => __( 'Phone number is missing', 'essential-addons-for-elementor-lite' ), |
| 1788 | 'ai' => [ |
| 1789 | 'active' => false, |
| 1790 | ], |
| 1791 | ] ); |
| 1792 | |
| 1793 | $this->add_control( 'err_phone_number_invalid', [ |
| 1794 | 'label' => __( 'Invalid phone number provided', 'essential-addons-for-elementor-lite' ), |
| 1795 | 'type' => Controls_Manager::TEXT, |
| 1796 | 'label_block' => true, |
| 1797 | 'placeholder' => __( 'Invalid phone number provided', 'essential-addons-for-elementor-lite' ), |
| 1798 | 'default' => __( 'Invalid phone number provided', 'essential-addons-for-elementor-lite' ), |
| 1799 | 'ai' => [ |
| 1800 | 'active' => false, |
| 1801 | ], |
| 1802 | ] ); |
| 1803 | |
| 1804 | $this->add_control( 'success_message_heading', [ |
| 1805 | 'label' => esc_html__( 'Success Messages', 'essential-addons-for-elementor-lite' ), |
| 1806 | 'type' => Controls_Manager::HEADING, |
| 1807 | 'separator' => 'before', |
| 1808 | ] ); |
| 1809 | |
| 1810 | $this->add_control( 'success_login', [ |
| 1811 | 'label' => __( 'Successful Login', 'essential-addons-for-elementor-lite' ), |
| 1812 | 'type' => Controls_Manager::TEXT, |
| 1813 | 'label_block' => true, |
| 1814 | 'placeholder' => __( 'Eg. You have logged in successfully', 'essential-addons-for-elementor-lite' ), |
| 1815 | 'default' => __( "You have logged in successfully", 'essential-addons-for-elementor-lite' ), |
| 1816 | 'ai' => [ |
| 1817 | 'active' => false, |
| 1818 | ], |
| 1819 | ] ); |
| 1820 | $this->add_control( 'success_register', [ |
| 1821 | 'label' => __( 'Successful Registration', 'essential-addons-for-elementor-lite' ), |
| 1822 | 'type' => Controls_Manager::TEXTAREA, |
| 1823 | 'default' => __( 'Registration completed successfully, Check your inbox for password if you did not provided while registering.', 'essential-addons-for-elementor-lite' ), |
| 1824 | 'placeholder' => __( 'eg. Registration completed successfully', 'essential-addons-for-elementor-lite' ), |
| 1825 | ] ); |
| 1826 | $this->add_control( 'success_lostpassword', [ |
| 1827 | 'label' => __( 'Lost Password Form Success', 'essential-addons-for-elementor-lite' ), |
| 1828 | 'type' => Controls_Manager::TEXTAREA, |
| 1829 | 'default' => __( 'Check your email for the confirmation link.', 'essential-addons-for-elementor-lite' ), |
| 1830 | 'placeholder' => __( 'eg. Check your email for the confirmation link.', 'essential-addons-for-elementor-lite' ), |
| 1831 | ] ); |
| 1832 | $this->add_control( 'success_resetpassword', [ |
| 1833 | 'label' => __( 'Successful Password Reset', 'essential-addons-for-elementor-lite' ), |
| 1834 | 'type' => Controls_Manager::TEXTAREA, |
| 1835 | 'default' => __( 'Your password has been reset.', 'essential-addons-for-elementor-lite' ), |
| 1836 | 'placeholder' => __( 'eg. Your password has been reset.', 'essential-addons-for-elementor-lite' ), |
| 1837 | ] ); |
| 1838 | |
| 1839 | $this->end_controls_section(); |
| 1840 | } |
| 1841 | |
| 1842 | protected function show_pro_promotion(){ |
| 1843 | |
| 1844 | $this->start_controls_section( |
| 1845 | 'eael_section_pro', |
| 1846 | [ |
| 1847 | 'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite' ), |
| 1848 | ] |
| 1849 | ); |
| 1850 | |
| 1851 | $this->add_control( |
| 1852 | 'eael_control_get_pro', |
| 1853 | [ |
| 1854 | 'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite' ), |
| 1855 | 'type' => Controls_Manager::CHOOSE, |
| 1856 | 'options' => [ |
| 1857 | '1' => [ |
| 1858 | 'title' => '', |
| 1859 | 'icon' => 'fa fa-unlock-alt', |
| 1860 | ], |
| 1861 | ], |
| 1862 | 'default' => '1', |
| 1863 | '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>', |
| 1864 | ] |
| 1865 | ); |
| 1866 | |
| 1867 | $this->end_controls_section(); |
| 1868 | |
| 1869 | } |
| 1870 | |
| 1871 | protected function init_content_register_fields_controls() { |
| 1872 | $custom_fields_image = array_keys( $this->get_eael_custom_profile_fields( 'image' ) ); |
| 1873 | |
| 1874 | $this->start_controls_section( 'section_content_register_fields', [ |
| 1875 | 'label' => __( 'Register Form Fields', 'essential-addons-for-elementor-lite' ), |
| 1876 | 'conditions' => $this->get_form_controls_display_condition( 'register' ), |
| 1877 | ] ); |
| 1878 | $this->add_control( 'register_form_field_note', [ |
| 1879 | 'type' => Controls_Manager::RAW_HTML, |
| 1880 | 'raw' => __( sprintf( 'Select the type of fields you want to show in the registration form. You can enable custom fields from EA Dashboard » Elements » <a href="%s" target="_blank">Login Register Form Settings</a>.', esc_attr( site_url('/wp-admin/admin.php?page=eael-settings') ) ), 'essential-addons-for-elementor-lite' ), |
| 1881 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 1882 | ] ); |
| 1883 | $repeater = new Repeater(); |
| 1884 | |
| 1885 | $repeater->add_control( 'field_type', [ |
| 1886 | 'label' => __( 'Type', 'essential-addons-for-elementor-lite' ), |
| 1887 | 'type' => Controls_Manager::SELECT, |
| 1888 | 'options' => $this->get_form_field_types(), |
| 1889 | 'default' => 'first_name', |
| 1890 | ] ); |
| 1891 | |
| 1892 | $repeater->add_control( 'field_type_custom_image_note', [ |
| 1893 | 'type' => Controls_Manager::RAW_HTML, |
| 1894 | 'raw' => __( 'File upload will not work if AJAX submission is enabled.', 'essential-addons-for-elementor-lite' ), |
| 1895 | 'condition' => [ |
| 1896 | 'field_type' => array_keys( $this->get_eael_custom_profile_fields( 'image' ) ), |
| 1897 | ], |
| 1898 | 'content_classes' => 'eael-warning', |
| 1899 | ] ); |
| 1900 | |
| 1901 | $repeater->add_control( 'field_label', [ |
| 1902 | 'label' => __( 'Label', 'essential-addons-for-elementor-lite' ), |
| 1903 | 'type' => Controls_Manager::TEXT, |
| 1904 | 'default' => '', |
| 1905 | 'dynamic' => [ |
| 1906 | 'active' => true, |
| 1907 | ], |
| 1908 | 'ai' => [ |
| 1909 | 'active' => false, |
| 1910 | ], |
| 1911 | ] ); |
| 1912 | |
| 1913 | $repeater->add_control( 'field_type_custom_image_extensions', [ |
| 1914 | 'label' => __( 'File Extensions', 'essential-addons-for-elementor-lite' ), |
| 1915 | 'description' => __('Only extensions that is permitted on WordPress.', 'essential-addons-for-elementor-lite'), |
| 1916 | 'type' => Controls_Manager::TEXT, |
| 1917 | 'default' => '', |
| 1918 | 'placeholder' => '.png, .jpg, .jpeg', |
| 1919 | 'dynamic' => [ |
| 1920 | 'active' => true, |
| 1921 | ], |
| 1922 | 'condition' => [ |
| 1923 | 'field_type' => $custom_fields_image, |
| 1924 | ], |
| 1925 | ] ); |
| 1926 | |
| 1927 | $repeater->add_control( |
| 1928 | 'field_type_custom_image_filename_length', |
| 1929 | [ |
| 1930 | 'label' => __('Max Filename Length', 'essential-addons-for-elementor-lite'), |
| 1931 | 'type' => Controls_Manager::NUMBER, |
| 1932 | 'placeholder' => '128', |
| 1933 | 'default' => '128', |
| 1934 | 'min' => '1', |
| 1935 | 'max' => '128', |
| 1936 | 'condition' => [ |
| 1937 | 'field_type' => $custom_fields_image, |
| 1938 | ], |
| 1939 | ] |
| 1940 | ); |
| 1941 | |
| 1942 | $repeater->add_control( |
| 1943 | 'field_type_custom_image_filesize', |
| 1944 | [ |
| 1945 | 'label' => __('Max File Size (MB)', 'essential-addons-for-elementor-lite'), |
| 1946 | 'description' => __('Set max file size up to 512 MB.', 'essential-addons-for-elementor-lite'), |
| 1947 | 'type' => Controls_Manager::NUMBER, |
| 1948 | 'placeholder' => '5', |
| 1949 | 'default' => '5', |
| 1950 | 'Min' => '1', |
| 1951 | 'Max' => '512', |
| 1952 | 'condition' => [ |
| 1953 | 'field_type' => $custom_fields_image, |
| 1954 | ], |
| 1955 | ] |
| 1956 | ); |
| 1957 | |
| 1958 | $repeater->add_control( 'placeholder', [ |
| 1959 | 'label' => __( 'Placeholder', 'essential-addons-for-elementor-lite' ), |
| 1960 | 'type' => Controls_Manager::TEXT, |
| 1961 | 'default' => '', |
| 1962 | 'dynamic' => [ |
| 1963 | 'active' => true, |
| 1964 | ], |
| 1965 | 'condition' => [ |
| 1966 | 'field_type!' => $custom_fields_image, |
| 1967 | ], |
| 1968 | 'ai' => [ |
| 1969 | 'active' => false, |
| 1970 | ], |
| 1971 | ] ); |
| 1972 | |
| 1973 | $repeater->add_control( 'required', [ |
| 1974 | 'label' => __( 'Required', 'essential-addons-for-elementor-lite' ), |
| 1975 | 'type' => Controls_Manager::SWITCHER, |
| 1976 | 'condition' => [ |
| 1977 | 'field_type!' => [ |
| 1978 | 'email', |
| 1979 | 'password', |
| 1980 | 'confirm_pass', |
| 1981 | ], |
| 1982 | ], |
| 1983 | ] ); |
| 1984 | |
| 1985 | $repeater->add_control( 'required_note', [ |
| 1986 | 'type' => Controls_Manager::RAW_HTML, |
| 1987 | 'raw' => __( 'Note: This field is required by default.', 'essential-addons-for-elementor-lite' ), |
| 1988 | 'condition' => [ |
| 1989 | 'field_type' => [ |
| 1990 | 'email', |
| 1991 | 'password', |
| 1992 | 'confirm_pass', |
| 1993 | ], |
| 1994 | ], |
| 1995 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 1996 | ] ); |
| 1997 | |
| 1998 | $repeater->add_responsive_control( 'width', [ |
| 1999 | 'label' => __( 'Field Width', 'essential-addons-for-elementor-lite' ), |
| 2000 | 'type' => Controls_Manager::SLIDER, |
| 2001 | 'size_units' => [ 'px', '%' ], |
| 2002 | 'range' => [ |
| 2003 | 'px' => [ |
| 2004 | 'min' => 0, |
| 2005 | 'max' => 1000, |
| 2006 | 'step' => 5, |
| 2007 | ], |
| 2008 | '%' => [ |
| 2009 | 'min' => 0, |
| 2010 | 'max' => 100, |
| 2011 | ], |
| 2012 | ], |
| 2013 | 'default' => [ |
| 2014 | 'unit' => '%', |
| 2015 | 'size' => 100, |
| 2016 | ], |
| 2017 | 'selectors' => [ |
| 2018 | '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', |
| 2019 | ], |
| 2020 | ] ); |
| 2021 | apply_filters( 'eael/login-register/register-repeater', $repeater ); |
| 2022 | $rf = [ |
| 2023 | 'label' => __( 'Fields', 'essential-addons-for-elementor-lite' ), |
| 2024 | 'type' => Controls_Manager::REPEATER, |
| 2025 | 'fields' => apply_filters( 'eael/login-register/register-repeater-fields', $repeater->get_controls() ), |
| 2026 | 'default' => apply_filters( 'eael/login-register/register-rf-default', [ |
| 2027 | [ |
| 2028 | 'field_type' => 'user_name', |
| 2029 | 'field_label' => __( 'Username', 'essential-addons-for-elementor-lite' ), |
| 2030 | 'placeholder' => __( 'Username', 'essential-addons-for-elementor-lite' ), |
| 2031 | ], |
| 2032 | [ |
| 2033 | 'field_type' => 'email', |
| 2034 | 'field_label' => __( 'Email', 'essential-addons-for-elementor-lite' ), |
| 2035 | 'placeholder' => __( 'Email', 'essential-addons-for-elementor-lite' ), |
| 2036 | 'required' => 'yes', |
| 2037 | ], |
| 2038 | [ |
| 2039 | 'field_type' => 'password', |
| 2040 | 'field_label' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 2041 | 'placeholder' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 2042 | 'required' => 'yes', |
| 2043 | ], |
| 2044 | ] ), |
| 2045 | 'title_field' => '{{ field_label }}', |
| 2046 | ]; |
| 2047 | if ( $this->pro_enabled ) { |
| 2048 | $rf['title_field'] = '{{{ elementor.helpers.renderIcon( this, icon, {}, "i", "panel" ) || \'<i class="{{ icon }}" aria-hidden="true"></i>\' }}} {{ field_label }}'; |
| 2049 | } |
| 2050 | $this->add_control( 'register_fields', $rf ); |
| 2051 | |
| 2052 | $this->add_control( 'show_labels', [ |
| 2053 | 'label' => __( 'Show Label', 'essential-addons-for-elementor-lite' ), |
| 2054 | 'type' => Controls_Manager::SWITCHER, |
| 2055 | 'default' => 'yes', |
| 2056 | ] ); |
| 2057 | |
| 2058 | $this->add_control( 'mark_required', [ |
| 2059 | 'label' => __( 'Show Required Mark', 'essential-addons-for-elementor-lite' ), |
| 2060 | 'type' => Controls_Manager::SWITCHER, |
| 2061 | 'condition' => [ |
| 2062 | 'show_labels' => 'yes', |
| 2063 | ], |
| 2064 | ] ); |
| 2065 | |
| 2066 | $this->add_control( 'password_toggle_register', [ |
| 2067 | 'label' => __( 'Password Visibility Icon', 'essential-addons-for-elementor-lite' ), |
| 2068 | 'type' => Controls_Manager::SWITCHER, |
| 2069 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 2070 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 2071 | 'default' => '', |
| 2072 | ] ); |
| 2073 | |
| 2074 | do_action( 'eael/login-register/after-register-options-controls', $this ); |
| 2075 | |
| 2076 | /*--Register Fields Button--*/ |
| 2077 | $this->add_control( 'reg_button_heading', [ |
| 2078 | 'label' => esc_html__( 'Register Button', 'essential-addons-for-elementor-lite' ), |
| 2079 | 'type' => Controls_Manager::HEADING, |
| 2080 | 'separator' => 'before', |
| 2081 | ] ); |
| 2082 | |
| 2083 | $this->add_control( 'reg_button_text', [ |
| 2084 | 'label' => __( 'Button Text', 'essential-addons-for-elementor-lite' ), |
| 2085 | 'type' => Controls_Manager::TEXT, |
| 2086 | 'dynamic' => [ 'active' => true, ], |
| 2087 | 'default' => __( 'Register', 'essential-addons-for-elementor-lite' ), |
| 2088 | 'ai' => [ |
| 2089 | 'active' => false, |
| 2090 | ], |
| 2091 | ] ); |
| 2092 | |
| 2093 | |
| 2094 | $this->end_controls_section(); |
| 2095 | } |
| 2096 | |
| 2097 | protected function init_content_register_options_controls() { |
| 2098 | |
| 2099 | $this->start_controls_section( 'section_content_register_actions', [ |
| 2100 | 'label' => __( 'Register Form Options', 'essential-addons-for-elementor-lite' ), |
| 2101 | 'conditions' => $this->get_form_controls_display_condition( 'register' ), |
| 2102 | ] ); |
| 2103 | |
| 2104 | $this->add_control( 'register_action', [ |
| 2105 | 'label' => __( 'Register Actions', 'essential-addons-for-elementor-lite' ), |
| 2106 | 'description' => __( 'You can select what should happen after a user registers successfully', 'essential-addons-for-elementor-lite' ), |
| 2107 | 'type' => Controls_Manager::SELECT2, |
| 2108 | 'multiple' => true, |
| 2109 | 'label_block' => true, |
| 2110 | 'default' => 'send_email', |
| 2111 | 'options' => [ |
| 2112 | 'redirect' => __( 'Redirect', 'essential-addons-for-elementor-lite' ), |
| 2113 | 'auto_login' => __( 'Auto Login', 'essential-addons-for-elementor-lite' ), |
| 2114 | 'send_email' => __( 'Notify User By Email', 'essential-addons-for-elementor-lite' ), |
| 2115 | ], |
| 2116 | ] ); |
| 2117 | |
| 2118 | $this->add_control( 'register_redirect_url', [ |
| 2119 | 'type' => Controls_Manager::URL, |
| 2120 | 'label' => __( 'Custom Redirect URL', 'essential-addons-for-elementor-lite' ), |
| 2121 | 'show_external' => false, |
| 2122 | 'placeholder' => __( 'eg. https://your-link.com/wp-admin/', 'essential-addons-for-elementor-lite' ), |
| 2123 | 'description' => __( 'Please note that only your current domain is allowed here to keep your site secure.', 'essential-addons-for-elementor-lite' ), |
| 2124 | 'default' => [ |
| 2125 | 'url' => get_admin_url(), |
| 2126 | 'is_external' => false, |
| 2127 | 'nofollow' => true, |
| 2128 | ], |
| 2129 | 'condition' => [ |
| 2130 | 'register_action' => 'redirect', |
| 2131 | ], |
| 2132 | ] ); |
| 2133 | |
| 2134 | if(current_user_can('create_users')){ |
| 2135 | $user_role = $this->get_user_roles(); |
| 2136 | }else{ |
| 2137 | $user_role = [ |
| 2138 | get_option( 'default_role' ) => ucfirst(get_option( 'default_role' )) |
| 2139 | ]; |
| 2140 | } |
| 2141 | |
| 2142 | $this->add_control( 'register_user_role', [ |
| 2143 | 'label' => __( 'New User Role', 'essential-addons-for-elementor-lite' ), |
| 2144 | 'type' => Controls_Manager::SELECT, |
| 2145 | 'default' => '', |
| 2146 | 'options' => $user_role, |
| 2147 | 'separator' => 'before', |
| 2148 | ] ); |
| 2149 | |
| 2150 | $this->end_controls_section(); |
| 2151 | } |
| 2152 | |
| 2153 | protected function init_content_register_user_email_controls() { |
| 2154 | /* translators: %s: Site Name */ |
| 2155 | $default_subject = sprintf( __( 'Thank you for registering on "%s"!', 'essential-addons-for-elementor-lite' ), get_option( 'blogname' ) ); |
| 2156 | $default_message = $default_subject . "\r\n\r\n"; |
| 2157 | $default_message .= __( 'Username: [username]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2158 | $default_message .= __( 'Password: [password]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2159 | $default_message .= __( 'To reset your password, visit the following address:', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2160 | $default_message .= "[password_reset_link]\r\n\r\n"; |
| 2161 | $default_message .= __( 'Please click the following address to login to your account:', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2162 | $default_message .= wp_login_url() . "\r\n"; |
| 2163 | |
| 2164 | $this->start_controls_section( 'section_content_reg_email', [ |
| 2165 | 'label' => __( 'Register User Email Options', 'essential-addons-for-elementor-lite' ), |
| 2166 | 'conditions' => [ |
| 2167 | 'relation' => 'or', |
| 2168 | 'terms' => [ |
| 2169 | [ |
| 2170 | 'name' => 'show_register_link', |
| 2171 | 'value' => 'yes', |
| 2172 | //@TODO; debug why multi-level condition is not working. |
| 2173 | //'relation' => 'and', |
| 2174 | //'terms' => [ |
| 2175 | // [ |
| 2176 | // 'name' => 'register_action', |
| 2177 | // 'value' => 'send_email', |
| 2178 | // 'operator' => '===', |
| 2179 | // ], |
| 2180 | //], |
| 2181 | ], |
| 2182 | [ |
| 2183 | 'name' => 'default_form_type', |
| 2184 | 'value' => 'register', |
| 2185 | //'relation' => 'and', |
| 2186 | //'terms' => [ |
| 2187 | // [ |
| 2188 | // 'name' => 'register_action', |
| 2189 | // 'value' => 'send_email', |
| 2190 | // 'operator' => '===', |
| 2191 | // ], |
| 2192 | //], |
| 2193 | ], |
| 2194 | ], |
| 2195 | ], |
| 2196 | ] ); |
| 2197 | |
| 2198 | $this->add_control( 'reg_email_template_type', [ |
| 2199 | 'label' => __( 'Email Template Type', 'essential-addons-for-elementor-lite' ), |
| 2200 | 'description' => __( 'Default template uses WordPress Default email template. So, please select the Custom Option to send the user proper information if you used any username field.', 'essential-addons-for-elementor-lite' ), |
| 2201 | 'type' => Controls_Manager::SELECT, |
| 2202 | 'default' => 'default', |
| 2203 | 'render_type' => 'none', |
| 2204 | 'options' => [ |
| 2205 | 'default' => __( 'WordPres Default', 'essential-addons-for-elementor-lite' ), |
| 2206 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 2207 | ], |
| 2208 | ] ); |
| 2209 | |
| 2210 | $this->add_control( 'reg_email_subject', [ |
| 2211 | 'label' => __( 'Email Subject', 'essential-addons-for-elementor-lite' ), |
| 2212 | 'type' => Controls_Manager::TEXT, |
| 2213 | 'placeholder' => $default_subject, |
| 2214 | 'default' => $default_subject, |
| 2215 | 'label_block' => true, |
| 2216 | 'render_type' => 'none', |
| 2217 | 'condition' => [ |
| 2218 | 'reg_email_template_type' => 'custom', |
| 2219 | ], |
| 2220 | 'ai' => [ |
| 2221 | 'active' => false, |
| 2222 | ], |
| 2223 | ] ); |
| 2224 | |
| 2225 | $this->add_control( 'reg_email_message', [ |
| 2226 | 'label' => __( 'Email Message', 'essential-addons-for-elementor-lite' ), |
| 2227 | 'type' => Controls_Manager::WYSIWYG, |
| 2228 | 'placeholder' => __( 'Enter Your Custom Email Message..', 'essential-addons-for-elementor-lite' ), |
| 2229 | 'default' => $default_message, |
| 2230 | 'label_block' => true, |
| 2231 | 'render_type' => 'none', |
| 2232 | 'condition' => [ |
| 2233 | 'reg_email_template_type' => 'custom', |
| 2234 | ], |
| 2235 | ] ); |
| 2236 | |
| 2237 | $this->add_control( 'reg_email_content_note', [ |
| 2238 | 'type' => Controls_Manager::RAW_HTML, |
| 2239 | 'raw' => __( '<strong>Note:</strong> You can use dynamic content in the email body like [fieldname]. For example [username] will be replaced by user-typed username. Available tags are: [password], [username], [email], [firstname],[lastname], [website], [loginurl], [password_reset_link], [eael_phone_number] and [sitetitle]. <br>For custom profile fields use slug of the field name e.x. [my_custom_field_1]', 'essential-addons-for-elementor-lite' ), |
| 2240 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 2241 | 'condition' => [ |
| 2242 | 'reg_email_template_type' => 'custom', |
| 2243 | ], |
| 2244 | 'render_type' => 'none', |
| 2245 | ] ); |
| 2246 | |
| 2247 | $this->add_control( 'reg_email_content_type', [ |
| 2248 | 'label' => __( 'Email Content Type', 'essential-addons-for-elementor-lite' ), |
| 2249 | 'type' => Controls_Manager::SELECT, |
| 2250 | 'default' => 'html', |
| 2251 | 'render_type' => 'none', |
| 2252 | 'options' => [ |
| 2253 | 'html' => __( 'HTML', 'essential-addons-for-elementor-lite' ), |
| 2254 | 'plain' => __( 'Plain', 'essential-addons-for-elementor-lite' ), |
| 2255 | ], |
| 2256 | 'condition' => [ |
| 2257 | 'reg_email_template_type' => 'custom', |
| 2258 | ], |
| 2259 | ] ); |
| 2260 | |
| 2261 | $this->end_controls_section(); |
| 2262 | } |
| 2263 | |
| 2264 | protected function init_content_register_admin_email_controls() { |
| 2265 | /* translators: %s: Site Name */ |
| 2266 | $default_subject = sprintf( __( '["%s"] New User Registration', 'essential-addons-for-elementor-lite' ), get_option( 'blogname' ) ); |
| 2267 | /* translators: %s: Site Name */ |
| 2268 | $default_message = sprintf( __( "New user registration on your site %s", 'essential-addons-for-elementor-lite' ), get_option( 'blogname' ) ) . "\r\n\r\n"; |
| 2269 | $default_message .= __( 'Username: [username]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2270 | $default_message .= __( 'Email: [email]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2271 | |
| 2272 | |
| 2273 | $this->start_controls_section( 'section_content_reg_admin_email', [ |
| 2274 | 'label' => __( 'Register Admin Email Options', 'essential-addons-for-elementor-lite' ), |
| 2275 | 'conditions' => [ |
| 2276 | 'relation' => 'or', |
| 2277 | 'terms' => [ |
| 2278 | [ |
| 2279 | 'name' => 'show_register_link', |
| 2280 | 'value' => 'yes', |
| 2281 | //@TODO; debug why multi-level condition is not working. |
| 2282 | //'relation' => 'and', |
| 2283 | //'terms' => [ |
| 2284 | // [ |
| 2285 | // 'name' => 'register_action', |
| 2286 | // 'value' => 'send_email', |
| 2287 | // 'operator' => '===', |
| 2288 | // ], |
| 2289 | //], |
| 2290 | ], |
| 2291 | [ |
| 2292 | 'name' => 'default_form_type', |
| 2293 | 'value' => 'register', |
| 2294 | //'relation' => 'and', |
| 2295 | //'terms' => [ |
| 2296 | // [ |
| 2297 | // 'name' => 'register_action', |
| 2298 | // 'value' => 'send_email', |
| 2299 | // 'operator' => '===', |
| 2300 | // ], |
| 2301 | //], |
| 2302 | ], |
| 2303 | ], |
| 2304 | ], |
| 2305 | ] ); |
| 2306 | |
| 2307 | $this->add_control( 'reg_admin_email_template_type', [ |
| 2308 | 'label' => __( 'Email Template Type', 'essential-addons-for-elementor-lite' ), |
| 2309 | 'description' => __( 'Default template uses WordPress Default Admin email template. You can customize it by choosing the custom option.', 'essential-addons-for-elementor-lite' ), |
| 2310 | 'type' => Controls_Manager::SELECT, |
| 2311 | 'default' => 'default', |
| 2312 | 'render_type' => 'none', |
| 2313 | 'options' => [ |
| 2314 | 'default' => __( 'WordPres Default', 'essential-addons-for-elementor-lite' ), |
| 2315 | 'custom' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 2316 | ], |
| 2317 | ] ); |
| 2318 | |
| 2319 | $this->add_control( 'reg_admin_email_subject', [ |
| 2320 | 'label' => __( 'Email Subject', 'essential-addons-for-elementor-lite' ), |
| 2321 | 'type' => Controls_Manager::TEXT, |
| 2322 | 'placeholder' => $default_subject, |
| 2323 | 'default' => $default_subject, |
| 2324 | 'label_block' => true, |
| 2325 | 'render_type' => 'none', |
| 2326 | 'condition' => [ |
| 2327 | 'reg_admin_email_template_type' => 'custom', |
| 2328 | ], |
| 2329 | 'ai' => [ |
| 2330 | 'active' => false, |
| 2331 | ], |
| 2332 | ] ); |
| 2333 | |
| 2334 | $this->add_control( 'reg_admin_email_message', [ |
| 2335 | 'label' => __( 'Email Message', 'essential-addons-for-elementor-lite' ), |
| 2336 | 'type' => Controls_Manager::WYSIWYG, |
| 2337 | 'placeholder' => __( 'Enter Your Custom Email Message..', 'essential-addons-for-elementor-lite' ), |
| 2338 | 'default' => $default_message, |
| 2339 | 'label_block' => true, |
| 2340 | 'render_type' => 'none', |
| 2341 | 'condition' => [ |
| 2342 | 'reg_admin_email_template_type' => 'custom', |
| 2343 | ], |
| 2344 | ] ); |
| 2345 | |
| 2346 | $this->add_control( 'reg_admin_email_content_note', [ |
| 2347 | 'type' => Controls_Manager::RAW_HTML, |
| 2348 | 'raw' => __( '<strong>Note:</strong> You can use dynamic content in the email body like [fieldname]. For example [username] will be replaced by user-typed username. Available tags are: [username], [email], [firstname],[lastname], [website], [loginurl] and [sitetitle]. <br>For custom profile fields use slug of the field name e.x. [my_custom_field_1]', 'essential-addons-for-elementor-lite' ), |
| 2349 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 2350 | 'condition' => [ |
| 2351 | 'reg_admin_email_template_type' => 'custom', |
| 2352 | ], |
| 2353 | 'render_type' => 'none', |
| 2354 | ] ); |
| 2355 | |
| 2356 | $this->add_control( 'reg_admin_email_content_type', [ |
| 2357 | 'label' => __( 'Email Content Type', 'essential-addons-for-elementor-lite' ), |
| 2358 | 'type' => Controls_Manager::SELECT, |
| 2359 | 'default' => 'html', |
| 2360 | 'render_type' => 'none', |
| 2361 | 'options' => [ |
| 2362 | 'html' => __( 'HTML', 'essential-addons-for-elementor-lite' ), |
| 2363 | 'plain' => __( 'Plain', 'essential-addons-for-elementor-lite' ), |
| 2364 | ], |
| 2365 | 'condition' => [ |
| 2366 | 'reg_admin_email_template_type' => 'custom', |
| 2367 | ], |
| 2368 | ] ); |
| 2369 | |
| 2370 | $this->end_controls_section(); |
| 2371 | } |
| 2372 | |
| 2373 | protected function init_content_lostpassword_user_email_controls() { |
| 2374 | /* translators: %s: Site Name */ |
| 2375 | $default_subject = __( 'Password Reset Confirmation', 'essential-addons-for-elementor-lite' ); |
| 2376 | $default_message = __( 'Someone has requested a password reset for the following account:', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2377 | $default_message .= __( 'Sitename: [sitetitle]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2378 | $default_message .= __( 'Username: [username]', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2379 | $default_message .= __( 'If this was a mistake, ignore this email and nothing will happen.', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2380 | $default_message .= __( 'To reset your password, visit the following address:', 'essential-addons-for-elementor-lite' ) . "\r\n\r\n"; |
| 2381 | $default_message .= '[password_reset_link]' . "\r\n\r\n"; |
| 2382 | $default_message .= __( 'Thanks!', 'essential-addons-for-elementor-lite' ); |
| 2383 | |
| 2384 | $this->start_controls_section( 'section_content_lostpassword_email', [ |
| 2385 | 'label' => __( 'Lost Password Email Options', 'essential-addons-for-elementor-lite' ), |
| 2386 | 'condition' => [ |
| 2387 | 'enable_reset_password' => 'yes' |
| 2388 | ], |
| 2389 | ] ); |
| 2390 | |
| 2391 | $this->add_control( 'lostpassword_email_subject', [ |
| 2392 | 'label' => __( 'Email Subject', 'essential-addons-for-elementor-lite' ), |
| 2393 | 'type' => Controls_Manager::TEXT, |
| 2394 | 'placeholder' => $default_subject, |
| 2395 | 'default' => $default_subject, |
| 2396 | 'label_block' => true, |
| 2397 | 'render_type' => 'none', |
| 2398 | 'ai' => [ |
| 2399 | 'active' => false, |
| 2400 | ], |
| 2401 | ] ); |
| 2402 | |
| 2403 | $this->add_control( 'lostpassword_email_message', [ |
| 2404 | 'label' => __( 'Email Message', 'essential-addons-for-elementor-lite' ), |
| 2405 | 'type' => Controls_Manager::WYSIWYG, |
| 2406 | 'placeholder' => $default_message, |
| 2407 | 'default' => $default_message, |
| 2408 | 'label_block' => true, |
| 2409 | 'render_type' => 'none', |
| 2410 | ] ); |
| 2411 | |
| 2412 | $this->add_control( 'lostpassword_email_content_note', [ |
| 2413 | 'type' => Controls_Manager::RAW_HTML, |
| 2414 | 'raw' => __( '<strong>Note:</strong> You can use dynamic content in the email body like [fieldname]. For example [username] will be replaced by user-typed username. Available tags are: [username], [email], [firstname],[lastname], [website], [password_reset_link] and [sitetitle] ', 'essential-addons-for-elementor-lite' ), |
| 2415 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 2416 | 'render_type' => 'none', |
| 2417 | ] ); |
| 2418 | |
| 2419 | $this->add_control( 'lostpassword_email_message_reset_link_text', [ |
| 2420 | 'label' => __( 'Reset Link Text', 'essential-addons-for-elementor-lite' ), |
| 2421 | 'type' => Controls_Manager::TEXT, |
| 2422 | 'placeholder' => __( 'Enter Reset Link Text', 'essential-addons-for-elementor-lite' ), |
| 2423 | 'default' => __( 'Click here to reset your password', 'essential-addons-for-elementor-lite'), |
| 2424 | 'label_block' => false, |
| 2425 | 'render_type' => 'none', |
| 2426 | 'ai' => [ |
| 2427 | 'active' => false, |
| 2428 | ], |
| 2429 | ] ); |
| 2430 | |
| 2431 | $this->add_control( 'lostpassword_email_message_reset_link_in_popup', [ |
| 2432 | 'label' => __( 'Reset Link in Popup', 'essential-addons-for-elementor-lite' ), |
| 2433 | 'type' => Controls_Manager::SWITCHER, |
| 2434 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 2435 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 2436 | 'return_value' => 'yes', |
| 2437 | 'default' => '', |
| 2438 | ] ); |
| 2439 | |
| 2440 | $this->add_control( 'lostpassword_email_message_reset_link_in_popup_warning', [ |
| 2441 | 'type' => Controls_Manager::RAW_HTML, |
| 2442 | 'raw' => __( 'Enable "Reset Link in Popup" feature if your form is displayed in a popup.', 'essential-addons-for-elementor-lite' ), |
| 2443 | 'content_classes' => 'eael-warning', |
| 2444 | ] ); |
| 2445 | |
| 2446 | $this->add_control( 'lostpassword_email_message_reset_link_popup_selector', [ |
| 2447 | 'label' => __( 'Popup Button Selector', 'essential-addons-for-elementor-lite' ), |
| 2448 | 'type' => Controls_Manager::TEXT, |
| 2449 | 'placeholder' => '.parent .child', |
| 2450 | 'description' => __( 'Specify the class for the popup button that can be automatically triggered upon the page\'s loading.', 'essential-addons-for-elementor-lite' ), |
| 2451 | 'condition' => [ |
| 2452 | 'lostpassword_email_message_reset_link_in_popup' => 'yes', |
| 2453 | ], |
| 2454 | 'ai' => [ |
| 2455 | 'active' => false, |
| 2456 | ], |
| 2457 | ] ); |
| 2458 | |
| 2459 | $this->add_control( 'lostpassword_email_content_type', [ |
| 2460 | 'label' => __( 'Email Content Type', 'essential-addons-for-elementor-lite' ), |
| 2461 | 'type' => Controls_Manager::SELECT, |
| 2462 | 'default' => 'html', |
| 2463 | 'render_type' => 'none', |
| 2464 | 'options' => [ |
| 2465 | 'html' => __( 'HTML', 'essential-addons-for-elementor-lite' ), |
| 2466 | 'plain' => __( 'Plain', 'essential-addons-for-elementor-lite' ), |
| 2467 | ], |
| 2468 | ] ); |
| 2469 | |
| 2470 | $this->end_controls_section(); |
| 2471 | } |
| 2472 | |
| 2473 | /** |
| 2474 | * It prints controls for managing general style of both login and registration form |
| 2475 | */ |
| 2476 | protected function init_style_general_controls() { |
| 2477 | $this->start_controls_section( 'section_style_general', [ |
| 2478 | 'label' => __( 'General', 'essential-addons-for-elementor-lite' ), |
| 2479 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2480 | ] ); |
| 2481 | //---Form Container or Box |
| 2482 | $this->add_control( 'form_form_wrap_po_toggle', [ |
| 2483 | 'label' => __( 'Container Box', 'essential-addons-for-elementor-lite' ), |
| 2484 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 2485 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 2486 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 2487 | 'return_value' => 'yes', |
| 2488 | ] ); |
| 2489 | $this->start_popover(); |
| 2490 | $this->add_control( 'eael_form_wrap_width_form_type', [ |
| 2491 | 'label' => __( 'Apply Width on', 'essential-addons-for-elementor-lite' ), |
| 2492 | 'type' => Controls_Manager::SELECT, |
| 2493 | 'options' => [ |
| 2494 | 'default' => __( 'All Forms', 'essential-addons-for-elementor-lite' ), |
| 2495 | 'lostpassword' => __( 'Lost Password', 'essential-addons-for-elementor-lite' ), |
| 2496 | ], |
| 2497 | 'default' => 'default', |
| 2498 | ] ); |
| 2499 | $this->add_responsive_control( "eael_form_wrap_width", [ |
| 2500 | 'label' => esc_html__( 'Width', 'essential-addons-for-elementor-lite' ), |
| 2501 | 'type' => Controls_Manager::SLIDER, |
| 2502 | 'size_units' => [ |
| 2503 | 'px', |
| 2504 | 'rem', |
| 2505 | '%', |
| 2506 | ], |
| 2507 | 'range' => [ |
| 2508 | 'px' => [ |
| 2509 | 'min' => 0, |
| 2510 | 'max' => 1000, |
| 2511 | 'step' => 5, |
| 2512 | ], |
| 2513 | 'rem' => [ |
| 2514 | 'min' => 0, |
| 2515 | 'max' => 10, |
| 2516 | 'step' => .5, |
| 2517 | ], |
| 2518 | '%' => [ |
| 2519 | 'min' => 0, |
| 2520 | 'max' => 100, |
| 2521 | ], |
| 2522 | ], |
| 2523 | 'desktop_default' => [ |
| 2524 | 'unit' => '%', |
| 2525 | 'size' => 65, |
| 2526 | ], |
| 2527 | 'tablet_default' => [ |
| 2528 | 'unit' => '%', |
| 2529 | 'size' => 75, |
| 2530 | ], |
| 2531 | 'mobile_default' => [ |
| 2532 | 'unit' => '%', |
| 2533 | 'size' => 100, |
| 2534 | ], |
| 2535 | 'selectors' => [ |
| 2536 | "{{WRAPPER}} .eael-lr-form-wrapper" => 'width: {{SIZE}}{{UNIT}};', |
| 2537 | ], |
| 2538 | 'condition' => [ |
| 2539 | 'form_form_wrap_po_toggle' => 'yes', |
| 2540 | 'eael_form_wrap_width_form_type' => 'default' |
| 2541 | ], |
| 2542 | ] ); |
| 2543 | |
| 2544 | $this->add_responsive_control( "eael_form_wrap_width_lostpassword", [ |
| 2545 | 'label' => esc_html__( 'Width', 'essential-addons-for-elementor-lite' ), |
| 2546 | 'type' => Controls_Manager::SLIDER, |
| 2547 | 'size_units' => [ |
| 2548 | 'px', |
| 2549 | 'rem', |
| 2550 | '%', |
| 2551 | ], |
| 2552 | 'range' => [ |
| 2553 | 'px' => [ |
| 2554 | 'min' => 0, |
| 2555 | 'max' => 1000, |
| 2556 | 'step' => 5, |
| 2557 | ], |
| 2558 | 'rem' => [ |
| 2559 | 'min' => 0, |
| 2560 | 'max' => 10, |
| 2561 | 'step' => .5, |
| 2562 | ], |
| 2563 | '%' => [ |
| 2564 | 'min' => 0, |
| 2565 | 'max' => 100, |
| 2566 | ], |
| 2567 | ], |
| 2568 | 'desktop_default' => [ |
| 2569 | 'unit' => '%', |
| 2570 | 'size' => 65, |
| 2571 | ], |
| 2572 | 'tablet_default' => [ |
| 2573 | 'unit' => '%', |
| 2574 | 'size' => 75, |
| 2575 | ], |
| 2576 | 'mobile_default' => [ |
| 2577 | 'unit' => '%', |
| 2578 | 'size' => 100, |
| 2579 | ], |
| 2580 | 'selectors' => [ |
| 2581 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-lostpassword-form-wrapper" => 'width: {{SIZE}}{{UNIT}};', |
| 2582 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper" => 'width: {{SIZE}}{{UNIT}};', |
| 2583 | ], |
| 2584 | 'condition' => [ |
| 2585 | 'form_form_wrap_po_toggle' => 'yes', |
| 2586 | 'eael_form_wrap_width_form_type' => 'lostpassword' |
| 2587 | ], |
| 2588 | ] ); |
| 2589 | |
| 2590 | $this->add_responsive_control( "eael_form_wrap_margin", [ |
| 2591 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 2592 | 'type' => Controls_Manager::DIMENSIONS, |
| 2593 | 'size_units' => [ |
| 2594 | 'px', |
| 2595 | 'em', |
| 2596 | '%', |
| 2597 | ], |
| 2598 | 'selectors' => [ |
| 2599 | "{{WRAPPER}} .eael-lr-form-wrapper" => $this->apply_dim( 'margin' ), |
| 2600 | ], |
| 2601 | 'condition' => [ |
| 2602 | 'form_form_wrap_po_toggle' => 'yes', |
| 2603 | ], |
| 2604 | ] ); |
| 2605 | $this->add_responsive_control( "eael_form_wrap_padding", [ |
| 2606 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 2607 | 'type' => Controls_Manager::DIMENSIONS, |
| 2608 | 'size_units' => [ |
| 2609 | 'px', |
| 2610 | 'em', |
| 2611 | '%', |
| 2612 | ], |
| 2613 | 'selectors' => [ |
| 2614 | "{{WRAPPER}} .eael-lr-form-wrapper" => $this->apply_dim( 'padding' ), |
| 2615 | ], |
| 2616 | 'condition' => [ |
| 2617 | 'form_form_wrap_po_toggle' => 'yes', |
| 2618 | ], |
| 2619 | ] ); |
| 2620 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 2621 | 'name' => "eael_form_wrap_border", |
| 2622 | 'selector' => "{{WRAPPER}} .eael-lr-form-wrapper", |
| 2623 | 'condition' => [ |
| 2624 | 'form_form_wrap_po_toggle' => 'yes', |
| 2625 | ], |
| 2626 | ] ); |
| 2627 | $this->add_control( "eael_form_wrap_border_radius", [ |
| 2628 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2629 | 'type' => Controls_Manager::DIMENSIONS, |
| 2630 | 'size_units' => [ |
| 2631 | 'px', |
| 2632 | '%', |
| 2633 | ], |
| 2634 | 'selectors' => [ |
| 2635 | "{{WRAPPER}} .eael-lr-form-wrapper" => $this->apply_dim( 'border-radius' ), |
| 2636 | ], |
| 2637 | 'condition' => [ |
| 2638 | 'form_form_wrap_po_toggle' => 'yes', |
| 2639 | ], |
| 2640 | ] ); |
| 2641 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 2642 | 'name' => "eael_form_wrap_bg_color", |
| 2643 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2644 | 'types' => [ |
| 2645 | 'classic', |
| 2646 | 'gradient', |
| 2647 | ], |
| 2648 | 'selector' => "{{WRAPPER}} .eael-lr-form-wrapper", |
| 2649 | 'condition' => [ |
| 2650 | 'form_form_wrap_po_toggle' => 'yes', |
| 2651 | ], |
| 2652 | ] ); |
| 2653 | $this->end_popover(); |
| 2654 | $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ |
| 2655 | 'label' => __( 'Container Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 2656 | 'name' => 'eael_form_wrap_shadow', |
| 2657 | 'selector' => "{{WRAPPER}} .eael-lr-form-wrapper", |
| 2658 | 'exclude' => [ |
| 2659 | 'box_shadow_position', |
| 2660 | ], |
| 2661 | ] ); |
| 2662 | |
| 2663 | //----Form Wrapper----- |
| 2664 | $this->add_control( 'form_form_po_toggle', [ |
| 2665 | 'label' => __( 'Form', 'essential-addons-for-elementor-lite' ), |
| 2666 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 2667 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 2668 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 2669 | 'return_value' => 'yes', |
| 2670 | 'separator' => 'before', |
| 2671 | ] ); |
| 2672 | $this->start_popover(); |
| 2673 | $this->add_control( 'eael_form_wrapper_heading', [ |
| 2674 | 'type' => Controls_Manager::HEADING, |
| 2675 | 'label' => __( '---Form Wrapper---', 'essential-addons-for-elementor-lite' ), |
| 2676 | 'separator' => 'before', |
| 2677 | ] ); |
| 2678 | |
| 2679 | $this->add_responsive_control( "eael_form_width", [ |
| 2680 | 'label' => esc_html__( 'Wrapper width', 'essential-addons-for-elementor-lite' ), |
| 2681 | 'type' => Controls_Manager::SLIDER, |
| 2682 | 'size_units' => [ |
| 2683 | 'px', |
| 2684 | 'rem', |
| 2685 | '%', |
| 2686 | ], |
| 2687 | 'range' => [ |
| 2688 | 'px' => [ |
| 2689 | 'min' => 0, |
| 2690 | 'max' => 1000, |
| 2691 | 'step' => 5, |
| 2692 | ], |
| 2693 | 'rem' => [ |
| 2694 | 'min' => 0, |
| 2695 | 'max' => 10, |
| 2696 | 'step' => .5, |
| 2697 | ], |
| 2698 | '%' => [ |
| 2699 | 'min' => 0, |
| 2700 | 'max' => 100, |
| 2701 | ], |
| 2702 | ], |
| 2703 | 'desktop_default' => [ |
| 2704 | 'unit' => '%', |
| 2705 | 'size' => 50, |
| 2706 | ], |
| 2707 | 'tablet_default' => [ |
| 2708 | 'unit' => '%', |
| 2709 | 'size' => 75, |
| 2710 | ], |
| 2711 | 'mobile_default' => [ |
| 2712 | 'unit' => '%', |
| 2713 | 'size' => 100, |
| 2714 | ], |
| 2715 | 'selectors' => [ |
| 2716 | "{{WRAPPER}} .lr-form-wrapper" => 'width: {{SIZE}}{{UNIT}};', |
| 2717 | ], |
| 2718 | 'condition' => [ |
| 2719 | 'form_form_po_toggle' => 'yes', |
| 2720 | ], |
| 2721 | ] ); |
| 2722 | |
| 2723 | $this->add_responsive_control( "eael_form_margin", [ |
| 2724 | 'label' => __( 'Wrapper Margin', 'essential-addons-for-elementor-lite' ), |
| 2725 | 'type' => Controls_Manager::DIMENSIONS, |
| 2726 | 'size_units' => [ |
| 2727 | 'px', |
| 2728 | 'em', |
| 2729 | '%', |
| 2730 | ], |
| 2731 | 'selectors' => [ |
| 2732 | "{{WRAPPER}} .lr-form-wrapper" => $this->apply_dim( 'margin' ), |
| 2733 | ], |
| 2734 | 'condition' => [ |
| 2735 | 'form_form_po_toggle' => 'yes', |
| 2736 | ], |
| 2737 | ] ); |
| 2738 | $this->add_responsive_control( "eael_form_padding", [ |
| 2739 | 'label' => __( 'Wrapper Padding', 'essential-addons-for-elementor-lite' ), |
| 2740 | 'type' => Controls_Manager::DIMENSIONS, |
| 2741 | 'size_units' => [ |
| 2742 | 'px', |
| 2743 | 'em', |
| 2744 | '%', |
| 2745 | ], |
| 2746 | 'selectors' => [ |
| 2747 | "{{WRAPPER}} .lr-form-wrapper" => $this->apply_dim( 'padding' ), |
| 2748 | ], |
| 2749 | 'condition' => [ |
| 2750 | 'form_form_po_toggle' => 'yes', |
| 2751 | ], |
| 2752 | ] ); |
| 2753 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 2754 | 'name' => "eael_form_border", |
| 2755 | 'selector' => "{{WRAPPER}} .lr-form-wrapper", |
| 2756 | 'condition' => [ |
| 2757 | 'form_form_po_toggle' => 'yes', |
| 2758 | ], |
| 2759 | ] ); |
| 2760 | $this->add_control( "eael_form_border_radius", [ |
| 2761 | 'label' => __( 'Wrapper Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2762 | 'type' => Controls_Manager::DIMENSIONS, |
| 2763 | 'size_units' => [ |
| 2764 | 'px', |
| 2765 | '%', |
| 2766 | ], |
| 2767 | 'selectors' => [ |
| 2768 | "{{WRAPPER}} .lr-form-wrapper" => $this->apply_dim( 'border-radius' ), |
| 2769 | ], |
| 2770 | 'condition' => [ |
| 2771 | 'form_form_po_toggle' => 'yes', |
| 2772 | ], |
| 2773 | ] ); |
| 2774 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 2775 | 'name' => "eael_form_bg_color", |
| 2776 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2777 | 'types' => [ |
| 2778 | 'classic', |
| 2779 | 'gradient', |
| 2780 | ], |
| 2781 | 'selector' => "{{WRAPPER}} .lr-form-wrapper", |
| 2782 | ] ); |
| 2783 | |
| 2784 | $this->add_control( 'eael_form_input_container', [ |
| 2785 | 'type' => Controls_Manager::HEADING, |
| 2786 | 'label' => __( '---Form Style---', 'essential-addons-for-elementor-lite' ), |
| 2787 | 'separator' => 'before', |
| 2788 | ] ); |
| 2789 | $this->add_responsive_control( "eael_form_ic_width", [ |
| 2790 | 'label' => esc_html__( 'Form width', 'essential-addons-for-elementor-lite' ), |
| 2791 | 'type' => Controls_Manager::SLIDER, |
| 2792 | 'size_units' => [ |
| 2793 | 'px', |
| 2794 | 'rem', |
| 2795 | '%', |
| 2796 | ], |
| 2797 | 'range' => [ |
| 2798 | 'px' => [ |
| 2799 | 'min' => 0, |
| 2800 | 'max' => 1000, |
| 2801 | 'step' => 5, |
| 2802 | ], |
| 2803 | 'rem' => [ |
| 2804 | 'min' => 0, |
| 2805 | 'max' => 10, |
| 2806 | 'step' => .5, |
| 2807 | ], |
| 2808 | '%' => [ |
| 2809 | 'min' => 0, |
| 2810 | 'max' => 100, |
| 2811 | ], |
| 2812 | ], |
| 2813 | 'default' => [ |
| 2814 | 'unit' => '%', |
| 2815 | 'size' => 100, |
| 2816 | ], |
| 2817 | 'selectors' => [ |
| 2818 | "{{WRAPPER}} .lr-form-wrapper form" => 'width: {{SIZE}}{{UNIT}};', |
| 2819 | ], |
| 2820 | 'condition' => [ |
| 2821 | 'form_form_po_toggle' => 'yes', |
| 2822 | ], |
| 2823 | ] ); |
| 2824 | |
| 2825 | $this->add_responsive_control( "eael_form_ic_margin", [ |
| 2826 | 'label' => __( 'Form Margin', 'essential-addons-for-elementor-lite' ), |
| 2827 | 'type' => Controls_Manager::DIMENSIONS, |
| 2828 | 'size_units' => [ |
| 2829 | 'px', |
| 2830 | 'em', |
| 2831 | '%', |
| 2832 | ], |
| 2833 | 'selectors' => [ |
| 2834 | "{{WRAPPER}} .lr-form-wrapper form" => $this->apply_dim( 'margin' ), |
| 2835 | ], |
| 2836 | 'condition' => [ |
| 2837 | 'form_form_po_toggle' => 'yes', |
| 2838 | ], |
| 2839 | ] ); |
| 2840 | $this->add_responsive_control( "eael_form_ic_padding", [ |
| 2841 | 'label' => __( 'Form Padding', 'essential-addons-for-elementor-lite' ), |
| 2842 | 'type' => Controls_Manager::DIMENSIONS, |
| 2843 | 'size_units' => [ |
| 2844 | 'px', |
| 2845 | 'em', |
| 2846 | '%', |
| 2847 | ], |
| 2848 | 'selectors' => [ |
| 2849 | "{{WRAPPER}} .lr-form-wrapper form" => $this->apply_dim( 'padding' ), |
| 2850 | ], |
| 2851 | 'condition' => [ |
| 2852 | 'form_form_po_toggle' => 'yes', |
| 2853 | ], |
| 2854 | ] ); |
| 2855 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 2856 | 'name' => "eael_form_ic_border", |
| 2857 | 'selector' => "{{WRAPPER}} .lr-form-wrapper form", |
| 2858 | 'condition' => [ |
| 2859 | 'form_form_po_toggle' => 'yes', |
| 2860 | ], |
| 2861 | ] ); |
| 2862 | $this->add_control( "eael_form_ic_border_radius", [ |
| 2863 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2864 | 'type' => Controls_Manager::DIMENSIONS, |
| 2865 | 'size_units' => [ |
| 2866 | 'px', |
| 2867 | '%', |
| 2868 | ], |
| 2869 | 'selectors' => [ |
| 2870 | "{{WRAPPER}} .lr-form-wrapper form" => $this->apply_dim( 'border-radius' ), |
| 2871 | ], |
| 2872 | 'condition' => [ |
| 2873 | 'form_form_po_toggle' => 'yes', |
| 2874 | ], |
| 2875 | ] ); |
| 2876 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 2877 | 'name' => "eael_form_ic_bg_color", |
| 2878 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2879 | 'types' => [ |
| 2880 | 'classic', |
| 2881 | 'gradient', |
| 2882 | ], |
| 2883 | 'selector' => "{{WRAPPER}} .lr-form-wrapper form", |
| 2884 | ] ); |
| 2885 | $this->end_popover(); |
| 2886 | |
| 2887 | $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ |
| 2888 | 'label' => __( 'Form Wrapper Shadow', 'essential-addons-for-elementor-lite' ), |
| 2889 | 'name' => 'eael_form_shadow', |
| 2890 | 'selector' => "{{WRAPPER}} .lr-form-wrapper", |
| 2891 | 'exclude' => [ |
| 2892 | 'box_shadow_position', |
| 2893 | ], |
| 2894 | ] ); |
| 2895 | |
| 2896 | $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ |
| 2897 | 'label' => __( 'Form Shadow', 'essential-addons-for-elementor-lite' ), |
| 2898 | 'name' => 'eael_form_ic_shadow', |
| 2899 | 'selector' => "{{WRAPPER}} .lr-form-wrapper form", |
| 2900 | 'exclude' => [ |
| 2901 | 'box_shadow_position', |
| 2902 | ], |
| 2903 | ] ); |
| 2904 | //@TODO; add only input wrapper shadow |
| 2905 | $this->end_controls_section(); |
| 2906 | } |
| 2907 | |
| 2908 | protected function init_style_header_content_controls( $form_type = 'login' ) { |
| 2909 | $form_type_for_heading = 'lostpassword' == $form_type ? __( 'Lost Password', 'essential-addons-for-elementor-lite' ) : $form_type; |
| 2910 | $form_type_for_heading = 'resetpassword' == $form_type ? __( 'Reset Password', 'essential-addons-for-elementor-lite' ) : $form_type_for_heading; |
| 2911 | |
| 2912 | $this->start_controls_section( "section_style_{$form_type}_header_content", [ |
| 2913 | 'label' => sprintf( __( '%s Form Header', 'essential-addons-for-elementor-lite' ), ucfirst( $form_type_for_heading ) ), |
| 2914 | // Login Form Header | Register Form Header | Lost Password Form Header | Reset Password Form Header |
| 2915 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2916 | 'conditions' => $this->get_form_controls_display_condition( $form_type ), |
| 2917 | ] ); |
| 2918 | //Define all css selectors ahead for better management |
| 2919 | $illustration_selector = "{{WRAPPER}} .eael-{$form_type}-form-wrapper .lr-form-illustration"; |
| 2920 | $header_selector = "{{WRAPPER}} .eael-{$form_type}-form-wrapper .lr-form-header"; |
| 2921 | $logo_selector = "{{WRAPPER}} .eael-{$form_type}-form-wrapper .lr-form-header img"; |
| 2922 | $title_selector = "{{WRAPPER}} .eael-{$form_type}-form-wrapper .lr-form-header .form-dsc h4"; |
| 2923 | $subtitle_selector = "{{WRAPPER}} .eael-{$form_type}-form-wrapper .lr-form-header .form-dsc p"; |
| 2924 | |
| 2925 | $this->add_control( "{$form_type}_fhc_po_toggle", [ |
| 2926 | 'label' => __( 'Header Content', 'essential-addons-for-elementor-lite' ), |
| 2927 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 2928 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 2929 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 2930 | 'return_value' => 'yes', |
| 2931 | ] ); |
| 2932 | |
| 2933 | $this->start_popover(); |
| 2934 | |
| 2935 | $this->add_responsive_control( "{$form_type}_fhc_width", [ |
| 2936 | 'label' => esc_html__( 'Header width', 'essential-addons-for-elementor-lite' ), |
| 2937 | 'type' => Controls_Manager::SLIDER, |
| 2938 | 'size_units' => [ |
| 2939 | 'px', |
| 2940 | 'rem', |
| 2941 | '%', |
| 2942 | ], |
| 2943 | 'range' => [ |
| 2944 | 'px' => [ |
| 2945 | 'min' => 0, |
| 2946 | 'max' => 1000, |
| 2947 | 'step' => 5, |
| 2948 | ], |
| 2949 | 'rem' => [ |
| 2950 | 'min' => 0, |
| 2951 | 'max' => 10, |
| 2952 | 'step' => .5, |
| 2953 | ], |
| 2954 | '%' => [ |
| 2955 | 'min' => 0, |
| 2956 | 'max' => 100, |
| 2957 | ], |
| 2958 | ], |
| 2959 | 'default' => [ |
| 2960 | 'unit' => '%', |
| 2961 | 'size' => 100, |
| 2962 | ], |
| 2963 | 'selectors' => [ |
| 2964 | $header_selector => 'width: {{SIZE}}{{UNIT}};', |
| 2965 | ], |
| 2966 | 'condition' => [ |
| 2967 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 2968 | ], |
| 2969 | ] ); |
| 2970 | $this->add_responsive_control( "{$form_type}_fhc_height", [ |
| 2971 | 'label' => esc_html__( 'Header height', 'essential-addons-for-elementor-lite' ), |
| 2972 | 'type' => Controls_Manager::SLIDER, |
| 2973 | 'size_units' => [ |
| 2974 | 'px', |
| 2975 | 'rem', |
| 2976 | '%', |
| 2977 | ], |
| 2978 | 'range' => [ |
| 2979 | 'px' => [ |
| 2980 | 'min' => 0, |
| 2981 | 'max' => 1000, |
| 2982 | 'step' => 5, |
| 2983 | ], |
| 2984 | 'rem' => [ |
| 2985 | 'min' => 0, |
| 2986 | 'max' => 10, |
| 2987 | 'step' => .5, |
| 2988 | ], |
| 2989 | '%' => [ |
| 2990 | 'min' => 0, |
| 2991 | 'max' => 100, |
| 2992 | ], |
| 2993 | ], |
| 2994 | 'selectors' => [ |
| 2995 | $header_selector => 'height: {{SIZE}}{{UNIT}};', |
| 2996 | ], |
| 2997 | 'condition' => [ |
| 2998 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 2999 | ], |
| 3000 | ] ); |
| 3001 | $this->add_responsive_control( "{$form_type}_fhc_margin", [ |
| 3002 | 'label' => __( 'Header Margin', 'essential-addons-for-elementor-lite' ), |
| 3003 | 'type' => Controls_Manager::DIMENSIONS, |
| 3004 | 'size_units' => [ |
| 3005 | 'px', |
| 3006 | 'em', |
| 3007 | '%', |
| 3008 | ], |
| 3009 | 'selectors' => [ |
| 3010 | $header_selector => $this->apply_dim( 'margin' ), |
| 3011 | ], |
| 3012 | 'condition' => [ |
| 3013 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 3014 | ], |
| 3015 | ] ); |
| 3016 | $this->add_responsive_control( "{$form_type}_fhc_padding", [ |
| 3017 | 'label' => __( 'Header Padding', 'essential-addons-for-elementor-lite' ), |
| 3018 | 'type' => Controls_Manager::DIMENSIONS, |
| 3019 | 'size_units' => [ |
| 3020 | 'px', |
| 3021 | 'em', |
| 3022 | '%', |
| 3023 | ], |
| 3024 | 'selectors' => [ |
| 3025 | $header_selector => $this->apply_dim( 'padding' ), |
| 3026 | ], |
| 3027 | 'condition' => [ |
| 3028 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 3029 | ], |
| 3030 | ] ); |
| 3031 | |
| 3032 | |
| 3033 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3034 | 'name' => "{$form_type}_fhc_border", |
| 3035 | 'selector' => $header_selector, |
| 3036 | 'condition' => [ |
| 3037 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 3038 | ], |
| 3039 | ] ); |
| 3040 | $this->add_control( "{$form_type}_fhc_border_radius", [ |
| 3041 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3042 | 'type' => Controls_Manager::DIMENSIONS, |
| 3043 | 'size_units' => [ |
| 3044 | 'px', |
| 3045 | '%', |
| 3046 | ], |
| 3047 | 'selectors' => [ |
| 3048 | $header_selector => $this->apply_dim( 'border-radius' ), |
| 3049 | ], |
| 3050 | 'condition' => [ |
| 3051 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 3052 | ], |
| 3053 | ] ); |
| 3054 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 3055 | 'name' => "{$form_type}_form_header_bg", |
| 3056 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3057 | 'types' => [ |
| 3058 | 'classic', |
| 3059 | 'gradient', |
| 3060 | ], |
| 3061 | 'selector' => $header_selector, |
| 3062 | 'condition' => [ |
| 3063 | "{$form_type}_fhc_po_toggle" => 'yes', |
| 3064 | ], |
| 3065 | ] ); |
| 3066 | $this->end_popover(); |
| 3067 | |
| 3068 | |
| 3069 | $this->add_control( "{$form_type}_form_img_po_toggle", [ |
| 3070 | 'label' => __( 'Form Illustration', 'essential-addons-for-elementor-lite' ), |
| 3071 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3072 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3073 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3074 | 'return_value' => 'yes', |
| 3075 | 'separator' => 'before', |
| 3076 | ] ); |
| 3077 | $this->start_popover(); |
| 3078 | $this->add_responsive_control( "{$form_type}_form_img_width", [ |
| 3079 | 'label' => esc_html__( 'Width', 'essential-addons-for-elementor-lite' ), |
| 3080 | 'type' => Controls_Manager::SLIDER, |
| 3081 | 'size_units' => [ |
| 3082 | 'px', |
| 3083 | 'rem', |
| 3084 | '%', |
| 3085 | ], |
| 3086 | 'range' => [ |
| 3087 | 'px' => [ |
| 3088 | 'min' => 0, |
| 3089 | 'max' => 1000, |
| 3090 | 'step' => 5, |
| 3091 | ], |
| 3092 | 'rem' => [ |
| 3093 | 'min' => 0, |
| 3094 | 'max' => 10, |
| 3095 | 'step' => .5, |
| 3096 | ], |
| 3097 | '%' => [ |
| 3098 | 'min' => 0, |
| 3099 | 'max' => 100, |
| 3100 | ], |
| 3101 | ], |
| 3102 | 'desktop_default' => [ |
| 3103 | 'unit' => '%', |
| 3104 | 'size' => 50, |
| 3105 | ], |
| 3106 | 'tablet_default' => [ |
| 3107 | 'unit' => '%', |
| 3108 | 'size' => 100, |
| 3109 | ], |
| 3110 | 'mobile_default' => [ |
| 3111 | 'unit' => '%', |
| 3112 | 'size' => 100, |
| 3113 | ], |
| 3114 | 'selectors' => [ |
| 3115 | $illustration_selector => 'width: {{SIZE}}{{UNIT}};', |
| 3116 | ], |
| 3117 | 'condition' => [ |
| 3118 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3119 | ], |
| 3120 | ] ); |
| 3121 | $this->add_responsive_control( "{$form_type}_form_img_height", [ |
| 3122 | 'label' => esc_html__( 'Height', 'essential-addons-for-elementor-lite' ), |
| 3123 | 'type' => Controls_Manager::SLIDER, |
| 3124 | 'size_units' => [ |
| 3125 | 'px', |
| 3126 | 'rem', |
| 3127 | ], |
| 3128 | 'range' => [ |
| 3129 | 'px' => [ |
| 3130 | 'min' => 0, |
| 3131 | 'max' => 1000, |
| 3132 | 'step' => 5, |
| 3133 | ], |
| 3134 | 'rem' => [ |
| 3135 | 'min' => 0, |
| 3136 | 'max' => 10, |
| 3137 | 'step' => .5, |
| 3138 | ], |
| 3139 | ], |
| 3140 | 'desktop_default' => [ |
| 3141 | 'unit' => 'px', |
| 3142 | 'size' => 375, |
| 3143 | ], |
| 3144 | 'tablet_default' => [ |
| 3145 | 'unit' => 'px', |
| 3146 | 'size' => 375, |
| 3147 | ], |
| 3148 | 'mobile_default' => [ |
| 3149 | 'unit' => 'px', |
| 3150 | 'size' => 375, |
| 3151 | ], |
| 3152 | 'selectors' => [ |
| 3153 | $illustration_selector => 'height: {{SIZE}}{{UNIT}};', |
| 3154 | ], |
| 3155 | 'condition' => [ |
| 3156 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3157 | ], |
| 3158 | ] ); |
| 3159 | $this->add_control( "{$form_type}_form_img_margin", [ |
| 3160 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3161 | 'type' => Controls_Manager::DIMENSIONS, |
| 3162 | 'size_units' => [ |
| 3163 | 'px', |
| 3164 | 'em', |
| 3165 | '%', |
| 3166 | ], |
| 3167 | 'selectors' => [ |
| 3168 | $illustration_selector => $this->apply_dim( 'margin' ), |
| 3169 | ], |
| 3170 | 'condition' => [ |
| 3171 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3172 | ], |
| 3173 | ] ); |
| 3174 | $this->add_control( "{$form_type}_form_img_padding", [ |
| 3175 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3176 | 'type' => Controls_Manager::DIMENSIONS, |
| 3177 | 'size_units' => [ |
| 3178 | 'px', |
| 3179 | 'em', |
| 3180 | '%', |
| 3181 | ], |
| 3182 | 'selectors' => [ |
| 3183 | $illustration_selector => $this->apply_dim( 'padding' ), |
| 3184 | ], |
| 3185 | 'condition' => [ |
| 3186 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3187 | ], |
| 3188 | ] ); |
| 3189 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3190 | 'name' => "{$form_type}_form_img_border", |
| 3191 | 'selector' => $illustration_selector, |
| 3192 | 'condition' => [ |
| 3193 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3194 | ], |
| 3195 | ] ); |
| 3196 | $this->add_control( "{$form_type}_form_img_border_radius", [ |
| 3197 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3198 | 'type' => Controls_Manager::DIMENSIONS, |
| 3199 | 'size_units' => [ |
| 3200 | 'px', |
| 3201 | '%', |
| 3202 | ], |
| 3203 | 'selectors' => [ |
| 3204 | $illustration_selector => $this->apply_dim( 'border-radius' ), |
| 3205 | ], |
| 3206 | 'condition' => [ |
| 3207 | "{$form_type}_form_img_po_toggle" => 'yes', |
| 3208 | ], |
| 3209 | ] ); |
| 3210 | $this->end_popover(); |
| 3211 | $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ |
| 3212 | 'label' => __( 'Illustration Shadow', 'essential-addons-for-elementor-lite' ), |
| 3213 | 'name' => "{$form_type}_form_img_shadow", |
| 3214 | 'selector' => $illustration_selector, |
| 3215 | 'exclude' => [ |
| 3216 | 'box_shadow_position', |
| 3217 | ], |
| 3218 | ] ); |
| 3219 | $this->add_control( "{$form_type}_form_logo_po_toggle", [ |
| 3220 | 'label' => __( 'Form Logo', 'essential-addons-for-elementor-lite' ), |
| 3221 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3222 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3223 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3224 | 'return_value' => 'yes', |
| 3225 | 'separator' => 'before', |
| 3226 | ] ); |
| 3227 | $this->start_popover(); |
| 3228 | $this->add_responsive_control( "{$form_type}_form_logo_width", [ |
| 3229 | 'label' => esc_html__( 'width', 'essential-addons-for-elementor-lite' ), |
| 3230 | 'type' => Controls_Manager::SLIDER, |
| 3231 | 'size_units' => [ |
| 3232 | 'px', |
| 3233 | 'rem', |
| 3234 | '%', |
| 3235 | ], |
| 3236 | 'range' => [ |
| 3237 | 'px' => [ |
| 3238 | 'min' => 0, |
| 3239 | 'max' => 1000, |
| 3240 | 'step' => 5, |
| 3241 | ], |
| 3242 | 'rem' => [ |
| 3243 | 'min' => 0, |
| 3244 | 'max' => 10, |
| 3245 | 'step' => .5, |
| 3246 | ], |
| 3247 | '%' => [ |
| 3248 | 'min' => 0, |
| 3249 | 'max' => 100, |
| 3250 | ], |
| 3251 | ], |
| 3252 | 'default' => [ |
| 3253 | 'unit' => 'px', |
| 3254 | 'size' => 100, |
| 3255 | ], |
| 3256 | 'selectors' => [ |
| 3257 | $logo_selector => 'width: {{SIZE}}{{UNIT}};', |
| 3258 | ], |
| 3259 | 'condition' => [ |
| 3260 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3261 | ], |
| 3262 | ] ); |
| 3263 | $this->add_responsive_control( "{$form_type}_form_logo_height", [ |
| 3264 | 'label' => esc_html__( 'height', 'essential-addons-for-elementor-lite' ), |
| 3265 | 'type' => Controls_Manager::SLIDER, |
| 3266 | 'size_units' => [ |
| 3267 | 'px', |
| 3268 | 'rem', |
| 3269 | '%', |
| 3270 | ], |
| 3271 | 'range' => [ |
| 3272 | 'px' => [ |
| 3273 | 'min' => 0, |
| 3274 | 'max' => 1000, |
| 3275 | 'step' => 5, |
| 3276 | ], |
| 3277 | 'rem' => [ |
| 3278 | 'min' => 0, |
| 3279 | 'max' => 10, |
| 3280 | 'step' => .5, |
| 3281 | ], |
| 3282 | '%' => [ |
| 3283 | 'min' => 0, |
| 3284 | 'max' => 100, |
| 3285 | ], |
| 3286 | ], |
| 3287 | 'default' => [ |
| 3288 | 'unit' => 'px', |
| 3289 | 'size' => 100, |
| 3290 | ], |
| 3291 | 'selectors' => [ |
| 3292 | $logo_selector => 'height: {{SIZE}}{{UNIT}};', |
| 3293 | ], |
| 3294 | 'condition' => [ |
| 3295 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3296 | ], |
| 3297 | ] ); |
| 3298 | $this->add_responsive_control( "{$form_type}_form_logo_margin", [ |
| 3299 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3300 | 'type' => Controls_Manager::DIMENSIONS, |
| 3301 | 'size_units' => [ |
| 3302 | 'px', |
| 3303 | 'em', |
| 3304 | '%', |
| 3305 | ], |
| 3306 | 'selectors' => [ |
| 3307 | $logo_selector => $this->apply_dim( 'margin' ), |
| 3308 | ], |
| 3309 | 'condition' => [ |
| 3310 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3311 | ], |
| 3312 | ] ); |
| 3313 | $this->add_responsive_control( "{$form_type}_form_logo_padding", [ |
| 3314 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3315 | 'type' => Controls_Manager::DIMENSIONS, |
| 3316 | 'size_units' => [ |
| 3317 | 'px', |
| 3318 | 'em', |
| 3319 | '%', |
| 3320 | ], |
| 3321 | 'selectors' => [ |
| 3322 | $logo_selector => $this->apply_dim( 'padding' ), |
| 3323 | ], |
| 3324 | 'condition' => [ |
| 3325 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3326 | ], |
| 3327 | ] ); |
| 3328 | |
| 3329 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3330 | 'name' => "{$form_type}_form_logo_border", |
| 3331 | 'selector' => $logo_selector, |
| 3332 | 'condition' => [ |
| 3333 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3334 | ], |
| 3335 | ] ); |
| 3336 | $this->add_control( "{$form_type}_form_logo_border_radius", [ |
| 3337 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3338 | 'type' => Controls_Manager::DIMENSIONS, |
| 3339 | 'size_units' => [ |
| 3340 | 'px', |
| 3341 | '%', |
| 3342 | ], |
| 3343 | 'selectors' => [ |
| 3344 | $logo_selector => $this->apply_dim( 'border-radius' ), |
| 3345 | ], |
| 3346 | 'condition' => [ |
| 3347 | "{$form_type}_form_logo_po_toggle" => 'yes', |
| 3348 | ], |
| 3349 | ] ); |
| 3350 | $this->end_popover(); |
| 3351 | $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ |
| 3352 | 'label' => __( 'Logo Shadow', 'essential-addons-for-elementor-lite' ), |
| 3353 | 'name' => "{$form_type}_form_logo_shadow", |
| 3354 | 'selector' => $logo_selector, |
| 3355 | 'exclude' => [ |
| 3356 | 'box_shadow_position', |
| 3357 | ], |
| 3358 | ] ); |
| 3359 | |
| 3360 | |
| 3361 | /*-- Title Typography --*/ |
| 3362 | $this->add_control( "{$form_type}_form_title_po_toggle", [ |
| 3363 | 'label' => __( 'Title', 'essential-addons-for-elementor-lite' ), |
| 3364 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3365 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3366 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3367 | 'return_value' => 'yes', |
| 3368 | 'separator' => 'before', |
| 3369 | ] ); |
| 3370 | $this->start_popover(); |
| 3371 | $this->add_responsive_control( "{$form_type}_form_title_margin", [ |
| 3372 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3373 | 'type' => Controls_Manager::DIMENSIONS, |
| 3374 | 'size_units' => [ |
| 3375 | 'px', |
| 3376 | 'em', |
| 3377 | '%', |
| 3378 | ], |
| 3379 | 'selectors' => [ |
| 3380 | $title_selector => $this->apply_dim( 'margin' ), |
| 3381 | ], |
| 3382 | 'condition' => [ |
| 3383 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3384 | ], |
| 3385 | ] ); |
| 3386 | $this->add_responsive_control( "{$form_type}_form_title_padding", [ |
| 3387 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3388 | 'type' => Controls_Manager::DIMENSIONS, |
| 3389 | 'size_units' => [ |
| 3390 | 'px', |
| 3391 | 'em', |
| 3392 | '%', |
| 3393 | ], |
| 3394 | 'selectors' => [ |
| 3395 | $title_selector => $this->apply_dim( 'padding' ), |
| 3396 | ], |
| 3397 | 'condition' => [ |
| 3398 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3399 | ], |
| 3400 | ] ); |
| 3401 | $this->add_control( "{$form_type}_form_title_color", [ |
| 3402 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 3403 | 'type' => Controls_Manager::COLOR, |
| 3404 | 'selectors' => [ |
| 3405 | $title_selector => 'color: {{VALUE}};', |
| 3406 | ], |
| 3407 | 'condition' => [ |
| 3408 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3409 | ], |
| 3410 | ] ); |
| 3411 | $this->add_control( "{$form_type}_form_title_bg_color", [ |
| 3412 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3413 | 'type' => Controls_Manager::COLOR, |
| 3414 | 'selectors' => [ |
| 3415 | $title_selector => 'background: {{VALUE}};', |
| 3416 | ], |
| 3417 | 'condition' => [ |
| 3418 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3419 | ], |
| 3420 | ] ); |
| 3421 | |
| 3422 | |
| 3423 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3424 | 'name' => "{$form_type}_form_title_border", |
| 3425 | 'selector' => $title_selector, |
| 3426 | 'condition' => [ |
| 3427 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3428 | ], |
| 3429 | ] ); |
| 3430 | $this->add_control( "{$form_type}_form_title_border_radius", [ |
| 3431 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3432 | 'type' => Controls_Manager::DIMENSIONS, |
| 3433 | 'size_units' => [ |
| 3434 | 'px', |
| 3435 | '%', |
| 3436 | ], |
| 3437 | 'selectors' => [ |
| 3438 | $title_selector => $this->apply_dim( 'border-radius' ), |
| 3439 | ], |
| 3440 | 'condition' => [ |
| 3441 | "{$form_type}_form_title_po_toggle" => 'yes', |
| 3442 | ], |
| 3443 | ] ); |
| 3444 | |
| 3445 | $this->end_popover(); |
| 3446 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 3447 | 'name' => "{$form_type}_form_title_typo", |
| 3448 | 'label' => __( 'Title Typography', 'essential-addons-for-elementor-lite' ), |
| 3449 | 'selector' => $title_selector, |
| 3450 | ] ); |
| 3451 | |
| 3452 | /*Subtitle----*/ |
| 3453 | $this->add_control( "{$form_type}_form_subtitle_po_toggle", [ |
| 3454 | 'label' => __( 'Subtitle', 'essential-addons-for-elementor-lite' ), |
| 3455 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3456 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3457 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3458 | 'return_value' => 'yes', |
| 3459 | 'separator' => 'before', |
| 3460 | ] ); |
| 3461 | $this->start_popover(); |
| 3462 | $this->add_responsive_control( "{$form_type}_form_subtitle_margin", [ |
| 3463 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3464 | 'type' => Controls_Manager::DIMENSIONS, |
| 3465 | 'size_units' => [ |
| 3466 | 'px', |
| 3467 | 'em', |
| 3468 | '%', |
| 3469 | ], |
| 3470 | 'selectors' => [ |
| 3471 | $subtitle_selector => $this->apply_dim( 'margin' ), |
| 3472 | ], |
| 3473 | 'condition' => [ |
| 3474 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3475 | ], |
| 3476 | ] ); |
| 3477 | $this->add_responsive_control( "{$form_type}_form_subtitle_padding", [ |
| 3478 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3479 | 'type' => Controls_Manager::DIMENSIONS, |
| 3480 | 'size_units' => [ |
| 3481 | 'px', |
| 3482 | 'em', |
| 3483 | '%', |
| 3484 | ], |
| 3485 | 'selectors' => [ |
| 3486 | $subtitle_selector => $this->apply_dim( 'padding' ), |
| 3487 | ], |
| 3488 | 'condition' => [ |
| 3489 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3490 | ], |
| 3491 | ] ); |
| 3492 | $this->add_control( "{$form_type}_form_subtitle_color", [ |
| 3493 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 3494 | 'type' => Controls_Manager::COLOR, |
| 3495 | 'selectors' => [ |
| 3496 | $subtitle_selector => 'color: {{VALUE}};', |
| 3497 | ], |
| 3498 | 'condition' => [ |
| 3499 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3500 | ], |
| 3501 | ] ); |
| 3502 | $this->add_control( "{$form_type}_form_subtitle_bg_color", [ |
| 3503 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3504 | 'type' => Controls_Manager::COLOR, |
| 3505 | 'selectors' => [ |
| 3506 | $subtitle_selector => 'background: {{VALUE}};', |
| 3507 | ], |
| 3508 | 'condition' => [ |
| 3509 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3510 | ], |
| 3511 | ] ); |
| 3512 | |
| 3513 | |
| 3514 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3515 | 'name' => "{$form_type}_form_subtitle_border", |
| 3516 | 'selector' => $subtitle_selector, |
| 3517 | 'condition' => [ |
| 3518 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3519 | ], |
| 3520 | ] ); |
| 3521 | $this->add_control( "{$form_type}_form_subtitle_border_radius", [ |
| 3522 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3523 | 'type' => Controls_Manager::DIMENSIONS, |
| 3524 | 'size_units' => [ |
| 3525 | 'px', |
| 3526 | '%', |
| 3527 | ], |
| 3528 | 'selectors' => [ |
| 3529 | $subtitle_selector => $this->apply_dim( 'border-radius' ), |
| 3530 | ], |
| 3531 | 'condition' => [ |
| 3532 | "{$form_type}_form_subtitle_po_toggle" => 'yes', |
| 3533 | ], |
| 3534 | ] ); |
| 3535 | |
| 3536 | $this->end_popover(); |
| 3537 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 3538 | 'name' => "{$form_type}_form_subtitle_typo", |
| 3539 | 'label' => __( 'Subtitle Typography', 'essential-addons-for-elementor-lite' ), |
| 3540 | 'selector' => $subtitle_selector, |
| 3541 | ] ); |
| 3542 | |
| 3543 | $this->end_controls_section(); |
| 3544 | } |
| 3545 | |
| 3546 | protected function init_style_input_fields_controls() { |
| 3547 | $this->start_controls_section( 'section_style_form_fields', [ |
| 3548 | 'label' => __( 'Form Fields', 'essential-addons-for-elementor-lite' ), |
| 3549 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3550 | ] ); |
| 3551 | $this->add_control( 'eael_form_field_po_toggle', [ |
| 3552 | 'label' => __( 'Spacing', 'essential-addons-for-elementor-lite' ), |
| 3553 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3554 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3555 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3556 | 'return_value' => 'yes', |
| 3557 | ] ); |
| 3558 | |
| 3559 | $this->start_popover(); |
| 3560 | $this->add_control( 'eael_form_input_fields_heading', [ |
| 3561 | 'type' => Controls_Manager::HEADING, |
| 3562 | 'label' => __( 'Form Input Fields', 'essential-addons-for-elementor-lite' ), |
| 3563 | ] ); |
| 3564 | $this->add_responsive_control( "eael_form_field_margin", [ |
| 3565 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3566 | 'type' => Controls_Manager::DIMENSIONS, |
| 3567 | 'size_units' => [ |
| 3568 | 'px', |
| 3569 | 'em', |
| 3570 | '%', |
| 3571 | ], |
| 3572 | 'selectors' => [ |
| 3573 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-group" => $this->apply_dim( 'margin' ), |
| 3574 | ], |
| 3575 | 'condition' => [ |
| 3576 | 'eael_form_field_po_toggle' => 'yes', |
| 3577 | ], |
| 3578 | ] ); |
| 3579 | $this->add_responsive_control( "eael_form_field_padding", [ |
| 3580 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3581 | 'type' => Controls_Manager::DIMENSIONS, |
| 3582 | 'size_units' => [ |
| 3583 | 'px', |
| 3584 | 'em', |
| 3585 | '%', |
| 3586 | ], |
| 3587 | 'selectors' => [ |
| 3588 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control" => $this->apply_dim( 'padding' ), |
| 3589 | ], |
| 3590 | 'condition' => [ |
| 3591 | 'eael_form_field_po_toggle' => 'yes', |
| 3592 | ], |
| 3593 | ] ); |
| 3594 | |
| 3595 | $this->add_control( 'eael_form_tc_fields_heading', [ |
| 3596 | 'type' => Controls_Manager::HEADING, |
| 3597 | 'label' => __( 'Terms & Condition Field', 'essential-addons-for-elementor-lite' ), |
| 3598 | 'separator' => 'before', |
| 3599 | ] ); |
| 3600 | $this->add_responsive_control( "eael_form_tc_field_margin", [ |
| 3601 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3602 | 'type' => Controls_Manager::DIMENSIONS, |
| 3603 | 'size_units' => [ |
| 3604 | 'px', |
| 3605 | 'em', |
| 3606 | '%', |
| 3607 | ], |
| 3608 | 'selectors' => [ |
| 3609 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => $this->apply_dim( 'margin' ), |
| 3610 | ], |
| 3611 | 'condition' => [ |
| 3612 | 'eael_form_field_po_toggle' => 'yes', |
| 3613 | ], |
| 3614 | ] ); |
| 3615 | $this->add_responsive_control( "eael_form_tc_field_padding", [ |
| 3616 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3617 | 'type' => Controls_Manager::DIMENSIONS, |
| 3618 | 'size_units' => [ |
| 3619 | 'px', |
| 3620 | 'em', |
| 3621 | '%', |
| 3622 | ], |
| 3623 | 'selectors' => [ |
| 3624 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => $this->apply_dim( 'padding' ), |
| 3625 | ], |
| 3626 | 'condition' => [ |
| 3627 | 'eael_form_field_po_toggle' => 'yes', |
| 3628 | ], |
| 3629 | ] ); |
| 3630 | $this->end_popover(); |
| 3631 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 3632 | 'name' => "eael_fields_typography", |
| 3633 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control", |
| 3634 | ] ); |
| 3635 | $this->add_responsive_control( "ph_align", [ |
| 3636 | 'label' => __( 'Text Alignment', 'essential-addons-for-elementor-lite' ), |
| 3637 | 'type' => Controls_Manager::CHOOSE, |
| 3638 | 'options' => [ |
| 3639 | 'left' => [ |
| 3640 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 3641 | 'icon' => 'eicon-h-align-left', |
| 3642 | ], |
| 3643 | 'center' => [ |
| 3644 | 'title' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 3645 | 'icon' => 'eicon-h-align-center', |
| 3646 | ], |
| 3647 | 'right' => [ |
| 3648 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 3649 | 'icon' => 'eicon-h-align-right', |
| 3650 | ], |
| 3651 | ], |
| 3652 | 'default' => 'left', |
| 3653 | 'selectors' => [ |
| 3654 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control" => 'text-align: {{VALUE}};', |
| 3655 | ], |
| 3656 | ] ); |
| 3657 | $this->add_control( 'eael_form_label_colors_heading', [ |
| 3658 | 'type' => Controls_Manager::HEADING, |
| 3659 | 'label' => __( 'Colors & Border', 'essential-addons-for-elementor-lite' ), |
| 3660 | 'separator' => 'before', |
| 3661 | ] ); |
| 3662 | $this->start_controls_tabs( "tabs_form_fields_style" ); |
| 3663 | |
| 3664 | /*-----Form Input Fields NORMAL state------ */ |
| 3665 | $this->start_controls_tab( "tab_form_field_style_normal", [ |
| 3666 | 'label' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 3667 | ] ); |
| 3668 | $this->add_control( 'eael_field_color', [ |
| 3669 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 3670 | 'type' => Controls_Manager::COLOR, |
| 3671 | 'selectors' => [ |
| 3672 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control" => 'color: {{VALUE}};', |
| 3673 | ], |
| 3674 | ] ); |
| 3675 | $this->add_control( 'eael_field_placeholder_color', [ |
| 3676 | 'label' => __( 'Placeholder Color', 'essential-addons-for-elementor-lite' ), |
| 3677 | 'type' => Controls_Manager::COLOR, |
| 3678 | 'selectors' => [ |
| 3679 | "{{WRAPPER}} .lr-form-wrapper input.eael-lr-form-control::placeholder" => 'color: {{VALUE}};', |
| 3680 | ], |
| 3681 | ] ); |
| 3682 | $this->add_control( 'eael_field_bg_color', [ |
| 3683 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3684 | 'type' => Controls_Manager::COLOR, |
| 3685 | 'default' => '#ffffff', |
| 3686 | 'selectors' => [ |
| 3687 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control" => 'background-color: {{VALUE}};', |
| 3688 | ], |
| 3689 | ] ); |
| 3690 | |
| 3691 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3692 | 'name' => "eael_field_border", |
| 3693 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control", |
| 3694 | ] ); |
| 3695 | $this->add_control( "eael_field_border_radius", [ |
| 3696 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3697 | 'type' => Controls_Manager::DIMENSIONS, |
| 3698 | 'size_units' => [ |
| 3699 | 'px', |
| 3700 | '%', |
| 3701 | ], |
| 3702 | 'selectors' => [ |
| 3703 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control" => $this->apply_dim( 'border-radius' ), |
| 3704 | ], |
| 3705 | ] ); |
| 3706 | |
| 3707 | $this->end_controls_tab(); |
| 3708 | |
| 3709 | $this->start_controls_tab( "tab_form_field_style_active", [ |
| 3710 | 'label' => __( 'Focus', 'essential-addons-for-elementor-lite' ), |
| 3711 | ] ); |
| 3712 | |
| 3713 | $this->add_control( 'eael_field_placeholder_color_active', [ |
| 3714 | 'label' => __( 'Placeholder Color', 'essential-addons-for-elementor-lite' ), |
| 3715 | 'type' => Controls_Manager::COLOR, |
| 3716 | 'selectors' => [ |
| 3717 | "{{WRAPPER}} .lr-form-wrapper input.eael-lr-form-control:focus::placeholder" => 'color: {{VALUE}};', |
| 3718 | ], |
| 3719 | ] ); |
| 3720 | $this->add_control( 'eael_field_bg_color_active', [ |
| 3721 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3722 | 'type' => Controls_Manager::COLOR, |
| 3723 | 'default' => '#ffffff', |
| 3724 | 'selectors' => [ |
| 3725 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control:focus" => 'background-color: {{VALUE}};', |
| 3726 | ], |
| 3727 | ] ); |
| 3728 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3729 | 'name' => "eael_field_border_focus", |
| 3730 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control:focus", |
| 3731 | ] ); |
| 3732 | $this->add_control( "eael_field_border_radius_focus", [ |
| 3733 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3734 | 'type' => Controls_Manager::DIMENSIONS, |
| 3735 | 'size_units' => [ |
| 3736 | 'px', |
| 3737 | '%', |
| 3738 | ], |
| 3739 | 'selectors' => [ |
| 3740 | "{{WRAPPER}} .lr-form-wrapper .eael-lr-form-control:focus" => $this->apply_dim( 'border-radius' ), |
| 3741 | ], |
| 3742 | ] ); |
| 3743 | $this->end_controls_tab(); |
| 3744 | $this->end_controls_tabs(); |
| 3745 | $this->end_controls_section(); |
| 3746 | } |
| 3747 | |
| 3748 | protected function init_style_input_labels_controls() { |
| 3749 | $this->start_controls_section( 'section_style_form_labels', [ |
| 3750 | 'label' => __( 'Form Labels', 'essential-addons-for-elementor-lite' ), |
| 3751 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3752 | ] ); |
| 3753 | $this->add_control( 'eael_form_label_po_toggle', [ |
| 3754 | 'label' => __( 'Spacing', 'essential-addons-for-elementor-lite' ), |
| 3755 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3756 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3757 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3758 | 'return_value' => 'yes', |
| 3759 | ] ); |
| 3760 | |
| 3761 | $this->start_popover(); |
| 3762 | $this->add_responsive_control( "eael_form_label_margin", [ |
| 3763 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 3764 | 'type' => Controls_Manager::DIMENSIONS, |
| 3765 | 'size_units' => [ |
| 3766 | 'px', |
| 3767 | 'em', |
| 3768 | '%', |
| 3769 | ], |
| 3770 | 'selectors' => [ |
| 3771 | "{{WRAPPER}} .lr-form-wrapper .eael-field-label" => $this->apply_dim( 'margin' ), |
| 3772 | ], |
| 3773 | 'condition' => [ |
| 3774 | 'eael_form_label_po_toggle' => 'yes', |
| 3775 | ], |
| 3776 | ] ); |
| 3777 | $this->add_responsive_control( "eael_form_label_padding", [ |
| 3778 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 3779 | 'type' => Controls_Manager::DIMENSIONS, |
| 3780 | 'size_units' => [ |
| 3781 | 'px', |
| 3782 | 'em', |
| 3783 | '%', |
| 3784 | ], |
| 3785 | 'selectors' => [ |
| 3786 | "{{WRAPPER}} .lr-form-wrapper .eael-field-label" => $this->apply_dim( 'padding' ), |
| 3787 | ], |
| 3788 | 'condition' => [ |
| 3789 | 'eael_form_label_po_toggle' => 'yes', |
| 3790 | ], |
| 3791 | ] ); |
| 3792 | $this->end_popover(); |
| 3793 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 3794 | 'name' => "eael_label_typography", |
| 3795 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael-field-label", |
| 3796 | ] ); |
| 3797 | |
| 3798 | $this->add_control( 'eael_form_label_c_po_toggle', [ |
| 3799 | 'label' => __( 'Colors', 'essential-addons-for-elementor-lite' ), |
| 3800 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3801 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3802 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3803 | 'return_value' => 'yes', |
| 3804 | ] ); |
| 3805 | |
| 3806 | $this->start_popover(); |
| 3807 | $this->add_control( 'eael_label_color', [ |
| 3808 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 3809 | 'type' => Controls_Manager::COLOR, |
| 3810 | 'selectors' => [ |
| 3811 | "{{WRAPPER}} .lr-form-wrapper .eael-field-label" => 'color: {{VALUE}};', |
| 3812 | ], |
| 3813 | 'condition' => [ |
| 3814 | 'eael_form_label_c_po_toggle' => 'yes', |
| 3815 | ], |
| 3816 | ] ); |
| 3817 | $this->add_control( 'eael_label_bg_color', [ |
| 3818 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3819 | 'type' => Controls_Manager::COLOR, |
| 3820 | 'default' => '#ffffff', |
| 3821 | 'selectors' => [ |
| 3822 | "{{WRAPPER}} .lr-form-wrapper .eael-field-label" => 'background-color: {{VALUE}};', |
| 3823 | ], |
| 3824 | 'condition' => [ |
| 3825 | 'eael_form_label_c_po_toggle' => 'yes', |
| 3826 | ], |
| 3827 | ] ); |
| 3828 | $this->end_popover(); |
| 3829 | |
| 3830 | $this->add_control( 'eael_form_label_b_po_toggle', [ |
| 3831 | 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ), |
| 3832 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3833 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 3834 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 3835 | 'return_value' => 'yes', |
| 3836 | ] ); |
| 3837 | |
| 3838 | $this->start_popover(); |
| 3839 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 3840 | 'name' => "eael_label_border", |
| 3841 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael-field-label", |
| 3842 | 'condition' => [ |
| 3843 | 'eael_form_label_b_po_toggle' => 'yes', |
| 3844 | ], |
| 3845 | ] ); |
| 3846 | $this->add_control( "eael_label_border_radius", [ |
| 3847 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 3848 | 'type' => Controls_Manager::DIMENSIONS, |
| 3849 | 'size_units' => [ |
| 3850 | 'px', |
| 3851 | '%', |
| 3852 | ], |
| 3853 | 'selectors' => [ |
| 3854 | "{{WRAPPER}} .lr-form-wrapper .eael-field-label" => $this->apply_dim( 'border-radius' ), |
| 3855 | ], |
| 3856 | 'condition' => [ |
| 3857 | 'eael_form_label_b_po_toggle' => 'yes', |
| 3858 | ], |
| 3859 | ] ); |
| 3860 | $this->end_popover(); |
| 3861 | |
| 3862 | $this->add_control( 'rmark_po_toggle', [ |
| 3863 | 'label' => __( 'Required Mark Style', 'essential-addons-for-elementor-lite' ), |
| 3864 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3865 | 'condition' => [ |
| 3866 | 'show_labels' => 'yes', |
| 3867 | 'mark_required' => 'yes', |
| 3868 | ], |
| 3869 | ] ); |
| 3870 | |
| 3871 | $this->start_popover(); |
| 3872 | $this->add_control( 'rmark_sign', [ |
| 3873 | 'label' => __( 'Mark Sign', 'essential-addons-for-elementor-lite' ), |
| 3874 | 'type' => Controls_Manager::TEXT, |
| 3875 | 'default' => '*', |
| 3876 | 'placeholder' => 'Enter * or (required) etc.', |
| 3877 | 'selectors' => [ |
| 3878 | "{{WRAPPER}} .eael-lr-form-wrapper .eael-lr-form-group label.mark-required:after" => 'content: "{{VALUE}}";', |
| 3879 | ], |
| 3880 | 'condition' => [ |
| 3881 | 'rmark_po_toggle' => 'yes', |
| 3882 | ], |
| 3883 | 'ai' => [ |
| 3884 | 'active' => false, |
| 3885 | ], |
| 3886 | ] ); |
| 3887 | $this->add_control( "rmark_size", [ |
| 3888 | 'label' => esc_html__( 'Size', 'essential-addons-for-elementor-lite' ), |
| 3889 | 'type' => Controls_Manager::SLIDER, |
| 3890 | 'size_units' => [ |
| 3891 | 'px', |
| 3892 | 'rem', |
| 3893 | '%', |
| 3894 | ], |
| 3895 | 'range' => [ |
| 3896 | 'px' => [ |
| 3897 | 'min' => 0, |
| 3898 | 'max' => 50, |
| 3899 | 'step' => 1, |
| 3900 | ], |
| 3901 | ], |
| 3902 | 'selectors' => [ |
| 3903 | "{{WRAPPER}} .eael-lr-form-wrapper .eael-lr-form-group label.mark-required:after" => 'font-size: {{SIZE}}{{UNIT}};', |
| 3904 | ], |
| 3905 | 'condition' => [ |
| 3906 | 'rmark_po_toggle' => 'yes', |
| 3907 | ], |
| 3908 | ] ); |
| 3909 | $this->add_control( "rmakr_color", [ |
| 3910 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 3911 | 'type' => Controls_Manager::COLOR, |
| 3912 | 'selectors' => [ |
| 3913 | "{{WRAPPER}} .eael-lr-form-wrapper .eael-lr-form-group label.mark-required:after" => 'color: {{VALUE}};', |
| 3914 | ], |
| 3915 | 'condition' => [ |
| 3916 | 'rmark_po_toggle' => 'yes', |
| 3917 | ], |
| 3918 | ] ); |
| 3919 | |
| 3920 | $this->add_responsive_control( "rmark_valign", [ |
| 3921 | 'label' => esc_html__( 'Vertical Alignment', 'essential-addons-for-elementor-lite' ), |
| 3922 | 'type' => Controls_Manager::SLIDER, |
| 3923 | 'range' => [ |
| 3924 | 'px' => [ |
| 3925 | 'min' => - 50, |
| 3926 | 'max' => 50, |
| 3927 | 'step' => 0, |
| 3928 | ], |
| 3929 | ], |
| 3930 | 'default' => [ |
| 3931 | 'unit' => 'px', |
| 3932 | 'size' => 17, |
| 3933 | ], |
| 3934 | 'selectors' => [ |
| 3935 | "{{WRAPPER}} .eael-lr-form-wrapper .eael-lr-form-group label.mark-required:after" => 'top: {{SIZE}}px;', |
| 3936 | ], |
| 3937 | 'condition' => [ |
| 3938 | 'rmark_po_toggle' => 'yes', |
| 3939 | ], |
| 3940 | ] ); |
| 3941 | $this->add_responsive_control( "rmark_halign", [ |
| 3942 | 'label' => esc_html__( 'Horizontal Alignment', 'essential-addons-for-elementor-lite' ), |
| 3943 | 'type' => Controls_Manager::SLIDER, |
| 3944 | 'range' => [ |
| 3945 | 'px' => [ |
| 3946 | 'min' => - 50, |
| 3947 | 'max' => 50, |
| 3948 | 'step' => 0, |
| 3949 | ], |
| 3950 | ], |
| 3951 | 'default' => [ |
| 3952 | 'unit' => 'px', |
| 3953 | 'size' => - 10, |
| 3954 | ], |
| 3955 | 'selectors' => [ |
| 3956 | "{{WRAPPER}} .eael-lr-form-wrapper .eael-lr-form-group label.mark-required:after" => 'right: {{SIZE}}px;', |
| 3957 | ], |
| 3958 | 'condition' => [ |
| 3959 | 'rmark_po_toggle' => 'yes', |
| 3960 | ], |
| 3961 | ] ); |
| 3962 | |
| 3963 | $this->end_popover(); |
| 3964 | $this->add_control( 'lpv_po_toggle', [ |
| 3965 | 'label' => __( 'Password Visibility', 'essential-addons-for-elementor-lite' ), |
| 3966 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 3967 | 'condition' => [ |
| 3968 | 'password_toggle' => 'yes', |
| 3969 | ], |
| 3970 | ] ); |
| 3971 | $this->start_popover(); |
| 3972 | |
| 3973 | $this->add_responsive_control( "lpv_size", [ |
| 3974 | 'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 3975 | 'type' => Controls_Manager::SLIDER, |
| 3976 | 'size_units' => [ |
| 3977 | 'px', |
| 3978 | 'rem', |
| 3979 | '%', |
| 3980 | ], |
| 3981 | 'range' => [ |
| 3982 | 'px' => [ |
| 3983 | 'min' => 0, |
| 3984 | 'max' => 50, |
| 3985 | 'step' => 1, |
| 3986 | ], |
| 3987 | ], |
| 3988 | 'selectors' => [ |
| 3989 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-login-form-wrapper .eael-lr-form-group .dashicons" => 'font-size: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', |
| 3990 | ], |
| 3991 | 'condition' => [ |
| 3992 | 'lpv_po_toggle' => 'yes', |
| 3993 | ], |
| 3994 | ] ); |
| 3995 | $this->add_control( "lvp_open_color", [ |
| 3996 | 'label' => __( 'Open Eye Color', 'essential-addons-for-elementor-lite' ), |
| 3997 | 'type' => Controls_Manager::COLOR, |
| 3998 | 'selectors' => [ |
| 3999 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-login-form-wrapper .eael-lr-form-group .dashicons-visibility" => 'color: {{VALUE}};', |
| 4000 | ], |
| 4001 | 'condition' => [ |
| 4002 | 'lpv_po_toggle' => 'yes', |
| 4003 | ], |
| 4004 | ] ); |
| 4005 | $this->add_control( "lvp_close_color", [ |
| 4006 | 'label' => __( 'Close Eye Color', 'essential-addons-for-elementor-lite' ), |
| 4007 | 'type' => Controls_Manager::COLOR, |
| 4008 | 'selectors' => [ |
| 4009 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-login-form-wrapper .eael-lr-form-group .dashicons-hidden" => 'color: {{VALUE}};', |
| 4010 | ], |
| 4011 | 'condition' => [ |
| 4012 | 'lpv_po_toggle' => 'yes', |
| 4013 | ], |
| 4014 | ] ); |
| 4015 | |
| 4016 | $this->add_responsive_control( "lpv_valign", [ |
| 4017 | 'label' => esc_html__( 'Vertical Alignment', 'essential-addons-for-elementor-lite' ), |
| 4018 | 'type' => Controls_Manager::SLIDER, |
| 4019 | 'range' => [ |
| 4020 | 'px' => [ |
| 4021 | 'min' => - 50, |
| 4022 | 'max' => 50, |
| 4023 | 'step' => 1, |
| 4024 | ], |
| 4025 | ], |
| 4026 | 'default' => [ |
| 4027 | 'unit' => 'px', |
| 4028 | 'size' => 0.73, |
| 4029 | ], |
| 4030 | 'selectors' => [ |
| 4031 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-login-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'top: {{SIZE}}px;', |
| 4032 | ], |
| 4033 | 'condition' => [ |
| 4034 | 'lpv_po_toggle' => 'yes', |
| 4035 | ], |
| 4036 | ] ); |
| 4037 | $this->add_responsive_control( "lpv_halign", [ |
| 4038 | 'label' => esc_html__( 'Horizontal Alignment', 'essential-addons-for-elementor-lite' ), |
| 4039 | 'type' => Controls_Manager::SLIDER, |
| 4040 | 'range' => [ |
| 4041 | 'px' => [ |
| 4042 | 'min' => - 50, |
| 4043 | 'max' => 50, |
| 4044 | 'step' => 1, |
| 4045 | ], |
| 4046 | ], |
| 4047 | 'default' => [ |
| 4048 | 'unit' => 'px', |
| 4049 | 'size' => - 27, |
| 4050 | ], |
| 4051 | 'selectors' => [ |
| 4052 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-login-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'right: {{SIZE}}px;', |
| 4053 | ], |
| 4054 | 'condition' => [ |
| 4055 | 'lpv_po_toggle' => 'yes', |
| 4056 | ], |
| 4057 | ] ); |
| 4058 | |
| 4059 | $this->end_popover(); |
| 4060 | |
| 4061 | $this->add_control( 'lpv_po_toggle_register', [ |
| 4062 | 'label' => __( 'Register Password Visibility Style', 'essential-addons-for-elementor-lite' ), |
| 4063 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4064 | 'condition' => [ |
| 4065 | 'password_toggle_register' => 'yes', |
| 4066 | ], |
| 4067 | ] ); |
| 4068 | $this->start_popover(); |
| 4069 | |
| 4070 | $this->add_responsive_control( "lpv_size_register", [ |
| 4071 | 'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 4072 | 'type' => Controls_Manager::SLIDER, |
| 4073 | 'size_units' => [ |
| 4074 | 'px', |
| 4075 | 'rem', |
| 4076 | '%', |
| 4077 | ], |
| 4078 | 'range' => [ |
| 4079 | 'px' => [ |
| 4080 | 'min' => 0, |
| 4081 | 'max' => 50, |
| 4082 | 'step' => 1, |
| 4083 | ], |
| 4084 | ], |
| 4085 | 'selectors' => [ |
| 4086 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-register-form-wrapper .eael-lr-form-group .dashicons" => 'font-size: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', |
| 4087 | ], |
| 4088 | 'condition' => [ |
| 4089 | 'lpv_po_toggle_register' => 'yes', |
| 4090 | ], |
| 4091 | ] ); |
| 4092 | $this->add_control( "lvp_open_color_register", [ |
| 4093 | 'label' => __( 'Open Eye Color', 'essential-addons-for-elementor-lite' ), |
| 4094 | 'type' => Controls_Manager::COLOR, |
| 4095 | 'selectors' => [ |
| 4096 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-register-form-wrapper .eael-lr-form-group .dashicons-visibility" => 'color: {{VALUE}};', |
| 4097 | ], |
| 4098 | 'condition' => [ |
| 4099 | 'lpv_po_toggle_register' => 'yes', |
| 4100 | ], |
| 4101 | ] ); |
| 4102 | $this->add_control( "lvp_close_color_register", [ |
| 4103 | 'label' => __( 'Close Eye Color', 'essential-addons-for-elementor-lite' ), |
| 4104 | 'type' => Controls_Manager::COLOR, |
| 4105 | 'selectors' => [ |
| 4106 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-register-form-wrapper .eael-lr-form-group .dashicons-hidden" => 'color: {{VALUE}};', |
| 4107 | ], |
| 4108 | 'condition' => [ |
| 4109 | 'lpv_po_toggle_register' => 'yes', |
| 4110 | ], |
| 4111 | ] ); |
| 4112 | |
| 4113 | $this->add_responsive_control( "lpv_valign_register", [ |
| 4114 | 'label' => esc_html__( 'Vertical Alignment', 'essential-addons-for-elementor-lite' ), |
| 4115 | 'type' => Controls_Manager::SLIDER, |
| 4116 | 'range' => [ |
| 4117 | 'px' => [ |
| 4118 | 'min' => - 50, |
| 4119 | 'max' => 50, |
| 4120 | 'step' => 1, |
| 4121 | ], |
| 4122 | ], |
| 4123 | 'default' => [ |
| 4124 | 'unit' => 'px', |
| 4125 | 'size' => 0.73, |
| 4126 | ], |
| 4127 | 'selectors' => [ |
| 4128 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-register-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'top: {{SIZE}}px;', |
| 4129 | ], |
| 4130 | 'condition' => [ |
| 4131 | 'lpv_po_toggle_register' => 'yes', |
| 4132 | ], |
| 4133 | ] ); |
| 4134 | $this->add_responsive_control( "lpv_halign_register", [ |
| 4135 | 'label' => esc_html__( 'Horizontal Alignment', 'essential-addons-for-elementor-lite' ), |
| 4136 | 'type' => Controls_Manager::SLIDER, |
| 4137 | 'range' => [ |
| 4138 | 'px' => [ |
| 4139 | 'min' => - 50, |
| 4140 | 'max' => 50, |
| 4141 | 'step' => 1, |
| 4142 | ], |
| 4143 | ], |
| 4144 | 'default' => [ |
| 4145 | 'unit' => 'px', |
| 4146 | 'size' => - 27, |
| 4147 | ], |
| 4148 | 'selectors' => [ |
| 4149 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-register-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'right: {{SIZE}}px;', |
| 4150 | ], |
| 4151 | 'condition' => [ |
| 4152 | 'lpv_po_toggle_register' => 'yes', |
| 4153 | ], |
| 4154 | ] ); |
| 4155 | |
| 4156 | $this->end_popover(); |
| 4157 | |
| 4158 | $this->add_control( 'lpv_po_toggle_resetpassword', [ |
| 4159 | 'label' => __( 'Reset Password Visibility', 'essential-addons-for-elementor-lite' ), |
| 4160 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4161 | 'condition' => [ |
| 4162 | 'password_toggle_resetpassword' => 'yes', |
| 4163 | ], |
| 4164 | ] ); |
| 4165 | $this->start_popover(); |
| 4166 | |
| 4167 | $this->add_responsive_control( "lpv_size_resetpassword", [ |
| 4168 | 'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 4169 | 'type' => Controls_Manager::SLIDER, |
| 4170 | 'size_units' => [ |
| 4171 | 'px', |
| 4172 | 'rem', |
| 4173 | '%', |
| 4174 | ], |
| 4175 | 'range' => [ |
| 4176 | 'px' => [ |
| 4177 | 'min' => 0, |
| 4178 | 'max' => 50, |
| 4179 | 'step' => 1, |
| 4180 | ], |
| 4181 | ], |
| 4182 | 'selectors' => [ |
| 4183 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper .eael-lr-form-group .dashicons" => 'font-size: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', |
| 4184 | ], |
| 4185 | 'condition' => [ |
| 4186 | 'lpv_po_toggle_resetpassword' => 'yes', |
| 4187 | ], |
| 4188 | ] ); |
| 4189 | $this->add_control( "lvp_open_color_resetpassword", [ |
| 4190 | 'label' => __( 'Open Eye Color', 'essential-addons-for-elementor-lite' ), |
| 4191 | 'type' => Controls_Manager::COLOR, |
| 4192 | 'selectors' => [ |
| 4193 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper .eael-lr-form-group .dashicons-visibility" => 'color: {{VALUE}};', |
| 4194 | ], |
| 4195 | 'condition' => [ |
| 4196 | 'lpv_po_toggle_resetpassword' => 'yes', |
| 4197 | ], |
| 4198 | ] ); |
| 4199 | $this->add_control( "lvp_close_color_resetpassword", [ |
| 4200 | 'label' => __( 'Close Eye Color', 'essential-addons-for-elementor-lite' ), |
| 4201 | 'type' => Controls_Manager::COLOR, |
| 4202 | 'selectors' => [ |
| 4203 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper .eael-lr-form-group .dashicons-hidden" => 'color: {{VALUE}};', |
| 4204 | ], |
| 4205 | 'condition' => [ |
| 4206 | 'lpv_po_toggle_resetpassword' => 'yes', |
| 4207 | ], |
| 4208 | ] ); |
| 4209 | |
| 4210 | $this->add_responsive_control( "lpv_valign_resetpassword", [ |
| 4211 | 'label' => esc_html__( 'Vertical Alignment', 'essential-addons-for-elementor-lite' ), |
| 4212 | 'type' => Controls_Manager::SLIDER, |
| 4213 | 'range' => [ |
| 4214 | 'px' => [ |
| 4215 | 'min' => - 50, |
| 4216 | 'max' => 50, |
| 4217 | 'step' => 1, |
| 4218 | ], |
| 4219 | ], |
| 4220 | 'default' => [ |
| 4221 | 'unit' => 'px', |
| 4222 | 'size' => 0.73, |
| 4223 | ], |
| 4224 | 'selectors' => [ |
| 4225 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'top: {{SIZE}}px;', |
| 4226 | ], |
| 4227 | 'condition' => [ |
| 4228 | 'lpv_po_toggle_resetpassword' => 'yes', |
| 4229 | ], |
| 4230 | ] ); |
| 4231 | $this->add_responsive_control( "lpv_halign_resetpassword", [ |
| 4232 | 'label' => esc_html__( 'Horizontal Alignment', 'essential-addons-for-elementor-lite' ), |
| 4233 | 'type' => Controls_Manager::SLIDER, |
| 4234 | 'range' => [ |
| 4235 | 'px' => [ |
| 4236 | 'min' => - 50, |
| 4237 | 'max' => 50, |
| 4238 | 'step' => 1, |
| 4239 | ], |
| 4240 | ], |
| 4241 | 'default' => [ |
| 4242 | 'unit' => 'px', |
| 4243 | 'size' => - 27, |
| 4244 | ], |
| 4245 | 'selectors' => [ |
| 4246 | "{{WRAPPER}} .eael-lr-form-wrapper.eael-resetpassword-form-wrapper .eael-lr-form-group .wp-hide-pw" => 'right: {{SIZE}}px;', |
| 4247 | ], |
| 4248 | 'condition' => [ |
| 4249 | 'lpv_po_toggle_resetpassword' => 'yes', |
| 4250 | ], |
| 4251 | ] ); |
| 4252 | |
| 4253 | $this->end_popover(); |
| 4254 | |
| 4255 | //Remember Me Style |
| 4256 | $this->add_control( 'eael_form_rm_fields_heading', [ |
| 4257 | 'type' => Controls_Manager::HEADING, |
| 4258 | 'label' => __( 'Remember Me', 'essential-addons-for-elementor-lite' ), |
| 4259 | 'separator' => 'before', |
| 4260 | ] ); |
| 4261 | $this->add_control( 'remember_me_style_pot', [ |
| 4262 | 'label' => __( 'Style', 'essential-addons-for-elementor-lite' ), |
| 4263 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4264 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 4265 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 4266 | 'return_value' => 'yes', |
| 4267 | 'condition' => [ |
| 4268 | 'login_show_remember_me' => 'yes', |
| 4269 | ], |
| 4270 | ] ); |
| 4271 | |
| 4272 | $this->start_popover(); |
| 4273 | $this->add_control( 'remember_me_style', [ |
| 4274 | 'label' => __( 'Style', 'essential-addons-for-elementor-lite' ), |
| 4275 | 'type' => Controls_Manager::SELECT, |
| 4276 | 'default' => 'lr-checkbox', |
| 4277 | 'options' => [ |
| 4278 | 'lr-checkbox' => __( 'Checkbox', 'essential-addons-for-elementor-lite' ), |
| 4279 | 'lr-toggle' => __( 'Toggle', 'essential-addons-for-elementor-lite' ), |
| 4280 | ], |
| 4281 | 'condition' => [ |
| 4282 | 'remember_me_style_pot' => 'yes', |
| 4283 | ], |
| 4284 | 'separator' => 'before', |
| 4285 | ] ); |
| 4286 | |
| 4287 | $this->add_responsive_control( "eael_form_rm_field_margin", [ |
| 4288 | 'label' => __( 'Container Margin', 'essential-addons-for-elementor-lite' ), |
| 4289 | 'type' => Controls_Manager::DIMENSIONS, |
| 4290 | 'size_units' => [ |
| 4291 | 'px', |
| 4292 | 'em', |
| 4293 | '%', |
| 4294 | ], |
| 4295 | 'selectors' => [ |
| 4296 | "{{WRAPPER}} .lr-form-wrapper .eael-forever-forget" => $this->apply_dim( 'margin' ), |
| 4297 | ], |
| 4298 | 'condition' => [ |
| 4299 | 'remember_me_style_pot' => 'yes', |
| 4300 | ], |
| 4301 | ] ); |
| 4302 | $this->add_responsive_control( "eael_form_rm_field_padding", [ |
| 4303 | 'label' => __( 'Container Padding', 'essential-addons-for-elementor-lite' ), |
| 4304 | 'type' => Controls_Manager::DIMENSIONS, |
| 4305 | 'size_units' => [ |
| 4306 | 'px', |
| 4307 | 'em', |
| 4308 | '%', |
| 4309 | ], |
| 4310 | 'selectors' => [ |
| 4311 | "{{WRAPPER}} .lr-form-wrapper .eael-forever-forget" => $this->apply_dim( 'padding' ), |
| 4312 | ], |
| 4313 | 'condition' => [ |
| 4314 | 'remember_me_style_pot' => 'yes', |
| 4315 | ], |
| 4316 | ] ); |
| 4317 | $this->add_responsive_control( "eael_form_rm_lbl_margin", [ |
| 4318 | 'label' => __( 'Label Margin', 'essential-addons-for-elementor-lite' ), |
| 4319 | 'type' => Controls_Manager::DIMENSIONS, |
| 4320 | 'size_units' => [ |
| 4321 | 'px', |
| 4322 | 'em', |
| 4323 | '%', |
| 4324 | ], |
| 4325 | 'selectors' => [ |
| 4326 | "{{WRAPPER}} .lr-form-wrapper .forget-menot label" => $this->apply_dim( 'margin' ), |
| 4327 | ], |
| 4328 | 'condition' => [ |
| 4329 | 'remember_me_style_pot' => 'yes', |
| 4330 | ], |
| 4331 | ] ); |
| 4332 | $this->add_responsive_control( "eael_form_rm_lbl_padding", [ |
| 4333 | 'label' => __( 'Label Padding', 'essential-addons-for-elementor-lite' ), |
| 4334 | 'type' => Controls_Manager::DIMENSIONS, |
| 4335 | 'size_units' => [ |
| 4336 | 'px', |
| 4337 | 'em', |
| 4338 | '%', |
| 4339 | ], |
| 4340 | 'selectors' => [ |
| 4341 | "{{WRAPPER}} .lr-form-wrapper .forget-menot" => $this->apply_dim( 'padding' ), |
| 4342 | ], |
| 4343 | 'condition' => [ |
| 4344 | 'remember_me_style_pot' => 'yes', |
| 4345 | ], |
| 4346 | ] ); |
| 4347 | |
| 4348 | $this->add_responsive_control( "eael_form_rm_checkbox_margin", [ |
| 4349 | 'label' => __( 'Checkbox Margin', 'essential-addons-for-elementor-lite' ), |
| 4350 | 'type' => Controls_Manager::DIMENSIONS, |
| 4351 | 'size_units' => [ |
| 4352 | 'px', |
| 4353 | 'em', |
| 4354 | '%', |
| 4355 | ], |
| 4356 | 'selectors' => [ |
| 4357 | "{{WRAPPER}} .lr-form-wrapper .forget-menot input" => $this->apply_dim( 'margin' ), |
| 4358 | ], |
| 4359 | 'condition' => [ |
| 4360 | 'remember_me_style_pot' => 'yes', |
| 4361 | ], |
| 4362 | ] ); |
| 4363 | |
| 4364 | $this->add_control( 'eael_rm_label_color', [ |
| 4365 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 4366 | 'type' => Controls_Manager::COLOR, |
| 4367 | 'selectors' => [ |
| 4368 | "{{WRAPPER}} .lr-form-wrapper .forget-menot" => 'color: {{VALUE}};', |
| 4369 | ], |
| 4370 | 'condition' => [ |
| 4371 | 'remember_me_style_pot' => 'yes', |
| 4372 | ], |
| 4373 | ] ); |
| 4374 | $this->add_control( 'eael_rm_label_bg_color', [ |
| 4375 | 'label' => __( 'Text Background', 'essential-addons-for-elementor-lite' ), |
| 4376 | 'type' => Controls_Manager::COLOR, |
| 4377 | 'default' => '#ffffff', |
| 4378 | 'selectors' => [ |
| 4379 | "{{WRAPPER}} .lr-form-wrapper .forget-menot" => 'background-color: {{VALUE}};', |
| 4380 | ], |
| 4381 | 'condition' => [ |
| 4382 | 'remember_me_style_pot' => 'yes', |
| 4383 | ], |
| 4384 | ] ); |
| 4385 | $this->add_control( 'eael_rm_checkbox_color', [ |
| 4386 | 'label' => __( 'Checkbox | Toggle Color', 'essential-addons-for-elementor-lite' ), |
| 4387 | 'type' => Controls_Manager::COLOR, |
| 4388 | 'selectors' => [ |
| 4389 | "{{WRAPPER}} .lr-form-wrapper .forget-menot input[type=checkbox]:checked" => 'border-color: {{VALUE}};background: {{VALUE}};', |
| 4390 | "{{WRAPPER}} .lr-form-wrapper input[type=checkbox]:hover:not(:checked):not(:disabled)" => 'border-color: {{VALUE}};', |
| 4391 | ], |
| 4392 | 'condition' => [ |
| 4393 | 'remember_me_style_pot' => 'yes', |
| 4394 | ], |
| 4395 | ] ); |
| 4396 | $this->end_popover(); |
| 4397 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 4398 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 4399 | 'name' => "eael_rm_label_typography", |
| 4400 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .forget-menot, {{WRAPPER}} .lr-form-wrapper .forget-menot label", |
| 4401 | ] ); |
| 4402 | |
| 4403 | //Forget Password Style |
| 4404 | $this->add_control( 'eael_form_forget_pass_fields_heading', [ |
| 4405 | 'type' => Controls_Manager::HEADING, |
| 4406 | 'label' => __( 'Forgot Password', 'essential-addons-for-elementor-lite' ), |
| 4407 | 'separator' => 'before', |
| 4408 | ] ); |
| 4409 | $this->add_control( 'forget_pass_style_pot', [ |
| 4410 | 'label' => __( 'Style', 'essential-addons-for-elementor-lite' ), |
| 4411 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4412 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 4413 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 4414 | 'return_value' => 'yes', |
| 4415 | ] ); |
| 4416 | |
| 4417 | $this->start_popover(); |
| 4418 | |
| 4419 | $this->add_responsive_control( "eael_form_forget_pass_field_margin", [ |
| 4420 | 'label' => __( 'Container Margin', 'essential-addons-for-elementor-lite' ), |
| 4421 | 'type' => Controls_Manager::DIMENSIONS, |
| 4422 | 'size_units' => [ |
| 4423 | 'px', |
| 4424 | 'em', |
| 4425 | '%', |
| 4426 | ], |
| 4427 | 'selectors' => [ |
| 4428 | "{{WRAPPER}} .lr-form-wrapper .eael-forever-forget" => $this->apply_dim( 'margin' ), |
| 4429 | ], |
| 4430 | 'condition' => [ |
| 4431 | 'forget_pass_style_pot' => 'yes', |
| 4432 | ], |
| 4433 | ] ); |
| 4434 | $this->add_responsive_control( "eael_form_forget_pass_field_padding", [ |
| 4435 | 'label' => __( 'Container Padding', 'essential-addons-for-elementor-lite' ), |
| 4436 | 'type' => Controls_Manager::DIMENSIONS, |
| 4437 | 'size_units' => [ |
| 4438 | 'px', |
| 4439 | 'em', |
| 4440 | '%', |
| 4441 | ], |
| 4442 | 'selectors' => [ |
| 4443 | "{{WRAPPER}} .lr-form-wrapper .eael-forever-forget" => $this->apply_dim( 'padding' ), |
| 4444 | ], |
| 4445 | 'condition' => [ |
| 4446 | 'forget_pass_style_pot' => 'yes', |
| 4447 | ], |
| 4448 | ] ); |
| 4449 | $this->add_responsive_control( "eael_form_forget_pass_lbl_margin", [ |
| 4450 | 'label' => __( 'Label Margin', 'essential-addons-for-elementor-lite' ), |
| 4451 | 'type' => Controls_Manager::DIMENSIONS, |
| 4452 | 'size_units' => [ |
| 4453 | 'px', |
| 4454 | 'em', |
| 4455 | '%', |
| 4456 | ], |
| 4457 | 'selectors' => [ |
| 4458 | "{{WRAPPER}} .lr-form-wrapper .forget-pass" => $this->apply_dim( 'margin' ), |
| 4459 | ], |
| 4460 | 'condition' => [ |
| 4461 | 'forget_pass_style_pot' => 'yes', |
| 4462 | ], |
| 4463 | ] ); |
| 4464 | $this->add_responsive_control( "eael_form_forget_pass_lbl_padding", [ |
| 4465 | 'label' => __( 'Label Padding', 'essential-addons-for-elementor-lite' ), |
| 4466 | 'type' => Controls_Manager::DIMENSIONS, |
| 4467 | 'size_units' => [ |
| 4468 | 'px', |
| 4469 | 'em', |
| 4470 | '%', |
| 4471 | ], |
| 4472 | 'selectors' => [ |
| 4473 | "{{WRAPPER}} .lr-form-wrapper .forget-pass" => $this->apply_dim( 'padding' ), |
| 4474 | ], |
| 4475 | 'condition' => [ |
| 4476 | 'forget_pass_style_pot' => 'yes', |
| 4477 | ], |
| 4478 | ] ); |
| 4479 | |
| 4480 | $this->add_control( 'eael_forget_pass_label_color_normal', [ |
| 4481 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 4482 | 'type' => Controls_Manager::COLOR, |
| 4483 | 'selectors' => [ |
| 4484 | "{{WRAPPER}} .lr-form-wrapper .forget-pass a" => 'color: {{VALUE}};', |
| 4485 | ], |
| 4486 | 'separator' => 'before', |
| 4487 | 'condition' => [ |
| 4488 | 'forget_pass_style_pot' => 'yes', |
| 4489 | ], |
| 4490 | ] ); |
| 4491 | $this->add_control( 'eael_forget_pass_label_bg_color_normal', [ |
| 4492 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 4493 | 'type' => Controls_Manager::COLOR, |
| 4494 | 'default' => '#ffffff', |
| 4495 | 'selectors' => [ |
| 4496 | "{{WRAPPER}} .lr-form-wrapper .forget-pass" => 'background-color: {{VALUE}};', |
| 4497 | ], |
| 4498 | 'condition' => [ |
| 4499 | 'forget_pass_style_pot' => 'yes', |
| 4500 | ], |
| 4501 | ] ); |
| 4502 | |
| 4503 | $this->add_control( 'eael_forget_pass_label_color_hover', [ |
| 4504 | 'label' => __( 'Hover Color', 'essential-addons-for-elementor-lite' ), |
| 4505 | 'type' => Controls_Manager::COLOR, |
| 4506 | 'selectors' => [ |
| 4507 | "{{WRAPPER}} .lr-form-wrapper .forget-pass:hover a" => 'color: {{VALUE}};', |
| 4508 | ], |
| 4509 | 'condition' => [ |
| 4510 | 'forget_pass_style_pot' => 'yes', |
| 4511 | ], |
| 4512 | ] ); |
| 4513 | $this->add_control( 'eael_forget_pass_label_bg_color_hover', [ |
| 4514 | 'label' => __( 'Background Hover Color', 'essential-addons-for-elementor-lite' ), |
| 4515 | 'type' => Controls_Manager::COLOR, |
| 4516 | 'default' => '#ffffff', |
| 4517 | 'selectors' => [ |
| 4518 | "{{WRAPPER}} .lr-form-wrapper .forget-pass:hover" => 'background-color: {{VALUE}};', |
| 4519 | ], |
| 4520 | 'condition' => [ |
| 4521 | 'forget_pass_style_pot' => 'yes', |
| 4522 | ], |
| 4523 | ] ); |
| 4524 | |
| 4525 | $this->end_popover(); |
| 4526 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 4527 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 4528 | 'name' => "eael_forget_pass_label_typography", |
| 4529 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .forget-pass a", |
| 4530 | ] ); |
| 4531 | |
| 4532 | //Terms & Conditions Style |
| 4533 | $this->add_control( 'eael_form_terms_fields_heading', [ |
| 4534 | 'type' => Controls_Manager::HEADING, |
| 4535 | 'label' => __( 'Terms & Conditions', 'essential-addons-for-elementor-lite' ), |
| 4536 | 'separator' => 'before', |
| 4537 | ] ); |
| 4538 | $this->add_control( 'terms_conditions_style_pot', [ |
| 4539 | 'label' => __( 'Style', 'essential-addons-for-elementor-lite' ), |
| 4540 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4541 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 4542 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 4543 | 'return_value' => 'yes', |
| 4544 | 'condition' => [ |
| 4545 | 'show_terms_conditions' => 'yes', |
| 4546 | ], |
| 4547 | ] ); |
| 4548 | |
| 4549 | $this->start_popover(); |
| 4550 | $this->add_responsive_control( "eael_form_terms_field_margin", [ |
| 4551 | 'label' => __( 'Container Margin', 'essential-addons-for-elementor-lite' ), |
| 4552 | 'type' => Controls_Manager::DIMENSIONS, |
| 4553 | 'size_units' => [ |
| 4554 | 'px', |
| 4555 | 'em', |
| 4556 | '%', |
| 4557 | ], |
| 4558 | 'selectors' => [ |
| 4559 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => $this->apply_dim( 'margin' ), |
| 4560 | ], |
| 4561 | 'condition' => [ |
| 4562 | 'terms_conditions_style_pot' => 'yes', |
| 4563 | ], |
| 4564 | ] ); |
| 4565 | $this->add_responsive_control( "eael_form_terms_field_padding", [ |
| 4566 | 'label' => __( 'Container Padding', 'essential-addons-for-elementor-lite' ), |
| 4567 | 'type' => Controls_Manager::DIMENSIONS, |
| 4568 | 'size_units' => [ |
| 4569 | 'px', |
| 4570 | 'em', |
| 4571 | '%', |
| 4572 | ], |
| 4573 | 'selectors' => [ |
| 4574 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => $this->apply_dim( 'padding' ), |
| 4575 | ], |
| 4576 | 'condition' => [ |
| 4577 | 'terms_conditions_style_pot' => 'yes', |
| 4578 | ], |
| 4579 | ] ); |
| 4580 | $this->add_responsive_control( "eael_form_terms_lbl_margin", [ |
| 4581 | 'label' => __( 'Label Margin', 'essential-addons-for-elementor-lite' ), |
| 4582 | 'type' => Controls_Manager::DIMENSIONS, |
| 4583 | 'size_units' => [ |
| 4584 | 'px', |
| 4585 | 'em', |
| 4586 | '%', |
| 4587 | ], |
| 4588 | 'selectors' => [ |
| 4589 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap label" => $this->apply_dim( 'margin' ), |
| 4590 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap a" => $this->apply_dim( 'margin' ), |
| 4591 | ], |
| 4592 | 'condition' => [ |
| 4593 | 'terms_conditions_style_pot' => 'yes', |
| 4594 | ], |
| 4595 | ] ); |
| 4596 | $this->add_responsive_control( "eael_form_terms_lbl_padding", [ |
| 4597 | 'label' => __( 'Label Padding', 'essential-addons-for-elementor-lite' ), |
| 4598 | 'type' => Controls_Manager::DIMENSIONS, |
| 4599 | 'size_units' => [ |
| 4600 | 'px', |
| 4601 | 'em', |
| 4602 | '%', |
| 4603 | ], |
| 4604 | 'selectors' => [ |
| 4605 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap label" => $this->apply_dim( 'padding' ), |
| 4606 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap a" => $this->apply_dim( 'padding' ), |
| 4607 | ], |
| 4608 | 'condition' => [ |
| 4609 | 'terms_conditions_style_pot' => 'yes', |
| 4610 | ], |
| 4611 | ] ); |
| 4612 | |
| 4613 | $this->add_responsive_control( "eael_form_terms_checkbox_margin", [ |
| 4614 | 'label' => __( 'Checkbox Margin', 'essential-addons-for-elementor-lite' ), |
| 4615 | 'type' => Controls_Manager::DIMENSIONS, |
| 4616 | 'size_units' => [ |
| 4617 | 'px', |
| 4618 | 'em', |
| 4619 | '%', |
| 4620 | ], |
| 4621 | 'selectors' => [ |
| 4622 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap input" => $this->apply_dim( 'margin' ), |
| 4623 | ], |
| 4624 | 'condition' => [ |
| 4625 | 'terms_conditions_style_pot' => 'yes', |
| 4626 | ], |
| 4627 | ] ); |
| 4628 | |
| 4629 | $this->add_control( 'eael_terms_label_color', [ |
| 4630 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 4631 | 'type' => Controls_Manager::COLOR, |
| 4632 | 'selectors' => [ |
| 4633 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => 'color: {{VALUE}};', |
| 4634 | ], |
| 4635 | 'condition' => [ |
| 4636 | 'terms_conditions_style_pot' => 'yes', |
| 4637 | ], |
| 4638 | ] ); |
| 4639 | |
| 4640 | $this->add_control( 'eael_terms_label_link_color', [ |
| 4641 | 'label' => __( 'Link Color', 'essential-addons-for-elementor-lite' ), |
| 4642 | 'type' => Controls_Manager::COLOR, |
| 4643 | 'selectors' => [ |
| 4644 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap a" => 'color: {{VALUE}};', |
| 4645 | ], |
| 4646 | 'condition' => [ |
| 4647 | 'terms_conditions_style_pot' => 'yes', |
| 4648 | ], |
| 4649 | ] ); |
| 4650 | |
| 4651 | $this->add_control( 'eael_terms_label_bg_color', [ |
| 4652 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 4653 | 'type' => Controls_Manager::COLOR, |
| 4654 | 'default' => '#ffffff', |
| 4655 | 'selectors' => [ |
| 4656 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap" => 'background-color: {{VALUE}};', |
| 4657 | ], |
| 4658 | 'condition' => [ |
| 4659 | 'terms_conditions_style_pot' => 'yes', |
| 4660 | ], |
| 4661 | ] ); |
| 4662 | $this->add_control( 'eael_terms_checkbox_color', [ |
| 4663 | 'label' => __( 'Checkbox | Toggle Color', 'essential-addons-for-elementor-lite' ), |
| 4664 | 'type' => Controls_Manager::COLOR, |
| 4665 | 'selectors' => [ |
| 4666 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap input[type=checkbox]:checked" => 'border-color: {{VALUE}};background: {{VALUE}};', |
| 4667 | "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap input[type=checkbox]:hover:not(:checked):not(:disabled)" => 'border-color: {{VALUE}};', |
| 4668 | ], |
| 4669 | 'condition' => [ |
| 4670 | 'terms_conditions_style_pot' => 'yes', |
| 4671 | ], |
| 4672 | ] ); |
| 4673 | $this->end_popover(); |
| 4674 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 4675 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 4676 | 'name' => "eael_terms_label_typography", |
| 4677 | 'selector' => "{{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap, {{WRAPPER}} .lr-form-wrapper .eael_accept_tnc_wrap label", |
| 4678 | ] ); |
| 4679 | |
| 4680 | $this->end_controls_section(); |
| 4681 | } |
| 4682 | |
| 4683 | protected function init_style_login_button_controls() { |
| 4684 | $this->_init_button_style( 'login' ); |
| 4685 | } |
| 4686 | |
| 4687 | protected function init_style_register_button_controls() { |
| 4688 | $this->_init_button_style( 'register' ); |
| 4689 | } |
| 4690 | |
| 4691 | protected function init_style_lostpassword_button_controls() { |
| 4692 | $this->_init_button_style( 'lostpassword' ); |
| 4693 | } |
| 4694 | |
| 4695 | protected function init_style_resetpassword_button_controls() { |
| 4696 | $this->_init_button_style( 'resetpassword' ); |
| 4697 | } |
| 4698 | |
| 4699 | protected function init_style_login_link_controls() { |
| 4700 | $this->_init_link_style( 'login' ); |
| 4701 | } |
| 4702 | |
| 4703 | protected function init_style_register_link_controls() { |
| 4704 | $link_section_conditions = [ |
| 4705 | 'relation' => 'or', |
| 4706 | 'terms' => [ |
| 4707 | [ |
| 4708 | 'name' => 'show_register_link', |
| 4709 | 'value' => 'yes', |
| 4710 | ], |
| 4711 | [ |
| 4712 | 'relation' => 'and', |
| 4713 | 'terms' => [ |
| 4714 | [ |
| 4715 | 'name' => 'show_lost_password', |
| 4716 | 'value' => 'yes', |
| 4717 | ], |
| 4718 | [ |
| 4719 | 'name' => 'lost_password_link_type', |
| 4720 | 'value' => 'form', |
| 4721 | ], |
| 4722 | [ |
| 4723 | 'name' => 'show_login_link_lostpassword', |
| 4724 | 'value' => 'yes', |
| 4725 | ], |
| 4726 | ] |
| 4727 | ], |
| 4728 | [ |
| 4729 | 'relation' => 'and', |
| 4730 | 'terms' => [ |
| 4731 | [ |
| 4732 | 'name' => 'default_form_type', |
| 4733 | 'value' => 'lostpassword', |
| 4734 | ], |
| 4735 | [ |
| 4736 | 'name' => 'show_login_link_lostpassword', |
| 4737 | 'value' => 'yes', |
| 4738 | ], |
| 4739 | ] |
| 4740 | ], |
| 4741 | |
| 4742 | ], |
| 4743 | ]; |
| 4744 | |
| 4745 | $this->start_controls_section( "section_style_register_link", [ |
| 4746 | 'label' => sprintf( __( '%s Link', 'essential-addons-for-elementor-lite' ), ucfirst( 'Login' ) ), |
| 4747 | 'tab' => Controls_Manager::TAB_STYLE, |
| 4748 | 'conditions' => $link_section_conditions, |
| 4749 | ] ); |
| 4750 | |
| 4751 | if( $this->user_can_register ) { |
| 4752 | $this->_init_link_style( 'register', 0 ); |
| 4753 | |
| 4754 | $this->add_control('separator_login_link_for_two_forms', |
| 4755 | [ |
| 4756 | 'type' => Controls_Manager::RAW_HTML, |
| 4757 | 'separator' => 'before' |
| 4758 | ]); |
| 4759 | } |
| 4760 | |
| 4761 | $this->_init_link_style( 'lostpassword', 0 ); |
| 4762 | |
| 4763 | $this->end_controls_section(); |
| 4764 | } |
| 4765 | |
| 4766 | protected function init_style_login_recaptcha_controls() { |
| 4767 | $this->_init_recaptcha_style( 'login' ); |
| 4768 | } |
| 4769 | |
| 4770 | protected function init_style_register_recaptcha_controls() { |
| 4771 | $this->_init_recaptcha_style( 'register' ); |
| 4772 | } |
| 4773 | |
| 4774 | /** |
| 4775 | * Print style controls for a specific type of button. |
| 4776 | * |
| 4777 | * @param string $button_type the type of the button. accepts login or register. |
| 4778 | */ |
| 4779 | protected function _init_button_style( $button_type = 'login' ) { |
| 4780 | $button_text = 'lostpassword' === $button_type ? esc_html__('Lost Password', 'essential-addons-for-elementor-lite') : ucfirst( $button_type ); |
| 4781 | $button_text = 'resetpassword' === $button_type ? esc_html__('Reset Password', 'essential-addons-for-elementor-lite') : $button_text; |
| 4782 | |
| 4783 | $this->start_controls_section( "section_style_{$button_type}_btn", [ |
| 4784 | 'label' => sprintf( __( '%s Button', 'essential-addons-for-elementor-lite' ), esc_html( $button_text ) ), |
| 4785 | 'tab' => Controls_Manager::TAB_STYLE, |
| 4786 | 'conditions' => $this->get_form_controls_display_condition( $button_type ), |
| 4787 | ] ); |
| 4788 | |
| 4789 | $this->add_control( "{$button_type}_button_style_notice", [ |
| 4790 | 'type' => Controls_Manager::RAW_HTML, |
| 4791 | 'raw' => sprintf( __( 'Here you can style the button displayed on the %s Form', 'essential-addons-for-elementor-lite' ), |
| 4792 | esc_html( $button_text ), |
| 4793 | esc_html( $button_text ) |
| 4794 | ), |
| 4795 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 4796 | ] ); |
| 4797 | |
| 4798 | $this->add_control( "{$button_type}_btn_pot", [ |
| 4799 | 'label' => __( 'Spacing', 'essential-addons-for-elementor-lite' ), |
| 4800 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 4801 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 4802 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 4803 | 'return_value' => 'yes', |
| 4804 | ] ); |
| 4805 | $this->start_popover(); |
| 4806 | $this->add_responsive_control( "{$button_type}_btn_margin", [ |
| 4807 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 4808 | 'type' => Controls_Manager::DIMENSIONS, |
| 4809 | 'size_units' => [ |
| 4810 | 'px', |
| 4811 | 'em', |
| 4812 | '%', |
| 4813 | ], |
| 4814 | 'selectors' => [ |
| 4815 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => $this->apply_dim( 'margin' ), |
| 4816 | ], |
| 4817 | 'condition' => [ |
| 4818 | "{$button_type}_btn_pot" => 'yes', |
| 4819 | ], |
| 4820 | ] ); |
| 4821 | $this->add_responsive_control( "{$button_type}_btn_padding", [ |
| 4822 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 4823 | 'type' => Controls_Manager::DIMENSIONS, |
| 4824 | 'size_units' => [ |
| 4825 | 'px', |
| 4826 | 'em', |
| 4827 | '%', |
| 4828 | ], |
| 4829 | 'selectors' => [ |
| 4830 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => $this->apply_dim( 'padding' ), |
| 4831 | ], |
| 4832 | 'condition' => [ |
| 4833 | "{$button_type}_btn_pot" => 'yes', |
| 4834 | ], |
| 4835 | ] ); |
| 4836 | $this->end_popover(); |
| 4837 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 4838 | 'name' => "{$button_type}_btn_typography", |
| 4839 | 'selector' => "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn", |
| 4840 | ] ); |
| 4841 | $this->add_responsive_control( "{$button_type}_btn_d_type", [ |
| 4842 | 'label' => __( 'Display as', 'essential-addons-for-elementor-lite' ), |
| 4843 | 'type' => Controls_Manager::SELECT, |
| 4844 | 'options' => [ |
| 4845 | 'row' => __( 'Inline', 'essential-addons-for-elementor-lite' ), |
| 4846 | 'column' => __( 'Block', 'essential-addons-for-elementor-lite' ), |
| 4847 | ], |
| 4848 | 'default' => 'row', |
| 4849 | 'selectors' => [ |
| 4850 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-footer" => 'flex-direction: {{VALUE}};', |
| 4851 | "{{WRAPPER}} .eael-{$button_type}-form .eael-sign-wrapper" => 'padding-top: 0;', |
| 4852 | ], |
| 4853 | ] ); |
| 4854 | |
| 4855 | |
| 4856 | $this->add_responsive_control( "{$button_type}_btn_jc", [ |
| 4857 | 'label' => __( 'Justify Content', 'essential-addons-for-elementor-lite' ), |
| 4858 | 'type' => Controls_Manager::SELECT, |
| 4859 | 'options' => [ |
| 4860 | 'flex-start' => __( 'Start', 'essential-addons-for-elementor-lite' ), |
| 4861 | 'flex-end' => __( 'End', 'essential-addons-for-elementor-lite' ), |
| 4862 | 'center' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 4863 | 'space-between' => __( 'Space Between', 'essential-addons-for-elementor-lite' ), |
| 4864 | 'space-around' => __( 'Space Around', 'essential-addons-for-elementor-lite' ), |
| 4865 | 'space-evenly' => __( 'Space Evenly', 'essential-addons-for-elementor-lite' ), |
| 4866 | ], |
| 4867 | 'default' => 'space-between', |
| 4868 | 'condition' => [ |
| 4869 | "{$button_type}_btn_d_type" => 'row', |
| 4870 | ], |
| 4871 | 'selectors' => [ |
| 4872 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-footer" => 'justify-content: {{VALUE}};', |
| 4873 | ], |
| 4874 | ] ); |
| 4875 | $this->add_responsive_control( "{$button_type}_btn_align", [ |
| 4876 | 'label' => __( 'Alignment', 'essential-addons-for-elementor-lite' ), |
| 4877 | 'type' => Controls_Manager::CHOOSE, |
| 4878 | 'options' => [ |
| 4879 | 'mr-auto' => [ |
| 4880 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 4881 | 'icon' => 'eicon-h-align-left', |
| 4882 | ], |
| 4883 | 'ml-auto mr-auto' => [ |
| 4884 | 'title' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 4885 | 'icon' => 'eicon-h-align-center', |
| 4886 | ], |
| 4887 | 'ml-auto' => [ |
| 4888 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 4889 | 'icon' => 'eicon-h-align-right', |
| 4890 | ], |
| 4891 | ], |
| 4892 | 'default' => '', |
| 4893 | 'condition' => [ |
| 4894 | "{$button_type}_btn_d_type" => 'column', |
| 4895 | ], |
| 4896 | ] ); |
| 4897 | $this->add_control( "tabs_{$button_type}_btn_colors_heading", [ |
| 4898 | 'type' => Controls_Manager::HEADING, |
| 4899 | 'label' => __( 'Colors & Border', 'essential-addons-for-elementor-lite' ), |
| 4900 | 'separator' => 'before', |
| 4901 | ] ); |
| 4902 | |
| 4903 | $this->start_controls_tabs( "tabs_{$button_type}_btn_style" ); |
| 4904 | /*-----Login Button NORMAL state------ */ |
| 4905 | $this->start_controls_tab( "tab_{$button_type}_btn_normal", [ |
| 4906 | 'label' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 4907 | ] ); |
| 4908 | $this->add_control( "{$button_type}_btn_color", [ |
| 4909 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 4910 | 'type' => Controls_Manager::COLOR, |
| 4911 | 'selectors' => [ |
| 4912 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => 'color: {{VALUE}};', |
| 4913 | ], |
| 4914 | ] ); |
| 4915 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 4916 | 'name' => "{$button_type}_btn_bg_color", |
| 4917 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 4918 | 'types' => [ |
| 4919 | 'classic', |
| 4920 | 'gradient', |
| 4921 | ], |
| 4922 | 'selector' => "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn", |
| 4923 | ] ); |
| 4924 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 4925 | 'name' => "{$button_type}_btn_border", |
| 4926 | 'selector' => "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn", |
| 4927 | ] ); |
| 4928 | $this->add_control( "{$button_type}_btn_border_radius", [ |
| 4929 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 4930 | 'type' => Controls_Manager::DIMENSIONS, |
| 4931 | 'size_units' => [ |
| 4932 | 'px', |
| 4933 | '%', |
| 4934 | ], |
| 4935 | 'selectors' => [ |
| 4936 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => $this->apply_dim( 'border-radius' ), |
| 4937 | ], |
| 4938 | ] ); |
| 4939 | $this->end_controls_tab(); |
| 4940 | |
| 4941 | /*-----Login Button HOVER state------ */ |
| 4942 | $this->start_controls_tab( "tab_{$button_type}_button_hover", [ |
| 4943 | 'label' => __( 'Hover', 'essential-addons-for-elementor-lite' ), |
| 4944 | ] ); |
| 4945 | $this->add_control( "{$button_type}_button_color_hover", [ |
| 4946 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 4947 | 'type' => Controls_Manager::COLOR, |
| 4948 | 'selectors' => [ |
| 4949 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn:hover" => 'color: {{VALUE}};', |
| 4950 | ], |
| 4951 | ] ); |
| 4952 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 4953 | 'name' => "{$button_type}_btn_bg_color_hover", |
| 4954 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 4955 | 'types' => [ |
| 4956 | 'classic', |
| 4957 | 'gradient', |
| 4958 | ], |
| 4959 | 'selector' => "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn:hover", |
| 4960 | ] ); |
| 4961 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 4962 | 'name' => "{$button_type}_btn_border_hover", |
| 4963 | 'selector' => "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn:hover", |
| 4964 | ] ); |
| 4965 | $this->add_control( "{$button_type}_btn_border_radius_hover", [ |
| 4966 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 4967 | 'type' => Controls_Manager::DIMENSIONS, |
| 4968 | 'size_units' => [ |
| 4969 | 'px', |
| 4970 | '%', |
| 4971 | ], |
| 4972 | 'selectors' => [ |
| 4973 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn:hover" => $this->apply_dim( 'border-radius' ), |
| 4974 | ], |
| 4975 | ] ); |
| 4976 | $this->end_controls_tab(); |
| 4977 | $this->end_controls_tabs(); |
| 4978 | /*-----ends Button tabs--------*/ |
| 4979 | |
| 4980 | $this->add_responsive_control( "{$button_type}_btn_width", [ |
| 4981 | 'label' => esc_html__( 'Button width', 'essential-addons-for-elementor-lite' ), |
| 4982 | 'type' => Controls_Manager::SLIDER, |
| 4983 | 'size_units' => [ |
| 4984 | 'px', |
| 4985 | '%', |
| 4986 | ], |
| 4987 | 'range' => [ |
| 4988 | 'px' => [ |
| 4989 | 'min' => 0, |
| 4990 | 'max' => 500, |
| 4991 | 'step' => 5, |
| 4992 | ], |
| 4993 | '%' => [ |
| 4994 | 'min' => 0, |
| 4995 | 'max' => 100, |
| 4996 | ], |
| 4997 | ], |
| 4998 | 'selectors' => [ |
| 4999 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => 'width: {{SIZE}}{{UNIT}};', |
| 5000 | ], |
| 5001 | 'separator' => 'before', |
| 5002 | ] ); |
| 5003 | $this->add_responsive_control( "{$button_type}_btn_height", [ |
| 5004 | 'label' => esc_html__( 'Button Height', 'essential-addons-for-elementor-lite' ), |
| 5005 | 'type' => Controls_Manager::SLIDER, |
| 5006 | 'size_units' => [ |
| 5007 | 'px', |
| 5008 | '%', |
| 5009 | ], |
| 5010 | 'range' => [ |
| 5011 | 'px' => [ |
| 5012 | 'min' => 0, |
| 5013 | 'max' => 500, |
| 5014 | 'step' => 5, |
| 5015 | ], |
| 5016 | '%' => [ |
| 5017 | 'min' => 0, |
| 5018 | 'max' => 100, |
| 5019 | ], |
| 5020 | ], |
| 5021 | 'selectors' => [ |
| 5022 | "{{WRAPPER}} .eael-{$button_type}-form .eael-lr-btn" => 'height: {{SIZE}}{{UNIT}};', |
| 5023 | ], |
| 5024 | ] ); |
| 5025 | |
| 5026 | //Show spinner |
| 5027 | do_action( "eael/login-register/after-init-{$button_type}-button-style", $this, $button_type ); |
| 5028 | |
| 5029 | if ( !$this->pro_enabled ) { |
| 5030 | $this->add_control( "{$button_type}_btn_show_spinner", [ |
| 5031 | 'label' => sprintf( __( 'Show Spinner %s', 'essential-addons-for-elementor-lite' ), '<i class="eael-pro-labe eicon-pro-icon"></i>' ), |
| 5032 | 'type' => Controls_Manager::SWITCHER, |
| 5033 | 'classes' => 'eael-pro-control', |
| 5034 | ] ); |
| 5035 | } |
| 5036 | |
| 5037 | $this->end_controls_section(); |
| 5038 | } |
| 5039 | |
| 5040 | /** |
| 5041 | * Print style controls for a specific type of reCAPTCHA. |
| 5042 | * |
| 5043 | * @param string $form_type the type of the reCAPTCHA. accepts login or register. |
| 5044 | */ |
| 5045 | protected function _init_recaptcha_style( $form_type = 'login' ) { |
| 5046 | $this->start_controls_section( "section_style_{$form_type}_rc", [ |
| 5047 | 'label' => sprintf( __( '%s Form reCAPTCHA', 'essential-addons-for-elementor-lite' ), ucfirst( $form_type ) ), |
| 5048 | 'tab' => Controls_Manager::TAB_STYLE, |
| 5049 | 'condition' => [ |
| 5050 | "enable_{$form_type}_recaptcha" => 'yes', |
| 5051 | ], |
| 5052 | ] ); |
| 5053 | $this->add_responsive_control( "{$form_type}_rc_margin", [ |
| 5054 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 5055 | 'type' => Controls_Manager::DIMENSIONS, |
| 5056 | 'size_units' => [ |
| 5057 | 'px', |
| 5058 | 'em', |
| 5059 | '%', |
| 5060 | ], |
| 5061 | 'selectors' => [ |
| 5062 | "{{WRAPPER}} .eael-{$form_type}-form .eael-recaptcha-wrapper" => $this->apply_dim( 'margin' ), |
| 5063 | ], |
| 5064 | |
| 5065 | ] ); |
| 5066 | |
| 5067 | $this->add_control( "{$form_type}_rc_theme", [ |
| 5068 | 'label' => __( 'Theme', 'essential-addons-for-elementor-lite' ), |
| 5069 | 'type' => Controls_Manager::SELECT, |
| 5070 | 'options' => [ |
| 5071 | 'light' => __( 'Light', 'essential-addons-for-elementor-lite' ), |
| 5072 | 'dark' => __( 'Dark', 'essential-addons-for-elementor-lite' ), |
| 5073 | ], |
| 5074 | 'default' => 'light', |
| 5075 | ] ); |
| 5076 | |
| 5077 | $this->add_control( "{$form_type}_rc_size", [ |
| 5078 | 'label' => __( 'Size', 'essential-addons-for-elementor-lite' ), |
| 5079 | 'type' => Controls_Manager::SELECT, |
| 5080 | 'options' => [ |
| 5081 | 'normal' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 5082 | 'compact' => __( 'Compact', 'essential-addons-for-elementor-lite' ), |
| 5083 | ], |
| 5084 | 'default' => 'normal', |
| 5085 | ] ); |
| 5086 | |
| 5087 | $this->end_controls_section(); |
| 5088 | } |
| 5089 | |
| 5090 | /** |
| 5091 | * Print style controls for a specific type of link on register or login form. |
| 5092 | * |
| 5093 | * @param string $form_type the type of form where the link is being shown. accepts login or register. |
| 5094 | */ |
| 5095 | protected function _init_link_style( $form_type = 'login', $show_as_section = 1 ) { |
| 5096 | $form_name = 'login' === $form_type ? __( 'Register', 'essential-addons-for-elementor-lite' ) : __( 'Login', 'essential-addons-for-elementor-lite' ); |
| 5097 | $form_name = 'lostpassword' === $form_type ? __( 'Login (Lost Password)', 'essential-addons-for-elementor-lite' ) : $form_name; |
| 5098 | $link_section_condition = [ |
| 5099 | "show_{$form_type}_link" => 'yes', |
| 5100 | ]; |
| 5101 | |
| 5102 | if( 'lostpassword' === $form_type ){ |
| 5103 | $link_section_condition = [ |
| 5104 | 'show_lost_password' => 'yes', |
| 5105 | 'lost_password_link_type' => 'form', |
| 5106 | 'show_login_link_lostpassword' => 'yes', |
| 5107 | ]; |
| 5108 | } |
| 5109 | |
| 5110 | if( $show_as_section ){ |
| 5111 | $this->start_controls_section( "section_style_{$form_type}_link", [ |
| 5112 | 'label' => sprintf( __( '%s Link', 'essential-addons-for-elementor-lite' ), ucfirst( $form_name ) ), |
| 5113 | 'tab' => Controls_Manager::TAB_STYLE, |
| 5114 | 'condition' => $link_section_condition, |
| 5115 | ] ); |
| 5116 | } |
| 5117 | |
| 5118 | $this->add_control( "{$form_type}_link_style_notice", [ |
| 5119 | 'type' => Controls_Manager::RAW_HTML, |
| 5120 | 'raw' => sprintf( __( 'Here you can style the %s link displayed on the %s Form', 'essential-addons-for-elementor-lite' ), |
| 5121 | 'lostpassword' === $form_type ? __('Login', 'essential-addons-for-elementor-lite') : $form_name, |
| 5122 | 'lostpassword' === $form_type ? __('Lost Password', 'essential-addons-for-elementor-lite') : ucfirst( $form_type ) |
| 5123 | ), |
| 5124 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 5125 | ] ); |
| 5126 | $this->add_control( "{$form_type}_link_pot", [ |
| 5127 | 'label' => __( 'Spacing', 'essential-addons-for-elementor-lite' ), |
| 5128 | 'type' => Controls_Manager::POPOVER_TOGGLE, |
| 5129 | 'label_off' => __( 'Default', 'essential-addons-for-elementor-lite' ), |
| 5130 | 'label_on' => __( 'Custom', 'essential-addons-for-elementor-lite' ), |
| 5131 | 'return_value' => 'yes', |
| 5132 | ] ); |
| 5133 | $this->start_popover(); |
| 5134 | $this->add_responsive_control( "{$form_type}_link_margin", [ |
| 5135 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 5136 | 'type' => Controls_Manager::DIMENSIONS, |
| 5137 | 'size_units' => [ |
| 5138 | 'px', |
| 5139 | 'em', |
| 5140 | '%', |
| 5141 | ], |
| 5142 | 'selectors' => [ |
| 5143 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => $this->apply_dim( 'margin' ), |
| 5144 | ], |
| 5145 | 'condition' => [ |
| 5146 | "{$form_type}_link_pot" => 'yes', |
| 5147 | ], |
| 5148 | ] ); |
| 5149 | $this->add_responsive_control( "{$form_type}_link_padding", [ |
| 5150 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 5151 | 'type' => Controls_Manager::DIMENSIONS, |
| 5152 | 'size_units' => [ |
| 5153 | 'px', |
| 5154 | 'em', |
| 5155 | '%', |
| 5156 | ], |
| 5157 | 'selectors' => [ |
| 5158 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => $this->apply_dim( 'padding' ), |
| 5159 | ], |
| 5160 | 'condition' => [ |
| 5161 | "{$form_type}_link_pot" => 'yes', |
| 5162 | ], |
| 5163 | ] ); |
| 5164 | $this->end_popover(); |
| 5165 | $this->add_group_control( Group_Control_Typography::get_type(), [ |
| 5166 | 'name' => "{$form_type}_link_typography", |
| 5167 | 'selector' => "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link", |
| 5168 | ] ); |
| 5169 | |
| 5170 | $this->add_responsive_control( "{$form_type}_link_d_type", [ |
| 5171 | 'label' => __( 'Display as', 'essential-addons-for-elementor-lite' ), |
| 5172 | 'type' => Controls_Manager::SELECT, |
| 5173 | 'options' => [ |
| 5174 | 'row' => __( 'Inline', 'essential-addons-for-elementor-lite' ), |
| 5175 | 'column' => __( 'Block', 'essential-addons-for-elementor-lite' ), |
| 5176 | ], |
| 5177 | 'default' => 'row', |
| 5178 | 'selectors' => [ |
| 5179 | "{{WRAPPER}} .eael-{$form_type}-form .eael-sign-wrapper" => 'display:flex; flex-direction: {{VALUE}};', |
| 5180 | ], |
| 5181 | ] ); |
| 5182 | |
| 5183 | |
| 5184 | $this->add_responsive_control( "{$form_type}_link_jc", [ |
| 5185 | 'label' => __( 'Justify Content', 'essential-addons-for-elementor-lite' ), |
| 5186 | 'type' => Controls_Manager::SELECT, |
| 5187 | 'options' => [ |
| 5188 | 'flex-start' => __( 'Start', 'essential-addons-for-elementor-lite' ), |
| 5189 | 'flex-end' => __( 'End', 'essential-addons-for-elementor-lite' ), |
| 5190 | 'center' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 5191 | 'space-between' => __( 'Space Between', 'essential-addons-for-elementor-lite' ), |
| 5192 | 'space-around' => __( 'Space Around', 'essential-addons-for-elementor-lite' ), |
| 5193 | 'space-evenly' => __( 'Space Evenly', 'essential-addons-for-elementor-lite' ), |
| 5194 | ], |
| 5195 | 'default' => 'center', |
| 5196 | 'condition' => [ |
| 5197 | "{$form_type}_link_d_type" => 'row', |
| 5198 | ], |
| 5199 | 'selectors' => [ |
| 5200 | "{{WRAPPER}} .eael-{$form_type}-form .eael-sign-wrapper" => 'justify-content: {{VALUE}};', |
| 5201 | ], |
| 5202 | ] ); |
| 5203 | |
| 5204 | $this->add_responsive_control( "{$form_type}_link_ai", [ |
| 5205 | 'label' => __( 'Align Items', 'essential-addons-for-elementor-lite' ), |
| 5206 | 'type' => Controls_Manager::SELECT, |
| 5207 | 'options' => [ |
| 5208 | 'flex-start' => __( 'Start', 'essential-addons-for-elementor-lite' ), |
| 5209 | 'flex-end' => __( 'End', 'essential-addons-for-elementor-lite' ), |
| 5210 | 'center' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 5211 | 'stretch' => __( 'Stretch', 'essential-addons-for-elementor-lite' ), |
| 5212 | 'baseline' => __( 'Baseline', 'essential-addons-for-elementor-lite' ), |
| 5213 | 'space-evenly' => __( 'Space Evenly', 'essential-addons-for-elementor-lite' ), |
| 5214 | ], |
| 5215 | 'default' => 'center', |
| 5216 | 'condition' => [ |
| 5217 | "{$form_type}_link_d_type" => 'column', |
| 5218 | ], |
| 5219 | 'selectors' => [ |
| 5220 | "{{WRAPPER}} .eael-{$form_type}-form .eael-sign-wrapper" => 'align-items: {{VALUE}};', |
| 5221 | ], |
| 5222 | ] ); |
| 5223 | |
| 5224 | $this->add_responsive_control( "{$form_type}_link_align", [ |
| 5225 | 'label' => __( 'Alignment', 'essential-addons-for-elementor-lite' ), |
| 5226 | 'type' => Controls_Manager::CHOOSE, |
| 5227 | 'options' => [ |
| 5228 | 'mr-auto' => [ |
| 5229 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 5230 | 'icon' => 'eicon-h-align-left', |
| 5231 | ], |
| 5232 | 'ml-auto mr-auto' => [ |
| 5233 | 'title' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 5234 | 'icon' => 'eicon-h-align-center', |
| 5235 | ], |
| 5236 | 'ml-auto' => [ |
| 5237 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 5238 | 'icon' => 'eicon-h-align-right', |
| 5239 | ], |
| 5240 | ], |
| 5241 | 'default' => '', |
| 5242 | 'condition' => [ |
| 5243 | "{$form_type}_link_d_type" => 'column', |
| 5244 | ], |
| 5245 | ] ); |
| 5246 | |
| 5247 | $this->add_control( "tabs_{$form_type}_link_colors_heading", [ |
| 5248 | 'type' => Controls_Manager::HEADING, |
| 5249 | 'label' => __( 'Colors & Border', 'essential-addons-for-elementor-lite' ), |
| 5250 | 'separator' => 'before', |
| 5251 | ] ); |
| 5252 | |
| 5253 | $this->start_controls_tabs( "tabs_{$form_type}_link_style" ); |
| 5254 | /*----- Link NORMAL state------ */ |
| 5255 | $this->start_controls_tab( "tab_{$form_type}_link_normal", [ |
| 5256 | 'label' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 5257 | ] ); |
| 5258 | $this->add_control( "{$form_type}_link_color", [ |
| 5259 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 5260 | 'type' => Controls_Manager::COLOR, |
| 5261 | 'selectors' => [ |
| 5262 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => 'color: {{VALUE}};', |
| 5263 | ], |
| 5264 | ] ); |
| 5265 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 5266 | 'name' => "{$form_type}_link_bg_color", |
| 5267 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 5268 | 'types' => [ |
| 5269 | 'classic', |
| 5270 | 'gradient', |
| 5271 | ], |
| 5272 | 'selector' => "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link", |
| 5273 | ] ); |
| 5274 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 5275 | 'name' => "{$form_type}_link_border", |
| 5276 | 'selector' => "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link", |
| 5277 | ] ); |
| 5278 | $this->add_control( "{$form_type}_link_border_radius", [ |
| 5279 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 5280 | 'type' => Controls_Manager::DIMENSIONS, |
| 5281 | 'size_units' => [ |
| 5282 | 'px', |
| 5283 | '%', |
| 5284 | ], |
| 5285 | 'selectors' => [ |
| 5286 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => $this->apply_dim( 'border-radius' ), |
| 5287 | ], |
| 5288 | ] ); |
| 5289 | $this->end_controls_tab(); |
| 5290 | |
| 5291 | /*-----Link HOVER state------ */ |
| 5292 | $this->start_controls_tab( "tab_{$form_type}_link_hover", [ |
| 5293 | 'label' => __( 'Hover', 'essential-addons-for-elementor-lite' ), |
| 5294 | ] ); |
| 5295 | $this->add_control( "{$form_type}_link_color_hover", [ |
| 5296 | 'label' => __( 'Text Color', 'essential-addons-for-elementor-lite' ), |
| 5297 | 'type' => Controls_Manager::COLOR, |
| 5298 | 'selectors' => [ |
| 5299 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link:hover" => 'color: {{VALUE}};', |
| 5300 | ], |
| 5301 | ] ); |
| 5302 | $this->add_group_control( Group_Control_Background::get_type(), [ |
| 5303 | 'name' => "{$form_type}_link_bg_color_hover", |
| 5304 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 5305 | 'types' => [ |
| 5306 | 'classic', |
| 5307 | 'gradient', |
| 5308 | ], |
| 5309 | 'selector' => "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link:hover", |
| 5310 | ] ); |
| 5311 | $this->add_group_control( Group_Control_Border::get_type(), [ |
| 5312 | 'name' => "{$form_type}_link_border_hover", |
| 5313 | 'selector' => "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link:hover", |
| 5314 | ] ); |
| 5315 | $this->add_control( "{$form_type}_link_border_radius_hover", [ |
| 5316 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 5317 | 'type' => Controls_Manager::DIMENSIONS, |
| 5318 | 'size_units' => [ |
| 5319 | 'px', |
| 5320 | '%', |
| 5321 | ], |
| 5322 | 'selectors' => [ |
| 5323 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link:hover" => $this->apply_dim( 'border-radius' ), |
| 5324 | ], |
| 5325 | ] ); |
| 5326 | $this->end_controls_tab(); |
| 5327 | $this->end_controls_tabs(); |
| 5328 | /*-----ends Link tabs--------*/ |
| 5329 | $this->add_responsive_control( "{$form_type}_link_wrap_width", [ |
| 5330 | 'label' => esc_html__( 'Link Container width', 'essential-addons-for-elementor-lite' ), |
| 5331 | 'type' => Controls_Manager::SLIDER, |
| 5332 | 'size_units' => [ |
| 5333 | 'px', |
| 5334 | '%', |
| 5335 | ], |
| 5336 | 'range' => [ |
| 5337 | 'px' => [ |
| 5338 | 'min' => 0, |
| 5339 | 'max' => 500, |
| 5340 | 'step' => 5, |
| 5341 | ], |
| 5342 | '%' => [ |
| 5343 | 'min' => 0, |
| 5344 | 'max' => 100, |
| 5345 | ], |
| 5346 | ], |
| 5347 | 'selectors' => [ |
| 5348 | "{{WRAPPER}} .eael-{$form_type}-form .eael-sign-wrapper" => 'width: {{SIZE}}{{UNIT}};', |
| 5349 | ], |
| 5350 | 'separator' => 'before', |
| 5351 | ] ); |
| 5352 | $this->add_responsive_control( "{$form_type}_link_width", [ |
| 5353 | 'label' => esc_html__( 'Link width', 'essential-addons-for-elementor-lite' ), |
| 5354 | 'type' => Controls_Manager::SLIDER, |
| 5355 | 'size_units' => [ |
| 5356 | 'px', |
| 5357 | '%', |
| 5358 | ], |
| 5359 | 'range' => [ |
| 5360 | 'px' => [ |
| 5361 | 'min' => 0, |
| 5362 | 'max' => 500, |
| 5363 | 'step' => 5, |
| 5364 | ], |
| 5365 | '%' => [ |
| 5366 | 'min' => 0, |
| 5367 | 'max' => 100, |
| 5368 | ], |
| 5369 | ], |
| 5370 | 'selectors' => [ |
| 5371 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => 'width: {{SIZE}}{{UNIT}};', |
| 5372 | ], |
| 5373 | ] ); |
| 5374 | |
| 5375 | $this->add_responsive_control( "{$form_type}_link_height", [ |
| 5376 | 'label' => esc_html__( 'Link Height', 'essential-addons-for-elementor-lite' ), |
| 5377 | 'type' => Controls_Manager::SLIDER, |
| 5378 | 'size_units' => [ |
| 5379 | 'px', |
| 5380 | '%', |
| 5381 | ], |
| 5382 | 'range' => [ |
| 5383 | 'px' => [ |
| 5384 | 'min' => 0, |
| 5385 | 'max' => 500, |
| 5386 | 'step' => 5, |
| 5387 | ], |
| 5388 | '%' => [ |
| 5389 | 'min' => 0, |
| 5390 | 'max' => 100, |
| 5391 | ], |
| 5392 | ], |
| 5393 | 'selectors' => [ |
| 5394 | "{{WRAPPER}} .eael-{$form_type}-form .eael-lr-link" => 'height: {{SIZE}}{{UNIT}};', |
| 5395 | ], |
| 5396 | ] ); |
| 5397 | |
| 5398 | if( $show_as_section ){ |
| 5399 | $this->end_controls_section(); |
| 5400 | } |
| 5401 | } |
| 5402 | |
| 5403 | /** |
| 5404 | * Get conditions for displaying login form and registration |
| 5405 | * |
| 5406 | * @param string $type |
| 5407 | * |
| 5408 | * @return array |
| 5409 | */ |
| 5410 | public function get_form_controls_display_condition( $type = 'login' ) { |
| 5411 | $type = 'resetpassword' === $type ? esc_html( 'lostpassword' ) : esc_html( $type ); |
| 5412 | |
| 5413 | $form_type = in_array( $type, [ |
| 5414 | 'login', |
| 5415 | 'register', |
| 5416 | 'lostpassword' |
| 5417 | ] ) ? $type : 'login'; |
| 5418 | |
| 5419 | $terms_condition = [ |
| 5420 | [ |
| 5421 | 'name' => 'default_form_type', |
| 5422 | 'value' => $form_type, |
| 5423 | ] |
| 5424 | ]; |
| 5425 | |
| 5426 | if('lostpassword' === $form_type){ |
| 5427 | $terms_condition[] = [ |
| 5428 | 'relation' => 'and', |
| 5429 | 'terms' => [ |
| 5430 | [ |
| 5431 | 'name' => 'show_lost_password', |
| 5432 | 'value' => 'yes' |
| 5433 | ], |
| 5434 | [ |
| 5435 | 'name' => 'lost_password_link_type', |
| 5436 | 'value' => 'form', |
| 5437 | ] |
| 5438 | ] |
| 5439 | ]; |
| 5440 | }else { |
| 5441 | $terms_condition[] = [ |
| 5442 | 'name' => "show_{$form_type}_link", |
| 5443 | 'value' => 'yes', |
| 5444 | ]; |
| 5445 | } |
| 5446 | |
| 5447 | $terms_relation_conditions = [ |
| 5448 | 'relation' => 'or', |
| 5449 | 'terms' => $terms_condition, |
| 5450 | ]; |
| 5451 | |
| 5452 | return $terms_relation_conditions; |
| 5453 | } |
| 5454 | |
| 5455 | protected function render() { |
| 5456 | |
| 5457 | if ( ! current_user_can( 'manage_options' ) && 'yes' === $this->get_settings_for_display( 'redirect_for_logged_in_user' ) && is_user_logged_in() ) { |
| 5458 | if ( $redirect = $this->get_settings_for_display( 'redirect_url_for_logged_in_user' )['url'] ) { |
| 5459 | $redirect = wp_sanitize_redirect( $redirect ); |
| 5460 | $logged_in_location = wp_validate_redirect( $redirect, site_url() ); ?> |
| 5461 | <div class="" data-logged-in-location="<?php echo empty( $logged_in_location ) ? '' : esc_url( $logged_in_location ); ?>"></div> |
| 5462 | <?php |
| 5463 | } |
| 5464 | } |
| 5465 | |
| 5466 | //Note. forms are handled in Login_Registration Trait used in the Bootstrap class. |
| 5467 | if ( ! $this->in_editor && 'yes' === $this->get_settings_for_display( 'hide_for_logged_in_user' ) && is_user_logged_in() ) { |
| 5468 | return; // do not show any form for already logged in user. but let edit on editor |
| 5469 | } |
| 5470 | |
| 5471 | $this->ds = $this->get_settings_for_display(); |
| 5472 | $this->default_form = $this->get_settings_for_display( 'default_form_type' ); |
| 5473 | $this->should_print_login_form = ( 'login' === $this->default_form || 'yes' === $this->get_settings_for_display( 'show_login_link' ) || 'yes' === $this->get_settings_for_display( 'show_login_link_lostpassword' ) ); |
| 5474 | $this->should_print_register_form = ( $this->user_can_register && ( 'register' === $this->get_settings_for_display( 'default_form_type' ) || 'yes' === $this->get_settings_for_display( 'show_register_link' ) ) ); |
| 5475 | $this->should_print_lostpassword_form = ( 'lostpassword' === $this->default_form || 'yes' === $this->get_settings_for_display( 'show_lost_password' ) ); |
| 5476 | $this->should_print_resetpassword_form_editor = $this->in_editor && 'yes' === $this->get_settings_for_display( 'preview_reset_password' ); |
| 5477 | |
| 5478 | if ( Plugin::$instance->documents->get_current() ) { |
| 5479 | $this->page_id = Plugin::$instance->documents->get_current()->get_main_id(); |
| 5480 | } |
| 5481 | |
| 5482 | $this->page_id_for_popup = get_queried_object_id(); |
| 5483 | |
| 5484 | //handle form illustration |
| 5485 | $form_image_id = ! empty( $this->ds['lr_form_image']['id'] ) ? $this->ds['lr_form_image']['id'] : ''; |
| 5486 | $this->form_illustration_pos = ! empty( $this->ds['lr_form_image_position'] ) ? $this->ds['lr_form_image_position'] : 'left'; |
| 5487 | $this->form_illustration_url = Group_Control_Image_Size::get_attachment_image_src( $form_image_id, 'lr_form_image', $this->ds ); |
| 5488 | |
| 5489 | $form_logo_id = ! empty( $this->ds['lr_form_logo']['id'] ) ? $this->ds['lr_form_logo']['id'] : ''; |
| 5490 | $this->form_logo = Group_Control_Image_Size::get_attachment_image_src( $form_logo_id, 'lr_form_logo', $this->ds ); |
| 5491 | $this->form_logo_pos = ! empty( $this->ds['lr_form_logo_position'] ) ? $this->ds['lr_form_logo_position'] : 'inline'; |
| 5492 | $login_redirect_url = ''; |
| 5493 | $resetpassword_redirect_url = ''; |
| 5494 | |
| 5495 | if ( ! empty( $this->ds['redirect_after_login'] ) && 'yes' === $this->ds['redirect_after_login'] ) { |
| 5496 | $login_redirect_url = !empty( $this->ds[ 'redirect_url' ][ 'url' ] ) ? esc_url( $this->ds[ 'redirect_url' ][ 'url' ] ) : ''; |
| 5497 | } |
| 5498 | |
| 5499 | $this->login_custom_redirect_url = apply_filters( 'eael/login-register/login-redirect-url', $login_redirect_url, $this ); |
| 5500 | |
| 5501 | if ( ! empty( $this->ds['redirect_after_resetpassword'] ) && 'yes' === $this->ds['redirect_after_resetpassword'] ) { |
| 5502 | $resetpassword_redirect_url = !empty( $this->ds[ 'redirect_url_resetpassword' ][ 'url' ] ) ? esc_url( $this->ds[ 'redirect_url_resetpassword' ][ 'url' ] ) : ''; |
| 5503 | } |
| 5504 | |
| 5505 | if ( ! empty( $this->ds['lostpassword_email_message_reset_link_in_popup'] ) && 'yes' === $this->ds['lostpassword_email_message_reset_link_in_popup'] ) { |
| 5506 | $this->resetpassword_in_popup_selector = ! empty( $this->ds[ 'lostpassword_email_message_reset_link_popup_selector' ] ) ? sanitize_text_field( $this->ds[ 'lostpassword_email_message_reset_link_popup_selector' ] ) : ''; |
| 5507 | } |
| 5508 | |
| 5509 | $login_recaptcha_version = $register_recaptcha_version = ! empty( $this->ds['login_register_recaptcha_version'] ) ? $this->ds['login_register_recaptcha_version'] : 'v2'; |
| 5510 | |
| 5511 | if ( get_option('eael_recaptcha_sitekey_v3') && ( 'v3' === $login_recaptcha_version || 'v3' === $register_recaptcha_version) ) { |
| 5512 | $site_key = esc_html( get_option('eael_recaptcha_sitekey_v3') ); |
| 5513 | |
| 5514 | if ( $recaptcha_language = esc_html( get_option( 'eael_recaptcha_language_v3' ) ) ) { |
| 5515 | $recaptcha_api_args1['hl'] = $recaptcha_language; |
| 5516 | } |
| 5517 | |
| 5518 | $recaptcha_api_args1['render'] = $site_key; |
| 5519 | |
| 5520 | $recaptcha_api_args1 = apply_filters( 'eael_lr_recaptcha_api_args_v3', $recaptcha_api_args1 ); |
| 5521 | $recaptcha_api_args1 = http_build_query( $recaptcha_api_args1 ); |
| 5522 | wp_register_script('eael-recaptcha-v3', "https://www.google.com/recaptcha/api.js?{$recaptcha_api_args1}", false, EAEL_PLUGIN_VERSION, false); |
| 5523 | wp_enqueue_script('eael-recaptcha-v3'); |
| 5524 | wp_dequeue_script('eael-recaptcha'); |
| 5525 | } |
| 5526 | |
| 5527 | ?> |
| 5528 | <div class="eael-login-registration-wrapper <?php echo empty( $form_image_id ) ? '' : esc_attr( 'has-illustration' ); ?>" |
| 5529 | data-is-ajax="<?php echo esc_attr( $this->get_settings_for_display( 'enable_ajax' ) ); ?>" |
| 5530 | data-widget-id="<?php echo esc_attr( $this->get_id() ); ?>" |
| 5531 | data-recaptcha-sitekey="<?php echo esc_attr( get_option( 'eael_recaptcha_sitekey' ) ); ?>" |
| 5532 | data-recaptcha-sitekey-v3="<?php echo esc_attr( get_option( 'eael_recaptcha_sitekey_v3' ) ); ?>" |
| 5533 | data-login-recaptcha-version="<?php echo esc_attr( $login_recaptcha_version ); ?>" |
| 5534 | data-register-recaptcha-version="<?php echo esc_attr( $register_recaptcha_version ); ?>" |
| 5535 | data-redirect-to="<?php echo esc_attr( $this->login_custom_redirect_url ); ?>" |
| 5536 | data-resetpassword-redirect-to="<?php echo esc_attr( $resetpassword_redirect_url ); ?>" |
| 5537 | > |
| 5538 | <?php |
| 5539 | $this->print_resetpassword_form(); // set a new password; user will land on this form via email reset password link. |
| 5540 | $this->print_login_form(); |
| 5541 | $this->print_register_form(); |
| 5542 | $this->print_lostpassword_form(); //request for a new password. |
| 5543 | ?> |
| 5544 | </div> |
| 5545 | |
| 5546 | <?php |
| 5547 | } |
| 5548 | |
| 5549 | protected function print_login_form() { |
| 5550 | if ( $this->should_print_login_form ) { |
| 5551 | // prepare all login form related vars |
| 5552 | $default_hide_class = ( 'register' === $this->default_form || 'lostpassword' === $this->default_form || $this->should_print_resetpassword_form_editor || isset($_GET['eael-register']) || isset($_GET['eael-lostpassword']) || isset($_GET['eael-resetpassword']) ) ? 'eael-lr-d-none' : ''; |
| 5553 | |
| 5554 | //Reg link related |
| 5555 | $reg_link_action = ! empty( $this->ds['registration_link_action'] ) ? $this->ds['registration_link_action'] : 'form'; |
| 5556 | $show_reg_link = ( $this->user_can_register && 'yes' === $this->get_settings( 'show_register_link' ) ); |
| 5557 | $reg_link_text = ! empty( $this->get_settings( 'registration_link_text' ) ) ? HelperCLass::eael_wp_kses($this->get_settings( 'registration_link_text' )) : __( 'Register', 'essential-addons-for-elementor-lite' ); |
| 5558 | $parts = explode( "\n", $reg_link_text ); |
| 5559 | $reg_link_text = array_pop( $parts ); |
| 5560 | $reg_message = array_shift( $parts ); |
| 5561 | |
| 5562 | $reg_link_placeholder = '<span class="d-ib">%1$s</span> <a href="%2$s" id="eael-lr-reg-toggle" class="eael-lr-link" data-action="%3$s" %5$s>%4$s</a>'; |
| 5563 | $reg_atts = $reg_url = ''; |
| 5564 | switch ( $reg_link_action ) { |
| 5565 | case 'custom': |
| 5566 | $reg_url = ! empty( $this->ds['custom_register_url']['url'] ) ? $this->ds['custom_register_url']['url'] : ''; |
| 5567 | $reg_atts = ! empty( $this->ds['custom_register_url']['is_external'] ) ? ' target="_blank"' : ''; |
| 5568 | $reg_atts .= ! empty( $this->ds['custom_register_url']['nofollow'] ) ? ' rel="nofollow"' : ''; |
| 5569 | break; |
| 5570 | case 'default': |
| 5571 | $reg_url = wp_registration_url(); |
| 5572 | break; |
| 5573 | } |
| 5574 | |
| 5575 | $reg_link = sprintf( $reg_link_placeholder, $reg_message, esc_attr( $reg_url ), esc_attr( $reg_link_action ), $reg_link_text, $reg_atts ); |
| 5576 | |
| 5577 | |
| 5578 | // login form fields related |
| 5579 | $label_type = ! empty( $this->ds['login_label_types'] ) ? $this->ds['login_label_types'] : 'default'; |
| 5580 | $is_custom_label = ( 'custom' === $label_type ); |
| 5581 | $display_label = ( 'none' !== $label_type ); |
| 5582 | |
| 5583 | //Default label n placeholder |
| 5584 | $u_label = $u_ph = __( 'Username or Email Address', 'essential-addons-for-elementor-lite' ); |
| 5585 | $p_label = $p_ph = __( 'Password', 'essential-addons-for-elementor-lite' ); |
| 5586 | // custom label n placeholder |
| 5587 | if ( $is_custom_label ) { |
| 5588 | $u_label = isset( $this->ds['login_user_label'] ) ? $this->ds['login_user_label'] : ''; |
| 5589 | $p_label = isset( $this->ds['login_password_label'] ) ? $this->ds['login_password_label'] : ''; |
| 5590 | $u_ph = isset( $this->ds['login_user_placeholder'] ) ? $this->ds['login_user_placeholder'] : ''; |
| 5591 | $p_ph = isset( $this->ds['login_password_placeholder'] ) ? $this->ds['login_password_placeholder'] : ''; |
| 5592 | } |
| 5593 | |
| 5594 | |
| 5595 | $btn_text = ! empty( $this->ds['login_button_text'] ) ? $this->ds['login_button_text'] : ''; |
| 5596 | $show_logout_link = ( ! empty( $this->ds['show_log_out_message'] ) && 'yes' === $this->ds['show_log_out_message'] ); |
| 5597 | $show_rememberme = ( ! empty( $this->ds['login_show_remember_me'] ) && 'yes' === $this->ds['login_show_remember_me'] ); |
| 5598 | $remember_text = isset( $this->ds['remember_text'] ) ? $this->ds['remember_text'] : esc_html__( 'Remember Me', 'essential-addons-for-elementor-lite'); |
| 5599 | $remember_checked = ( ! empty( $this->ds['login_form_fields_remember_me_checked'] ) && 'yes' === $this->ds['login_form_fields_remember_me_checked'] ); |
| 5600 | $rm_type = ! empty( $this->ds['remember_me_style'] ) ? $this->ds['remember_me_style'] : ''; |
| 5601 | $show_pv_icon = ( ! empty( $this->ds['password_toggle'] ) && 'yes' === $this->ds['password_toggle'] ); |
| 5602 | |
| 5603 | //Loss password |
| 5604 | $show_lp = ( ! empty( $this->ds['show_lost_password'] ) && 'yes' === $this->ds['show_lost_password'] ); |
| 5605 | $lp_text = ! empty( $this->ds['lost_password_text'] ) ? HelperCLass::eael_wp_kses($this->ds['lost_password_text']) : __( 'Forgot Password?', 'essential-addons-for-elementor-lite' ); |
| 5606 | $lp_link = sprintf( '<a href="%s">%s</a>', esc_attr( wp_lostpassword_url() ), $lp_text ); |
| 5607 | if ( ! empty( $this->ds['lost_password_link_type'] ) && 'custom' === $this->ds['lost_password_link_type'] ) { |
| 5608 | $lp_url = ! empty( $this->ds['lost_password_url']['url'] ) ? $this->ds['lost_password_url']['url'] : wp_lostpassword_url(); |
| 5609 | $lp_atts = ! empty( $this->ds['lost_password_url']['is_external'] ) ? ' target="_blank"' : ''; |
| 5610 | $lp_atts .= ! empty( $this->ds['lost_password_url']['nofollow'] ) ? ' rel="nofollow"' : ''; |
| 5611 | $lp_link = sprintf( '<a href="%s" %s >%s</a>', esc_attr( $lp_url ), $lp_atts, $lp_text ); |
| 5612 | } else if ( ! empty( $this->ds['lost_password_link_type'] ) && 'form' === $this->ds['lost_password_link_type'] ){ |
| 5613 | $lp_link = sprintf( '<a id="eael-lr-lostpassword-toggle" href="" data-action="%s">%s</a>', esc_attr('form'), $lp_text ); |
| 5614 | } |
| 5615 | // btn alignment |
| 5616 | $btn_align = isset( $this->ds['login_btn_align'] ) ? $this->ds['login_btn_align'] : ''; |
| 5617 | // btn alignment |
| 5618 | $link_align = isset( $this->ds['login_link_align'] ) ? $this->ds['login_link_align'] : ''; |
| 5619 | // reCAPTCHA style |
| 5620 | $rc_theme = isset( $this->ds['login_rc_theme'] ) ? $this->ds['login_rc_theme'] : 'light'; |
| 5621 | $rc_size = isset( $this->ds['login_rc_size'] ) ? $this->ds['login_rc_size'] : 'normal'; |
| 5622 | // input icons |
| 5623 | $show_icon = ( $this->pro_enabled && ! empty( $this->ds['show_login_icon'] ) && 'yes' === $this->ds['show_login_icon'] ); |
| 5624 | $icon_class = $show_icon ? 'lr-icon-showing' : ''; |
| 5625 | |
| 5626 | $show_login_spinner = !empty( $this->ds['login_btn_show_spinner'] ) ? $this->ds['login_btn_show_spinner'] : ''; |
| 5627 | ?> |
| 5628 | <section |
| 5629 | id="eael-login-form-wrapper" |
| 5630 | class="<?php echo esc_attr( $default_hide_class ); ?>" |
| 5631 | data-recaptcha-theme="<?php echo esc_attr( $rc_theme ); ?>" |
| 5632 | data-recaptcha-size="<?php echo esc_attr( $rc_size ); ?>"> |
| 5633 | <div class="eael-login-form-wrapper eael-lr-form-wrapper style-2 <?php echo esc_attr( $icon_class ); ?>"> |
| 5634 | <?php |
| 5635 | if ( $show_logout_link && is_user_logged_in() && ! $this->in_editor ) { |
| 5636 | /* translators: %s user display name */ |
| 5637 | $logout_link_text = ! empty( $this->ds['log_out_link_text'] ) ? $this->ds['log_out_link_text'] : 'You are already logged in as [username]. ([logout_link])'; |
| 5638 | $logout_link_text = $this->replace_placeholders_logout_link_text($logout_link_text); |
| 5639 | printf( '%s', __( HelperCLass::eael_wp_kses( $logout_link_text ), 'essential-addons-for-elementor-lite' ) ); |
| 5640 | } else { |
| 5641 | if ( 'left' === $this->form_illustration_pos ) { |
| 5642 | $this->print_form_illustration(); |
| 5643 | } |
| 5644 | ?> |
| 5645 | <div class="lr-form-wrapper"> |
| 5646 | <?php $this->print_form_header( 'login' ); ?> |
| 5647 | <?php do_action( 'eael/login-register/before-login-form', $this ); ?> |
| 5648 | <form class="eael-login-form eael-lr-form" |
| 5649 | id="eael-login-form" |
| 5650 | method="post"> |
| 5651 | <?php do_action( 'eael/login-register/after-login-form-open', $this ); ?> |
| 5652 | <div class="eael-lr-form-group eael-user-login"> |
| 5653 | <?php if ( $display_label && $u_label ) { |
| 5654 | printf( '<label for="eael-user-login" class="eael-field-label">%s</label>', HelperCLass::eael_wp_kses( $u_label ) ); |
| 5655 | } ?> |
| 5656 | <input type="text" |
| 5657 | name="eael-user-login" |
| 5658 | id="eael-user-login" |
| 5659 | class="eael-lr-form-control" |
| 5660 | aria-describedby="emailHelp" |
| 5661 | placeholder="<?php if ( $display_label && $u_ph ) { |
| 5662 | echo esc_attr( $u_ph ); |
| 5663 | } ?>" |
| 5664 | required> |
| 5665 | <?php |
| 5666 | if ( $show_icon ) { |
| 5667 | echo '<i class="fas fa-user"></i>'; |
| 5668 | } ?> |
| 5669 | </div> |
| 5670 | <div class="eael-lr-form-group eael-user-password"> |
| 5671 | <?php if ( $display_label && $p_label ) { |
| 5672 | printf( '<label for="eael-user-password" class="eael-field-label">%s</label>', $p_label ); |
| 5673 | } ?> |
| 5674 | <div class="eael-lr-password-wrapper"> |
| 5675 | <input type="password" |
| 5676 | name="eael-user-password" |
| 5677 | class="eael-lr-form-control" |
| 5678 | id="eael-user-password" |
| 5679 | placeholder="<?php if ( $display_label && $p_ph ) { |
| 5680 | echo esc_attr( $p_ph ); |
| 5681 | } ?>" |
| 5682 | required> |
| 5683 | <?php if ( $show_pv_icon ) { ?> |
| 5684 | <button type="button" |
| 5685 | id="wp-hide-pw" |
| 5686 | class="wp-hide-pw hide-if-no-js" |
| 5687 | aria-label="Show password"> |
| 5688 | <span class="dashicons dashicons-visibility" |
| 5689 | aria-hidden="true"></span> |
| 5690 | </button> |
| 5691 | <?php } ?> |
| 5692 | <?php |
| 5693 | if ( $show_icon ) { |
| 5694 | echo '<i class="fas fa-lock"></i>'; |
| 5695 | } ?> |
| 5696 | </div> |
| 5697 | </div> |
| 5698 | <div class="eael-forever-forget eael-lr-form-group"> |
| 5699 | <?php if ( $show_rememberme && !empty( $remember_text )) { ?> |
| 5700 | <p class="forget-menot"> |
| 5701 | <input name="eael-rememberme" |
| 5702 | type="checkbox" |
| 5703 | id="rememberme" |
| 5704 | <?php if ( $remember_checked ) : ?> |
| 5705 | checked |
| 5706 | <?php endif; ?> |
| 5707 | class="remember-me <?php echo esc_attr( $rm_type ); ?>" |
| 5708 | value="forever"> |
| 5709 | <label for="rememberme" |
| 5710 | class="eael-checkbox-label rememberme"><?php echo esc_html( $remember_text ); ?></label> |
| 5711 | </p> |
| 5712 | <?php } |
| 5713 | if ( $show_lp ) { |
| 5714 | echo '<p class="forget-pass">' . $lp_link . '</p>';//XSS ok. already escaped |
| 5715 | } ?> |
| 5716 | |
| 5717 | </div> |
| 5718 | |
| 5719 | <?php |
| 5720 | do_action( 'eael/login-register/before-recaptcha', $this ); |
| 5721 | $this->print_recaptcha_node( 'login' ); |
| 5722 | do_action( 'eael/login-register/after-recaptcha', $this ); |
| 5723 | do_action( 'eael/login-register/before-login-footer', $this ); |
| 5724 | ?> |
| 5725 | |
| 5726 | |
| 5727 | <div class="eael-lr-footer"> |
| 5728 | <div class="eael-lr-form-loader-wrapper"> |
| 5729 | <input type="submit" |
| 5730 | name="eael-login-submit" |
| 5731 | id="eael-login-submit" |
| 5732 | class="g-recaptcha eael-lr-btn eael-lr-btn-block <?php echo esc_attr( $btn_align ); ?>" |
| 5733 | value="<?php echo esc_attr( $btn_text ); ?>"/> |
| 5734 | |
| 5735 | <?php if( !empty( $show_login_spinner ) && 'true' === $show_login_spinner ): ?> |
| 5736 | <span class="eael-lr-form-loader eael-lr-login-form-loader d-none<?php esc_attr_e($this->in_editor ? '-editor' : '') ?>"> |
| 5737 | <i class="eicon-spinner eicon-animation-spin"></i> |
| 5738 | </span> |
| 5739 | <?php endif; ?> |
| 5740 | |
| 5741 | </div> |
| 5742 | <?php if ( $show_reg_link ) { ?> |
| 5743 | <div class="eael-sign-wrapper <?php echo esc_attr( $link_align ); ?>"> |
| 5744 | <?php echo $reg_link; // XSS ok. already escaped ?> |
| 5745 | </div> |
| 5746 | <?php } ?> |
| 5747 | |
| 5748 | </div> |
| 5749 | <?php do_action( 'eael/login-register/after-login-footer', $this ); |
| 5750 | ?> |
| 5751 | <div class="eael-form-validation-container"> |
| 5752 | <?php $this->print_login_validation_errors(); ?> |
| 5753 | </div> |
| 5754 | <?php |
| 5755 | $this->print_necessary_hidden_fields( 'login' ); |
| 5756 | |
| 5757 | $this->print_login_validation_errors(); |
| 5758 | |
| 5759 | do_action( 'eael/login-register/before-login-form-close', $this ); |
| 5760 | ?> |
| 5761 | </form> |
| 5762 | <?php do_action( 'eael/login-register/after-login-form', $this ); ?> |
| 5763 | </div> |
| 5764 | <?php |
| 5765 | if ( 'right' === $this->form_illustration_pos ) { |
| 5766 | $this->print_form_illustration(); |
| 5767 | } |
| 5768 | } |
| 5769 | ?> |
| 5770 | </div> |
| 5771 | |
| 5772 | </section> |
| 5773 | <?php |
| 5774 | } |
| 5775 | } |
| 5776 | |
| 5777 | protected function print_register_form() { |
| 5778 | if ( $this->should_print_register_form ) { |
| 5779 | $default_hide_class = ( 'login' === $this->default_form || 'lostpassword' === $this->default_form || $this->should_print_resetpassword_form_editor || isset($_GET['eael-lostpassword']) || isset($_GET['eael-resetpassword']) ) && !isset($_GET['eael-register']) ? 'eael-lr-d-none' : ''; //eael-register flag for show error/success message when formal form submit |
| 5780 | $is_pass_valid = false; // Does the form has a password field? |
| 5781 | $is_pass_confirmed = false; |
| 5782 | // placeholders to flag if user use one type of field more than once. |
| 5783 | $email_exists = 0; |
| 5784 | $user_name_exists = 0; |
| 5785 | $password_exists = 0; |
| 5786 | $confirm_pass_exists = 0; |
| 5787 | $first_name_exists = 0; |
| 5788 | $last_name_exists = 0; |
| 5789 | $website_exists = 0; |
| 5790 | $eael_phone_number_exists = 0; |
| 5791 | |
| 5792 | $f_labels = [ |
| 5793 | 'email' => __( 'Email', 'essential-addons-for-elementor-lite' ), |
| 5794 | 'password' => __( 'Password', 'essential-addons-for-elementor-lite' ), |
| 5795 | 'confirm_password' => __( 'Confirm Password', 'essential-addons-for-elementor-lite' ), |
| 5796 | 'user_name' => __( 'Username', 'essential-addons-for-elementor-lite' ), |
| 5797 | 'first_name' => __( 'First Name', 'essential-addons-for-elementor-lite' ), |
| 5798 | 'last_name' => __( 'Last Name', 'essential-addons-for-elementor-lite' ), |
| 5799 | 'website' => __( 'Website', 'essential-addons-for-elementor-lite' ), |
| 5800 | 'eael_phone_number' => __( 'Phone', 'essential-addons-for-elementor-lite' ), |
| 5801 | ]; |
| 5802 | |
| 5803 | $eael_custom_profile_fields_text = $this->get_eael_custom_profile_fields( 'text' ); |
| 5804 | $eael_custom_profile_fields_image = $this->get_eael_custom_profile_fields( 'image' ); |
| 5805 | $eael_custom_profile_fields = array_merge( $eael_custom_profile_fields_text, $eael_custom_profile_fields_image ); |
| 5806 | |
| 5807 | $f_labels = array_merge($f_labels, $eael_custom_profile_fields); |
| 5808 | |
| 5809 | foreach( $eael_custom_profile_fields as $eael_custom_profile_field_key => $eael_custom_profile_field_value ) { |
| 5810 | $eael_custom_profile_field_key_exists = $eael_custom_profile_field_key . '_exists'; |
| 5811 | $$eael_custom_profile_field_key_exists = 0; // dynamic variable |
| 5812 | } |
| 5813 | |
| 5814 | $repeated_f_labels = []; |
| 5815 | |
| 5816 | //Login link related |
| 5817 | $lgn_link_action = ! empty( $this->ds['login_link_action'] ) ? $this->ds['login_link_action'] : 'form'; |
| 5818 | $show_lgn_link = 'yes' === $this->get_settings( 'show_login_link' ); |
| 5819 | $lgn_link_text = ! empty( $this->get_settings( 'login_link_text' ) ) ? HelperCLass::eael_wp_kses($this->get_settings( 'login_link_text' )) : __( 'Login', 'essential-addons-for-elementor-lite' ); |
| 5820 | $btn_text = ! empty( $this->ds['reg_button_text'] ) ? $this->ds['reg_button_text'] : ''; |
| 5821 | |
| 5822 | $parts = explode( "\n", $lgn_link_text ); |
| 5823 | $lgn_link_text = array_pop( $parts ); |
| 5824 | $lgn_message = array_shift( $parts ); |
| 5825 | $lgn_link_placeholder = '<span class="d-ib">%1$s</span> <a href="%2$s" id="eael-lr-login-toggle" class="eael-lr-link" data-action="%3$s" %5$s>%4$s</a>'; |
| 5826 | $lgn_url = $lgn_atts = ''; |
| 5827 | |
| 5828 | $show_register_spinner = !empty( $this->ds['register_btn_show_spinner'] ) ? $this->ds['register_btn_show_spinner'] : ''; |
| 5829 | $show_pv_icon = ( ! empty( $this->ds['password_toggle_register'] ) && 'yes' === $this->ds['password_toggle_register'] ); |
| 5830 | |
| 5831 | switch ( $lgn_link_action ) { |
| 5832 | case 'custom': |
| 5833 | $lgn_url = ! empty( $this->ds['custom_login_url']['url'] ) ? $this->ds['custom_login_url']['url'] : ''; |
| 5834 | $lgn_atts = ! empty( $this->ds['custom_login_url']['is_external'] ) ? ' target="_blank"' : ''; |
| 5835 | $lgn_atts .= ! empty( $this->ds['custom_login_url']['nofollow'] ) ? ' rel="nofollow"' : ''; |
| 5836 | break; |
| 5837 | case 'default': |
| 5838 | $lgn_url = wp_login_url(); |
| 5839 | break; |
| 5840 | } |
| 5841 | $lgn_link = sprintf( $lgn_link_placeholder, $lgn_message, esc_attr( $lgn_url ), esc_attr( $lgn_link_action ), $lgn_link_text, $lgn_atts ); |
| 5842 | |
| 5843 | // btn alignment |
| 5844 | $btn_align = isset( $this->ds['register_btn_align'] ) ? esc_html( $this->ds['register_btn_align'] ) : ''; |
| 5845 | $link_align = isset( $this->ds['register_link_align'] ) ? esc_html( $this->ds['register_link_align'] ) : ''; |
| 5846 | // reCAPTCHA style |
| 5847 | $rc_theme = isset( $this->ds['register_rc_theme'] ) ? esc_html( $this->ds['register_rc_theme'] ) : 'light'; |
| 5848 | $rc_size = isset( $this->ds['register_rc_size'] ) ? esc_html( $this->ds['register_rc_size'] ) : 'normal'; |
| 5849 | // input icons |
| 5850 | $show_icon = ( $this->pro_enabled && ! empty( $this->ds['show_register_icon'] ) && 'yes' === $this->ds['show_register_icon'] ); |
| 5851 | $icon_class = $show_icon ? 'lr-icon-showing' : ''; |
| 5852 | |
| 5853 | $use_weak_password = true; |
| 5854 | if( isset( $this->ds['use_weak_password'] ) ){ |
| 5855 | $use_weak_password = !empty( $this->ds['use_weak_password'] ) ? 1 : 0; |
| 5856 | } |
| 5857 | |
| 5858 | $password_min_length = !empty( $this->ds['weak_pass_min_char'] ) ? intval( $this->ds['weak_pass_min_char'] ) : ''; |
| 5859 | $password_one_uppercase = !empty( $this->ds['weak_pass_one_uppercase'] ) ? true : false; |
| 5860 | $password_one_lowercase = !empty( $this->ds['weak_pass_one_lowercase'] ) ? true : false; |
| 5861 | $password_one_number = !empty( $this->ds['weak_pass_one_number'] ) ? true : false; |
| 5862 | $password_one_special = !empty( $this->ds['weak_pass_one_special'] ) ? true : false; |
| 5863 | |
| 5864 | ob_start(); |
| 5865 | ?> |
| 5866 | <section |
| 5867 | id="eael-register-form-wrapper" |
| 5868 | class="<?php echo esc_attr( $default_hide_class ); ?>" |
| 5869 | data-recaptcha-theme="<?php echo esc_attr( $rc_theme ); ?>" |
| 5870 | data-recaptcha-size="<?php echo esc_attr( $rc_size ); ?>" |
| 5871 | data-use-weak-password="<?php echo esc_attr( $use_weak_password ); ?>" |
| 5872 | data-password-min-length="<?php echo esc_attr( $password_min_length ); ?>" |
| 5873 | data-password-one-uppercase="<?php echo esc_attr( $password_one_uppercase ); ?>" |
| 5874 | data-password-one-lowercase="<?php echo esc_attr( $password_one_lowercase ); ?>" |
| 5875 | data-password-one-number="<?php echo esc_attr( $password_one_number ); ?>" |
| 5876 | data-password-one-special="<?php echo esc_attr( $password_one_special ); ?>" |
| 5877 | > |
| 5878 | <div class="eael-register-form-wrapper eael-lr-form-wrapper style-2 <?php echo esc_attr( $icon_class ); ?>"> |
| 5879 | <?php if ( 'left' === $this->form_illustration_pos ) { |
| 5880 | $this->print_form_illustration(); |
| 5881 | } ?> |
| 5882 | <div class="lr-form-wrapper"> |
| 5883 | <?php |
| 5884 | $this->print_form_header( 'register' ); |
| 5885 | do_action( 'eael/login-register/before-register-form', $this ); |
| 5886 | |
| 5887 | $has_file_input = 0; |
| 5888 | foreach ( $this->ds['register_fields'] as $single_field ) { |
| 5889 | $single_field_type = $single_field['field_type']; |
| 5890 | |
| 5891 | if( ! empty( $eael_custom_profile_fields_image[ $single_field_type ] ) ){ |
| 5892 | $has_file_input = 1; |
| 5893 | break; |
| 5894 | } |
| 5895 | } |
| 5896 | ?> |
| 5897 | <form class="eael-register-form eael-lr-form" |
| 5898 | id="eael-register-form" |
| 5899 | method="post" |
| 5900 | <?php if ( $has_file_input ) : ?> |
| 5901 | enctype="multipart/form-data" |
| 5902 | <?php endif; ?> |
| 5903 | > |
| 5904 | <?php do_action( 'eael/login-register/after-register-form-open', $this ); ?> |
| 5905 | <?php // Print all dynamic fields |
| 5906 | foreach ( $this->ds['register_fields'] as $f_index => $field ) : |
| 5907 | $field_type = $field['field_type']; |
| 5908 | $dynamic_field_name = "{$field_type}_exists"; |
| 5909 | $$dynamic_field_name ++; //NOTE, double $$ intentional. Dynamically update the var check eg. $username_exists++ to prevent user from using the same field twice |
| 5910 | // is same field repeated? |
| 5911 | if( isset( $$dynamic_field_name ) ){ |
| 5912 | if ( $$dynamic_field_name > 1 ) { |
| 5913 | $repeated_f_labels[] = $f_labels[ $field_type ]; |
| 5914 | } |
| 5915 | } |
| 5916 | |
| 5917 | if ( 'password' === $field_type ) { |
| 5918 | $is_pass_valid = true; |
| 5919 | } |
| 5920 | |
| 5921 | $current_field_required = ( ! empty( $field['required'] ) || in_array( $field_type, [ |
| 5922 | 'password', |
| 5923 | 'confirm_pass', |
| 5924 | 'email', |
| 5925 | ] ) ); |
| 5926 | |
| 5927 | //keys for attribute binding |
| 5928 | $input_key = "input{$f_index}"; |
| 5929 | $label_key = "label{$f_index}"; |
| 5930 | $field_group_key = "field-group{$f_index}"; |
| 5931 | |
| 5932 | // determine proper input tag type |
| 5933 | switch ( $field_type ) { |
| 5934 | case 'eael_phone_number': |
| 5935 | case 'user_name': |
| 5936 | case 'first_name': |
| 5937 | case 'last_name': |
| 5938 | $field_input_type = 'text'; |
| 5939 | break; |
| 5940 | case 'confirm_pass': |
| 5941 | $field_input_type = 'password'; |
| 5942 | break; |
| 5943 | case 'website': |
| 5944 | $field_input_type = 'url'; |
| 5945 | break; |
| 5946 | default: |
| 5947 | $field_input_type = $field_type; |
| 5948 | } |
| 5949 | |
| 5950 | if( ! empty( $eael_custom_profile_fields_text[ $field_type ] ) ){ |
| 5951 | $field_input_type = 'text'; |
| 5952 | } |
| 5953 | |
| 5954 | if( ! empty( $eael_custom_profile_fields_image[ $field_type ] ) ){ |
| 5955 | $field_input_type = 'file'; |
| 5956 | } |
| 5957 | |
| 5958 | $this->add_render_attribute( [ |
| 5959 | $input_key => [ |
| 5960 | 'name' => $field_type, |
| 5961 | 'type' => $field_input_type, |
| 5962 | 'placeholder' => $field['placeholder'], |
| 5963 | 'class' => [ |
| 5964 | 'eael-lr-form-control', |
| 5965 | 'form-field-' . $field_type, |
| 5966 | ], |
| 5967 | 'id' => 'form-field-' . $field_type, |
| 5968 | ], |
| 5969 | $label_key => [ |
| 5970 | 'for' => 'form-field-' . $field_type, |
| 5971 | 'class' => 'eael-field-label', |
| 5972 | ], |
| 5973 | ] ); |
| 5974 | |
| 5975 | // print require field attributes |
| 5976 | if ( $current_field_required ) { |
| 5977 | $this->add_render_attribute( $input_key, [ |
| 5978 | 'required' => 'required', |
| 5979 | 'aria-required' => 'true', |
| 5980 | ] ); |
| 5981 | if ( 'yes' === $this->ds['mark_required'] ) { |
| 5982 | $this->add_render_attribute( $label_key, [ |
| 5983 | 'class' => 'mark-required', |
| 5984 | ] ); |
| 5985 | } |
| 5986 | |
| 5987 | } |
| 5988 | |
| 5989 | |
| 5990 | // add css classes to the main input field wrapper. |
| 5991 | $this->add_render_attribute( [ |
| 5992 | $field_group_key => [ |
| 5993 | 'class' => [ |
| 5994 | 'eael-lr-form-group', |
| 5995 | 'elementor-repeater-item-'.$field['_id'], |
| 5996 | 'eael-field-type-' . $field_type, |
| 5997 | ], |
| 5998 | ], |
| 5999 | ] ); |
| 6000 | |
| 6001 | ?> |
| 6002 | <div <?php $this->print_render_attribute_string( $field_group_key ) ?>> |
| 6003 | <?php |
| 6004 | if ( 'yes' === $this->ds['show_labels'] && ! empty( $field['field_label'] ) ) { |
| 6005 | echo '<label ' . $this->get_render_attribute_string( $label_key ) . '>' . HelperCLass::eael_wp_kses( $field['field_label'] ) . '</label>'; |
| 6006 | } |
| 6007 | if( 'password' === $field['field_type'] ){ |
| 6008 | echo '<div class="eael-lr-password-wrapper-register">'; |
| 6009 | echo '<input ' . $this->get_render_attribute_string( $input_key ) . '>'; |
| 6010 | |
| 6011 | if ( $show_pv_icon ) { ?> |
| 6012 | <button type="button" |
| 6013 | id="wp-hide-pw-register" |
| 6014 | class="wp-hide-pw hide-if-no-js" |
| 6015 | aria-label="Show password"> |
| 6016 | <span class="dashicons dashicons-visibility" |
| 6017 | aria-hidden="true"></span> |
| 6018 | </button> |
| 6019 | <?php } |
| 6020 | |
| 6021 | if ( $show_icon && ! empty( $field['icon'] ) ) { |
| 6022 | Icons_Manager::render_icon( $field['icon'], [ 'aria-hidden' => 'true' ] ); |
| 6023 | } |
| 6024 | echo '</div>'; |
| 6025 | } else { |
| 6026 | echo '<input ' . $this->get_render_attribute_string( $input_key ) . '>'; |
| 6027 | |
| 6028 | if ( $show_icon && ! empty( $field['icon'] ) ) { |
| 6029 | Icons_Manager::render_icon( $field['icon'], [ 'aria-hidden' => 'true' ] ); |
| 6030 | } |
| 6031 | } |
| 6032 | ?> |
| 6033 | |
| 6034 | <?php |
| 6035 | if ( 'password' === $field['field_type'] ) { |
| 6036 | do_action( 'eael/login-register/after-password-field', $this ); |
| 6037 | } |
| 6038 | echo "</div>"; |
| 6039 | endforeach; |
| 6040 | $this->print_necessary_hidden_fields( 'register' ); |
| 6041 | $this->print_terms_condition_notice(); |
| 6042 | $this->print_recaptcha_node( 'register' ); |
| 6043 | ?> |
| 6044 | |
| 6045 | <div class="eael-lr-footer"> |
| 6046 | <div class="eael-lr-form-loader-wrapper"> |
| 6047 | <input type="submit" |
| 6048 | name="eael-register-submit" |
| 6049 | id="eael-register-submit" |
| 6050 | class="eael-lr-btn eael-lr-btn-block<?php echo esc_attr( $btn_align ); ?>" |
| 6051 | value="<?php echo esc_attr( $btn_text ); ?>"/> |
| 6052 | |
| 6053 | <?php if( !empty( $show_register_spinner ) && 'true' === $show_register_spinner ): ?> |
| 6054 | <span class="eael-lr-form-loader eael-lr-register-form-loader d-none<?php esc_attr_e($this->in_editor ? '-editor' : '') ?>"> |
| 6055 | <i class="eicon-spinner eicon-animation-spin"></i> |
| 6056 | </span> |
| 6057 | <?php endif; ?> |
| 6058 | |
| 6059 | </div> |
| 6060 | <?php if ( $show_lgn_link ) { ?> |
| 6061 | <div class="eael-sign-wrapper <?php echo esc_attr( $link_align ); ?>"> |
| 6062 | <?php echo $lgn_link; ?> |
| 6063 | </div> |
| 6064 | <?php } ?> |
| 6065 | </div> |
| 6066 | |
| 6067 | <?php do_action( 'eael/login-register/after-register-footer', $this ); ?> |
| 6068 | |
| 6069 | <div class="eael-form-validation-container"> |
| 6070 | <?php $this->print_validation_message(); ?> |
| 6071 | </div> |
| 6072 | <?php |
| 6073 | |
| 6074 | do_action( 'eael/login-register/before-register-form-close', $this ); |
| 6075 | ?> |
| 6076 | </form> |
| 6077 | <?php do_action( 'eael/login-register/after-register-form', $this ); ?> |
| 6078 | </div> |
| 6079 | <?php if ( 'right' === $this->form_illustration_pos ) { |
| 6080 | $this->print_form_illustration(); |
| 6081 | } ?> |
| 6082 | </div> |
| 6083 | </section> |
| 6084 | <?php |
| 6085 | $form_markup = apply_filters( 'eael/login-register/register-form-markup', ob_get_clean() ); |
| 6086 | // if we are in the editor then show error related to different input field. |
| 6087 | if ( $this->in_editor ) { |
| 6088 | $repeated = $this->print_error_for_repeated_fields( $repeated_f_labels ); |
| 6089 | $email_field_missing = $this->print_error_for_missing_email_field( $email_exists ); |
| 6090 | $pass_missing = $this->print_error_for_missing_password_field( $password_exists, $confirm_pass_exists ); |
| 6091 | if ( $repeated || $email_field_missing || $pass_missing ) { |
| 6092 | return false; // error found, exit, dont show form. |
| 6093 | } |
| 6094 | echo $form_markup; //XSS OK, data sanitized already. |
| 6095 | } else { |
| 6096 | echo $form_markup; //XSS OK, data sanitized already. |
| 6097 | } |
| 6098 | } |
| 6099 | } |
| 6100 | |
| 6101 | protected function print_lostpassword_form(){ |
| 6102 | if ( $this->should_print_lostpassword_form ) { |
| 6103 | $form_not_enabled = ! ( 'lostpassword' === $this->default_form || ( 'yes' === $this->get_settings_for_display( 'show_lost_password' ) && 'form' === $this->get_settings_for_display( 'lost_password_link_type' ) ) ); |
| 6104 | |
| 6105 | if( $form_not_enabled && isset( $_GET['eael-lostpassword'] ) ){ |
| 6106 | wp_safe_redirect( remove_query_arg( array( 'eael-lostpassword' ) ) ); |
| 6107 | exit; |
| 6108 | } |
| 6109 | |
| 6110 | // prepare all lostpassword form related vars |
| 6111 | $default_hide_class = ( 'register' === $this->default_form || 'login' === $this->default_form || $this->should_print_resetpassword_form_editor || isset($_GET['eael-register']) || isset($_GET['eael-resetpassword']) ) && !isset($_GET['eael-lostpassword']) ? 'eael-lr-d-none' : ''; |
| 6112 | |
| 6113 | //Login link related |
| 6114 | $login_link_action_lostpassword = ! empty( $this->ds['login_link_action_lostpassword'] ) ? esc_html( $this->ds['login_link_action_lostpassword'] ) : 'form'; |
| 6115 | $show_login_link_lostpassword = ( 'yes' === $this->get_settings( 'show_login_link_lostpassword' ) ); |
| 6116 | $login_link_text_lostpassword = ! empty( $this->get_settings( 'login_link_text_lostpassword' ) ) ? HelperCLass::eael_wp_kses($this->get_settings( 'login_link_text_lostpassword' )) : __( 'Login', 'essential-addons-for-elementor-lite' ); |
| 6117 | $parts = explode( "\n", $login_link_text_lostpassword ); |
| 6118 | $login_link_text_lostpassword = array_pop( $parts ); |
| 6119 | $login_message_lostpassword = array_shift( $parts ); |
| 6120 | |
| 6121 | $success_key = 'eael_lostpassword_success_' . esc_attr( $this->get_id() ); |
| 6122 | $lostpassword_success = apply_filters( 'eael/login-register/lostpassword-success-message', get_option( $success_key ) ); |
| 6123 | $hide_class_after_submission = ! empty( $lostpassword_success ) ? 'eael-d-none' : ''; |
| 6124 | |
| 6125 | $login_link_placeholder_lostpassword = '<span class="d-ib">%1$s</span> <a href="%2$s" id="eael-lr-login-toggle-lostpassword" class="eael-lr-link" data-action="%3$s" %5$s %6$s>%4$s</a>'; |
| 6126 | $login_atts_lostpassword = $login_url_lostpassword = ''; |
| 6127 | switch ( $login_link_action_lostpassword ) { |
| 6128 | case 'custom': |
| 6129 | $login_url_lostpassword = ! empty( $this->ds['custom_login_url_lostpass']['url'] ) ? esc_url_raw( $this->ds['custom_login_url_lostpass']['url'] ) : ''; |
| 6130 | $login_atts_lostpassword = ! empty( $this->ds['custom_login_url_lostpass']['is_external'] ) ? ' target="_blank"' : ''; |
| 6131 | $login_atts_lostpassword .= ! empty( $this->ds['custom_login_url_lostpass']['nofollow'] ) ? ' rel="nofollow"' : ''; |
| 6132 | $this->add_link_attributes( 'login_button_lostpassword', $this->ds['custom_login_url_lostpass'] ); |
| 6133 | break; |
| 6134 | case 'default': |
| 6135 | $login_url_lostpassword = wp_login_url(); |
| 6136 | break; |
| 6137 | } |
| 6138 | |
| 6139 | $login_link_lostpassword = sprintf( $login_link_placeholder_lostpassword, $login_message_lostpassword, esc_attr( $login_url_lostpassword ), esc_attr( $login_link_action_lostpassword ), $login_link_text_lostpassword, $login_atts_lostpassword, $this->get_render_attribute_string( 'login_button_lostpassword' ) ); |
| 6140 | |
| 6141 | // lost password form fields related |
| 6142 | $label_type = ! empty( $this->ds['lostpassword_label_types'] ) ? esc_html( $this->ds['lostpassword_label_types'] ) : 'default'; |
| 6143 | $is_custom_label = ( 'custom' === $label_type ); |
| 6144 | $display_label = ( 'none' !== $label_type ); |
| 6145 | |
| 6146 | //Default label n placeholder |
| 6147 | $u_label = $u_ph = esc_html__( 'Username or Email Address', 'essential-addons-for-elementor-lite' ); |
| 6148 | |
| 6149 | // custom label n placeholder |
| 6150 | if ( $is_custom_label ) { |
| 6151 | $u_label = isset( $this->ds['lostpassword_user_label'] ) ? esc_html__( wp_strip_all_tags( $this->ds['lostpassword_user_label'] ), 'essential-addons-for-elementor-lite' ) : ''; |
| 6152 | $u_ph = isset( $this->ds['lostpassword_user_placeholder'] ) ? esc_html__( wp_strip_all_tags( $this->ds['lostpassword_user_placeholder'] ), 'essential-addons-for-elementor-lite' ) : ''; |
| 6153 | } |
| 6154 | $btn_text = ! empty( $this->ds['lostpassword_button_text'] ) ? $this->ds['lostpassword_button_text'] : ''; |
| 6155 | |
| 6156 | // btn alignment |
| 6157 | $btn_align = isset( $this->ds['lostpassword_btn_align'] ) ? esc_html( $this->ds['lostpassword_btn_align'] ) : ''; |
| 6158 | // btn alignment |
| 6159 | $link_align = isset( $this->ds['lostpassword_link_align'] ) ? esc_html( $this->ds['lostpassword_link_align'] ) : ''; |
| 6160 | // input icons |
| 6161 | $show_icon = ( $this->pro_enabled && ! empty( $this->ds['show_lostpassword_icon'] ) && 'yes' === esc_html( $this->ds['show_lostpassword_icon'] ) ); |
| 6162 | $icon_class = $show_icon ? 'lr-icon-showing' : ''; |
| 6163 | ?> |
| 6164 | <section |
| 6165 | id="eael-lostpassword-form-wrapper" |
| 6166 | class="<?php echo esc_attr( $default_hide_class ); ?>" |
| 6167 | > |
| 6168 | <div class="eael-lostpassword-form-wrapper eael-lr-form-wrapper style-2 <?php echo esc_attr( $icon_class ); ?>"> |
| 6169 | <?php |
| 6170 | if ( 'left' === $this->form_illustration_pos ) { |
| 6171 | $this->print_form_illustration('lostpassword'); |
| 6172 | } |
| 6173 | ?> |
| 6174 | <div class="lr-form-wrapper"> |
| 6175 | <?php $this->print_form_header( 'lostpassword' ); ?> |
| 6176 | <?php do_action( 'eael/login-register/before-lostpassword-form', $this ); ?> |
| 6177 | <form class="eael-lostpassword-form eael-lr-form" |
| 6178 | id="eael-lostpassword-form" |
| 6179 | method="post"> |
| 6180 | <?php do_action( 'eael/login-register/after-lostpassword-form-open', $this ); ?> |
| 6181 | <div class="eael-lr-form-group <?php echo esc_attr( $hide_class_after_submission ); ?>"> |
| 6182 | <?php if ( $display_label && $u_label ) { |
| 6183 | printf( '<label for="eael-user-lostpassword" class="eael-field-label">%s</label>', esc_html__( $u_label, 'essential-addons-for-elementor-lite' ) ); |
| 6184 | } ?> |
| 6185 | <input type="text" |
| 6186 | name="eael-user-lostpassword" |
| 6187 | id="eael-user-lostpassword" |
| 6188 | class="eael-lr-form-control" |
| 6189 | aria-describedby="emailHelp" |
| 6190 | placeholder="<?php if ( $display_label && $u_ph ) { |
| 6191 | echo esc_attr( $u_ph ); |
| 6192 | } ?>" |
| 6193 | required> |
| 6194 | <?php |
| 6195 | if ( $show_icon ) { |
| 6196 | echo '<i class="fas fa-user"></i>'; |
| 6197 | } ?> |
| 6198 | </div> |
| 6199 | |
| 6200 | <?php |
| 6201 | do_action( 'eael/login-register/before-lostpassword-footer', $this ); |
| 6202 | ?> |
| 6203 | |
| 6204 | <div class="eael-lr-footer"> |
| 6205 | <input type="submit" |
| 6206 | name="eael-lostpassword-submit" |
| 6207 | id="eael-lostpassword-submit" |
| 6208 | class="eael-lr-btn eael-lr-btn-block <?php echo esc_attr( $btn_align ); ?> <?php echo esc_attr( $hide_class_after_submission ); ?>" |
| 6209 | value="<?php echo wp_strip_all_tags( $btn_text ); ?>"/> |
| 6210 | <?php if ( $show_login_link_lostpassword ) { ?> |
| 6211 | <div class="eael-sign-wrapper <?php echo esc_attr( $link_align ); ?>"> |
| 6212 | <?php echo $login_link_lostpassword; // XSS ok. already escaped ?> |
| 6213 | </div> |
| 6214 | <?php } ?> |
| 6215 | |
| 6216 | </div> |
| 6217 | <?php do_action( 'eael/login-register/after-lostpassword-footer', $this ); |
| 6218 | ?> |
| 6219 | <div class="eael-form-validation-container"> |
| 6220 | <?php $this->print_lostpassword_validation_errors(); ?> |
| 6221 | </div> |
| 6222 | <?php |
| 6223 | $this->print_necessary_hidden_fields( 'lostpassword' ); |
| 6224 | |
| 6225 | $this->print_lostpassword_validation_errors(); |
| 6226 | |
| 6227 | do_action( 'eael/login-register/before-lostpassword-form-close', $this ); |
| 6228 | ?> |
| 6229 | </form> |
| 6230 | <?php do_action( 'eael/login-register/after-lostpassword-form', $this ); ?> |
| 6231 | </div> |
| 6232 | <?php |
| 6233 | if ( 'right' === $this->form_illustration_pos ) { |
| 6234 | $this->print_form_illustration('lostpassword'); |
| 6235 | } |
| 6236 | ?> |
| 6237 | </div> |
| 6238 | |
| 6239 | </section> |
| 6240 | <?php |
| 6241 | } |
| 6242 | } |
| 6243 | |
| 6244 | protected function print_resetpassword_form(){ |
| 6245 | $default_hide_class = ( 'register' === $this->default_form || 'login' === $this->default_form || 'lostpassword' === $this->default_form || isset($_GET['eael-register']) || isset($_GET['eael-lostpassword']) ) && !isset($_GET['eael-resetpassword']) ? 'eael-lr-d-none' : ''; |
| 6246 | $default_hide_class = $this->should_print_resetpassword_form_editor ? '' : $default_hide_class; |
| 6247 | $rp_page_url = ! empty( $this->page_id_for_popup ) ? get_permalink( $this->page_id_for_popup ) : get_permalink( $this->page_id ); |
| 6248 | |
| 6249 | if ( $this->should_print_resetpassword_form_editor || ( ! empty( $_GET['eael-resetpassword'] ) ) ) { |
| 6250 | $rp_data = $_COOKIE; |
| 6251 | $show_resetpassword_on_form_submit = get_option('eael_show_reset_password_on_form_submit_' . $this->get_id()); |
| 6252 | |
| 6253 | $validation_required = true; |
| 6254 | if( $this->should_print_resetpassword_form_editor || $show_resetpassword_on_form_submit ){ |
| 6255 | $validation_required = false; |
| 6256 | } |
| 6257 | |
| 6258 | $rp_cookie = 'wp-resetpass-' . COOKIEHASH; |
| 6259 | if ( ! empty( $rp_data[ $rp_cookie ] ) ) { |
| 6260 | list( $rp_data['rp_login'], $rp_data['rp_key'] ) = explode( ':', sanitize_text_field( $rp_data[ $rp_cookie ] ) ); |
| 6261 | } |
| 6262 | |
| 6263 | if( $validation_required ){ |
| 6264 | $rp_data['rp_key'] = ! empty( $rp_data['rp_key'] ) ? $rp_data['rp_key'] : ''; |
| 6265 | $rp_data['rp_login'] = ! empty( $rp_data['rp_login'] ) ? $rp_data['rp_login'] : ''; |
| 6266 | |
| 6267 | $user = check_password_reset_key( $rp_data['rp_key'], $rp_data['rp_login'] ); |
| 6268 | |
| 6269 | if ( empty( $rp_data['rp_key'] ) || ! $user || is_wp_error( $user ) ) { |
| 6270 | $rp_err_msg = ! empty( $this->ds['err_reset_password_key_expired'] ) ? esc_html__( wp_strip_all_tags( $this->ds['err_reset_password_key_expired'] ), 'essential-addons-for-elementor-lite' ) : __( 'Your password reset link appears to be invalid. Please request a new link.', 'essential-addons-for-elementor-lite' ); |
| 6271 | update_option( 'eael_lostpassword_error_' . esc_attr( $this->get_id() ), $rp_err_msg, false ); |
| 6272 | |
| 6273 | $resetpassword_redirect_url = esc_url_raw( $rp_page_url . '?eael-lostpassword=1&error=expiredkey' ); |
| 6274 | |
| 6275 | if( ! empty( $this->resetpassword_in_popup_selector ) ){ |
| 6276 | $resetpassword_redirect_url = esc_url_raw( $rp_page_url . '?eael-lostpassword=1&error=expiredkey&popup-selector=' . $this->resetpassword_in_popup_selector ); |
| 6277 | } |
| 6278 | ?> |
| 6279 | <script type="text/javascript"> |
| 6280 | document.location.href = <?php echo json_encode( $resetpassword_redirect_url ); ?>; |
| 6281 | </script> |
| 6282 | <?php |
| 6283 | exit; |
| 6284 | } |
| 6285 | } |
| 6286 | |
| 6287 | delete_option('eael_show_reset_password_on_form_submit_' . $this->get_id()); |
| 6288 | |
| 6289 | // lost password form fields related |
| 6290 | $label_type = ! empty( $this->ds['resetpassword_label_types'] ) ? esc_html( $this->ds['resetpassword_label_types'] ) : 'default'; |
| 6291 | $is_custom_label = ( 'custom' === $label_type ); |
| 6292 | $display_label = ( 'none' !== $label_type ); |
| 6293 | |
| 6294 | $success_key = 'eael_resetpassword_success_' . esc_attr( $this->get_id() ); |
| 6295 | $resetpassword_success = apply_filters( 'eael/login-register/resetpassword-success-message', get_option( $success_key ) ); |
| 6296 | $hide_class_after_submission = ! empty( $resetpassword_success ) ? 'eael-d-none' : ''; |
| 6297 | |
| 6298 | //Default label |
| 6299 | $password_label = __( 'New Password', 'essential-addons-for-elementor-lite' ); |
| 6300 | $confirm_password_label = __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ); |
| 6301 | |
| 6302 | $password_placeholder = __( 'New Password', 'essential-addons-for-elementor-lite' ); |
| 6303 | $confirm_password_placeholder = __( 'Confirm New Password', 'essential-addons-for-elementor-lite' ); |
| 6304 | |
| 6305 | // custom label n placeholder |
| 6306 | if ( $is_custom_label ) { |
| 6307 | $password_label = isset( $this->ds['resetpassword_password_label'] ) ? __( $this->ds['resetpassword_password_label'], 'essential-addons-for-elementor-lite' ) : ''; |
| 6308 | $confirm_password_label = isset( $this->ds['resetpassword_confirm_password_label'] ) ? __( $this->ds['resetpassword_confirm_password_label'], 'essential-addons-for-elementor-lite' ) : ''; |
| 6309 | |
| 6310 | $password_placeholder = isset( $this->ds['resetpassword_password_placeholder'] ) ? __( $this->ds['resetpassword_password_placeholder'], 'essential-addons-for-elementor-lite' ) : ''; |
| 6311 | $confirm_password_placeholder = isset( $this->ds['resetpassword_confirm_password_placeholder'] ) ? __( $this->ds['resetpassword_confirm_password_placeholder'], 'essential-addons-for-elementor-lite' ) : ''; |
| 6312 | } |
| 6313 | |
| 6314 | $btn_text = ! empty( $this->ds['resetpassword_button_text'] ) ? __( $this->ds['resetpassword_button_text'], 'essential-addons-for-elementor-lite' ) : ''; |
| 6315 | |
| 6316 | // btn alignment |
| 6317 | $btn_align = isset( $this->ds['resetpassword_btn_align'] ) ? esc_html( $this->ds['resetpassword_btn_align'] ) : ''; |
| 6318 | // input icons |
| 6319 | $show_icon = ( $this->pro_enabled && ! empty( $this->ds['show_resetpassword_icon'] ) && 'yes' === esc_html( $this->ds['show_resetpassword_icon'] ) ); |
| 6320 | $icon_class = $show_icon ? 'lr-icon-showing' : ''; |
| 6321 | |
| 6322 | $show_pv_icon = ( ! empty( $this->ds['password_toggle_resetpassword'] ) && 'yes' === $this->ds['password_toggle_resetpassword'] ); |
| 6323 | ?> |
| 6324 | <section |
| 6325 | id="eael-resetpassword-form-wrapper" |
| 6326 | class="<?php echo esc_attr( $default_hide_class ); ?>" |
| 6327 | > |
| 6328 | <div class="eael-resetpassword-form-wrapper eael-lr-form-wrapper style-2 <?php echo esc_attr( $icon_class ); ?>"> |
| 6329 | <?php |
| 6330 | if ( 'left' === $this->form_illustration_pos ) { |
| 6331 | $this->print_form_illustration('resetpassword'); |
| 6332 | } |
| 6333 | ?> |
| 6334 | <div class="lr-form-wrapper"> |
| 6335 | <?php $this->print_form_header( 'resetpassword' ); ?> |
| 6336 | <?php do_action( 'eael/login-register/before-resetpassword-form', $this ); ?> |
| 6337 | <form class="eael-resetpassword-form eael-lr-form" |
| 6338 | id="eael-resetpassword-form" |
| 6339 | method="post"> |
| 6340 | <?php do_action( 'eael/login-register/after-resetpassword-form-open', $this ); ?> |
| 6341 | <div class="eael-lr-form-group <?php echo esc_attr( $hide_class_after_submission ); ?>"> |
| 6342 | <?php if ( $display_label && $password_label ) { |
| 6343 | printf( '<label for="eael-pass1" class="eael-field-label">%s</label>', esc_html( wp_strip_all_tags( $password_label ) ) ); |
| 6344 | } ?> |
| 6345 | <div class="eael-lr-password-wrapper eael-lr-resetpassword-wrapper eael-lr-resetpassword1-wrapper"> |
| 6346 | <input type="password" |
| 6347 | name="eael-pass1" |
| 6348 | id="eael-pass1" |
| 6349 | class="eael-lr-form-control" |
| 6350 | placeholder="<?php esc_html_e( wp_strip_all_tags( $password_placeholder ), 'essential-addons-for-elementor-lite' ); ?>" |
| 6351 | required> |
| 6352 | |
| 6353 | <?php if ( $show_pv_icon ) { ?> |
| 6354 | <button type="button" |
| 6355 | id="wp-hide-pw1" |
| 6356 | class="wp-hide-pw hide-if-no-js" |
| 6357 | aria-label="Show password"> |
| 6358 | <span class="dashicons dashicons-visibility" |
| 6359 | aria-hidden="true"></span> |
| 6360 | </button> |
| 6361 | <?php } ?> |
| 6362 | |
| 6363 | <?php |
| 6364 | if ( $show_icon ) { |
| 6365 | echo '<i class="fas fa-lock"></i>'; |
| 6366 | } ?> |
| 6367 | </div> |
| 6368 | </div> |
| 6369 | |
| 6370 | <div class="eael-lr-form-group <?php echo esc_attr( $hide_class_after_submission ); ?>"> |
| 6371 | <?php if ( $display_label && $confirm_password_label ) { |
| 6372 | printf( '<label for="eael-pass2" class="eael-field-label">%s</label>', esc_html( wp_strip_all_tags( $confirm_password_label ) ) ); |
| 6373 | } ?> |
| 6374 | <div class="eael-lr-password-wrapper eael-lr-resetpassword-wrapper eael-lr-resetpassword2-wrapper"> |
| 6375 | <input type="password" |
| 6376 | name="eael-pass2" |
| 6377 | id="eael-pass2" |
| 6378 | class="eael-lr-form-control" |
| 6379 | placeholder="<?php esc_html_e( wp_strip_all_tags( $confirm_password_placeholder ), 'essential-addons-for-elementor-lite' ); ?>" |
| 6380 | required> |
| 6381 | |
| 6382 | <?php if ( $show_pv_icon ) { ?> |
| 6383 | <button type="button" |
| 6384 | id="wp-hide-pw2" |
| 6385 | class="wp-hide-pw hide-if-no-js eael-d-none" |
| 6386 | aria-label="Show password"> |
| 6387 | <span class="dashicons dashicons-visibility" |
| 6388 | aria-hidden="true"></span> |
| 6389 | </button> |
| 6390 | <?php } ?> |
| 6391 | |
| 6392 | <?php |
| 6393 | if ( $show_icon ) { |
| 6394 | echo '<i class="fas fa-lock"></i>'; |
| 6395 | } ?> |
| 6396 | </div> |
| 6397 | </div> |
| 6398 | |
| 6399 | <?php |
| 6400 | do_action( 'eael/login-register/before-resetpassword-footer', $this ); |
| 6401 | ?> |
| 6402 | |
| 6403 | <div class="eael-lr-footer"> |
| 6404 | <input type="hidden" name="rp_key" value="<?php echo esc_attr( !empty( $rp_data['rp_key'] ) ? esc_html( $rp_data['rp_key'] ) : '' ); ?>" /> |
| 6405 | <input type="hidden" name="rp_login" value="<?php echo esc_attr( !empty( $rp_data['rp_login'] ) ? esc_html( $rp_data['rp_login'] ) : '' ); ?>" /> |
| 6406 | |
| 6407 | <input type="submit" |
| 6408 | name="eael-resetpassword-submit" |
| 6409 | id="eael-resetpassword-submit" |
| 6410 | class="eael-lr-btn eael-lr-btn-block <?php echo esc_attr( $btn_align ); ?> <?php echo esc_attr( $hide_class_after_submission ); ?>" |
| 6411 | value="<?php echo esc_html( wp_strip_all_tags( $btn_text ) ); ?>"/> |
| 6412 | </div> |
| 6413 | <?php do_action( 'eael/login-register/after-resetpassword-footer', $this ); |
| 6414 | ?> |
| 6415 | <div class="eael-form-validation-container"> |
| 6416 | <?php $this->print_resetpassword_validation_errors(); ?> |
| 6417 | </div> |
| 6418 | <?php |
| 6419 | $this->print_necessary_hidden_fields( 'resetpassword' ); |
| 6420 | |
| 6421 | $this->print_resetpassword_validation_errors(); |
| 6422 | |
| 6423 | do_action( 'eael/login-register/before-resetpassword-form-close', $this ); |
| 6424 | ?> |
| 6425 | </form> |
| 6426 | <?php do_action( 'eael/login-register/after-resetpassword-form', $this ); ?> |
| 6427 | </div> |
| 6428 | <?php |
| 6429 | if ( 'right' === $this->form_illustration_pos ) { |
| 6430 | $this->print_form_illustration('resetpassword'); |
| 6431 | } |
| 6432 | ?> |
| 6433 | </div> |
| 6434 | |
| 6435 | </section> |
| 6436 | <?php |
| 6437 | } |
| 6438 | } |
| 6439 | |
| 6440 | protected function print_form_illustration($form_type = 'login') { |
| 6441 | $show_form_image_class = ''; |
| 6442 | if( 'lostpassword' === $form_type || 'resetpassword' === $form_type ){ |
| 6443 | $show_form_image_class = ! empty( $this->ds['show_image_on_lostpassword_form'] ) && 'yes' === $this->ds['show_image_on_lostpassword_form'] ? '' : 'eael-d-none'; |
| 6444 | } |
| 6445 | |
| 6446 | if ( ! empty( $this->form_illustration_url ) ) { ?> |
| 6447 | <div class="lr-form-illustration lr-img-pos-<?php echo esc_attr( $this->form_illustration_pos ); ?> <?php echo esc_attr( $show_form_image_class ); ?>" |
| 6448 | style="background-image: url('<?php echo esc_attr( esc_url( $this->form_illustration_url ) ); ?>');"></div> |
| 6449 | <?php } |
| 6450 | } |
| 6451 | |
| 6452 | /** |
| 6453 | * @param string $form_type the type of form. Available values: login and register |
| 6454 | */ |
| 6455 | protected function print_form_header( $form_type = 'login' ) { |
| 6456 | $title = ! empty( $this->ds["{$form_type}_form_title"] ) ? esc_html__( wp_strip_all_tags( $this->ds["{$form_type}_form_title"] ), 'essential-addons-for-elementor-lite' ) : ''; |
| 6457 | $subtitle = ! empty( $this->ds["{$form_type}_form_subtitle"] ) ? HelperCLass::eael_wp_kses( $this->ds["{$form_type}_form_subtitle"] ) : ''; |
| 6458 | |
| 6459 | $show_form_logo_class = ''; |
| 6460 | if( 'lostpassword' === $form_type || 'resetpassword' === $form_type ){ |
| 6461 | $show_form_logo_class = ! empty( $this->ds['show_logo_on_lostpassword_form'] ) && 'yes' === $this->ds['show_logo_on_lostpassword_form'] ? '' : 'eael-d-none'; |
| 6462 | } |
| 6463 | |
| 6464 | if ( empty( $this->form_logo ) && empty( $title ) && empty( $subtitle ) ) { |
| 6465 | return; |
| 6466 | } |
| 6467 | |
| 6468 | ?> |
| 6469 | <div class="lr-form-header header-<?php echo esc_attr( $this->form_logo_pos ); ?>"> |
| 6470 | <?php if ( ! empty( $this->form_logo ) ) { ?> |
| 6471 | <div class="form-logo <?php echo esc_attr( $show_form_logo_class ); ?>"> |
| 6472 | <img src="<?php echo esc_attr( esc_url( $this->form_logo ) ); ?>" |
| 6473 | alt="<?php esc_attr_e( 'Form Logo Image', 'essential-addons-for-elementor-lite' ); ?>"> |
| 6474 | </div> |
| 6475 | <?php } ?> |
| 6476 | |
| 6477 | <?php if ( ! empty( $title ) || ! empty( $subtitle ) ) { ?> |
| 6478 | <div class="form-dsc"> |
| 6479 | <?php |
| 6480 | if ( ! empty( $title ) ) { |
| 6481 | echo "<h4>{$title}</h4>"; // data escaped already. |
| 6482 | } |
| 6483 | |
| 6484 | if ( ! empty( $subtitle ) ) { |
| 6485 | echo "<p>{$subtitle}</p>"; // data escaped already. |
| 6486 | } ?> |
| 6487 | </div> |
| 6488 | <?php } ?> |
| 6489 | </div> |
| 6490 | <?php |
| 6491 | } |
| 6492 | |
| 6493 | protected function print_necessary_hidden_fields( $form_type = 'login' ) { |
| 6494 | if ( 'login' === $form_type ) { |
| 6495 | if ( ! empty( $this->ds['redirect_after_login'] ) && 'yes' === $this->ds['redirect_after_login'] ) { |
| 6496 | ?> |
| 6497 | <input type="hidden" |
| 6498 | name="redirect_to" |
| 6499 | value="<?php echo esc_attr( $this->login_custom_redirect_url ); ?>"> |
| 6500 | <?php } |
| 6501 | |
| 6502 | if ( ! empty( $this->ds['redirect_based_on_roles'] ) && 'yes' === $this->ds['redirect_based_on_roles'] ) { |
| 6503 | $user_roles = $this->eael_get_role_names(); |
| 6504 | |
| 6505 | if( ! empty( $user_roles ) && is_array( $user_roles ) && count( $user_roles ) ){ |
| 6506 | foreach( $user_roles as $user_role_key => $user_role_value ){ |
| 6507 | $login_redirect_url = ! empty( $this->ds['redirect_url_' . esc_html( $user_role_key ) ]['url'] ) ? esc_url( $this->ds['redirect_url_' . esc_html( $user_role_key )]['url'] ) : $login_redirect_url; |
| 6508 | ?> |
| 6509 | <input type="hidden" |
| 6510 | name="redirect_to_<?php echo esc_html( $user_role_key ); ?>" |
| 6511 | value="<?php echo esc_attr( $login_redirect_url ); ?>"> |
| 6512 | <?php |
| 6513 | } |
| 6514 | } |
| 6515 | } |
| 6516 | } |
| 6517 | |
| 6518 | if ( 'resetpassword' === $form_type ) { |
| 6519 | if ( ! empty( $this->ds['redirect_after_resetpassword'] ) && 'yes' === $this->ds['redirect_after_resetpassword'] ) { |
| 6520 | $resetpassword_redirect_url = ! empty( $this->ds['redirect_url_resetpassword']['url'] ) ? esc_url( $this->ds['redirect_url_resetpassword']['url'] ) : ''; |
| 6521 | ?> |
| 6522 | <input type="hidden" |
| 6523 | name="resetpassword_redirect_to" |
| 6524 | value="<?php echo esc_attr( $resetpassword_redirect_url ); ?>"> |
| 6525 | <?php } |
| 6526 | } |
| 6527 | |
| 6528 | // add login security nonce |
| 6529 | wp_nonce_field( "eael-{$form_type}-action", "eael-{$form_type}-nonce" ); |
| 6530 | ?> |
| 6531 | <input type="hidden" |
| 6532 | name="page_id" |
| 6533 | value="<?php echo esc_attr( $this->page_id ); ?>"> |
| 6534 | <input type="hidden" |
| 6535 | name="page_id_for_popup" |
| 6536 | value="<?php echo esc_attr( ! empty( $this->page_id_for_popup ) ? $this->page_id_for_popup : $this->page_id ); ?>"> |
| 6537 | <input type="hidden" |
| 6538 | name="resetpassword_in_popup_selector" |
| 6539 | value="<?php echo esc_attr( ! empty( $this->resetpassword_in_popup_selector ) ? $this->resetpassword_in_popup_selector : '' ); ?>"> |
| 6540 | <input type="hidden" |
| 6541 | name="widget_id" |
| 6542 | value="<?php echo esc_attr( $this->get_id() ); ?>"> |
| 6543 | <?php |
| 6544 | } |
| 6545 | |
| 6546 | protected function print_terms_condition_notice() { |
| 6547 | if ( empty( $this->ds['show_terms_conditions'] ) || 'yes' !== $this->ds['show_terms_conditions'] ) { |
| 6548 | return; |
| 6549 | } |
| 6550 | $l = isset( $this->ds['acceptance_label'] ) ? HelperCLass::eael_wp_kses($this->ds['acceptance_label']) : ''; |
| 6551 | $parts = explode( "\n", $l ); |
| 6552 | $label = array_shift( $parts ); |
| 6553 | $link_text = array_pop( $parts ); |
| 6554 | $source = isset( $this->ds['acceptance_text_source'] ) ? $this->ds['acceptance_text_source'] : 'editor'; |
| 6555 | $tc_text = isset( $this->ds['acceptance_text'] ) ? $this->ds['acceptance_text'] : ''; |
| 6556 | $tc_link = '<a href="#" id="eael-lr-tnc-link" class="eael-lr-tnc-link">' . esc_html( $link_text ) . '</a>'; |
| 6557 | if ( 'custom' === $source ) { |
| 6558 | $tc_url = ! empty( $this->ds['acceptance_text_url']['url'] ) ? esc_url( $this->ds['acceptance_text_url']['url'] ) : esc_url( get_the_permalink( get_option( 'wp_page_for_privacy_policy' ) ) ); |
| 6559 | $tc_atts = ! empty( $this->ds['acceptance_text_url']['is_external'] ) ? ' target="_blank"' : ''; |
| 6560 | $tc_atts .= ! empty( $this->ds['acceptance_text_url']['nofollow'] ) ? ' rel="nofollow"' : ''; |
| 6561 | $tc_link = sprintf( '<a href="%1$s" id="eael-lr-tnc-link" class="eael-lr-tnc-link" %2$s>%3$s</a>', esc_attr( $tc_url ), $tc_atts, $link_text ); |
| 6562 | } |
| 6563 | $lrtoggle = ! empty( $this->ds['eael_terms_conditions_field_type'] ) && 'toggle' === $this->ds['eael_terms_conditions_field_type'] ? 'lr-toggle' : ''; |
| 6564 | ?> |
| 6565 | <div class="eael_accept_tnc_wrap"> |
| 6566 | <input type="hidden" |
| 6567 | name="eael_tnc_active" |
| 6568 | value="1"> |
| 6569 | <input type="checkbox" |
| 6570 | name="eael_accept_tnc" |
| 6571 | class="eael_accept_tnc <?php echo esc_attr($lrtoggle); ?>" |
| 6572 | value="1" |
| 6573 | id="eael_accept_tnc"> |
| 6574 | <label for="eael_accept_tnc" |
| 6575 | class="eael-checkbox-label check-accept"> |
| 6576 | <?php |
| 6577 | echo esc_html( $label ); |
| 6578 | ?> |
| 6579 | </label> |
| 6580 | <?php |
| 6581 | echo $tc_link; // XSS ok. already sanitized. |
| 6582 | ?> |
| 6583 | </div> |
| 6584 | |
| 6585 | <?php |
| 6586 | $tc = '<div class="eael-lr-tnc-wrap">'; |
| 6587 | $tc .= $this->parse_text_editor( $tc_text ); |
| 6588 | $tc .= '</div>'; |
| 6589 | echo $tc; |
| 6590 | |
| 6591 | |
| 6592 | } |
| 6593 | |
| 6594 | protected function print_login_validation_errors() { |
| 6595 | $error_key = 'eael_login_error_' . $this->get_id(); |
| 6596 | $resetpassword_success_key = 'eael_resetpassword_success_' . $this->get_id(); |
| 6597 | $resetpassword_success = apply_filters( 'eael/login-register/resetpassword-success-message', get_option( $resetpassword_success_key ) ); |
| 6598 | |
| 6599 | if ( $login_error = apply_filters( 'eael/login-register/login-error-message', get_option( $error_key ) ) ) { |
| 6600 | do_action( 'eael/login-register/before-showing-login-error', $login_error, $this ); |
| 6601 | ?> |
| 6602 | <p class="eael-form-msg invalid"> |
| 6603 | <?php echo HelperCLass::eael_wp_kses( $login_error ); ?> |
| 6604 | </p> |
| 6605 | <?php |
| 6606 | do_action( 'eael/login-register/after-showing-login-error', $login_error, $this ); |
| 6607 | |
| 6608 | delete_option( $error_key ); |
| 6609 | } else if( ! empty( $resetpassword_success ) && 'register' !== $this->ds['default_form_type'] ){ |
| 6610 | $this->print_resetpassword_success_message( $resetpassword_success ); |
| 6611 | } |
| 6612 | } |
| 6613 | |
| 6614 | protected function print_lostpassword_validation_errors() { |
| 6615 | $error_key = 'eael_lostpassword_error_' . esc_attr( $this->get_id() ); |
| 6616 | $error_key_show = $error_key . '_show'; |
| 6617 | |
| 6618 | $success_key = 'eael_lostpassword_success_' . esc_attr( $this->get_id() ); |
| 6619 | |
| 6620 | if ( intval( get_option( $error_key_show ) ) ) { |
| 6621 | $rp_err_msg = isset( $this->ds['err_reset_password_key_expired'] ) ? esc_html__( $this->ds['err_reset_password_key_expired'], 'essential-addons-for-elementor-lite' ) : esc_html__( 'Hey Your password reset link appears to be invalid. Please request a new link.', 'essential-addons-for-elementor-lite' ); |
| 6622 | ?> |
| 6623 | <p class="eael-form-msg invalid"> |
| 6624 | <?php echo esc_html__( $rp_err_msg, 'essential-addons-for-elementor-lite' ); ?> |
| 6625 | </p> |
| 6626 | <?php |
| 6627 | delete_option( $error_key_show ); |
| 6628 | } |
| 6629 | |
| 6630 | if ( $lostpassword_error = apply_filters( 'eael/login-register/lostpassword-error-message', get_option( $error_key ) ) ) { |
| 6631 | do_action( 'eael/login-register/before-showing-lostpassword-error', $lostpassword_error, $this ); |
| 6632 | ?> |
| 6633 | <p class="eael-form-msg invalid"> |
| 6634 | <?php echo esc_html( $lostpassword_error ); ?> |
| 6635 | </p> |
| 6636 | <?php |
| 6637 | do_action( 'eael/login-register/after-showing-login-error', $lostpassword_error, $this ); |
| 6638 | |
| 6639 | delete_option( $error_key ); |
| 6640 | } |
| 6641 | |
| 6642 | if ( $lostpassword_success = apply_filters( 'eael/login-register/lostpassword-success-message', get_option( $success_key ) ) ) { |
| 6643 | do_action( 'eael/login-register/before-showing-lostpassword-success', $lostpassword_success, $this ); |
| 6644 | ?> |
| 6645 | <p class="eael-form-msg valid"> |
| 6646 | <?php echo esc_html( $lostpassword_success ); ?> |
| 6647 | </p> |
| 6648 | <?php |
| 6649 | do_action( 'eael/login-register/after-showing-login-success', $lostpassword_success, $this ); |
| 6650 | |
| 6651 | delete_option( $success_key ); |
| 6652 | } |
| 6653 | } |
| 6654 | |
| 6655 | protected function print_resetpassword_validation_errors() { |
| 6656 | $error_key = 'eael_resetpassword_error_' . $this->get_id(); |
| 6657 | |
| 6658 | if ( $resetpassword_error = apply_filters( 'eael/login-register/resetpassword-error-message', maybe_unserialize( get_option( $error_key ) ) ) ) { |
| 6659 | do_action( 'eael/login-register/before-showing-resetpassword-error', $resetpassword_error, $this ); |
| 6660 | ?> |
| 6661 | <div class="eael-form-msg invalid"> |
| 6662 | <?php |
| 6663 | if( is_array( $resetpassword_error ) ) { |
| 6664 | if( count( $resetpassword_error ) ){ |
| 6665 | echo "<ol>"; |
| 6666 | foreach( $resetpassword_error as $error ) { |
| 6667 | echo "<li>" . esc_html( $error ) . "</li>"; |
| 6668 | } |
| 6669 | echo "</ol>"; |
| 6670 | } |
| 6671 | } else { |
| 6672 | echo esc_html( $resetpassword_error ); |
| 6673 | } |
| 6674 | ?> |
| 6675 | </div> |
| 6676 | <?php |
| 6677 | do_action( 'eael/login-register/after-showing-login-error', $resetpassword_error, $this ); |
| 6678 | |
| 6679 | delete_option( $error_key ); |
| 6680 | } |
| 6681 | } |
| 6682 | |
| 6683 | protected function print_recaptcha_node( $form_type = 'login' ) { |
| 6684 | if ( 'yes' === $this->get_settings_for_display( "enable_{$form_type}_recaptcha" ) && 'v3' !== $this->ds["login_register_recaptcha_version"] ) { |
| 6685 | $id = "{$form_type}-recaptcha-node-" . $this->get_id(); |
| 6686 | echo "<input type='hidden' name='g-recaptcha-enabled' value='1'/><div id='{$id}' class='eael-recaptcha-wrapper'></div>"; |
| 6687 | } |
| 6688 | } |
| 6689 | |
| 6690 | protected function print_error_for_repeated_fields( $repeated_fields ) { |
| 6691 | if ( ! empty( $repeated_fields ) ) { |
| 6692 | $error_fields = '<strong>' . implode( "</strong>, <strong>", $repeated_fields ) . '</strong>'; |
| 6693 | ?> |
| 6694 | <p class='eael-register-form-error elementor-alert elementor-alert-warning'> |
| 6695 | <?php |
| 6696 | /* translators: %s: Error fields */ |
| 6697 | printf( __( 'Error! you seem to have added %s field in the form more than once.', 'essential-addons-for-elementor-lite' ), $error_fields ); |
| 6698 | ?> |
| 6699 | </p> |
| 6700 | <?php |
| 6701 | return true; |
| 6702 | } |
| 6703 | |
| 6704 | return false; |
| 6705 | } |
| 6706 | |
| 6707 | protected function print_error_for_missing_email_field( $email_exist ) { |
| 6708 | if ( empty( $email_exist ) ) { |
| 6709 | ?> |
| 6710 | <p class='eael-register-form-error elementor-alert elementor-alert-warning'> |
| 6711 | <?php |
| 6712 | /* translators: %s: Error String */ |
| 6713 | printf( __( 'Error! It is required to use %s field.', 'essential-addons-for-elementor-lite' ), '<strong>Email</strong>' ); |
| 6714 | ?> |
| 6715 | </p> |
| 6716 | <?php |
| 6717 | return true; |
| 6718 | } |
| 6719 | |
| 6720 | return false; |
| 6721 | } |
| 6722 | |
| 6723 | /** |
| 6724 | * It shows error if Confirm Password Field is used without using Password Field. |
| 6725 | * |
| 6726 | * @param $password_exist |
| 6727 | * @param $confirm_pass_exist |
| 6728 | * |
| 6729 | * @return bool |
| 6730 | */ |
| 6731 | protected function print_error_for_missing_password_field( $password_exist, $confirm_pass_exist ) { |
| 6732 | if ( empty( $password_exist ) && ! empty( $confirm_pass_exist ) ) { |
| 6733 | ?> |
| 6734 | <p class='eael-register-form-error elementor-alert elementor-alert-warning'> |
| 6735 | <?php |
| 6736 | /* translators: %s: Error String */ |
| 6737 | printf( __( 'Error! It is required to use %s field with %s Field.', 'essential-addons-for-elementor-lite' ), '<strong>Password</strong>', '<strong>Password Confirmation</strong>' ); |
| 6738 | ?> |
| 6739 | </p> |
| 6740 | <?php |
| 6741 | return true; |
| 6742 | } |
| 6743 | |
| 6744 | return false; |
| 6745 | } |
| 6746 | |
| 6747 | protected function print_validation_message() { |
| 6748 | $errors = get_option( 'eael_register_errors_' . $this->get_id() ); |
| 6749 | $success = get_option( 'eael_register_success_' . $this->get_id() ); |
| 6750 | $resetpassword_success_key = 'eael_resetpassword_success_' . $this->get_id(); |
| 6751 | $resetpassword_success = apply_filters( 'eael/login-register/resetpassword-success-message', get_option( $resetpassword_success_key ) ); |
| 6752 | |
| 6753 | if ( empty( $errors ) && empty( $success ) && empty( $resetpassword_success ) ) { |
| 6754 | return; |
| 6755 | } |
| 6756 | if ( ! empty( $errors ) && is_array( $errors ) ) { |
| 6757 | $this->print_registration_errors_message( $errors ); |
| 6758 | } else if( ! empty ( $success ) ) { |
| 6759 | $this->print_registration_success_message( $success ); |
| 6760 | } else if( !empty( $resetpassword_success ) && 'register' === $this->ds['default_form_type'] ){ |
| 6761 | $this->print_resetpassword_success_message( $resetpassword_success ); |
| 6762 | } |
| 6763 | } |
| 6764 | |
| 6765 | protected function print_registration_errors_message( $errors ) { |
| 6766 | ?> |
| 6767 | <div class="eael-form-msg invalid"> |
| 6768 | <?php |
| 6769 | if ( ! empty( $this->ds['err_unknown'] ) ) { |
| 6770 | // printf( '<p>%s</p>', esc_html( $this->ds['err_unknown'] ) ); |
| 6771 | } |
| 6772 | ?> |
| 6773 | <ol> |
| 6774 | <?php |
| 6775 | foreach ( $errors as $register_error ) { |
| 6776 | printf( '<li>%s</li>', esc_html( $register_error ) ); |
| 6777 | } |
| 6778 | ?> |
| 6779 | </ol> |
| 6780 | </div> |
| 6781 | <?php |
| 6782 | delete_option( 'eael_register_errors_' . $this->get_id() ); |
| 6783 | } |
| 6784 | |
| 6785 | protected function print_registration_success_message( $success ) { |
| 6786 | |
| 6787 | if ( $success ) { |
| 6788 | $message = '<p class="eael-form-msg valid">' . esc_html( $this->get_settings_for_display( 'success_register' ) ) . '</p>'; |
| 6789 | echo apply_filters( 'eael/login-register/registration-success-msg', $message, $success ); |
| 6790 | |
| 6791 | delete_option( 'eael_register_success_' . $this->get_id() ); |
| 6792 | |
| 6793 | return true; // it will help in case we wanna know if error is printed. |
| 6794 | } |
| 6795 | |
| 6796 | return false; |
| 6797 | } |
| 6798 | |
| 6799 | protected function print_resetpassword_success_message( $resetpassword_success ) { |
| 6800 | $resetpassword_success_key = 'eael_resetpassword_success_' . $this->get_id(); |
| 6801 | |
| 6802 | do_action( 'eael/login-register/before-showing-resetpassword-success', $resetpassword_success, $this ); |
| 6803 | ?> |
| 6804 | <div class="eael-form-msg valid"> |
| 6805 | <?php |
| 6806 | echo esc_html( $resetpassword_success ); |
| 6807 | ?> |
| 6808 | </div> |
| 6809 | <?php |
| 6810 | do_action( 'eael/login-register/after-showing-resetpassword-success', $resetpassword_success, $this ); |
| 6811 | |
| 6812 | delete_option( $resetpassword_success_key ); |
| 6813 | } |
| 6814 | |
| 6815 | /** |
| 6816 | * It will apply value like Elementor's dimension control to a property and return it. |
| 6817 | * |
| 6818 | * @param string $css_property CSS property name |
| 6819 | * |
| 6820 | * @return string |
| 6821 | */ |
| 6822 | public function apply_dim( $css_property ) { |
| 6823 | return "{$css_property}: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};"; |
| 6824 | } |
| 6825 | |
| 6826 | } |