elements
2 months ago
fragments
19 hours ago
metabox
1 year ago
modal
19 hours ago
options
19 hours ago
pages
19 hours ago
qna
19 hours ago
quiz
19 hours ago
templates
19 hours ago
course-share.php
2 months ago
maintenance.php
3 years ago
onboarding.php
19 hours ago
onboarding.php
201 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Onboarding page |
| 4 | * |
| 5 | * @package Tutor |
| 6 | * @since 4.0.0 onboarding |
| 7 | */ |
| 8 | |
| 9 | use Tutor\Components\SvgIcon; |
| 10 | use TUTOR\Icon; |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | set_current_screen(); |
| 15 | ?> |
| 16 | <!DOCTYPE html> |
| 17 | <html <?php language_attributes(); ?>> |
| 18 | <head> |
| 19 | <meta name="viewport" content="width=device-width" /> |
| 20 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 21 | <title><?php esc_html_e( 'Tutor › Onboarding', 'tutor' ); ?></title> |
| 22 | <?php |
| 23 | try { |
| 24 | do_action( 'admin_enqueue_scripts' ); |
| 25 | } catch ( \Throwable $th ) { //phpcs:ignore |
| 26 | } |
| 27 | ?> |
| 28 | <?php wp_print_scripts( 'tutor-setup' ); ?> |
| 29 | <?php do_action( 'admin_print_styles' ); ?> |
| 30 | <?php do_action( 'admin_head' ); ?> |
| 31 | </head> |
| 32 | <body class="tutor-setup wp-core-ui"> |
| 33 | <?php |
| 34 | $current_user = wp_get_current_user(); //phpcs:ignore |
| 35 | $display_name = $current_user instanceof \WP_User && $current_user->exists() ? tutor_utils()->display_name( $current_user->ID ) : __( 'there', 'tutor' ); |
| 36 | $logo_url = tutor()->url . 'assets/images/tutor-logo.png'; |
| 37 | ?> |
| 38 | <div id="tutor-onboard-wrapper" class="tutor-d-flex tutor-flex-column tutor-align-center tutor-justify-center"> |
| 39 | <section class="tutor-onboard-screen tutor-onboard-screen-welcome is-active" data-screen="welcome"> |
| 40 | <div class="tutor-onboard-screen-logo tutor-d-flex tutor-justify-center"> |
| 41 | <img src="<?php echo esc_url( tutor()->url . 'assets/images/tutor-logo.png' ); ?>" alt="<?php esc_attr_e( 'Tutor LMS', 'tutor' ); ?>"> |
| 42 | </div> |
| 43 | |
| 44 | <div class="tutor-onboard-card"> |
| 45 | <div class="tutor-onboard-card-body"> |
| 46 | <div class="tutor-onboard-welcome-text"> |
| 47 | <div class="tutor-onboard-welcome-greeting"> |
| 48 | <?php |
| 49 | echo wp_kses( |
| 50 | sprintf( |
| 51 | /* translators: %1$s: User display name wrapped in a span element. */ |
| 52 | __( 'Hello %1$s', 'tutor' ), |
| 53 | '<span>' . esc_html( $display_name ) . '</span>' |
| 54 | ), |
| 55 | array( |
| 56 | 'span' => array(), |
| 57 | ) |
| 58 | ); |
| 59 | ?> |
| 60 | </div> |
| 61 | <h2 class="tutor-onboard-welcome-title"> |
| 62 | <?php |
| 63 | echo wp_kses( |
| 64 | sprintf( |
| 65 | /* translators: %1$s: Tutor LMS text wrapped in a span element. */ |
| 66 | __( 'Welcome to %1$s', 'tutor' ), |
| 67 | '<span>' . esc_html__( 'Tutor LMS', 'tutor' ) . '</span>' |
| 68 | ), |
| 69 | array( |
| 70 | 'span' => array(), |
| 71 | ) |
| 72 | ); |
| 73 | ?> |
| 74 | </h2> |
| 75 | </div> |
| 76 | |
| 77 | <div class="tutor-onboard-welcome-media"> |
| 78 | <img src="<?php echo esc_url( tutor()->url . 'assets/images/tutor-onboard-hero-img.webp' ); ?>" alt="<?php esc_attr_e( 'Setup welcome preview', 'tutor' ); ?>"> |
| 79 | </div> |
| 80 | |
| 81 | <div class="tutor-onboard-welcome-description"> |
| 82 | <?php |
| 83 | echo wp_kses( |
| 84 | sprintf( |
| 85 | /* translators: %s: Number of trusted websites */ |
| 86 | __( 'Get started with an all-in-one platform to create, manage, and sell your courses effortlessly, trusted by over %s eLearning websites worldwide.', 'tutor' ), |
| 87 | '<span>100k+</span>' |
| 88 | ), |
| 89 | array( |
| 90 | 'span' => array(), |
| 91 | ) |
| 92 | ); |
| 93 | ?> |
| 94 | </div> |
| 95 | </div> |
| 96 | |
| 97 | <div class="tutor-onboard-card-footer"> |
| 98 | <button type="button" class="tutor-btn tutor-btn-primary tutor-btn-block tutor-onboard-next-screen" data-target="preferences"> |
| 99 | <span><?php esc_html_e( 'Next', 'tutor' ); ?></span> |
| 100 | <?php SvgIcon::make()->name( Icon::ARROW_RIGHT_2 )->flip_rtl()->render(); ?> |
| 101 | </button> |
| 102 | </div> |
| 103 | </div> |
| 104 | </section> |
| 105 | |
| 106 | <section class="tutor-onboard-screen tutor-onboard-screen-preferences" data-screen="preferences"> |
| 107 | <div class="tutor-onboard-screen-logo tutor-d-flex tutor-justify-center"> |
| 108 | <img src="<?php echo esc_url( $logo_url ); ?>" alt="<?php esc_attr_e( 'Tutor LMS', 'tutor' ); ?>"> |
| 109 | </div> |
| 110 | |
| 111 | <div class="tutor-onboard-card"> |
| 112 | <form class="tutor-onboard-setup-form" method="post"> |
| 113 | <input type="hidden" name="action" value="tutor_onboard_setup"> |
| 114 | |
| 115 | <div class="tutor-onboard-card-body"> |
| 116 | <h2 class="tutor-onboard-preferences-title"><?php esc_html_e( 'Choose a look for your learners', 'tutor' ); ?></h2> |
| 117 | |
| 118 | <div class="tutor-onboard-preferences-group"> |
| 119 | <h3 class="tutor-onboard-preferences-label"><?php esc_html_e( 'Default Learning Mode', 'tutor' ); ?></h3> |
| 120 | |
| 121 | <div class="tutor-onboard-choice-wrapper tutor-onboard-choice-learning"> |
| 122 | <label class="tutor-onboard-choice-card is-selected"> |
| 123 | <input type="radio" class="tutor-onboard-choice-input" name="learning_mode" value="modern" checked> |
| 124 | <span class="tutor-onboard-choice-media"> |
| 125 | <img src="<?php echo esc_url( tutor()->assets_url . 'images/images-v2/learning-mode/modern.svg' ); ?>" alt="<?php esc_attr_e( 'Modern mode preview', 'tutor' ); ?>"> |
| 126 | </span> |
| 127 | <span class="tutor-onboard-choice-text"><?php esc_html_e( 'Modern', 'tutor' ); ?></span> |
| 128 | </label> |
| 129 | |
| 130 | <label class="tutor-onboard-choice-card"> |
| 131 | <input type="radio" class="tutor-onboard-choice-input" name="learning_mode" value="kids"> |
| 132 | <span class="tutor-onboard-choice-media"> |
| 133 | <img src="<?php echo esc_url( tutor()->assets_url . 'images/images-v2/learning-mode/kids.svg' ); ?>" alt="<?php esc_attr_e( 'Kids mode preview', 'tutor' ); ?>"> |
| 134 | </span> |
| 135 | <span class="tutor-onboard-choice-text"><?php esc_html_e( 'Kids', 'tutor' ); ?></span> |
| 136 | </label> |
| 137 | </div> |
| 138 | </div> |
| 139 | |
| 140 | <div class="tutor-onboard-preferences-group"> |
| 141 | <h3 class="tutor-onboard-preferences-label"><?php esc_html_e( 'Default Theme', 'tutor' ); ?></h3> |
| 142 | |
| 143 | <div class="tutor-onboard-choice-wrapper tutor-onboard-choice-theme"> |
| 144 | <label class="tutor-onboard-choice-card is-selected"> |
| 145 | <input type="radio" class="tutor-onboard-choice-input" name="default_theme" value="light" checked> |
| 146 | <span class="tutor-onboard-choice-media"> |
| 147 | <img src="<?php echo esc_url( tutor()->assets_url . 'images/images-v2/default-theme/light.webp' ); ?>" alt="<?php esc_attr_e( 'Light theme preview', 'tutor' ); ?>"> |
| 148 | </span> |
| 149 | <span class="tutor-onboard-choice-text"><?php esc_html_e( 'Light', 'tutor' ); ?></span> |
| 150 | </label> |
| 151 | |
| 152 | <label class="tutor-onboard-choice-card"> |
| 153 | <input type="radio" class="tutor-onboard-choice-input" name="default_theme" value="dark"> |
| 154 | <span class="tutor-onboard-choice-media"> |
| 155 | <img src="<?php echo esc_url( tutor()->assets_url . 'images/images-v2/default-theme/dark.webp' ); ?>" alt="<?php esc_attr_e( 'Dark theme preview', 'tutor' ); ?>"> |
| 156 | </span> |
| 157 | <span class="tutor-onboard-choice-text"><?php esc_html_e( 'Dark', 'tutor' ); ?></span> |
| 158 | </label> |
| 159 | |
| 160 | <label class="tutor-onboard-choice-card"> |
| 161 | <input type="radio" class="tutor-onboard-choice-input" name="default_theme" value="system"> |
| 162 | <span class="tutor-onboard-choice-media"> |
| 163 | <img src="<?php echo esc_url( tutor()->assets_url . 'images/images-v2/default-theme/auto.webp' ); ?>" alt="<?php esc_attr_e( 'Auto theme preview', 'tutor' ); ?>"> |
| 164 | </span> |
| 165 | <span class="tutor-onboard-choice-text"><?php esc_html_e( 'Auto', 'tutor' ); ?></span> |
| 166 | </label> |
| 167 | </div> |
| 168 | </div> |
| 169 | |
| 170 | <div class="tutor-onboard-load-sample tutor-form-check tutor-d-flex tutor-align-center tutor-gap-1 tutor-onboard-checkbox"> |
| 171 | <input id="tutor-onboard-load-sample-course" type="checkbox" name="tutor_onboard_load_sample_course" value="1" class="tutor-form-check-input" checked> |
| 172 | <label for="tutor-onboard-load-sample-course" class="tutor-onboard-checkbox-label"> |
| 173 | <?php esc_html_e( 'Load sample courses to help you get started.', 'tutor' ); ?> |
| 174 | </label> |
| 175 | </div> |
| 176 | </div> |
| 177 | |
| 178 | <div class="tutor-onboard-card-footer tutor-onboard-card-footer-stack"> |
| 179 | <button type="submit" class="tutor-onboard-submit-btn tutor-btn tutor-btn-primary tutor-btn-block" data-screen="loading"> |
| 180 | <span><?php esc_html_e( 'Let\'s go', 'tutor' ); ?></span> |
| 181 | <?php SvgIcon::make()->name( Icon::ARROW_RIGHT_2 )->flip_rtl()->render(); ?> |
| 182 | </button> |
| 183 | <p class="tutor-onboard-help-text"><?php esc_html_e( 'Don\'t worry, you can always change these settings later! 😊', 'tutor' ); ?></p> |
| 184 | </div> |
| 185 | </form> |
| 186 | </div> |
| 187 | </section> |
| 188 | |
| 189 | <section class="tutor-onboard-screen tutor-onboard-screen-loading" data-screen="loading"> |
| 190 | <div class="tutor-onboard-card-loading"> |
| 191 | <?php $loading_text = __( 'The world is changing with AI, but the need for great teachers never will', 'tutor' ); ?> |
| 192 | <span class="tutor-onboard-loading-text" data-text="<?php echo esc_attr( $loading_text ); ?>"> |
| 193 | <?php echo esc_html( $loading_text ); ?> |
| 194 | </span> |
| 195 | </div> |
| 196 | </section> |
| 197 | </div> |
| 198 | <?php wp_print_scripts( 'tutor-script' ); ?> |
| 199 | </body> |
| 200 | </html> |
| 201 |