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.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 3 years ago dashboard 3 years ago email 4 years ago global 4 years ago instructor 4 years ago loop 3 years ago modal 4 years ago profile 4 years ago shortcode 4 years ago single 3 years ago template-part 3 years ago widget 3 years ago archive-course-init.php 3 years ago archive-course.php 3 years ago course-embed.php 3 years ago course-none.php 3 years ago dashboard.php 3 years ago feature_disabled.php 3 years ago instructor-setting.php 3 years ago login-form.php 3 years ago login.php 3 years ago permission-denied.php 3 years ago public-profile.php 3 years ago single-assignment.php 3 years ago single-content-loader.php 3 years ago single-course.php 3 years ago single-lesson.php 3 years ago single-preview-lesson.php 3 years ago single-quiz.php 3 years ago template.php 3 years ago
dashboard.php
292 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 $is_by_short_code = isset( $is_shortcode ) && true === $is_shortcode;
12 if ( ! $is_by_short_code && ! defined( 'OTLMS_VERSION' ) ) {
13 tutor_utils()->tutor_custom_header();
14 }
15
16 global $wp_query;
17
18 $dashboard_page_slug = '';
19 $dashboard_page_name = '';
20 if ( isset( $wp_query->query_vars['tutor_dashboard_page'] ) && $wp_query->query_vars['tutor_dashboard_page'] ) {
21 $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
22 $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
23 }
24 /**
25 * Getting dashboard sub pages
26 */
27 if ( isset( $wp_query->query_vars['tutor_dashboard_sub_page'] ) && $wp_query->query_vars['tutor_dashboard_sub_page'] ) {
28 $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_sub_page'];
29 if ( $dashboard_page_slug ) {
30 $dashboard_page_name = $dashboard_page_slug . '/' . $dashboard_page_name;
31 }
32 }
33
34 $user_id = get_current_user_id();
35 $user = get_user_by( 'ID', $user_id );
36 $enable_profile_completion = tutor_utils()->get_option( 'enable_profile_completion' );
37 $is_instructor = tutor_utils()->is_instructor();
38
39 // URLS
40 $current_url = tutor()->current_url;
41 $footer_url_1 = trailingslashit( tutor_utils()->tutor_dashboard_url( $is_instructor ? 'my-courses' : '' ) );
42 $footer_url_2 = trailingslashit( tutor_utils()->tutor_dashboard_url( $is_instructor ? 'question-answer' : 'my-quiz-attempts' ) );
43
44 // Footer links
45 $footer_links = array(
46 array(
47 'title' => $is_instructor ? __( 'My Courses', 'tutor' ) : __( 'Dashboard', 'tutor' ),
48 'url' => $footer_url_1,
49 'is_active' => $footer_url_1 == $current_url,
50 'icon_class' => 'ttr tutor-icon-dashboard',
51 ),
52 array(
53 'title' => $is_instructor ? __( 'Q&A', 'tutor' ) : __( 'Quiz Attempts', 'tutor' ),
54 'url' => $footer_url_2,
55 'is_active' => $footer_url_2 == $current_url,
56 'icon_class' => $is_instructor ? 'ttr tutor-icon-question' : 'ttr tutor-icon-quiz-attempt',
57 ),
58 array(
59 'title' => __( 'Menu', 'tutor' ),
60 'url' => '#',
61 'is_active' => false,
62 'icon_class' => 'ttr tutor-icon-hamburger-o tutor-dashboard-menu-toggler',
63 ),
64 );
65
66 do_action( 'tutor_dashboard/before/wrap' );
67 ?>
68
69 <div class="tutor-wrap tutor-wrap-parent tutor-dashboard tutor-frontend-dashboard tutor-dashboard-student tutor-pb-80">
70 <div class="tutor-container">
71 <div class="tutor-row tutor-d-flex tutor-justify-between tutor-frontend-dashboard-header">
72 <div class="tutor-header-left-side tutor-dashboard-header tutor-col-md-6 tutor-d-flex tutor-align-center" style="border: none;">
73 <div class="tutor-dashboard-header-avatar">
74 <?php
75 echo wp_kses(
76 tutor_utils()->get_tutor_avatar( $user_id, 'xl' ),
77 tutor_utils()->allowed_avatar_tags()
78 );
79 ?>
80 </div>
81
82 <div class="tutor-user-info tutor-ml-24">
83 <?php
84 $instructor_rating = tutor_utils()->get_instructor_ratings( $user->ID );
85
86 if ( current_user_can( tutor()->instructor_role ) ) {
87 ?>
88 <div class="tutor-fs-4 tutor-fw-medium tutor-color-black tutor-dashboard-header-username">
89 <?php echo esc_html( $user->display_name ); ?>
90 </div>
91 <div class="tutor-dashboard-header-stats">
92 <div class="tutor-dashboard-header-ratings">
93 <?php tutor_utils()->star_rating_generator_v2( $instructor_rating->rating_avg, $instructor_rating->rating_count, true ); ?>
94 </div>
95 </div>
96 <?php
97 } else {
98 ?>
99 <div class="tutor-dashboard-header-display-name tutor-color-black">
100 <div class="tutor-fs-5 tutor-dashboard-header-greetings">
101 <?php esc_html_e( 'Hello', 'tutor' ); ?>,
102 </div>
103 <div class="tutor-fs-4 tutor-fw-medium tutor-dashboard-header-username">
104 <?php echo esc_html( $user->display_name ); ?>
105 </div>
106 </div>
107 <?php
108 }
109 ?>
110 </div>
111 </div>
112 <div class="tutor-header-right-side tutor-col-md-6 tutor-d-flex tutor-justify-end tutor-mt-20 tutor-mt-md-0">
113 <div class="tutor-d-flex tutor-align-center">
114 <?php
115 do_action( 'tutor_dashboard/before_header_button' );
116 $instructor_status = tutor_utils()->instructor_status();
117 $instructor_status = is_string( $instructor_status ) ? strtolower( $instructor_status ) : '';
118 $rejected_on = get_user_meta( $user->ID, '_is_tutor_instructor_rejected', true );
119 $info_style = 'vertical-align: middle; margin-right: 7px;';
120 $info_message_style = 'display:inline-block; color:#7A7A7A; font-size: 15px;';
121
122 ob_start();
123 if ( tutor_utils()->get_option( 'enable_become_instructor_btn' ) ) {
124 ?>
125 <a id="tutor-become-instructor-button" class="tutor-btn tutor-btn-outline-primary" href="<?php echo esc_url( tutor_utils()->instructor_register_url() ); ?>">
126 <i class="tutor-icon-user-bold"></i> &nbsp; <?php esc_html_e( 'Become an instructor', 'tutor' ); ?>
127 </a>
128 <?php
129 }
130 $become_button = ob_get_clean();
131
132 if ( current_user_can( tutor()->instructor_role ) ) {
133 $course_type = tutor()->course_post_type;
134 ?>
135 <?php
136 /**
137 * Render create course button based on free & pro
138 *
139 * @since v2.0.7
140 */
141 if ( function_exists( 'tutor_pro' ) ) :
142 ?>
143 <?php do_action( 'tutor_course_create_button' ); ?>
144 <?php else : ?>
145 <a href="<?php echo esc_url( admin_url( "post-new.php?post_type=$course_type" ) ); ?>" class="tutor-btn tutor-btn-outline-primary">
146 <i class="tutor-icon-plus-square tutor-my-n4 tutor-mr-8"></i>
147 <?php esc_html_e( 'Create a New Course', 'tutor' ); ?>
148 </a>
149 <?php endif; ?>
150 <?php
151 } elseif ( 'pending' == $instructor_status ) {
152 $on = get_user_meta( $user->ID, '_is_tutor_instructor', true );
153 $on = date( 'd F, Y', $on );
154 echo '<span style="' . esc_attr( $info_message_style ) . '">
155 <i class="dashicons dashicons-info tutor-color-warning" style=" ' . esc_attr( $info_style ) . '"></i>',
156 esc_html__( 'Your Application is pending as of', 'tutor' ), ' <b>', esc_html( $on ), '</b>',
157 '</span>';
158 } elseif ( $rejected_on || $instructor_status !== 'blocked' ) {
159 echo $become_button; //phpcs:ignore --data escaped above
160 }
161 ?>
162 </div>
163 </div>
164 </div>
165
166 <div class="tutor-row tutor-frontend-dashboard-maincontent">
167 <div class="tutor-col-12 tutor-col-md-4 tutor-col-lg-3 tutor-dashboard-left-menu">
168 <ul class="tutor-dashboard-permalinks">
169 <?php
170 $dashboard_pages = tutor_utils()->tutor_dashboard_nav_ui_items();
171 // get reviews settings value.
172 $disable = ! get_tutor_option( 'enable_course_review' );
173 foreach ( $dashboard_pages as $dashboard_key => $dashboard_page ) {
174 /**
175 * If not enable from settings then quit
176 *
177 * @since v2.0.0
178 */
179 if ( $disable && 'reviews' === $dashboard_key ) {
180 continue;
181 }
182
183 $menu_title = $dashboard_page;
184 $menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $dashboard_key );
185 $separator = false;
186 $menu_icon = '';
187
188 if ( is_array( $dashboard_page ) ) {
189 $menu_title = tutor_utils()->array_get( 'title', $dashboard_page );
190 $menu_icon_name = tutor_utils()->array_get( 'icon', $dashboard_page, ( isset( $dashboard_page['icon'] ) ? $dashboard_page['icon'] : '' ) );
191 if ( $menu_icon_name ) {
192 $menu_icon = "<span class='{$menu_icon_name} tutor-dashboard-menu-item-icon'></span>";
193 }
194 // Add new menu item property "url" for custom link
195 if ( isset( $dashboard_page['url'] ) ) {
196 $menu_link = $dashboard_page['url'];
197 }
198 if ( isset( $dashboard_page['type'] ) && $dashboard_page['type'] == 'separator' ) {
199 $separator = true;
200 }
201 }
202 if ( $separator ) {
203 echo '<li class="tutor-dashboard-menu-divider"></li>';
204 if ( $menu_title ) {
205 ?>
206 <li class='tutor-dashboard-menu-divider-header'>
207 <?php echo esc_html( $menu_title ); ?>
208 </li>
209 <?php
210 }
211 } else {
212 $li_class = "tutor-dashboard-menu-{$dashboard_key}";
213 if ( 'index' === $dashboard_key ) {
214 $dashboard_key = '';
215 }
216 $active_class = $dashboard_key == $dashboard_page_slug ? 'active' : '';
217 $data_no_instant = 'logout' == $dashboard_key ? 'data-no-instant' : '';
218 ?>
219 <li class='tutor-dashboard-menu-item <?php echo esc_attr( $li_class . ' ' . $active_class ); ?>'>
220 <a <?php echo esc_html( $data_no_instant ); ?> href="<?php echo esc_url( $menu_link ); ?>" class='tutor-dashboard-menu-item-link tutor-fs-6 tutor-color-black'>
221 <?php
222 echo wp_kses(
223 $menu_icon,
224 tutor_utils()->allowed_icon_tags()
225 );
226 ?>
227 <span class='tutor-dashboard-menu-item-text tutor-ml-12'>
228 <?php echo esc_html( $menu_title ); ?>
229 </span>
230 </a>
231 </li>
232 <?php
233 }
234 }
235 ?>
236 </ul>
237 </div>
238
239 <div class="tutor-col-12 tutor-col-md-8 tutor-col-lg-9">
240 <div class="tutor-dashboard-content">
241 <?php
242
243 if ( $dashboard_page_name ) {
244 do_action( 'tutor_load_dashboard_template_before', $dashboard_page_name );
245
246 /**
247 * Load dashboard template part from other location
248 *
249 * This filter is basically added for adding templates from respective addons
250 *
251 * @since version 1.9.3
252 */
253 $other_location = '';
254 $from_other_location = apply_filters( 'load_dashboard_template_part_from_other_location', $other_location );
255
256 if ( '' == $from_other_location ) {
257 tutor_load_template( 'dashboard.' . $dashboard_page_name );
258 } else {
259 // Load template from other location full abspath.
260 include_once $from_other_location;
261 }
262
263 do_action( 'tutor_load_dashboard_template_before', $dashboard_page_name );
264 } else {
265 tutor_load_template( 'dashboard.dashboard' );
266 }
267 ?>
268 </div>
269 </div>
270 </div>
271 </div>
272 <div id="tutor-dashboard-footer-mobile">
273 <div class="tutor-container">
274 <div class="tutor-row">
275 <?php foreach ( $footer_links as $link ) : ?>
276 <a class="tutor-col-4 <?php echo $link['is_active'] ? 'active' : ''; ?>" href="<?php echo esc_url( $link['url'] ); ?>">
277 <i class="<?php echo esc_attr( $link['icon_class'] ); ?>"></i>
278 <span><?php echo esc_html( $link['title'] ); ?></span>
279 </a>
280 <?php endforeach; ?>
281 </div>
282 </div>
283 </div>
284 </div>
285
286 <?php do_action( 'tutor_dashboard/after/wrap' ); ?>
287
288 <?php
289 if ( ! $is_by_short_code && ! defined( 'OTLMS_VERSION' ) ) {
290 tutor_utils()->tutor_custom_footer();
291 }
292