dashboard
7 years ago
email
7 years ago
global
7 years ago
loop
7 years ago
profile
7 years ago
shortcode
7 years ago
single
7 years ago
widget
7 years ago
archive-course.php
7 years ago
course-none.php
7 years ago
dashboard.php
7 years ago
login.php
7 years ago
single-course-enrolled-announcements.php
7 years ago
single-course-enrolled-overview.php
7 years ago
single-course-enrolled-questions.php
7 years ago
single-course-enrolled.php
7 years ago
single-course.php
7 years ago
single-lesson.php
7 years ago
single-preview-lesson.php
7 years ago
single-quiz.php
7 years ago
student-public-profile.php
7 years ago
dashboard.php
142 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying student Public Profile |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * |
| 7 | * @author Themeum |
| 8 | * @url https://themeum.com |
| 9 | */ |
| 10 | |
| 11 | get_header(); |
| 12 | |
| 13 | |
| 14 | global $wp_query; |
| 15 | |
| 16 | $dashboard_page_slug = ''; |
| 17 | $dashboard_page_name = ''; |
| 18 | if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) { |
| 19 | $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page']; |
| 20 | $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page']; |
| 21 | } |
| 22 | /** |
| 23 | * Getting dashboard sum pages |
| 24 | */ |
| 25 | if (isset($wp_query->query_vars['tutor_dashboard_sub_page']) && $wp_query->query_vars['tutor_dashboard_sub_page']) { |
| 26 | $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_sub_page']; |
| 27 | if ($dashboard_page_slug){ |
| 28 | $dashboard_page_name = $dashboard_page_slug.'/'.$dashboard_page_name; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | $user_id = get_current_user_id(); |
| 33 | $user = get_user_by('ID', $user_id); |
| 34 | |
| 35 | do_action('tutor_dashboard/before/wrap'); ?> |
| 36 | |
| 37 | <div class="tutor-wrap tutor-dashboard tutor-dashboard-student"> |
| 38 | <div class="tutor-container"> |
| 39 | |
| 40 | |
| 41 | <div class="tutor-row"> |
| 42 | <div class="tutor-col-12"> |
| 43 | <div class="tutor-dashboard-header"> |
| 44 | |
| 45 | <div class="tutor-dashboard-header-avatar"> |
| 46 | <img src="<?php echo get_avatar_url($user_id, array('size' => 150)); ?>" /> |
| 47 | </div> |
| 48 | |
| 49 | <div class="tutor-dashboard-header-info"> |
| 50 | |
| 51 | <div class="tutor-dashboard-header-display-name"> |
| 52 | <h4><?php _e('Howdy,', 'tutor'); ?> <strong><?php echo $user->display_name; ?></strong> </h4> |
| 53 | </div> |
| 54 | |
| 55 | <?php |
| 56 | $instructor_rating = tutor_utils()->get_instructor_ratings($user->ID); |
| 57 | ?> |
| 58 | |
| 59 | <?php |
| 60 | if (current_user_can(tutor()->instructor_role)){ |
| 61 | ?> |
| 62 | <div class="tutor-dashboard-header-stats"> |
| 63 | <div class="tutor-dashboard-header-ratings"> |
| 64 | <?php tutor_utils()->star_rating_generator($instructor_rating->rating_avg); ?> |
| 65 | <span><?php echo esc_html($instructor_rating->rating_avg); ?></span> |
| 66 | <span> (<?php _e(sprintf('%d Ratings', $instructor_rating->rating_count), 'tutor') ?>) </span> |
| 67 | </div> |
| 68 | <!--<div class="tutor-dashboard-header-notifications"> |
| 69 | <?php /*_e('Notification'); */?> <span>9</span> |
| 70 | </div>--> |
| 71 | </div> |
| 72 | <?php } ?> |
| 73 | |
| 74 | </div> |
| 75 | |
| 76 | <div class="tutor-dashboard-header-button"> |
| 77 | <?php |
| 78 | |
| 79 | if(current_user_can(tutor()->instructor_role)){ |
| 80 | $course_type = tutor()->course_post_type; |
| 81 | ?> |
| 82 | <a class="tutor-btn bordered-btn" href="<?php echo esc_url(add_query_arg(array('post_type'=>$course_type),admin_url('post-new.php'))); ?>"> |
| 83 | <?php _e('<i class="tutor-icon-video-camera"></i> Upload A Course', 'tutor'); ?> |
| 84 | </a> |
| 85 | <?php |
| 86 | |
| 87 | }else{ |
| 88 | if (tutor_utils()->get_option('enable_become_instructor_btn')) { |
| 89 | ?> |
| 90 | <a class="tutor-btn bordered-btn" href="<?php echo esc_url(tutor_utils()->instructor_register_url()); ?>"> |
| 91 | <?php _e( '<i class="tutor-icon-man-user"></i> Become an instructor', 'tutor' ); ?> |
| 92 | </a> |
| 93 | <?php |
| 94 | } |
| 95 | } |
| 96 | ?> |
| 97 | |
| 98 | </div> |
| 99 | |
| 100 | </div> |
| 101 | </div> |
| 102 | </div> |
| 103 | |
| 104 | <div class="tutor-row"> |
| 105 | <div class="tutor-col-3 tutor-dashboard-left-menu"> |
| 106 | <ul class="tutor-dashboard-permalinks"> |
| 107 | <?php |
| 108 | $dashboard_pages = tutor_utils()->tutor_dashboard_pages(); |
| 109 | foreach ($dashboard_pages as $dashboard_key => $dashboard_page){ |
| 110 | $li_class = "tutor-dashboard-menu-{$dashboard_key}"; |
| 111 | if ($dashboard_key === 'index') |
| 112 | $dashboard_key = ''; |
| 113 | $active_class = $dashboard_key == $dashboard_page_slug ? 'active' : ''; |
| 114 | |
| 115 | echo "<li class='{$li_class} {$active_class}'><a href='".tutor_utils()->get_tutor_dashboard_page_permalink($dashboard_key)."'> {$dashboard_page} </a> </li>"; |
| 116 | } |
| 117 | ?> |
| 118 | </ul> |
| 119 | </div> |
| 120 | |
| 121 | <div class="tutor-col-9"> |
| 122 | <div class="tutor-dashboard-content"> |
| 123 | <?php |
| 124 | if ($dashboard_page_name){ |
| 125 | tutor_load_template("dashboard.".$dashboard_page_name); |
| 126 | }else{ |
| 127 | tutor_load_template("dashboard.dashboard"); |
| 128 | } |
| 129 | ?> |
| 130 | </div> |
| 131 | </div> |
| 132 | </div> |
| 133 | </div> |
| 134 | |
| 135 | </div> |
| 136 | |
| 137 | |
| 138 | <?php do_action('tutor_dashboard/after/wrap'); ?> |
| 139 | |
| 140 | <?php |
| 141 | get_footer(); |
| 142 |