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