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