-
Notifications
You must be signed in to change notification settings - Fork 135
/
syllabus.php
68 lines (49 loc) · 1.56 KB
/
syllabus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Template for the Course Syllabus Displayed on individual course pages
*
* @author LifterLMS
* @package LifterLMS/Templates
*
* @since 1.0.0
* @since 3.24.0 Unknown.
* @since 4.4.0 Pass the progressive lesson order value to the lesson-preview template.
* @since 7.1.3 Add paragraph tag to wrap message when sections or lessons are empty.
* @version 7.1.3
*/
defined( 'ABSPATH' ) || exit;
global $post;
$course = new LLMS_Course( $post );
$sections = $course->get_sections();
?>
<div class="clear"></div>
<div class="llms-syllabus-wrapper">
<?php if ( ! $sections ) : ?>
<p><?php esc_html_e( 'This course does not have any sections.', 'lifterlms' ); ?></p>
<?php else : ?>
<?php foreach ( $sections as $section ) : ?>
<?php $lesson_order = 0; ?>
<?php if ( apply_filters( 'llms_display_outline_section_titles', true ) ) : ?>
<h3 class="llms-h3 llms-section-title"><?php echo esc_html( get_the_title( $section->get( 'id' ) ) ); ?></h3>
<?php endif; ?>
<?php $lessons = $section->get_lessons(); ?>
<?php if ( $lessons ) : ?>
<?php foreach ( $lessons as $lesson ) : ?>
<?php
llms_get_template(
'course/lesson-preview.php',
array(
'lesson' => $lesson,
'total_lessons' => count( $lessons ),
'order' => ++$lesson_order,
)
);
?>
<?php endforeach; ?>
<?php else : ?>
<p><?php esc_html_e( 'This section does not have any lessons.', 'lifterlms' ); ?></p>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<div class="clear"></div>
</div>