| 1 |
<?php |
| 2 |
namespace Elementor; |
| 3 |
|
| 4 |
class LP_Elementor_Widget_Login_Form extends LP_Elementor_Widget_Base { |
| 5 |
|
| 6 |
public function get_name() { |
| 7 |
return 'learnpress_login_form'; |
| 8 |
} |
| 9 |
|
| 10 |
public function get_title() { |
| 11 |
return esc_html__( 'Login Form', 'learnpress' ); |
| 12 |
} |
| 13 |
|
| 14 |
public function get_keywords() { |
| 15 |
return array( 'learnpress', 'login' ); |
| 16 |
} |
| 17 |
|
| 18 |
public function get_icon() { |
| 19 |
return 'eicon-lock-user'; |
| 20 |
} |
| 21 |
|
| 22 |
protected function register_controls() { |
| 23 |
$this->register_control_style_form_title( '.learn-press-form-login h3' ); |
| 24 |
$this->register_control_style_form_field( '.learn-press-form-login', '.form-field' ); |
| 25 |
$this->register_control_style_form_button( '.learn-press-form-login button[type="submit"]' ); |
| 26 |
$this->register_control_style_message(); |
| 27 |
} |
| 28 |
|
| 29 |
public function render() { |
| 30 |
if ( 'yes' !== \LP_Settings::get_option( 'enable_login_profile', 'no' ) ) { |
| 31 |
learn_press_display_message( __( 'Login form is disabled', 'learnpress' ), 'error' ); |
| 32 |
} |
| 33 |
|
| 34 |
if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) { |
| 35 |
learn_press_get_template( 'global/form-login.php' ); |
| 36 |
} else { |
| 37 |
echo LP()->template( 'profile' )->login_form(); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|