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.2 3.5.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 / views / metabox / course-contents.php
tutor / views / metabox Last commit date
course 4 years ago course-add-edd-product-metabox.php 3 years ago course-add-product-metabox.php 3 years ago course-additional-data.php 4 years ago course-contents.php 4 years ago course-level-metabox.php 4 years ago course-topics.php 3 years ago instructors-metabox.php 3 years ago lesson-attachments-metabox.php 4 years ago lesson-metabox.php 4 years ago product-selection.php 3 years ago settings-tabs.php 3 years ago user-profile-fields.php 4 years ago video-metabox.php 4 years ago
course-contents.php
184 lines
1 <div class="wp_editor_config_example" style="display: none;">
2 <?php wp_editor('', 'tutor_lesson_editor_config'); ?>
3 </div>
4
5 <div class="wp_editor_config_example" style="display: none;">
6 <?php wp_editor('', 'tutor_assignment_editor_config'); ?>
7 </div>
8
9 <div class="course-contents">
10
11 <?php
12
13 $query_topics = new WP_Query(array(
14 'post_type' => 'topics',
15 'post_parent' => $course_id,
16 'orderby' => 'menu_order',
17 'order' => 'ASC',
18 'posts_per_page' => -1,
19 ));
20
21 $query_topics = $query_topics->posts;
22
23 // Actually all kind of contents.
24 // This keyword '_tutor_course_id_for_lesson' used just to support backward compatibillity
25 global $wpdb;
26 $unassigned_contents = $wpdb->get_results(
27 "SELECT content.* FROM {$wpdb->posts} content
28 INNER JOIN {$wpdb->postmeta} meta ON content.ID=meta.post_id
29 WHERE content.post_parent=0
30 AND meta.meta_key='_tutor_course_id_for_lesson'
31 AND meta.meta_value=".$course_id
32 );
33
34 if(is_array($unassigned_contents) && count($unassigned_contents)) {
35
36 $query_topics[]=(object)array(
37 'ID' => 0,
38 'post_title' => __('Un-assigned Topic Contents', 'tutor'),
39 'contents' => $unassigned_contents
40 );
41 }
42
43 foreach ($query_topics as $topic){
44 $is_topic = $topic->ID > 0;
45 ?>
46 <div id="tutor-topics-<?php echo $topic->ID; ?>" class="tutor-topics-wrap" data-topic-id="<?php echo $topic->ID; ?>">
47 <div class="tutor-topics-top">
48 <div class="tutor-topic-title">
49 <span class="<?php echo $is_topic ? 'tutor-icon-hamburger-menu course-move-handle' : 'tutor-icon-warning'; ?> tutor-px-12"></span>
50 <span class="topic-inner-title tutor-fs-6 tutor-fw-bold tutor-color-black tutor-d-flex tutor-align-center">
51 <?php echo stripslashes($topic->post_title); ?>
52 </span>
53 <?php if($is_topic): ?>
54 <span class="tutor-iconic-btn" data-tutor-modal-target="tutor-topics-edit-id-<?php echo $topic->ID; ?>">
55 <i class="tutor-icon-edit" area-hidden="true"></i>
56 </span>
57 <span class="topic-delete-btn tutor-iconic-btn" action-delete-course-topic>
58 <i class="tutor-icon-trash-can-line" area-hidden="true"></i>
59 </span>
60 <?php endif; ?>
61 <span class="expand-collapse-wrap">
62 <i class="tutor-icon-angle-down" area-hidden="true"></i>
63 </span>
64 </div>
65 <?php
66 if($is_topic) {
67 tutor_load_template_from_custom_path(tutor()->path.'/views/modal/topic-form.php', array(
68 'modal_title' => __('Update Topic', 'tutor'),
69 'wrapper_id' => 'tutor-topics-edit-id-' . $topic->ID,
70 'topic_id' => $topic->ID,
71 'course_id' => $course_id,
72 'title' => $topic->post_title,
73 'summary' => $topic->post_content,
74 'wrapper_class' => 'tutor-topics-edit-form',
75 'button_text' => __('Update Topic', 'tutor'),
76 'button_class' => 'tutor-save-topic-btn'
77 ), false);
78 }
79 ?>
80 </div>
81 <div class="tutor-topics-body" style="display: <?php echo (isset($current_topic_id) && $current_topic_id == $topic->ID) ? 'block' : 'none'; ?>;">
82 <div class="tutor-lessons"><?php
83 $post_type = apply_filters( 'tutor_course_contents_post_types', array( tutor()->lesson_post_type, 'tutor_quiz' ) );
84 $course_contents = !$is_topic ? $topic->contents : get_posts(array(
85 'post_type' => $post_type,
86 'post_parent' => $topic->ID,
87 'posts_per_page' => -1,
88 'orderby' => 'menu_order',
89 'order' => 'ASC',
90 ));
91
92 $counter = array(
93 'lesson' => 0,
94 'quiz' => 0,
95 'assignment' => 0
96 );
97
98 foreach ($course_contents as $content){
99
100 if ($content->post_type === 'tutor_quiz'){
101 $quiz = $content;
102 $counter['quiz']++;
103 tutor_load_template_from_custom_path(tutor()->path.'/views/fragments/quiz-list-single.php', array(
104 'quiz_id' => $quiz->ID,
105 'topic_id' => $topic->ID,
106 'quiz_title' => __('Quiz', 'tutor').' '.$counter['quiz'].': '. $quiz->post_title,
107 ), false);
108
109 } elseif ($content->post_type === 'tutor_assignments'){
110 $counter['assignment']++;
111 ?>
112 <div data-course_content_id="<?php echo $content->ID; ?>" id="tutor-assignmentø-<?php echo $content->ID; ?>" class="course-content-item tutor-assignment tutor-assignment-<?php echo $content->ID; ?>">
113 <div class="tutor-course-content-top tutor-d-flex tutor-align-center">
114 <span class="tutor-icon-hamburger-menu tutor-cursor-move tutor-px-12"></span>
115 <a href="javascript:;" class="<?php echo $is_topic ? 'open-tutor-assignment-modal' : ''; ?>" data-assignment-id="<?php echo $content->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>">
116 <?php echo __('Assignment', 'tutor').' '.$counter['assignment'].': '. $content->post_title; ?>
117 </a>
118 <div class="tutor-course-content-top-right-action">
119 <?php if($is_topic): ?>
120 <a href="javascript:;" class="open-tutor-assignment-modal tutor-iconic-btn" data-assignment-id="<?php echo $content->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>">
121 <span class="tutor-icon-edit" area-hidden="true"></span>
122 </a>
123 <?php endif; ?>
124 <a href="javascript:;" class="tutor-delete-lesson-btn tutor-iconic-btn" data-lesson-id="<?php echo $content->ID; ?>">
125 <span class="tutor-icon-trash-can-line" area-hidden="true"></span>
126 </a>
127 </div>
128 </div>
129 </div>
130 <?php
131 } else if($content->post_type=='lesson') {
132 $counter['lesson']++;
133 ?>
134 <div data-course_content_id="<?php echo $content->ID; ?>" id="tutor-lesson-<?php echo $content->ID; ?>" class="course-content-item tutor-lesson tutor-lesson-<?php echo $content->ID; ?>">
135 <div class="tutor-course-content-top tutor-d-flex tutor-align-center">
136 <span class="tutor-icon-hamburger-menu tutor-cursor-move tutor-px-12"></span>
137 <a href="javascript:;" class="<?php echo $is_topic ? 'open-tutor-lesson-modal' : ''; ?>" data-lesson-id="<?php echo $content->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>">
138 <?php echo __('Lesson', 'tutor').' '.$counter['lesson'].': '.stripslashes($content->post_title); ?>
139 </a>
140 <div class="tutor-course-content-top-right-action">
141 <?php if($is_topic): ?>
142 <a href="javascript:;" class="open-tutor-lesson-modal tutor-iconic-btn" data-lesson-id="<?php echo $content->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>">
143 <span class="tutor-icon-edit" area-hidden="true"></span>
144 </a>
145 <?php endif; ?>
146 <a href="javascript:;" class="tutor-delete-lesson-btn tutor-iconic-btn" data-lesson-id="<?php echo $content->ID; ?>">
147 <span class="tutor-icon-trash-can-line" area-hidden="true"></span>
148 </a>
149 </div>
150 </div>
151 </div>
152 <?php
153 } else {
154 !isset($counter[$content->post_type]) ? $counter[$content->post_type]=0 : 0;
155 $counter[$content->post_type]++;
156 do_action( 'tutor/course/builder/content/'.$content->post_type, $content, $topic, $course_id, $counter[$content->post_type] );
157 }
158 }
159 ?></div>
160
161 <?php if($is_topic): ?>
162 <div class="tutor_add_content_wrap tutor_add_content_wrap_btn_sm" data-topic_id="<?php echo $topic->ID; ?>">
163 <?php do_action('tutor_course_builder_before_btn_group', $topic->ID); ?>
164
165 <button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm open-tutor-lesson-modal create-lesson-in-topic-btn" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" >
166 <i class="tutor-icon-plus-square tutor-mr-8"></i>
167 <?php _e('Lesson', 'tutor'); ?>
168 </button>
169
170 <button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm tutor-add-quiz-btn" data-topic-id="<?php echo $topic->ID; ?>">
171 <i class="tutor-icon-plus-square tutor-mr-8"></i>
172 <?php _e('Quiz', 'tutor'); ?>
173 </button>
174
175 <?php do_action('tutor_course_builder_after_btn_group', $topic->ID, $course_id); ?>
176 </div>
177 <?php endif; ?>
178 </div>
179 </div>
180 <?php
181 }
182 ?>
183 <input type="hidden" id="tutor_topics_lessons_sorting" name="tutor_topics_lessons_sorting" value="" />
184 </div>