enrolled
6 years ago
add-to-cart-edd.php
6 years ago
add-to-cart-woocommerce.php
6 years ago
add-to-cart.php
6 years ago
complete_form.php
6 years ago
course-benefits.php
6 years ago
course-content.php
6 years ago
course-enroll-box.php
6 years ago
course-enrolled-box.php
6 years ago
course-requirements.php
6 years ago
course-target-audience.php
6 years ago
course-topics.php
6 years ago
instructors.php
6 years ago
lead-info.php
6 years ago
login.php
6 years ago
material-includes.php
6 years ago
q_and_a_turned_off.php
6 years ago
review-form.php
6 years ago
reviews.php
6 years ago
social_share.php
6 years ago
tags.php
6 years ago
wc-price-html.php
6 years ago
course-topics.php
129 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying single course |
| 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 | if ( ! defined( 'ABSPATH' ) ) |
| 15 | exit; |
| 16 | |
| 17 | $topics = tutor_utils()->get_topics(); |
| 18 | $course_id = get_the_ID(); |
| 19 | $is_enrolled = tutor_utils()->is_enrolled($course_id); |
| 20 | |
| 21 | ?> |
| 22 | |
| 23 | |
| 24 | <?php do_action('tutor_course/single/before/topics'); ?> |
| 25 | |
| 26 | <?php if($topics->have_posts()) { ?> |
| 27 | <div class="tutor-single-course-segment tutor-course-topics-wrap"> |
| 28 | <div class="tutor-course-topics-header"> |
| 29 | <div class="tutor-course-topics-header-left"> |
| 30 | <h4 class="tutor-segment-title"><?php _e('Topics for this course', 'tutor'); ?></h4> |
| 31 | </div> |
| 32 | <div class="tutor-course-topics-header-right"> |
| 33 | <?php |
| 34 | $tutor_lesson_count = tutor_utils()->get_lesson_count_by_course($course_id); |
| 35 | $tutor_course_duration = get_tutor_course_duration_context($course_id); |
| 36 | |
| 37 | if($tutor_lesson_count) { |
| 38 | echo "<span> $tutor_lesson_count"; |
| 39 | _e(' Lessons', 'tutor'); |
| 40 | echo "</span>"; |
| 41 | } |
| 42 | if($tutor_course_duration){ |
| 43 | echo "<span>$tutor_course_duration</span>"; |
| 44 | } |
| 45 | ?> |
| 46 | </div> |
| 47 | </div> |
| 48 | <div class="tutor-course-topics-contents"> |
| 49 | <?php |
| 50 | |
| 51 | $index = 0; |
| 52 | |
| 53 | if ($topics->have_posts()){ |
| 54 | while ($topics->have_posts()){ $topics->the_post(); |
| 55 | $index++; |
| 56 | ?> |
| 57 | |
| 58 | <div class="tutor-course-topic <?php if($index == 1) echo "tutor-active"; ?>"> |
| 59 | <div class="tutor-course-title"> |
| 60 | <h4> <i class="tutor-icon-plus"></i> <?php the_title(); ?></h4> |
| 61 | </div> |
| 62 | |
| 63 | |
| 64 | <div class="tutor-course-lessons" style="<?php echo $index > 1 ? 'display: none' : ''; ?>"> |
| 65 | |
| 66 | <?php |
| 67 | $lessons = tutor_utils()->get_course_contents_by_topic(get_the_ID(), -1); |
| 68 | |
| 69 | if ($lessons->have_posts()){ |
| 70 | while ($lessons->have_posts()){ $lessons->the_post(); |
| 71 | global $post; |
| 72 | |
| 73 | $video = tutor_utils()->get_video_info(); |
| 74 | |
| 75 | $play_time = false; |
| 76 | if ($video){ |
| 77 | $play_time = $video->playtime; |
| 78 | } |
| 79 | |
| 80 | $lesson_icon = $play_time ? 'tutor-icon-youtube' : 'tutor-icon-document-alt'; |
| 81 | |
| 82 | if ($post->post_type === 'tutor_quiz'){ |
| 83 | $lesson_icon = 'tutor-icon-doubt'; |
| 84 | } |
| 85 | if ($post->post_type === 'tutor_assignments'){ |
| 86 | $lesson_icon = 'tutor-icon-clipboard'; |
| 87 | } |
| 88 | ?> |
| 89 | |
| 90 | <div class="tutor-course-lesson"> |
| 91 | <h5> |
| 92 | <?php |
| 93 | $lesson_title = "<i class='$lesson_icon'></i>"; |
| 94 | |
| 95 | if ($is_enrolled){ |
| 96 | $lesson_title .= "<a href='".get_the_permalink()."'> ".get_the_title()." </a>"; |
| 97 | |
| 98 | |
| 99 | $lesson_title .= $play_time ? "<span class='tutor-lesson-duration'>$play_time</span>" : ''; |
| 100 | |
| 101 | echo $lesson_title; |
| 102 | }else{ |
| 103 | $lesson_title .= get_the_title(); |
| 104 | $lesson_title .= $play_time ? "<span class='tutor-lesson-duration'>$play_time</span>" : ''; |
| 105 | echo apply_filters('tutor_course/contents/lesson/title', $lesson_title, get_the_ID()); |
| 106 | } |
| 107 | |
| 108 | ?> |
| 109 | </h5> |
| 110 | </div> |
| 111 | |
| 112 | <?php |
| 113 | } |
| 114 | $lessons->reset_postdata(); |
| 115 | } |
| 116 | ?> |
| 117 | </div> |
| 118 | </div> |
| 119 | <?php |
| 120 | } |
| 121 | $topics->reset_postdata(); |
| 122 | } |
| 123 | ?> |
| 124 | </div> |
| 125 | </div> |
| 126 | <?php } ?> |
| 127 | |
| 128 | |
| 129 | <?php do_action('tutor_course/single/after/topics'); ?> |