analytics
1 day ago
home
1 day ago
apply_for_instructor.php
1 day ago
dashboard-empty.php
1 day ago
home.php
1 day ago
instructor-request-alert.php
1 day ago
logged-in.php
1 day ago
profile-statistics.php
1 day ago
registration.php
1 day ago
registration.php
169 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Registration template |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage Dashboard\Instructor |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.4.3 |
| 10 | */ |
| 11 | |
| 12 | use Tutor\Components\Alert; |
| 13 | use Tutor\Components\SvgIcon; |
| 14 | use Tutor\GDPR\Controllers\LegalConsent; |
| 15 | use TUTOR\Icon; |
| 16 | |
| 17 | ?> |
| 18 | |
| 19 | <?php if ( ! get_option( 'users_can_register', false ) ) : ?> |
| 20 | <?php |
| 21 | $args = array( |
| 22 | 'image_path' => tutor()->url . 'assets/images/construction.png', |
| 23 | 'title' => __( 'Ooh! Access Denied', 'tutor' ), |
| 24 | 'description' => __( 'You do not have access to this area of the application. Please refer to your system administrator.', 'tutor' ), |
| 25 | 'button' => array( |
| 26 | 'text' => __( 'Go to Home', 'tutor' ), |
| 27 | 'url' => get_home_url(), |
| 28 | 'class' => 'tutor-btn', |
| 29 | ), |
| 30 | ); |
| 31 | tutor_load_template( 'feature_disabled', $args ); |
| 32 | ?> |
| 33 | <?php else : ?> |
| 34 | |
| 35 | <div id="tutor-registration-wrap" class="tutor-card" style="max-width: 520px; margin: 40px auto;"> |
| 36 | |
| 37 | <?php do_action( 'tutor_before_instructor_reg_form' ); ?> |
| 38 | |
| 39 | <form method="post" enctype="multipart/form-data" id="tutor-registration-form"> |
| 40 | |
| 41 | <?php do_action( 'tutor_instructor_reg_form_start' ); ?> |
| 42 | |
| 43 | <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?> |
| 44 | <input type="hidden" value="tutor_register_instructor" name="tutor_action"/> |
| 45 | |
| 46 | <?php |
| 47 | $errors = apply_filters( 'tutor_instructor_register_validation_errors', array() ); //phpcs:ignore |
| 48 | if ( is_array( $errors ) && count( $errors ) ) : |
| 49 | foreach ( $errors as $error_key => $error_value ) : |
| 50 | Alert::make() |
| 51 | ->text( $error_value ) |
| 52 | ->variant( Alert::ERROR ) |
| 53 | ->icon( Icon::WARNING ) |
| 54 | ->attr( 'class', 'tutor-mb-8' ) |
| 55 | ->render(); |
| 56 | endforeach; |
| 57 | endif; |
| 58 | ?> |
| 59 | <div class="tutor-input-field tutor-mb-8"> |
| 60 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'First Name', 'tutor' ); ?></label> |
| 61 | <input class="tutor-form-control tutor-input" type="text" name="first_name" value="<?php echo esc_attr( tutor_utils()->input_old( 'first_name' ) ); ?>" placeholder="<?php esc_html_e( 'First Name', 'tutor' ); ?>" required autocomplete="given-name"> |
| 62 | </div> |
| 63 | |
| 64 | <div class="tutor-input-field tutor-mb-8"> |
| 65 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Last Name', 'tutor' ); ?></label> |
| 66 | <input class="tutor-form-control tutor-input" type="text" name="last_name" value="<?php echo esc_attr( tutor_utils()->input_old( 'last_name' ) ); ?>" placeholder="<?php esc_html_e( 'Last Name', 'tutor' ); ?>" required autocomplete="family-name"> |
| 67 | </div> |
| 68 | |
| 69 | <div class="tutor-input-field tutor-mb-8"> |
| 70 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'User Name', 'tutor' ); ?></label> |
| 71 | <input class="tutor-form-control tutor-input" type="text" name="user_login" value="<?php echo esc_attr( tutor_utils()->input_old( 'user_login' ) ); ?>" placeholder="<?php esc_html_e( 'User Name', 'tutor' ); ?>" required autocomplete="username"> |
| 72 | </div> |
| 73 | |
| 74 | <div class="tutor-input-field tutor-mb-8"> |
| 75 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'E-Mail', 'tutor' ); ?></label> |
| 76 | <input class="tutor-form-control tutor-input" type="text" name="email" value="<?php echo esc_attr( tutor_utils()->input_old( 'email' ) ); ?>" placeholder="<?php esc_html_e( 'E-Mail', 'tutor' ); ?>" required autocomplete="email"> |
| 77 | </div> |
| 78 | |
| 79 | <div class="tutor-password-strength-checker tutor-mb-8" x-data="{ show: false, value: '<?php echo esc_attr( tutor_utils()->input_old( 'password' ) ); ?>' }"> |
| 80 | <div class="tutor-input-field"> |
| 81 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Password', 'tutor' ); ?></label> |
| 82 | <div class="tutor-form-wrap" style="position: relative;"> |
| 83 | <span |
| 84 | class="tutor-flex" |
| 85 | style="position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; z-index: 1;" |
| 86 | x-show="value.length > 0" |
| 87 | @click="show = !show" |
| 88 | > |
| 89 | <template x-if="!show"> |
| 90 | <?php SvgIcon::make()->name( Icon::EYE )->size( 20 )->render(); ?> |
| 91 | </template> |
| 92 | <template x-if="show"> |
| 93 | <?php SvgIcon::make()->name( Icon::EYE_OFF )->size( 20 )->render(); ?> |
| 94 | </template> |
| 95 | </span> |
| 96 | <input |
| 97 | class="tutor-form-control tutor-input" |
| 98 | id="tutor-new-password" |
| 99 | :type="show ? 'text' : 'password'" |
| 100 | name="password" |
| 101 | x-model="value" |
| 102 | placeholder="<?php esc_html_e( 'Password', 'tutor' ); ?>" |
| 103 | required |
| 104 | autocomplete="new-password" |
| 105 | > |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | |
| 110 | <div class="tutor-input-field tutor-mb-8"> |
| 111 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Password confirmation', 'tutor' ); ?></label> |
| 112 | <div class="tutor-form-wrap"> |
| 113 | <input |
| 114 | class="tutor-form-control tutor-input" |
| 115 | type="password" |
| 116 | name="password_confirmation" |
| 117 | placeholder="<?php esc_html_e( 'Password Confirmation', 'tutor' ); ?>" |
| 118 | required |
| 119 | autocomplete="new-password" |
| 120 | > |
| 121 | </div> |
| 122 | </div> |
| 123 | |
| 124 | <div class="tutor-form-row"> |
| 125 | <div class="tutor-form-col-12"> |
| 126 | <div class="tutor-form-group"> |
| 127 | <?php |
| 128 | // Providing register_form hook. |
| 129 | do_action( 'tutor_instructor_reg_form_middle' ); |
| 130 | do_action( 'register_form' ); |
| 131 | ?> |
| 132 | </div> |
| 133 | </div> |
| 134 | </div> |
| 135 | |
| 136 | <?php do_action( 'tutor_instructor_reg_form_end' ); ?> |
| 137 | |
| 138 | <?php |
| 139 | $tutor_toc_page_link = tutor_utils()->get_toc_page_link(); |
| 140 | $consents = LegalConsent::get_consent_by_display_key( LegalConsent::DISPLAY_ON_INS_REG ); |
| 141 | if ( tutor_utils()->count( $consents ) ) : |
| 142 | ?> |
| 143 | <?php foreach ( $consents as $consent ) : ?> |
| 144 | <?php LegalConsent::render_consent_field( $consent, 'tutor-mb-8' ); ?> |
| 145 | <?php endforeach; ?> |
| 146 | <?php else : ?> |
| 147 | <?php if ( $tutor_toc_page_link ) : ?> |
| 148 | <div class="tutor-form-row tutor-mb-8"> |
| 149 | <div class="tutor-input-field"> |
| 150 | <div class="tutor-input-wrapper"> |
| 151 | <input type="checkbox" id="tutor-terms-conditions" name="terms_conditions" class="tutor-checkbox" required> |
| 152 | <label for="tutor-terms-conditions" class="tutor-label"> |
| 153 | <?php esc_html_e( 'By signing up, you agree to the ', 'tutor' ); ?> <a target="_blank" href="<?php echo esc_url( $tutor_toc_page_link ); ?>" title="<?php esc_html_e( 'Terms and Conditions', 'tutor' ); ?>"><?php esc_html_e( 'Terms and Conditions', 'tutor' ); ?></a> |
| 154 | </label> |
| 155 | </div> |
| 156 | </div> |
| 157 | </div> |
| 158 | <?php endif; ?> |
| 159 | <?php endif; ?> |
| 160 | |
| 161 | <button type="submit" name="tutor_register_instructor_btn" value="register" class="tutor-btn tutor-btn-primary tutor-btn-block"><?php esc_html_e( 'Register as instructor', 'tutor' ); ?></button> |
| 162 | <?php do_action( 'tutor_after_register_button' ); ?> |
| 163 | |
| 164 | </form> |
| 165 | <?php do_action( 'tutor_after_registration_form_wrap' ); ?> |
| 166 | </div> |
| 167 | |
| 168 | <?php do_action( 'tutor_after_instructor_reg_form' ); ?> |
| 169 | <?php endif; ?> |