dashboard
6 years ago
email
6 years ago
global
6 years ago
loop
6 years ago
profile
6 years ago
shortcode
6 years ago
single
6 years ago
template-part
6 years ago
widget
6 years ago
archive-course.php
6 years ago
course-none.php
6 years ago
dashboard.php
6 years ago
login.php
6 years ago
single-assignment.php
6 years ago
single-course-enrolled-announcements.php
6 years ago
single-course-enrolled-overview.php
6 years ago
single-course-enrolled-questions.php
6 years ago
single-course-enrolled-subpage.php
6 years ago
single-course-enrolled.php
6 years ago
single-course.php
6 years ago
single-lesson.php
6 years ago
single-preview-lesson.php
6 years ago
single-quiz.php
6 years ago
student-public-profile.php
6 years ago
template.php
6 years ago
single-preview-lesson.php
229 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying single lesson |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * |
| 7 | * @author Themeum |
| 8 | * @url https://themeum.com |
| 9 | * |
| 10 | * @package TutorLMS/Templates |
| 11 | * @version 1.4.3 |
| 12 | */ |
| 13 | |
| 14 | /* |
| 15 | get_header(); |
| 16 | |
| 17 | global $post; |
| 18 | $currentPost = $post; |
| 19 | */?><!-- |
| 20 | <?php /*do_action('tutor_lesson/single/before/wrap'); */?> |
| 21 | <div <?php /*tutor_post_class('tutor-single-lesson-wrap tutor-page-wrap'); */?>> |
| 22 | <div class="tutor-container"> |
| 23 | <div class="tutor-row"> |
| 24 | <div class="tutor-col-12"> |
| 25 | <?php /*tutor_lesson_video(); */?> |
| 26 | <?php /*the_content(); */?> |
| 27 | <?php /*get_tutor_posts_attachments(); */?> |
| 28 | </div> |
| 29 | </div> |
| 30 | </div> |
| 31 | </div> |
| 32 | --><?php /*do_action('tutor_lesson/single/after/wrap'); |
| 33 | |
| 34 | get_footer();*/ |
| 35 | |
| 36 | |
| 37 | |
| 38 | get_tutor_header(); |
| 39 | |
| 40 | global $post; |
| 41 | $currentPost = $post; |
| 42 | |
| 43 | $enable_spotlight_mode = tutor_utils()->get_option('enable_spotlight_mode'); |
| 44 | ?> |
| 45 | |
| 46 | <?php do_action('tutor_lesson/single/before/wrap'); ?> |
| 47 | <div class="tutor-single-lesson-wrap <?php echo $enable_spotlight_mode ? "tutor-spotlight-mode" : ""; ?>"> |
| 48 | <div class="tutor-lesson-sidebar"> |
| 49 | |
| 50 | |
| 51 | <!-- Start: Sidebar --> |
| 52 | |
| 53 | <?php |
| 54 | |
| 55 | $course_id = 0; |
| 56 | if ($post->post_type === 'tutor_quiz'){ |
| 57 | $course = tutor_utils()->get_course_by_quiz(get_the_ID()); |
| 58 | $course_id = $course->ID; |
| 59 | }elseif($post->post_type === 'tutor_assignments'){ |
| 60 | $course_id = get_post_meta($post->ID, '_tutor_course_id_for_assignments', true); |
| 61 | |
| 62 | } else{ |
| 63 | $course_id = get_post_meta($post->ID, '_tutor_course_id_for_lesson', true); |
| 64 | } |
| 65 | |
| 66 | ?> |
| 67 | |
| 68 | <?php do_action('tutor_lesson/single/before/lesson_sidebar'); ?> |
| 69 | |
| 70 | <div class="tutor-sidebar-tabs-wrap"> |
| 71 | <div class="tutor-tabs-btn-group"> |
| 72 | <a href="#tutor-lesson-sidebar-tab-content" class="active"> <i class="tutor-icon-education"></i> <span> <?php esc_html_e('Lesson List', 'tutor'); ?></span></a> |
| 73 | </div> |
| 74 | |
| 75 | <div class="tutor-sidebar-tabs-content"> |
| 76 | |
| 77 | <div id="tutor-lesson-sidebar-tab-content" class="tutor-lesson-sidebar-tab-item"> |
| 78 | <?php |
| 79 | $topics = tutor_utils()->get_topics($course_id); |
| 80 | if ($topics->have_posts()){ |
| 81 | while ($topics->have_posts()){ $topics->the_post(); |
| 82 | $topic_id = get_the_ID(); |
| 83 | $topic_summery = get_the_content(); |
| 84 | ?> |
| 85 | |
| 86 | <div class="tutor-topics-in-single-lesson tutor-topics-<?php echo $topic_id; ?>"> |
| 87 | <div class="tutor-topics-title <?php echo $topic_summery ? 'has-summery' : ''; ?>"> |
| 88 | <h3> |
| 89 | <?php |
| 90 | the_title(); |
| 91 | if($topic_summery) { |
| 92 | echo "<span class='toogle-informaiton-icon'>?</span>"; |
| 93 | } |
| 94 | ?> |
| 95 | </h3> |
| 96 | <button class="tutor-single-lesson-topic-toggle"><i class="tutor-icon-plus"></i></button> |
| 97 | </div> |
| 98 | |
| 99 | <?php |
| 100 | if ($topic_summery){ |
| 101 | ?> |
| 102 | <div class="tutor-topics-summery"> |
| 103 | <?php echo $topic_summery; ?> |
| 104 | </div> |
| 105 | <?php |
| 106 | } |
| 107 | ?> |
| 108 | |
| 109 | <div class="tutor-lessons-under-topic" style="display: none"> |
| 110 | <?php |
| 111 | do_action('tutor/lesson_list/before/topic', $topic_id); |
| 112 | |
| 113 | $lessons = tutor_utils()->get_course_contents_by_topic(get_the_ID(), -1); |
| 114 | if ($lessons->have_posts()){ |
| 115 | while ($lessons->have_posts()){ $lessons->the_post(); |
| 116 | global $post; |
| 117 | |
| 118 | $video = tutor_utils()->get_video_info(); |
| 119 | |
| 120 | $play_time = false; |
| 121 | if ($video){ |
| 122 | $play_time = $video->playtime; |
| 123 | } |
| 124 | |
| 125 | $lesson_icon = $play_time ? 'tutor-icon-youtube' : 'tutor-icon-document-alt'; |
| 126 | if ($post->post_type === 'tutor_quiz'){ |
| 127 | $lesson_icon = 'tutor-icon-doubt'; |
| 128 | } |
| 129 | if ($post->post_type === 'tutor_assignments'){ |
| 130 | $lesson_icon = 'tutor-icon-clipboard'; |
| 131 | } |
| 132 | ?> |
| 133 | |
| 134 | <div class="tutor-course-lesson <?php echo ( $currentPost->ID === get_the_ID() ) ? 'active' : ''; ?>"> |
| 135 | <h5> |
| 136 | <?php |
| 137 | $lesson_title = "<i class='$lesson_icon'></i>"; |
| 138 | |
| 139 | $lesson_title .= get_the_title(); |
| 140 | $lesson_title .= $play_time ? "<span class='tutor-lesson-duration'>$play_time</span>" : ''; |
| 141 | echo apply_filters('tutor_course/contents/lesson/title', $lesson_title, get_the_ID()); |
| 142 | ?> |
| 143 | </h5> |
| 144 | </div> |
| 145 | |
| 146 | <?php |
| 147 | } |
| 148 | $lessons->reset_postdata(); |
| 149 | } |
| 150 | ?> |
| 151 | |
| 152 | <?php do_action('tutor/lesson_list/after/topic', $topic_id); ?> |
| 153 | </div> |
| 154 | </div> |
| 155 | |
| 156 | <?php |
| 157 | } |
| 158 | $topics->reset_postdata(); |
| 159 | wp_reset_postdata(); |
| 160 | } |
| 161 | ?> |
| 162 | </div> |
| 163 | |
| 164 | </div> |
| 165 | |
| 166 | </div> |
| 167 | |
| 168 | <?php do_action('tutor_lesson/single/after/lesson_sidebar'); ?> |
| 169 | |
| 170 | |
| 171 | <!-- END: Sidebar --> |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | </div> |
| 177 | <div id="tutor-single-entry-content" class="tutor-lesson-content tutor-single-entry-content tutor-single-entry-content-<?php the_ID(); ?>"> |
| 178 | |
| 179 | <?php //tutor_lesson_content(); ?> |
| 180 | |
| 181 | <?php |
| 182 | |
| 183 | do_action('tutor_lesson/single/before/content'); |
| 184 | |
| 185 | $jsonData = array(); |
| 186 | $jsonData['post_id'] = get_the_ID(); |
| 187 | $jsonData['best_watch_time'] = 0; |
| 188 | $jsonData['autoload_next_course_content'] = (bool) get_tutor_option('autoload_next_course_content'); |
| 189 | |
| 190 | ?> |
| 191 | |
| 192 | <?php do_action('tutor_lesson/single/before/content'); ?> |
| 193 | |
| 194 | <div class="tutor-single-page-top-bar"> |
| 195 | <div class="tutor-topbar-item tutor-hide-sidebar-bar"> |
| 196 | <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-angle-left"></i> </a> |
| 197 | <?php $course_id = get_post_meta(get_the_ID(), '_tutor_course_id_for_lesson', true); ?> |
| 198 | <a href="<?php echo get_the_permalink($course_id); ?>" class="tutor-topbar-home-btn"> |
| 199 | <i class="tutor-icon-home"></i> <?php echo __('Go to Course Home', 'tutor') ; ?> |
| 200 | </a> |
| 201 | </div> |
| 202 | <div class="tutor-topbar-item tutor-topbar-content-title-wrap"> |
| 203 | <?php |
| 204 | tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true); |
| 205 | the_title(); ?> |
| 206 | </div> |
| 207 | </div> |
| 208 | |
| 209 | |
| 210 | <div class="tutor-lesson-content-area"> |
| 211 | <input type="hidden" id="tutor_video_tracking_information" value="<?php echo esc_attr(json_encode($jsonData)); ?>"> |
| 212 | <?php tutor_lesson_video(); ?> |
| 213 | <?php the_content(); ?> |
| 214 | <?php get_tutor_posts_attachments(); ?> |
| 215 | <?php tutor_next_previous_pagination(); ?> |
| 216 | </div> |
| 217 | |
| 218 | <?php do_action('tutor_lesson/single/after/content'); ?> |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | </div> |
| 226 | </div> |
| 227 | <?php do_action('tutor_lesson/single/after/wrap'); |
| 228 | |
| 229 | get_tutor_footer(); |