continue-learning.php
1 day ago
dashboard-empty.php
1 day ago
dashboard.php
1 day ago
stat-card.php
1 day ago
stats.php
1 day ago
time-spent-modal.php
1 day ago
continue-learning.php
59 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Student dashboard continue learning section |
| 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\EmptyState; |
| 15 | use Tutor\Models\CourseModel; |
| 16 | |
| 17 | $user_id = $user_id ?? get_current_user_id(); |
| 18 | $courses_in_progress = CourseModel::get_active_courses_by_user( $user_id, 0, 2, array( 'post_status' => array( 'private', 'publish' ) ) ); |
| 19 | ?> |
| 20 | <div class="tutor-student-dashboard-courses"> |
| 21 | <div class="tutor-flex tutor-items-center tutor-justify-between tutor-mb-4"> |
| 22 | <div class="tutor-small tutor-font-medium"> |
| 23 | <?php esc_html_e( 'Continue Learning', 'tutor' ); ?> |
| 24 | </div> |
| 25 | <?php if ( $courses_in_progress && $courses_in_progress->have_posts() ) : ?> |
| 26 | <a |
| 27 | href="<?php echo esc_url( tutor_utils()->tutor_dashboard_url( 'courses/active-courses' ) ); ?>" |
| 28 | class="tutor-btn tutor-btn-link tutor-btn-x-small tutor-text-brand tutor-p-none tutor-min-h-0" |
| 29 | > |
| 30 | <?php esc_html_e( 'See All', 'tutor' ); ?> |
| 31 | </a> |
| 32 | <?php endif; ?> |
| 33 | </div> |
| 34 | <div class="tutor-flex tutor-flex-column tutor-gap-4"> |
| 35 | <?php |
| 36 | if ( $courses_in_progress && $courses_in_progress->have_posts() ) : |
| 37 | while ( $courses_in_progress->have_posts() ) : |
| 38 | $courses_in_progress->the_post(); |
| 39 | $course_id = get_the_ID(); |
| 40 | |
| 41 | $default_template = tutor_get_template( 'dashboard.courses.course-card' ); |
| 42 | $course_card_template = apply_filters( 'tutor_dashboard_course_card_template', $default_template, $course_id ); |
| 43 | |
| 44 | if ( file_exists( $course_card_template ) ) { |
| 45 | require $course_card_template; |
| 46 | } |
| 47 | endwhile; |
| 48 | wp_reset_postdata(); |
| 49 | else : |
| 50 | EmptyState::make() |
| 51 | ->title( __( 'No Courses Found', 'tutor' ) ) |
| 52 | ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/learning-empty.svg' ) ) |
| 53 | ->attr( 'class', 'tutor-card' ) |
| 54 | ->render(); |
| 55 | endif; |
| 56 | ?> |
| 57 | </div> |
| 58 | </div> |
| 59 |