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.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard.php
tutor / templates Last commit date
course-filter 2 months ago dashboard 1 day ago ecommerce 1 day ago email 1 day ago global 1 week ago instructor 3 years ago learning-area 1 day ago loop 1 day ago modal 2 months ago profile 3 years ago shared 1 day ago shortcode 2 months ago single 1 day ago template-part 1 day ago widget 3 years ago account-header.php 1 day ago account.php 1 day ago archive-course-init.php 9 months ago archive-course.php 3 years ago course-embed.php 2 months ago course-none.php 3 years ago dashboard-isolated.php 1 day ago dashboard.php 1 day ago feature_disabled.php 3 years ago login-form-legacy.php 1 day ago login-form.php 1 day ago login.php 1 day ago permission-denied.php 1 day ago public-profile.php 1 day ago single-assignment.php 3 years ago single-content-loader.php 2 months ago single-course.php 1 day ago single-lesson.php 3 years ago single-preview-lesson.php 3 years ago single-quiz.php 1 year ago template.php 3 years ago user-profile.php 1 day ago
dashboard.php
163 lines
1 <?php
2 /**
3 * Template for displaying frontend dashboard
4 *
5 * @package Tutor\Templates
6 * @author Themeum <support@themeum.com>
7 * @link https://themeum.com
8 * @since 1.4.3
9 */
10
11 defined( 'ABSPATH' ) || exit;
12
13 use Tutor\Components\Alert;
14 use Tutor\Components\EmptyState;
15 use TUTOR\Dashboard;
16 use TUTOR\Icon;
17 use TUTOR\User;
18
19 global $wp_query;
20
21 $dashboard_page_slug = '';
22 $dashboard_page_subslug = '';
23 $dashboard_page_name = '';
24 $page_data = array();
25
26 if ( isset( $wp_query->query_vars['tutor_dashboard_page'] ) && $wp_query->query_vars['tutor_dashboard_page'] ) {
27 $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
28 $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
29 }
30 /**
31 * Getting dashboard sub pages
32 */
33 if ( isset( $wp_query->query_vars['tutor_dashboard_sub_page'] ) && $wp_query->query_vars['tutor_dashboard_sub_page'] ) {
34 $dashboard_page_subslug = $wp_query->query_vars['tutor_dashboard_sub_page'];
35 $dashboard_page_name = $dashboard_page_subslug;
36 if ( $dashboard_page_slug ) {
37 $dashboard_page_name = $dashboard_page_slug . '/' . $dashboard_page_name;
38 }
39 }
40 $dashboard_page_name = apply_filters( 'tutor_dashboard_sub_page_template', $dashboard_page_name );
41
42 $dashboard_pages = tutor_utils()->tutor_dashboard_nav_ui_items();
43 $dashboard_pages = array_merge(
44 array(
45 'index' => array(
46 'title' => __( 'Dashboard', 'tutor' ),
47 ),
48 ),
49 $dashboard_pages
50 );
51
52 $page_meta = Dashboard::get_page_meta_data( $dashboard_page_slug ? $dashboard_page_slug : 'index', $dashboard_page_subslug, $dashboard_pages );
53
54 $meta_title = $page_meta['meta_title'];
55 Dashboard::set_document_title( $meta_title );
56
57 $is_by_short_code = isset( $is_shortcode ) && true === $is_shortcode;
58 if ( ! $is_by_short_code && ! defined( 'OTLMS_VERSION' ) ) :
59 ?>
60 <!DOCTYPE html>
61 <html <?php language_attributes(); ?>>
62 <head>
63 <meta charset="UTF-8">
64 <meta name="viewport" content="width=device-width, initial-scale=1" />
65 <?php wp_head(); ?>
66 </head>
67 <body <?php body_class( '' ); ?>>
68 <?php wp_body_open(); ?>
69 <?php
70 endif;
71
72 $user_id = get_current_user_id();
73 $user = get_user_by( 'ID', $user_id );
74 $enable_profile_completion = tutor_utils()->get_option( 'enable_profile_completion' );
75 $is_instructor = tutor_utils()->is_instructor();
76 $is_tour_completed = get_user_meta( $user_id, User::TOUR_COMPLETED_META, true );
77
78 // URLS.
79 $current_url = tutor()->current_url;
80 $footer_url_1 = trailingslashit( tutor_utils()->tutor_dashboard_url( $is_instructor ? 'my-courses' : '' ) );
81 $footer_url_2 = trailingslashit( tutor_utils()->tutor_dashboard_url( $is_instructor ? 'question-answer' : 'my-quiz-attempts' ) );
82
83 // Footer links.
84 $footer_links = array(
85 array(
86 'title' => $is_instructor ? __( 'My Courses', 'tutor' ) : __( 'Dashboard', 'tutor' ),
87 'url' => $footer_url_1,
88 'is_active' => $footer_url_1 == $current_url,
89 'icon_class' => 'ttr tutor-icon-dashboard',
90 ),
91 array(
92 'title' => $is_instructor ? __( 'Q&A', 'tutor' ) : __( 'Quiz Attempts', 'tutor' ),
93 'url' => $footer_url_2,
94 'is_active' => $footer_url_2 == $current_url,
95 'icon_class' => $is_instructor ? 'ttr tutor-icon-question' : 'ttr tutor-icon-quiz-attempt',
96 ),
97 array(
98 'title' => __( 'Menu', 'tutor' ),
99 'url' => '#',
100 'is_active' => false,
101 'icon_class' => 'ttr tutor-icon-hamburger-o tutor-dashboard-menu-toggler',
102 ),
103 );
104 ?>
105
106 <?php do_action( 'tutor_dashboard/before/wrap' ); ?>
107 <div class="tutor-dashboard-layout">
108 <?php tutor_load_template( 'dashboard.components.sidebar' ); ?>
109 <div class="tutor-dashboard-main">
110 <?php tutor_load_template( 'dashboard.components.header' ); ?>
111 <div class="tutor-dashboard-body" role="main">
112 <div class="tutor-dashboard-page">
113 <?php
114 if ( User::used_instructor_registration() && User::has_pending_instructor_application() && $dashboard_page_slug ) {
115 tutor_load_template( 'dashboard.instructor.instructor-request-alert' );
116
117 EmptyState::make()
118 ->title( __( 'Your application is under review', 'tutor' ) )
119 ->subtitle( __( 'Only your dashboard home is available while your instructor application is pending.', 'tutor' ) )
120 ->attr( 'class', 'tutor-surface-l1 tutor-border tutor-rounded-2xl' )
121 ->render();
122 } elseif ( $dashboard_page_name ) {
123 do_action( 'tutor_load_dashboard_template_before', $dashboard_page_name );
124
125 /**
126 * Load dashboard template part from other location
127 *
128 * This filter is basically added for adding templates from respective addons
129 *
130 * @since version 1.9.3
131 */
132 $other_location = '';
133 $from_other_location = apply_filters( 'load_dashboard_template_part_from_other_location', $other_location );
134
135 if ( '' == $from_other_location ) {
136 tutor_load_template( 'dashboard.' . $dashboard_page_name );
137 } else {
138 // Load template from other location full abspath.
139 include_once $from_other_location;
140 }
141
142 do_action( 'tutor_load_dashboard_template_after', $dashboard_page_name );
143 } elseif ( User::is_instructor_view() ) {
144 tutor_load_template( 'dashboard.dashboard' );
145 } else {
146 tutor_load_template( 'dashboard.student.dashboard' );
147 }
148 ?>
149 </div>
150 </div>
151 </div>
152 </div>
153 <?php if ( User::is_student_view() && ! $is_tour_completed ) : ?>
154 <?php tutor_load_template( 'shared.tour' ); ?>
155 <?php endif; ?>
156
157 <?php do_action( 'tutor_dashboard/after/wrap' ); ?>
158 <?php if ( ! $is_by_short_code && ! defined( 'OTLMS_VERSION' ) ) : ?>
159 <?php wp_footer(); ?>
160 <?php endif; ?>
161 </body>
162 </html>
163