tour.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Frontend Dashboard Tour Component |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage Dashboard |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 4.0.0 |
| 10 | */ |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | use Tutor\Components\Modal; |
| 15 | |
| 16 | $tour_asset_base = 'https://tutor-lms.s3.us-east-1.amazonaws.com/tour'; |
| 17 | |
| 18 | $slides_data = array( |
| 19 | array( |
| 20 | 'title' => __( 'Your learning experience just got a whole lot better', 'tutor' ), |
| 21 | 'imageLarge' => $tour_asset_base . '/tour-1.webp', |
| 22 | 'imageSmall' => $tour_asset_base . '/tour-1-sm.webp', |
| 23 | ), |
| 24 | array( |
| 25 | 'title' => __( 'Find quiz attempts inside your courses', 'tutor' ), |
| 26 | 'imageLarge' => $tour_asset_base . '/tour-2.webp', |
| 27 | 'imageSmall' => $tour_asset_base . '/tour-2-sm.webp', |
| 28 | ), |
| 29 | array( |
| 30 | 'title' => __( 'Access all your lesson & video notes in one place', 'tutor' ), |
| 31 | 'imageLarge' => $tour_asset_base . '/tour-3.webp', |
| 32 | 'imageSmall' => $tour_asset_base . '/tour-3-sm.webp', |
| 33 | ), |
| 34 | array( |
| 35 | 'title' => __( 'Everything about your account now lives in one place', 'tutor' ), |
| 36 | 'imageLarge' => $tour_asset_base . '/tour-4.webp', |
| 37 | 'imageSmall' => $tour_asset_base . '/tour-4-sm.webp', |
| 38 | ), |
| 39 | array( |
| 40 | 'title' => __( 'Switch between dark and light mode whenever you like', 'tutor' ), |
| 41 | 'imageLarge' => $tour_asset_base . '/tour-5.webp', |
| 42 | 'imageSmall' => $tour_asset_base . '/tour-5-sm.webp', |
| 43 | ), |
| 44 | ); |
| 45 | |
| 46 | $tour_content_template = tutor_get_template( 'shared.tour-content' ); |
| 47 | $tour_modal_id = 'tutor-tour-modal'; |
| 48 | $tour_user_id = get_current_user_id(); |
| 49 | $slides_json = wp_json_encode( $slides_data ); |
| 50 | ?> |
| 51 | |
| 52 | <div |
| 53 | x-data="tutorTour({ |
| 54 | slidesData: <?php echo esc_attr( $slides_json ); ?>, |
| 55 | modalId: '<?php echo esc_attr( $tour_modal_id ); ?>', |
| 56 | userId: <?php echo absint( $tour_user_id ); ?> |
| 57 | })" |
| 58 | > |
| 59 | <?php |
| 60 | Modal::make() |
| 61 | ->id( $tour_modal_id ) |
| 62 | ->closeable( false ) |
| 63 | ->width( '600px' ) |
| 64 | ->template( $tour_content_template ) |
| 65 | ->render(); |
| 66 | ?> |
| 67 | |
| 68 | </div> |