| 1 |
<?php |
| 2 |
defined('ABSPATH') || exit; |
| 3 |
|
| 4 |
/** |
| 5 |
* Module Name: Login |
| 6 |
* Description: Displays login form |
| 7 |
*/ |
| 8 |
class TB_Login_Module extends Themify_Builder_Component_Module { |
| 9 |
|
| 10 |
public static function get_module_name():string { |
| 11 |
return __('Login', 'themify'); |
| 12 |
} |
| 13 |
|
| 14 |
public static function get_module_icon():string { |
| 15 |
return 'unlock'; |
| 16 |
} |
| 17 |
|
| 18 |
public static function get_js_css():array { |
| 19 |
$_arr = array( |
| 20 |
'css' => 1 |
| 21 |
); |
| 22 |
if (!Themify_Builder_Model::is_front_builder_activate()) { |
| 23 |
$_arr['js'] = 1; |
| 24 |
} |
| 25 |
return $_arr; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Render plain content for static content. |
| 30 |
* |
| 31 |
* @param array $module |
| 32 |
* @return string |
| 33 |
*/ |
| 34 |
public static function get_static_content(array $module):string { |
| 35 |
return sprintf( __( '<a href="%s" target="_blank">Click here to Login</a>', 'themify' ), esc_url( wp_login_url() ) ); |
| 36 |
} |
| 37 |
|
| 38 |
public static function get_styling_image_fields() : array { |
| 39 |
return [ |
| 40 |
'b_i' => '' |
| 41 |
]; |
| 42 |
} |
| 43 |
|
| 44 |
public static function get_translatable_text_fields( $module ) : array { |
| 45 |
return [ 'mod_title', 'label_username', 'label_password', 'label_remember', 'label_log_in', 'label_forgotten_password', 'lostpasswordform_label_username', 'lostpasswordform_label_reset' ]; |
| 46 |
} |
| 47 |
|
| 48 |
public static function get_translatable_textarea_fields( $module ) : array { |
| 49 |
return [ 'content_text', 'msg_fail' ]; |
| 50 |
} |
| 51 |
|
| 52 |
public static function get_translatable_link_fields( $module ) : array { |
| 53 |
return [ 'redirect_to', 'redirect_fail', 'lostpasswordform_redirect_to' ]; |
| 54 |
} |
| 55 |
} |