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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 / single / lesson / content.php
tutor / templates / single / lesson Last commit date
comment.php 4 years ago complete_form.php 4 years ago content.php 4 years ago lesson_sidebar.php 4 years ago required-enroll.php 4 years ago sidebar_question_and_answer.php 4 years ago
content.php
256 lines
1 <?php
2 /**
3 * Display the content
4 *
5 * @since v.1.0.0
6 * @author themeum
7 * @url https://themeum.com
8 *
9 * @package TutorLMS/Templates
10 * @version 1.4.3
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 global $post;
18 global $previous_id;
19 global $next_id;
20
21 // Get the ID of this content and the corresponding course
22 $course_content_id = get_the_ID();
23 $course_id = tutor_utils()->get_course_id_by_subcontent( $course_content_id );
24
25 $_is_preview = get_post_meta( $course_content_id, '_is_preview', true );
26 $content_id = tutor_utils()->get_post_id( $course_content_id );
27 $contents = tutor_utils()->get_course_prev_next_contents_by_id( $content_id );
28 $previous_id = $contents->previous_id;
29 $next_id = $contents->next_id;
30
31 $prev_is_preview = get_post_meta( $previous_id, '_is_preview', true );
32 $next_is_preview = get_post_meta( $next_id, '_is_preview', true );
33 $is_enrolled = tutor_utils()->is_enrolled( $course_id );
34 $is_public = get_post_meta( $course_id, '_tutor_is_public_course', true );
35
36 $prev_is_locked = !($is_enrolled || $prev_is_preview || $is_public);
37 $next_is_locked = !($is_enrolled || $next_is_preview || $is_public);
38
39 // Get total content count
40 $course_stats = tutor_utils()->get_course_completed_percent( $course_id, 0, true );
41
42 $jsonData = array();
43 $jsonData['post_id'] = get_the_ID();
44 $jsonData['best_watch_time'] = 0;
45 $jsonData['autoload_next_course_content'] = (bool) get_tutor_option( 'autoload_next_course_content' );
46
47 $best_watch_time = tutor_utils()->get_lesson_reading_info( get_the_ID(), 0, 'video_best_watched_time' );
48 if ( $best_watch_time > 0 ) {
49 $jsonData['best_watch_time'] = $best_watch_time;
50 }
51
52 $is_comment_enabled = tutor_utils()->get_option( 'enable_comment_for_lesson' ) && comments_open();
53 $is_enrolled = tutor_utils()->is_enrolled( $course_id );
54 ?>
55
56 <?php do_action( 'tutor_lesson/single/before/content' ); ?>
57 <?php if ( $is_enrolled ) : ?>
58 <div class="tutor-single-page-top-bar tutor-d-flex tutor-justify-between">
59 <div class="tutor-topbar-left-item tutor-d-flex">
60 <div class="tutor-topbar-item tutor-topbar-sidebar-toggle tutor-hide-sidebar-bar tutor-d-flex tutor-align-center tutor-d-none tutor-d-xl-flex">
61 <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar">
62 <span class="tutor-icon-left tutor-color-white tutor-d-flex tutor-align-center"></span>
63 </a>
64 </div>
65 <div class="tutor-topbar-item tutor-topbar-content-title-wrap tutor-d-flex tutor-align-center">
66 <span class="tutor-icon-brand-youtube-bold tutor-color-white tutor-mr-8"></span>
67 <span class="tutor-fs-7 tutor-color-white">
68 <?php
69 esc_html_e( 'Lesson: ', 'tutor' );
70 the_title();
71 ?>
72 </span>
73 </div>
74 </div>
75 <div class="tutor-topbar-right-item tutor-d-flex">
76 <div class="tutor-topbar-assignment-details tutor-d-flex tutor-align-center">
77 <?php
78 do_action( 'tutor_course/single/enrolled/before/lead_info/progress_bar' );
79 ?>
80 <div class="tutor-fs-7 tutor-color-white">
81 <?php if ( true == get_tutor_option( 'enable_course_progress_bar' ) ) : ?>
82 <span class="tutor-progress-content tutor-color-primary-60">
83 <?php _e( 'Your Progress:', 'tutor' ); ?>
84 </span>
85 <span class="tutor-fs-7 tutor-fw-bold">
86 <?php echo $course_stats['completed_count']; ?>
87 </span>
88 <?php _e( 'of ', 'tutor' ); ?>
89 <span class="tutor-fs-7 tutor-fw-bold">
90 <?php echo $course_stats['total_count']; ?>
91 </span>
92 (<?php echo $course_stats['completed_percent'] . '%'; ?>)
93 <?php endif; ?>
94 </div>
95 <?php
96 do_action( 'tutor_course/single/enrolled/after/lead_info/progress_bar' );
97 ?>
98 <!-- <div class="tutor-topbar-complete-btn tutor-ml-24"> -->
99 <?php tutor_lesson_mark_complete_html(); ?>
100 <!-- </div> -->
101 </div>
102 <div class="tutor-topbar-cross-icon tutor-ml-16 tutor-d-flex tutor-align-center">
103 <?php $course_id = tutor_utils()->get_course_id_by( 'lesson', get_the_ID() ); ?>
104 <a href="<?php echo get_the_permalink( $course_id ); ?>">
105 <span class="tutor-icon-times tutor-color-white tutor-d-flex tutor-align-center"></span>
106 </a>
107 </div>
108 </div>
109 </div>
110 <div class="tutor-mobile-top-navigation tutor-d-block tutor-d-sm-none tutor-my-20 tutor-mx-12">
111 <div class="tutor-mobile-top-nav tutor-d-flex tutor-align-center tutor-justify-between">
112 <a href="<?php echo $prev_is_locked ? '#' : get_the_permalink( $previous_id ); ?>">
113 <span class="tutor-top-nav-icon tutor-icon-previous design-lightgrey"></span>
114 </a>
115 <div class="tutor-top-nav-title tutor-fs-6 tutor-color-black">
116 <?php
117 the_title();
118 ?>
119 </div>
120 <div class="tutor-topbar-cross-icon tutor-ml-16 tutor-d-sm-none tutor-d-flex tutor-d-sm-none">
121 <?php $course_id = tutor_utils()->get_course_id_by( 'lesson', get_the_ID() ); ?>
122 <a href="<?php echo get_the_permalink( $course_id ); ?>">
123 <span class="tutor-icon-times tutor-color-primary tutor-d-flex tutor-align-center"></span>
124 </a>
125 </div>
126 </div>
127 </div>
128 <?php else : ?>
129 <div class="tutor-single-page-top-bar tutor-d-flex tutor-justify-between">
130 <div class="tutor-topbar-item tutor-topbar-sidebar-toggle tutor-hide-sidebar-bar tutor-d-flex tutor-align-center tutor-d-none tutor-d-xl-flex">
131 <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar">
132 <span class="tutor-icon-left tutor-color-white tutor-d-flex tutor-align-center"></span>
133 </a>
134 </div>
135 <div class="tutor-topbar-item tutor-topbar-content-title-wrap tutor-d-flex tutor-align-center">
136 <span class="tutor-icon-brand-youtube-bold tutor-color-white tutor-mr-8"></span>
137 <span class="tutor-fs-7 tutor-color-white">
138 <?php
139 esc_html_e( 'Lesson: ', 'tutor' );
140 the_title();
141 ?>
142 </span>
143 </div>
144
145 <div class="tutor-topbar-cross-icon tutor-ml-16 tutor-d-flex tutor-align-center">
146 <?php $course_id = tutor_utils()->get_course_id_by( 'lesson', get_the_ID() ); ?>
147 <a href="<?php echo get_the_permalink( $course_id ); ?>">
148 <span class="tutor-icon-times tutor-color-white tutor-d-flex tutor-align-center"></span>
149 </a>
150 </div>
151 </div>
152 <?php endif; ?>
153
154 <!-- Load Lesson Video -->
155 <?php
156 $video_info = tutor_utils()->get_video_info();
157 $source_key = is_object($video_info) && 'html5' !== $video_info->source ? 'source_'.$video_info->source : null;
158 $has_source = (is_object($video_info) && $video_info->source_video_id) || (isset($source_key) ? $video_info->$source_key : null);
159 ?>
160 <?php if ($has_source) : ?>
161 <input type="hidden" id="tutor_video_tracking_information" value="<?php echo esc_attr( json_encode( $jsonData ) ); ?>">
162 <div class="tutor-video-player-wrapper">
163 <?php tutor_lesson_video(); ?>
164 <?php if($previous_id): ?>
165 <div class="tutor-single-course-content-prev tutor-d-flex tutor-align-center">
166 <a href="<?php echo $prev_is_locked ? '#' : get_the_permalink( $previous_id ); ?>">
167 <span class="tutor-icon-angle-left" area-hidden="true"></span>
168 </a>
169 </div>
170 <?php endif; ?>
171
172 <?php if($next_id): ?>
173 <div class="tutor-single-course-content-next tutor-d-flex tutor-align-center">
174 <a href="<?php echo $next_is_locked ? '#' : get_the_permalink( $next_id ); ?>">
175 <span class="tutor-icon-angle-right" area-hidden="true"></span>
176 </a>
177 </div>
178 <?php endif; ?>
179 </div>
180 <?php endif; ?>
181
182 <?php
183 $referer_url = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
184 $referer_comment_id = explode( '#', $_SERVER['REQUEST_URI'] );
185 $url_components = parse_url( $referer_url );
186 isset( $url_components['query'] ) ? parse_str( $url_components['query'], $output ) : null;
187 $page_tab = isset( $_GET['page_tab'] ) ? esc_attr( $_GET['page_tab'] ) : ( isset( $output['page_tab'] ) ? $output['page_tab'] : null );
188 ?>
189
190 <style>
191 .tutor-actual-comment.viewing{
192 box-shadow: 0 0 10px #cdcfd5;
193 animation: blinkComment 1s infinite;
194 }
195 @keyframes blinkComment { 50% { box-shadow:0 0 0px #ffffff; } }
196 </style>
197
198 <div class="tutor-course-spotlight-wrapper">
199 <ul class="tutor-nav tutor-course-spotlight-nav tutor-justify-center">
200 <li class="tutor-nav-item">
201 <a href="#" class="tutor-nav-link<?php echo ( ! isset( $page_tab ) || 'overview' == $page_tab ) ? ' is-active' : ''; ?>" data-tutor-nav-target="tutor-course-spotlight-overview" data-tutor-query-variable="page_tab" data-tutor-query-value="overview">
202 <span class="tutor-icon-document-text tutor-mr-8" area-hidden="true"></span>
203 <span><?php _e( 'Overview', 'tutor' ); ?></span>
204 </a>
205 </li>
206
207 <li class="tutor-nav-item">
208 <a href="#" class="tutor-nav-link<?php echo 'files' == $page_tab ? ' is-active' : ''; ?>" data-tutor-nav-target="tutor-course-spotlight-files" data-tutor-query-variable="page_tab" data-tutor-query-value="files">
209 <span class="tutor-icon-paperclip tutor-mr-8" area-hidden="true"></span>
210 <span><?php _e( 'Exercise Files', 'tutor' ); ?></span>
211 </a>
212 </li>
213
214 <?php if ( $is_comment_enabled ) : ?>
215 <li class="tutor-nav-item">
216 <a href="#" class="tutor-nav-link<?php echo 'comments' == $page_tab ? ' is-active' : ''; ?>" data-tutor-nav-target="tutor-course-spotlight-comments" data-tutor-query-variable="page_tab" data-tutor-query-value="comments">
217 <span class="tutor-icon-comment tutor-mr-8" area-hidden="true"></span>
218 <span><?php _e( 'Comments', 'tutor' ); ?></span>
219 </a>
220 </li>
221 <?php endif; ?>
222 </ul>
223
224 <div class="tutor-tab tutor-course-spotlight-tab">
225 <div id="tutor-course-spotlight-overview" class="tutor-tab-item<?php echo ( ! isset( $page_tab ) || 'overview' == $page_tab ) ? ' is-active' : ''; ?>">
226 <div class="tutor-container">
227 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-12">
228 <?php _e( 'About Lesson', 'tutor' ); ?>
229 </div>
230 <div class="tutor-fs-6 tutor-color-secondary" style="min-height: 300px;">
231 <?php the_content(); ?>
232 </div>
233 </div>
234 </div>
235
236 <div id="tutor-course-spotlight-files" class="tutor-tab-item<?php echo 'files' == $page_tab ? ' is-active' : ''; ?>">
237 <div class="tutor-container">
238 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black"><?php _e( 'Exercise Files', 'tutor' ); ?></div>
239 <?php get_tutor_posts_attachments(); ?>
240 </div>
241 </div>
242
243 <?php if ( $is_comment_enabled ) : ?>
244 <div id="tutor-course-spotlight-comments" class="tutor-tab-item<?php echo 'comments' == $page_tab ? ' is-active' : ''; ?>">
245 <div class="tutor-container">
246 <div class="tutor-course-spotlight-comments">
247 <?php require __DIR__ . '/comment.php'; ?>
248 </div>
249 </div>
250 </div>
251 <?php endif; ?>
252 </div>
253 </div>
254
255 <?php do_action( 'tutor_lesson/single/after/content' ); ?>
256