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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 4 years ago dashboard 4 years ago email 4 years ago global 4 years ago loop 4 years ago profile 4 years ago shortcode 4 years ago single 4 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 4 years ago feature_disabled.php 4 years ago instructor-setting.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 4 years ago template.php 4 years ago
dashboard.php
276 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 ? __('Dashboard', 'tutor') : __('Courses', 'tutor'),
52 'url' => $footer_url_1,
53 'is_active' => $footer_url_1 == $current_url,
54 'icon_class' => 'ttr tutor-icon-dashboard-filled',
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-filled' : 'ttr tutor-icon-quiz-attempt-filled',
61 ),
62 array(
63 'title' => __('Menu', 'tutor'),
64 'url' => '#',
65 'is_active' => false,
66 'icon_class' => 'ttr tutor-icon-menu-line tutor-dashboard-menu-toggler',
67 ),
68 );
69
70 do_action('tutor_dashboard/before/wrap');
71 ?>
72
73 <div class="tutor-wrap tutor-dashboard tutor-frontend-dashboard tutor-dashboard-student tutor-pb-80">
74 <div class="tutor-container">
75 <!-- new head part -->
76 <div class="tutor-row tutor-d-flex tutor-justify-content-between tutor-frontend-dashboard-header">
77 <div class="tutor-header-left-side tutor-dashboard-header tutor-col-md-6 tutor-d-flex tutor-align-items-center" style="border: none;">
78 <div class="tutor-dashboard-header-avatar" style="background-image: url( <?php echo esc_url(get_avatar_url($user_id, array('size' => 150))); ?>)">
79 </div>
80 <div class="tutor-user-info tutor-ml-24">
81 <?php
82 $instructor_rating = tutor_utils()->get_instructor_ratings($user->ID);
83
84 if (current_user_can(tutor()->instructor_role)) {
85 ?>
86 <div class="tutor-fs-4 tutor-fw-medium tutor-dashboard-header-username">
87 <?php echo esc_html($user->display_name); ?>
88 </div>
89 <div class="tutor-dashboard-header-stats">
90 <div class="tutor-dashboard-header-ratings">
91 <?php tutor_utils()->star_rating_generator_v2($instructor_rating->rating_avg, $instructor_rating->rating_count, true); ?>
92 </div>
93 <!-- <div class="tutor-dashboard-header-notifications">
94 <?php /*_e('Notification'); */ ?> <span>9</span>
95 </div> -->
96 </div>
97 <?php
98 } else {
99 ?>
100 <div class="tutor-dashboard-header-display-name tutor-color-black">
101 <div class="tutor-fs-5 tutor-fw-normal tutor-dashboard-header-greetings">
102 Hello,
103 </div>
104 <div class="tutor-fs-4 tutor-fw-medium tutor-dashboard-header-username">
105 <?php echo esc_html($user->display_name); ?>
106 </div>
107 </div>
108 <?php
109 }
110 ?>
111 </div>
112 </div>
113 <div class="tutor-header-right-side tutor-col-md-6 tutor-d-flex tutor-justify-content-end tutor-mt-20 tutor-mt-md-0">
114 <div class="tutor-d-flex tutor-align-items-center">
115 <?php
116 do_action('tutor_dashboard/before_header_button');
117 $instructor_status = tutor_utils()->instructor_status();
118 $instructor_status = is_string($instructor_status) ? strtolower($instructor_status) : '';
119 $rejected_on = get_user_meta($user->ID, '_is_tutor_instructor_rejected', true);
120 $info_style = 'vertical-align: middle; margin-right: 7px;';
121 $info_message_style = 'display:inline-block; color:#7A7A7A; font-size: 15px;';
122
123 ob_start();
124 if (tutor_utils()->get_option('enable_become_instructor_btn')) {
125 ?>
126 <a id="tutor-become-instructor-button" style="vertical-align:middle" class="tutor-btn tutor-btn-tertiary tutor-is-outline" href="<?php echo esc_url(tutor_utils()->instructor_register_url()); ?>">
127 <i class="tutor-icon-man-user-filled tutor-icon-24"></i> &nbsp; <?php _e('Become an instructor', 'tutor'); ?>
128 </a>
129 <?php
130 }
131 $become_button = ob_get_clean();
132
133 if (current_user_can(tutor()->instructor_role)) {
134 $course_type = tutor()->course_post_type;
135 ?>
136 <a class="tutor-btn tutor-btn-tertiary tutor-is-outline" href="<?php echo esc_url(apply_filters('frontend_course_create_url', admin_url('post-new.php?post_type=' . tutor()->course_post_type))); ?>">
137 <i class="tutor-icon-plus-square-filled tutor-icon-24 tutor-mr-12"></i> <?php esc_html_e('Create a New Course', 'tutor'); ?>
138 </a>
139 <?php
140 } elseif ($instructor_status == 'pending') {
141 $on = get_user_meta($user->ID, '_is_tutor_instructor', true);
142 $on = date('d F, Y', $on);
143 echo '<span style="' . $info_message_style . '">
144 <i class="dashicons dashicons-info color-warning-90" style=" ' . $info_style . '"></i>',
145 __('Your Application is pending as of', 'tutor'), ' <b>', $on, '</b>',
146 '</span>';
147 } elseif ($rejected_on || $instructor_status !== 'blocked') {
148 echo $become_button;
149 }
150 ?>
151 </div>
152 </div>
153 </div>
154 <!-- new head part end -->
155 <!-- Sidebar and Content Part -->
156 <div class="tutor-row tutor-frontend-dashboard-maincontent">
157 <div class="tutor-col-12 tutor-col-md-4 tutor-col-lg-3 tutor-dashboard-left-menu">
158 <ul class="tutor-dashboard-permalinks">
159 <?php
160 $dashboard_pages = tutor_utils()->tutor_dashboard_nav_ui_items();
161 // get reviews settings value.
162 $disable = !get_tutor_option('enable_course_review');
163 foreach ($dashboard_pages as $dashboard_key => $dashboard_page) {
164 /**
165 * If not enable from settings then quit
166 *
167 * @since v2.0.0
168 */
169 if ($disable && 'reviews' === $dashboard_key) {
170 continue;
171 }
172
173 $menu_title = $dashboard_page;
174 $menu_link = tutor_utils()->get_tutor_dashboard_page_permalink($dashboard_key);
175 $separator = false;
176 $menu_icon = '';
177
178 if (is_array($dashboard_page)) {
179 $menu_title = tutor_utils()->array_get('title', $dashboard_page);
180 $menu_icon_name = tutor_utils()->array_get('icon', $dashboard_page);
181 if ($menu_icon_name) {
182 $menu_icon = "<span class='{$menu_icon_name} tutor-dashboard-menu-item-icon tutor-icon-30'></span>";
183 }
184 // Add new menu item property "url" for custom link
185 if (isset($dashboard_page['url'])) {
186 echo $menu_link = $dashboard_page['url'];
187 }
188 if (isset($dashboard_page['type']) && $dashboard_page['type'] == 'separator') {
189 $separator = true;
190 }
191 }
192 if ($separator) {
193 echo '<li class="tutor-dashboard-menu-divider"></li>';
194 if ($menu_title) {
195 echo "<li class='tutor-dashboard-menu-divider-header'>{$menu_title}</li>";
196 }
197 } else {
198 $li_class = "tutor-dashboard-menu-{$dashboard_key}";
199 if ($dashboard_key === 'index') {
200 $dashboard_key = '';
201 }
202 $active_class = $dashboard_key == $dashboard_page_slug ? 'active' : '';
203 $data_no_instant = 'logout' == $dashboard_key ? 'data-no-instant' : '';
204
205 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-fw-normal tutor-color-black'>{$menu_icon} <span class='tutor-dashboard-menu-item-text tutor-ml-12'>{$menu_title}</span></a></li>";
206 }
207 }
208 ?>
209 </ul>
210 </div>
211
212 <div class="tutor-col-12 tutor-col-md-8 tutor-col-lg-9">
213 <div class="tutor-dashboard-content">
214 <?php
215
216 if ($dashboard_page_name) {
217 do_action('tutor_load_dashboard_template_before', $dashboard_page_name);
218
219 /**
220 * Load dashboard template part from other location
221 *
222 * this filter is basically added for adding templates from respective addons
223 *
224 * @since version 1.9.3
225 */
226 $other_location = '';
227 $from_other_location = apply_filters('load_dashboard_template_part_from_other_location', $other_location);
228
229 if ($from_other_location == '') {
230 tutor_load_template('dashboard.' . $dashboard_page_name);
231 } else {
232 // load template from other location full abspath
233 include_once $from_other_location;
234 }
235
236 do_action('tutor_load_dashboard_template_before', $dashboard_page_name);
237 } else {
238 tutor_load_template('dashboard.dashboard');
239 }
240 ?>
241 </div>
242 </div>
243 </div>
244 </div>
245 <div id="tutor-dashboard-footer-mobile">
246 <div class="tutor-container">
247 <div class="tutor-row">
248 <?php foreach ($footer_links as $link) : ?>
249 <a class="tutor-col-4 <?php echo $link['is_active'] ? 'active' : ''; ?>" href="<?php echo $link['url']; ?>">
250 <i class="<?php echo $link['icon_class']; ?>"></i>
251 <span><?php echo $link['title']; ?></span>
252 </a>
253 <?php endforeach; ?>
254 </div>
255 </div>
256 </div>
257 </div>
258
259 <style>
260 .site-content {
261 overflow-y: hidden;
262 padding-bottom: 0;
263 }
264
265 .tutor-frontend-dashboard {
266 overflow-y: hidden;
267 }
268 </style>
269
270 <?php do_action('tutor_dashboard/after/wrap'); ?>
271
272 <?php
273 if ( ! $is_by_short_code && ! defined( 'OTLMS_VERSION' ) ) {
274 tutor_utils()->tutor_custom_footer();
275 }
276