account
1 day ago
components
1 day ago
courses
1 day ago
discussions
1 day ago
elements
1 day ago
instructor
1 day ago
my-courses
1 year ago
my-quiz-attempts
1 day ago
quiz-attempts
1 day ago
student
1 day ago
wishlist
1 day ago
announcements.php
1 day ago
courses.php
1 day ago
create-course.php
1 day ago
dashboard.php
1 day ago
discussions.php
1 day ago
index.php
3 years ago
logged-in.php
3 years ago
my-courses.php
1 day ago
my-quiz-attempts.php
1 day ago
quiz-attempts.php
1 day ago
registration.php
1 day ago
wishlist.php
1 day ago
registration.php
190 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Tutor registration template |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage Dashboard |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.4.3 |
| 10 | */ |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | use Tutor\Components\Alert; |
| 15 | use Tutor\Components\SvgIcon; |
| 16 | use Tutor\GDPR\Controllers\LegalConsent; |
| 17 | use TUTOR\Icon; |
| 18 | |
| 19 | ?> |
| 20 | |
| 21 | <?php if ( ! get_option( 'users_can_register', false ) ) : ?> |
| 22 | <?php |
| 23 | $args = array( |
| 24 | 'image_path' => tutor()->url . 'assets/images/construction.png', |
| 25 | 'title' => __( 'Oooh! Access Denied', 'tutor' ), |
| 26 | 'description' => __( 'You do not have access to this area of the application. Please refer to your system administrator.', 'tutor' ), |
| 27 | 'button' => array( |
| 28 | 'text' => __( 'Go to Home', 'tutor' ), |
| 29 | 'url' => get_home_url(), |
| 30 | 'class' => 'tutor-btn', |
| 31 | ), |
| 32 | ); |
| 33 | tutor_load_template( 'feature_disabled', $args ); |
| 34 | ?> |
| 35 | <?php else : ?> |
| 36 | <div id="tutor-registration-wrap" class="tutor-card tutor-p-none tutor-py-9" style="max-width: 520px; margin: 0px auto;"> |
| 37 | |
| 38 | <?php do_action( 'tutor_before_student_reg_form' ); ?> |
| 39 | |
| 40 | <form method="post" enctype="multipart/form-data" id="tutor-registration-form" class="tutor-p-8"> |
| 41 | <input type="hidden" name="tutor_course_enroll_attempt" value="<?php echo isset( $_GET['enrol_course_id'] ) ? (int) $_GET['enrol_course_id'] : ''; ?>"> |
| 42 | <?php do_action( 'tutor_student_reg_form_start' ); ?> |
| 43 | |
| 44 | <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?> |
| 45 | <input type="hidden" value="tutor_register_student" name="tutor_action"/> |
| 46 | |
| 47 | <?php |
| 48 | $validation_errors = apply_filters( 'tutor_student_register_validation_errors', array() ); |
| 49 | if ( is_array( $validation_errors ) && count( $validation_errors ) ) : |
| 50 | foreach ( $validation_errors as $validation_error ) : |
| 51 | Alert::make() |
| 52 | ->text( $validation_error ) |
| 53 | ->variant( Alert::ERROR ) |
| 54 | ->icon( Icon::WARNING ) |
| 55 | ->attr( 'class', 'tutor-mb-8' ) |
| 56 | ->render(); |
| 57 | endforeach; |
| 58 | endif; |
| 59 | ?> |
| 60 | <div class="tutor-form-group"> |
| 61 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'First Name', 'tutor' ); ?></label> |
| 62 | <div class="tutor-input-field tutor-mb-8"> |
| 63 | <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_attr_e( 'First Name', 'tutor' ); ?>" required autocomplete="given-name"> |
| 64 | </div> |
| 65 | </div> |
| 66 | |
| 67 | <div class="tutor-form-group"> |
| 68 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Last Name', 'tutor' ); ?></label> |
| 69 | <div class="tutor-input-field tutor-mb-8"> |
| 70 | <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_attr_e( 'Last Name', 'tutor' ); ?>" required autocomplete="family-name"> |
| 71 | </div> |
| 72 | </div> |
| 73 | |
| 74 | <div class="tutor-form-group"> |
| 75 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'User Name', 'tutor' ); ?></label> |
| 76 | <div class="tutor-input-field tutor-mb-8"> |
| 77 | <input class="tutor-form-control tutor-input" type="text" name="user_login" class="tutor_user_name" value="<?php echo esc_attr( tutor_utils()->input_old( 'user_login' ) ); ?>" placeholder="<?php esc_html_e( 'User Name', 'tutor' ); ?>" required autocomplete="username"> |
| 78 | </div> |
| 79 | </div> |
| 80 | |
| 81 | <div class="tutor-form-group"> |
| 82 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'E-Mail', 'tutor' ); ?></label> |
| 83 | <div class="tutor-input-field tutor-mb-8"> |
| 84 | <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"> |
| 85 | </div> |
| 86 | </div> |
| 87 | |
| 88 | <div class="tutor-password-strength-checker" x-data="{ show: false, value: '<?php echo esc_attr( tutor_utils()->input_old( 'password' ) ); ?>' }"> |
| 89 | <div class="tutor-password-field"> |
| 90 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Password', 'tutor' ); ?></label> |
| 91 | <div class="tutor-input-field tutor-mb-8" style="position: relative;"> |
| 92 | <span |
| 93 | class="tutor-flex tutor-items-center tutor-justify-center" |
| 94 | style="position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; z-index: 1;" |
| 95 | x-show="value.length > 0" |
| 96 | @click="show = !show" |
| 97 | > |
| 98 | <template x-if="!show"> |
| 99 | <?php SvgIcon::make()->name( Icon::EYE )->size( 20 )->render(); ?> |
| 100 | </template> |
| 101 | <template x-if="show"> |
| 102 | <?php SvgIcon::make()->name( Icon::EYE_OFF )->size( 20 )->render(); ?> |
| 103 | </template> |
| 104 | </span> |
| 105 | <input |
| 106 | class="tutor-form-control tutor-input password-checker" |
| 107 | id="tutor-new-password" |
| 108 | :type="show ? 'text' : 'password'" |
| 109 | name="password" |
| 110 | x-model="value" |
| 111 | placeholder="<?php esc_html_e( 'Password', 'tutor' ); ?>" |
| 112 | required |
| 113 | autocomplete="new-password" |
| 114 | > |
| 115 | </div> |
| 116 | </div> |
| 117 | </div> |
| 118 | |
| 119 | <div class="tutor-form-group"> |
| 120 | <label class="tutor-block tutor-mb-3"><?php esc_html_e( 'Password confirmation', 'tutor' ); ?></label> |
| 121 | <div class="tutor-form-wrap"> |
| 122 | <div class="tutor-input-field tutor-mb-8"> |
| 123 | <input |
| 124 | class="tutor-form-control tutor-input" |
| 125 | type="password" |
| 126 | name="password_confirmation" |
| 127 | placeholder="<?php esc_html_e( 'Password Confirmation', 'tutor' ); ?>" |
| 128 | required |
| 129 | autocomplete="new-password" |
| 130 | > |
| 131 | </div> |
| 132 | </div> |
| 133 | </div> |
| 134 | |
| 135 | <div class="tutor-form-row"> |
| 136 | <div class="tutor-form-col-12"> |
| 137 | <div class="tutor-form-group"> |
| 138 | <?php |
| 139 | // providing register_form hook. |
| 140 | do_action( 'tutor_student_reg_form_middle' ); |
| 141 | do_action( 'register_form' ); |
| 142 | ?> |
| 143 | </div> |
| 144 | </div> |
| 145 | </div> |
| 146 | |
| 147 | <?php do_action( 'tutor_student_reg_form_end' ); ?> |
| 148 | |
| 149 | <?php |
| 150 | $tutor_toc_page_link = tutor_utils()->get_toc_page_link(); |
| 151 | $consents = LegalConsent::get_consent_by_display_key( LegalConsent::DISPLAY_ON_STD_REG ); |
| 152 | if ( tutor_utils()->count( $consents ) ) : |
| 153 | |
| 154 | ?> |
| 155 | <?php foreach ( $consents as $consent ) : ?> |
| 156 | <?php LegalConsent::render_consent_field( $consent, 'tutor-mb-8' ); ?> |
| 157 | <?php endforeach; ?> |
| 158 | |
| 159 | <?php else : ?> |
| 160 | <?php if ( $tutor_toc_page_link ) : ?> |
| 161 | <div class="tutor-form-row tutor-mb-8"> |
| 162 | <div class="tutor-input-field"> |
| 163 | <div class="tutor-input-wrapper"> |
| 164 | <input type="checkbox" id="tutor-terms-conditions" name="terms_conditions" class="tutor-checkbox tutor-checkbox-md" required> |
| 165 | <label for="tutor-terms-conditions" class="tutor-label"> |
| 166 | <?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> |
| 167 | </label> |
| 168 | </div> |
| 169 | </div> |
| 170 | </div> |
| 171 | <?php endif; ?> |
| 172 | <?php endif; ?> |
| 173 | <div> |
| 174 | <button type="submit" name="tutor_register_student_btn" value="register" class="tutor-btn tutor-btn-primary tutor-btn-block"><?php esc_html_e( 'Register', 'tutor' ); ?></button> |
| 175 | <div class="tutor-flex tutor-items-center tutor-justify-center tutor-gap-2 tutor-mt-8"> |
| 176 | <div class="tutor-small"> |
| 177 | <?php esc_html_e( 'Already have an account?', 'tutor' ); ?> |
| 178 | </div> |
| 179 | <a href="<?php echo esc_url( tutor_utils()->tutor_dashboard_url() ); ?>" class="tutor-btn tutor-btn-link"> |
| 180 | <?php esc_html_e( 'Login', 'tutor' ); ?> |
| 181 | </a> |
| 182 | </div> |
| 183 | </div> |
| 184 | <?php do_action( 'tutor_after_register_button' ); ?> |
| 185 | </form> |
| 186 | <?php do_action( 'tutor_after_registration_form_wrap' ); ?> |
| 187 | </div> |
| 188 | <?php do_action( 'tutor_after_student_reg_form' ); ?> |
| 189 | <?php endif; ?> |
| 190 |