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
198 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 | // Get total content count |
| 32 | $course_stats = tutor_utils()->get_course_completed_percent( $course_id, 0, true ); |
| 33 | |
| 34 | $jsonData = array(); |
| 35 | $jsonData['post_id'] = get_the_ID(); |
| 36 | $jsonData['best_watch_time'] = 0; |
| 37 | $jsonData['autoload_next_course_content'] = (bool) get_tutor_option( 'autoload_next_course_content' ); |
| 38 | |
| 39 | $best_watch_time = tutor_utils()->get_lesson_reading_info( get_the_ID(), 0, 'video_best_watched_time' ); |
| 40 | if ( $best_watch_time > 0 ) { |
| 41 | $jsonData['best_watch_time'] = $best_watch_time; |
| 42 | } |
| 43 | |
| 44 | $is_comment_enabled = tutor_utils()->get_option( 'enable_comment_for_lesson' ) && comments_open(); |
| 45 | $is_enrolled = tutor_utils()->is_enrolled( $course_id ); |
| 46 | ?> |
| 47 | |
| 48 | <?php do_action( 'tutor_lesson/single/before/content' ); ?> |
| 49 | <?php if ( $is_enrolled ) : ?> |
| 50 | <div class="tutor-single-page-top-bar tutor-d-flex tutor-justify-content-between"> |
| 51 | <div class="tutor-topbar-left-item tutor-d-flex"> |
| 52 | <div class="tutor-topbar-item tutor-topbar-sidebar-toggle tutor-hide-sidebar-bar flex-center tutor-d-none tutor-d-xl-flex"> |
| 53 | <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"> |
| 54 | <span class="tutor-icon-icon-light-left-line tutor-color-white flex-center"></span> |
| 55 | </a> |
| 56 | </div> |
| 57 | <div class="tutor-topbar-item tutor-topbar-content-title-wrap flex-center"> |
| 58 | <span class="tutor-icon-youtube-brand tutor-icon-24 tutor-color-white tutor-mr-4"></span> |
| 59 | <span class="text-regular-caption tutor-color-design-white"> |
| 60 | <?php |
| 61 | esc_html_e( 'Lesson: ', 'tutor' ); |
| 62 | the_title(); |
| 63 | ?> |
| 64 | </span> |
| 65 | </div> |
| 66 | </div> |
| 67 | <div class="tutor-topbar-right-item tutor-d-flex"> |
| 68 | <div class="tutor-topbar-assignment-details tutor-d-flex tutor-align-items-center"> |
| 69 | <?php |
| 70 | do_action( 'tutor_course/single/enrolled/before/lead_info/progress_bar' ); |
| 71 | ?> |
| 72 | <div class="text-regular-caption tutor-color-design-white"> |
| 73 | <span class="tutor-progress-content tutor-color-primary-60"> |
| 74 | <?php _e( 'Your Progress:', 'tutor' ); ?> |
| 75 | </span> |
| 76 | <span class="text-bold-caption"> |
| 77 | <?php echo $course_stats['completed_count']; ?> |
| 78 | </span> |
| 79 | <?php _e( 'of ', 'tutor' ); ?> |
| 80 | <span class="text-bold-caption"> |
| 81 | <?php echo $course_stats['total_count']; ?> |
| 82 | </span> |
| 83 | (<?php echo $course_stats['completed_percent'] . '%'; ?>) |
| 84 | </div> |
| 85 | <?php |
| 86 | do_action( 'tutor_course/single/enrolled/after/lead_info/progress_bar' ); |
| 87 | ?> |
| 88 | <!-- <div class="tutor-topbar-complete-btn tutor-ml-24"> --> |
| 89 | <?php tutor_lesson_mark_complete_html(); ?> |
| 90 | <!-- </div> --> |
| 91 | </div> |
| 92 | <div class="tutor-topbar-cross-icon tutor-ml-16 flex-center"> |
| 93 | <?php $course_id = tutor_utils()->get_course_id_by( 'lesson', get_the_ID() ); ?> |
| 94 | <a href="<?php echo get_the_permalink( $course_id ); ?>"> |
| 95 | <span class="tutor-icon-line-cross-line tutor-color-white flex-center"></span> |
| 96 | </a> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | <div class="tutor-mobile-top-navigation tutor-d-block tutor-d-sm-none tutor-my-20 tutor-mx-12"> |
| 101 | <div class="tutor-mobile-top-nav d-grid"> |
| 102 | <a href="<?php echo get_the_permalink( $previous_id ); ?>"> |
| 103 | <span class="tutor-top-nav-icon tutor-icon-previous-line design-lightgrey"></span> |
| 104 | </a> |
| 105 | <div class="tutor-top-nav-title tutor-fs-6 tutor-fw-normal tutor-color-black"> |
| 106 | <?php |
| 107 | the_title(); |
| 108 | ?> |
| 109 | </div> |
| 110 | </div> |
| 111 | </div> |
| 112 | <?php else : ?> |
| 113 | <div class="tutor-single-page-top-bar tutor-d-flex tutor-justify-content-between"> |
| 114 | <div class="tutor-topbar-item tutor-topbar-sidebar-toggle tutor-hide-sidebar-bar flex-center tutor-d-none tutor-d-xl-flex"> |
| 115 | <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"> |
| 116 | <span class="tutor-icon-icon-light-left-line tutor-color-white flex-center"></span> |
| 117 | </a> |
| 118 | </div> |
| 119 | <div class="tutor-topbar-item tutor-topbar-content-title-wrap flex-center"> |
| 120 | <span class="tutor-icon-youtube-brand tutor-icon-24 tutor-color-white tutor-mr-4"></span> |
| 121 | <span class="text-regular-caption tutor-color-design-white"> |
| 122 | <?php |
| 123 | esc_html_e( 'Lesson: ', 'tutor' ); |
| 124 | the_title(); |
| 125 | ?> |
| 126 | </span> |
| 127 | </div> |
| 128 | |
| 129 | <div class="tutor-topbar-cross-icon tutor-ml-16 flex-center"> |
| 130 | <?php $course_id = tutor_utils()->get_course_id_by( 'lesson', get_the_ID() ); ?> |
| 131 | <a href="<?php echo get_the_permalink( $course_id ); ?>"> |
| 132 | <span class="tutor-icon-line-cross-line tutor-color-white flex-center"></span> |
| 133 | </a> |
| 134 | </div> |
| 135 | </div> |
| 136 | <?php endif; ?> |
| 137 | |
| 138 | <!-- Load Lesson Video --> |
| 139 | <input type="hidden" id="tutor_video_tracking_information" value="<?php echo esc_attr( json_encode( $jsonData ) ); ?>"> |
| 140 | <?php tutor_lesson_video(); |
| 141 | |
| 142 | $referer_url = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:''; |
| 143 | $referer_comment_id = explode( '#', $_SERVER['REQUEST_URI'] ); |
| 144 | $url_components = parse_url( $referer_url ); |
| 145 | isset( $url_components['query'] ) ? parse_str( $url_components['query'], $output ) : null; |
| 146 | $page_tab = isset( $_GET['page_tab'] ) ? esc_attr( $_GET['page_tab'] ) : ( isset($output['page_tab']) ?$output['page_tab']: null ); |
| 147 | ?> |
| 148 | |
| 149 | <style> |
| 150 | .tutor-actual-comment.viewing{ |
| 151 | box-shadow: 0 0 10px #cdcfd5; |
| 152 | animation: blinkComment 1s infinite; |
| 153 | } |
| 154 | @keyframes blinkComment { 50% { box-shadow:0 0 0px #ffffff; } } |
| 155 | </style> |
| 156 | |
| 157 | <div class="tutor-course-spotlight-wrapper"> |
| 158 | <div class="tutor-spotlight-tab tutor-default-tab tutor-course-details-tab"> |
| 159 | <div class="tab-header tutor-d-flex justify-content-center"> |
| 160 | <div class="tab-header-item flex-center<?php echo (!isset($page_tab) || 'overview'==$page_tab) ? ' is-active' : ''; ?>" data-tutor-spotlight-tab-target="tutor-course-spotlight-tab-1" data-tutor-query-string="overview"> |
| 161 | <span class="tutor-icon-document-alt-filled"></span> |
| 162 | <span><?php _e( 'Overview', 'tutor' ); ?></span> |
| 163 | </div> |
| 164 | <div class="tab-header-item flex-center<?php echo 'files'==$page_tab ? ' is-active' : ''; ?>" data-tutor-spotlight-tab-target="tutor-course-spotlight-tab-2" data-tutor-query-string="files"> |
| 165 | <span class="tutor-icon-attach-filled"></span> |
| 166 | <span><?php _e( 'Exercise Files', 'tutor' ); ?></span> |
| 167 | </div> |
| 168 | <?php if ( $is_comment_enabled ) : ?> |
| 169 | <div class="tab-header-item flex-center<?php echo 'comments'==$page_tab ? ' is-active' : ''; ?>" data-tutor-spotlight-tab-target="tutor-course-spotlight-tab-3" data-tutor-query-string="comments"> |
| 170 | <span class="tutor-icon-comment-filled"></span> |
| 171 | <span><?php _e( 'Comments', 'tutor' ); ?></span> |
| 172 | </div> |
| 173 | <?php endif; ?> |
| 174 | </div> |
| 175 | <div class="tab-body"> |
| 176 | <div class="tab-body-item<?php echo (!isset($page_tab) || 'overview'==$page_tab) ? ' is-active' : ''; ?>" id="tutor-course-spotlight-tab-1" data-tutor-query-string-content="overview"> |
| 177 | <div class="text-medium-h6 tutor-color-black"> |
| 178 | <?php _e( 'About Lesson', 'tutor' ); ?> |
| 179 | </div> |
| 180 | <div class="text-regular-body tutor-color-black-60 tutor-mt-12" style="min-height:293px;"> |
| 181 | <?php the_content(); ?> |
| 182 | </div> |
| 183 | </div> |
| 184 | <div class="tab-body-item<?php echo 'files'==$page_tab ? ' is-active' : ''; ?>" id="tutor-course-spotlight-tab-2" data-tutor-query-string-content="files"> |
| 185 | <div class="text-medium-h6 tutor-color-black"><?php _e( 'Exercise Files', 'tutor' ); ?></div> |
| 186 | <?php get_tutor_posts_attachments(); ?> |
| 187 | </div> |
| 188 | <?php if ( $is_comment_enabled ) : ?> |
| 189 | <div class="tab-body-item<?php echo 'comments'==$page_tab ? ' is-active' : ''; ?>" id="tutor-course-spotlight-tab-3" data-tutor-query-string-content="comments"> |
| 190 | <?php require __DIR__ . '/comment.php'; ?> |
| 191 | </div> |
| 192 | <?php endif; ?> |
| 193 | </div> |
| 194 | </div> |
| 195 | </div> |
| 196 | |
| 197 | <?php do_action( 'tutor_lesson/single/after/content' ); ?> |
| 198 |