complete_form.php
5 years ago
content.php
5 years ago
lesson_sidebar.php
5 years ago
required-enroll.php
5 years ago
sidebar_question_and_answer.php
5 years ago
lesson_sidebar.php
214 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display Topics and Lesson lists for learn |
| 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 | global $post; |
| 17 | |
| 18 | $currentPost = $post; |
| 19 | |
| 20 | $course_id = 0; |
| 21 | if ($post->post_type === 'tutor_quiz'){ |
| 22 | $course = tutor_utils()->get_course_by_quiz(get_the_ID()); |
| 23 | $course_id = $course->ID; |
| 24 | } elseif ($post->post_type === 'tutor_assignments'){ |
| 25 | $course_id = get_post_meta($post->ID, '_tutor_course_id_for_assignments', true); |
| 26 | } elseif ($post->post_type === 'tutor_zoom_meeting'){ |
| 27 | $course_id = get_post_meta($post->ID, '_tutor_zm_for_course', true); |
| 28 | } else { |
| 29 | $course_id = get_post_meta($post->ID, '_tutor_course_id_for_lesson', true); |
| 30 | } |
| 31 | $disable_qa_for_this_course = get_post_meta($course_id, '_tutor_disable_qa', true); |
| 32 | $enable_q_and_a_on_course = tutor_utils()->get_option('enable_q_and_a_on_course') && $disable_qa_for_this_course != 'yes'; |
| 33 | |
| 34 | |
| 35 | ?> |
| 36 | |
| 37 | <?php do_action('tutor_lesson/single/before/lesson_sidebar'); ?> |
| 38 | |
| 39 | <div class="tutor-sidebar-tabs-wrap"> |
| 40 | <div class="tutor-tabs-btn-group"> |
| 41 | <a href="#tutor-lesson-sidebar-tab-content" class="<?php echo $enable_q_and_a_on_course ? "active" : ""; ?>"> <i class="tutor-icon-education"></i> <span> <?php esc_html_e('Lesson List', 'tutor'); ?></span></a> |
| 42 | <?php if($enable_q_and_a_on_course) { ?> |
| 43 | <a href="#tutor-lesson-sidebar-qa-tab-content"> <i class="tutor-icon-question-1"></i> <span><?php esc_html_e('Browse Q&A', 'tutor'); ?></span></a> |
| 44 | <?php } ?> |
| 45 | </div> |
| 46 | |
| 47 | <div class="tutor-sidebar-tabs-content"> |
| 48 | |
| 49 | <div id="tutor-lesson-sidebar-tab-content" class="tutor-lesson-sidebar-tab-item"> |
| 50 | <?php |
| 51 | $topics = tutor_utils()->get_topics($course_id); |
| 52 | if ($topics->have_posts()){ |
| 53 | while ($topics->have_posts()){ $topics->the_post(); |
| 54 | $topic_id = get_the_ID(); |
| 55 | $topic_summery = get_the_content(); |
| 56 | ?> |
| 57 | |
| 58 | <div class="tutor-topics-in-single-lesson tutor-topics-<?php echo $topic_id; ?>"> |
| 59 | <div class="tutor-topics-title <?php echo $topic_summery ? 'has-summery' : ''; ?>"> |
| 60 | <h3> |
| 61 | <?php |
| 62 | the_title(); |
| 63 | if($topic_summery) { |
| 64 | echo "<span class='toogle-informaiton-icon'>?</span>"; |
| 65 | } |
| 66 | ?> |
| 67 | </h3> |
| 68 | <button class="tutor-single-lesson-topic-toggle"><i class="tutor-icon-plus"></i></button> |
| 69 | </div> |
| 70 | |
| 71 | <?php |
| 72 | if ($topic_summery){ |
| 73 | ?> |
| 74 | <div class="tutor-topics-summery"> |
| 75 | <?php echo $topic_summery; ?> |
| 76 | </div> |
| 77 | <?php |
| 78 | } |
| 79 | ?> |
| 80 | |
| 81 | <div class="tutor-lessons-under-topic" style="display: none"> |
| 82 | <?php |
| 83 | do_action('tutor/lesson_list/before/topic', $topic_id); |
| 84 | |
| 85 | $lessons = tutor_utils()->get_course_contents_by_topic(get_the_ID(), -1); |
| 86 | if ($lessons->have_posts()){ |
| 87 | while ($lessons->have_posts()){ |
| 88 | $lessons->the_post(); |
| 89 | |
| 90 | if ($post->post_type === 'tutor_quiz') { |
| 91 | $quiz = $post; |
| 92 | ?> |
| 93 | <div class="tutor-single-lesson-items quiz-single-item quiz-single-item-<?php echo $quiz->ID; ?> <?php echo ( $currentPost->ID === get_the_ID() ) ? 'active' : ''; ?>" data-quiz-id="<?php echo $quiz->ID; ?>"> |
| 94 | <a href="<?php echo get_permalink($quiz->ID); ?>" class="sidebar-single-quiz-a" data-quiz-id="<?php echo $quiz->ID; ?>"> |
| 95 | <i class="tutor-icon-doubt"></i> |
| 96 | <span class="lesson_title"><?php echo $quiz->post_title; ?></span> |
| 97 | <span class="tutor-lesson-right-icons"> |
| 98 | <?php |
| 99 | do_action('tutor/lesson_list/right_icon_area', $post); |
| 100 | |
| 101 | $time_limit = tutor_utils()->get_quiz_option($quiz->ID, 'time_limit.time_value'); |
| 102 | if ($time_limit){ |
| 103 | $time_type = tutor_utils()->get_quiz_option($quiz->ID, 'time_limit.time_type'); |
| 104 | echo "<span class='quiz-time-limit'>{$time_limit} {$time_type}</span>"; |
| 105 | } |
| 106 | ?> |
| 107 | </span> |
| 108 | </a> |
| 109 | </div> |
| 110 | <?php |
| 111 | }elseif($post->post_type === 'tutor_assignments'){ |
| 112 | /** |
| 113 | * Assignments |
| 114 | * @since this block v.1.3.3 |
| 115 | */ |
| 116 | |
| 117 | ?> |
| 118 | <div class="tutor-single-lesson-items assignments-single-item assignment-single-item-<?php echo $post->ID; ?> <?php echo ( $currentPost->ID === get_the_ID() ) ? 'active' : ''; ?>" |
| 119 | data-assignment-id="<?php echo $post->ID; ?>"> |
| 120 | <a href="<?php echo get_permalink($post->ID); ?>" class="sidebar-single-assignment-a" data-assignment-id="<?php echo $post->ID; ?>"> |
| 121 | <i class="tutor-icon-clipboard"></i> |
| 122 | <span class="lesson_title"> <?php echo $post->post_title; ?> </span> |
| 123 | <span class="tutor-lesson-right-icons"> |
| 124 | <?php do_action('tutor/lesson_list/right_icon_area', $post); ?> |
| 125 | </span> |
| 126 | </a> |
| 127 | </div> |
| 128 | <?php |
| 129 | |
| 130 | }elseif($post->post_type === 'tutor_zoom_meeting'){ |
| 131 | /** |
| 132 | * Zoom Meeting |
| 133 | * @since this block v.1.7.1 |
| 134 | */ |
| 135 | |
| 136 | ?> |
| 137 | <div class="tutor-single-lesson-items zoom-meeting-single-item zoom-meeting-single-item-<?php echo $post->ID; ?> <?php echo ( $currentPost->ID === get_the_ID() ) ? 'active' : ''; ?>" |
| 138 | data-assignment-id="<?php echo $post->ID; ?>"> |
| 139 | <a href="<?php echo get_permalink($post->ID); ?>" class="sidebar-single-zoom-meeting-a"> |
| 140 | <i class="zoom-icon"><img src="<?php echo TUTOR_ZOOM()->url; ?>assets/images/zoom-icon-grey.svg"></i> |
| 141 | <span class="lesson_title"> <?php echo $post->post_title; ?> </span> |
| 142 | <span class="tutor-lesson-right-icons"> |
| 143 | <?php do_action('tutor/lesson_list/right_icon_area', $post); ?> |
| 144 | </span> |
| 145 | </a> |
| 146 | </div> |
| 147 | <?php |
| 148 | |
| 149 | }else{ |
| 150 | |
| 151 | /** |
| 152 | * Lesson |
| 153 | */ |
| 154 | |
| 155 | $video = tutor_utils()->get_video_info(); |
| 156 | |
| 157 | $play_time = false; |
| 158 | if ( $video ) { |
| 159 | $play_time = $video->playtime; |
| 160 | } |
| 161 | $is_completed_lesson = tutor_utils()->is_completed_lesson(); |
| 162 | ?> |
| 163 | |
| 164 | <div class="tutor-single-lesson-items <?php echo ( $currentPost->ID === get_the_ID() ) ? 'active' : ''; ?>"> |
| 165 | <a href="<?php the_permalink(); ?>" class="tutor-single-lesson-a" data-lesson-id="<?php the_ID(); ?>"> |
| 166 | |
| 167 | <?php |
| 168 | $tutor_lesson_type_icon = $play_time ? 'youtube' : 'document'; |
| 169 | echo "<i class='tutor-icon-$tutor_lesson_type_icon'></i>"; |
| 170 | ?> |
| 171 | <span class="lesson_title"><?php the_title(); ?></span> |
| 172 | <span class="tutor-lesson-right-icons"> |
| 173 | <?php |
| 174 | do_action('tutor/lesson_list/right_icon_area', $post); |
| 175 | if ( $play_time ) { |
| 176 | echo "<i class='tutor-play-duration'>".tutor_utils()->get_optimized_duration($play_time)."</i>"; |
| 177 | } |
| 178 | $lesson_complete_icon = $is_completed_lesson ? 'tutor-icon-mark tutor-done' : ''; |
| 179 | echo "<i class='tutor-lesson-complete $lesson_complete_icon'></i>"; |
| 180 | ?> |
| 181 | </span> |
| 182 | </a> |
| 183 | </div> |
| 184 | |
| 185 | <?php |
| 186 | } |
| 187 | } |
| 188 | $lessons->reset_postdata(); |
| 189 | } |
| 190 | ?> |
| 191 | |
| 192 | <?php do_action('tutor/lesson_list/after/topic', $topic_id); ?> |
| 193 | </div> |
| 194 | </div> |
| 195 | |
| 196 | <?php |
| 197 | } |
| 198 | $topics->reset_postdata(); |
| 199 | wp_reset_postdata(); |
| 200 | } |
| 201 | ?> |
| 202 | </div> |
| 203 | |
| 204 | <div id="tutor-lesson-sidebar-qa-tab-content" class="tutor-lesson-sidebar-tab-item" style="display: none;"> |
| 205 | <?php |
| 206 | tutor_lesson_sidebar_question_and_answer(); |
| 207 | ?> |
| 208 | </div> |
| 209 | |
| 210 | </div> |
| 211 | |
| 212 | </div> |
| 213 | |
| 214 | <?php do_action('tutor_lesson/single/after/lesson_sidebar'); ?> |