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.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 / templates / dashboard / create-course.php
tutor / templates / dashboard Last commit date
announcements 4 years ago assignments 4 years ago elements 4 years ago enrolled-courses 4 years ago instructor 4 years ago my-courses 4 years ago my-quiz-attempts 4 years ago notifications 4 years ago question-answer 4 years ago quiz-attempts 4 years ago reviews 4 years ago settings 4 years ago withdraw-method-fields 4 years ago announcements.php 4 years ago assignments.php 4 years ago create-course.php 4 years ago dashboard.php 4 years ago enrolled-courses.php 4 years ago index.php 4 years ago logged-in.php 4 years ago my-courses.php 4 years ago my-profile.php 4 years ago my-quiz-attempts.php 4 years ago purchase_history.php 4 years ago question-answer.php 4 years ago quiz-attempts.php 4 years ago registration.php 4 years ago reviews.php 4 years ago settings.php 4 years ago wishlist.php 4 years ago withdraw.php 4 years ago
create-course.php
301 lines
1 <?php
2
3 /**
4 * @package TutorLMS/Templates
5 * @version 1.4.3
6 */
7
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11
12 get_tutor_header(true);
13 do_action('tutor_load_template_before', 'dashboard.create-course', null);
14
15 $course_id = (int) isset( $_GET['course_ID'] ) ? sanitize_text_field( $_GET['course_ID'] ) : 0;
16
17 $post = get_post( $course_id );
18
19 if ( ! $course_id || tutor()->course_post_type != get_post_type( $post) ) {
20 return;
21 }
22 setup_postdata( $post );
23
24 $can_publish_course = (bool) tutor_utils()->get_option('instructor_can_publish_course') || current_user_can('administrator');
25 ?>
26
27 <?php
28 if (!tutor_utils()->is_instructor(get_current_user_id(), true) || !tutor_utils()->can_user_edit_course(get_current_user_id(), $course_id)) {
29 $args = array(
30 'headline' => __('Permission Denied', 'tutor'),
31 'message' => __('You don\'t have the right to edit this course', 'tutor'),
32 'description' => __('Please make sure you are logged in to correct account', 'tutor'),
33 'button' => array(
34 'url' => get_permalink($course_id),
35 'text' => __('View Course', 'tutor'),
36 ),
37 );
38
39 tutor_load_template('permission-denied', $args);
40 return;
41 }
42 ?>
43
44 <?php do_action('tutor/dashboard_course_builder_before'); ?>
45 <form action="" id="tutor-frontend-course-builder" method="post" enctype="multipart/form-data">
46 <?php
47 wp_nonce_field(tutor()->nonce_action, tutor()->nonce);
48 if ( $post->post_status === 'draft' ) {
49 ?>
50 <input name="original_publish" type="hidden" id="original_publish" value="Publish">
51 <?php } ?>
52
53
54 <!-- Sticky header with course action buttons -->
55 <header class="tutor-dashboard-builder-header tutor-mb-32">
56 <div class="tutor-container-fluid">
57 <div class="tutor-row tutor-align-center">
58 <div class="tutor-col-auto">
59 <div class="tutor-dashboard-builder-header-left">
60 <div class="tutor-dashboard-builder-logo">
61 <?php $tutor_course_builder_logo_src = apply_filters('tutor_course_builder_logo_src', tutor()->url . 'assets/images/tutor-logo.png'); ?>
62 <img src="<?php echo esc_url($tutor_course_builder_logo_src); ?>" alt="">
63 </div>
64 </div>
65 </div>
66
67 <div class="tutor-col tutor-mt-12 tutor-mb-12">
68 <div class="tutor-dashboard-builder-header-right tutor-d-flex tutor-align-center tutor-justify-end">
69 <?php if ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) : ?>
70 <a href="#" id="tutor-course-save-draft" class="tutor-btn tutor-btn-ghost tutor-btn-md tutor-mr-20" name="course_submit_btn" value="save_course_as_draft">
71 <i class="tutor-icon-save-line tutor-mr-8" area-hidden="true"></i>
72 <?php _e('Save as Draft', 'tutor'); ?>
73 </a>
74 <?php endif; ?>
75
76 <a class="tutor-btn tutor-btn-secondary tutor-btn-md" href="<?php echo esc_url( get_the_permalink($course_id) ); ?>" target="_blank">
77 <?php _e('Preview', 'tutor'); ?>
78 </a>
79
80 <?php if ($can_publish_course): ?>
81 <button class="tutor-btn tutor-btn-primary tutor-btn-md tutor-ml-20 tutor-static-loader" type="submit" name="course_submit_btn" value="publish_course">
82 <?php _e('Publish', 'tutor'); ?>
83 </button>
84 <?php else: ?>
85 <button class="tutor-btn tutor-btn-primary tutor-btn-md tutor-ml-20" type="submit" name="course_submit_btn" value="submit_for_review" title="<?php _e('Submit for Review', 'tutor'); ?>">
86 <?php _e('Submit', 'tutor'); ?>
87 </button>
88 <?php endif; ?>
89
90 <a href="<?php echo tutor_utils()->tutor_dashboard_url(); ?>" class="tutor-iconic-btn tutor-iconic-btn-md tutor-ml-12" title="<?php _e('Exit', 'tutor'); ?>"><i class="tutor-icon-times" area-hidden="true"></i></a>
91 </div>
92 </div>
93 </div>
94 </div>
95 </header>
96
97 <!-- Course builder body -->
98 <div class="tutor-container">
99 <div class="tutor-row">
100 <div class="tutor-col-12 tutor-col-lg-8 tutor-mb-32 tutor-pr-32">
101 <input type="hidden" value="tutor_add_course_builder" name="tutor_action" />
102 <input type="hidden" name="course_ID" id="course_ID" value="<?php echo get_the_ID(); ?>">
103 <input type="hidden" name="post_ID" id="post_ID" value="<?php echo get_the_ID(); ?>">
104
105 <!--since 1.8.0 alert message -->
106 <?php
107 $user_id = get_current_user_id();
108 $expires = get_user_meta($user_id, 'tutor_frontend_course_message_expires', true);
109 $message = get_user_meta($user_id, 'tutor_frontend_course_action_message', true);
110
111 if ($message && $expires && $expires > time()) {
112 $show_modal = $message['show_modal'];
113 $message = $message['message'];
114
115 if (!$show_modal) {
116 ?>
117 <div class="tutor-alert tutor-alert-info">
118 <?php echo $message; ?>
119 </div>
120 <?php } else { ?>
121 <!-- @todo: move to toast -->
122 <div id="modal-course-save-feedback" class="tutor-modal tutor-is-active">
123 <span class="tutor-modal-overlay"></span>
124 <div class="tutor-modal-window tutor-modal-window-md">
125 <div class="tutor-modal-content tutor-modal-content-white">
126 <button class="tutor-iconic-btn tutor-modal-close-o" data-tutor-modal-close>
127 <span class="tutor-icon-times" area-hidden="true"></span>
128 </button>
129
130 <div class="tutor-modal-body tutor-text-center">
131 <div class="tutor-py-48">
132 <img class="tutor-d-inline-block" src="<?php echo tutor()->url; ?>assets/images/icon-cup.svg" />
133 <div class="tutor-fs-3 tutor-fw-medium tutor-color-black tutor-mb-12"><?php _e('Thank You!', 'tutor'); ?></div>
134 <div class="tutor-fs-6 tutor-color-muted"><?php echo $message; ?></div>
135 </div>
136 </div>
137 </div>
138 </div>
139 </div>
140 <script>
141 const alertBox = document.getElementById('modal-course-save-feedback');
142 setTimeout(() => {
143 if (alertBox) alertBox.classList.remove('tutor-is-active');
144 }, 5000)
145 </script>
146 <?php
147 }
148 }
149
150 if ($message || $expires) {
151 delete_user_meta($user_id, 'tutor_frontend_course_message_expires');
152 delete_user_meta($user_id, 'tutor_frontend_course_action_message');
153 }
154 ?>
155 <!--alert message end -->
156 <?php do_action('tutor/dashboard_course_builder_form_field_before'); ?>
157
158 <div class="tutor-course-builder-section tutor-course-builder-info">
159 <div class="tutor-course-builder-section-title">
160 <span class="tutor-fs-5 tutor-fw-bold tutor-color-secondary">
161 <i class="color-text-brand tutor-icon-angle-up tutor-fs-5" area-hidden="true"></i>
162 <span><?php esc_html_e('Course Info', 'tutor'); ?></span>
163 </span>
164 </div>
165 <!--.tutor-course-builder-section-title-->
166 <div class="tutor-course-builder-section-content">
167 <div class="tutor-mb-32">
168 <label class="tutor-course-field-label tutor-fs-6 tutor-color-black"><?php _e('Course Title', 'tutor'); ?></label>
169 <div id="tutor-course-create-title-tooltip-wrapper" class="tooltip-wrap tutor-d-block">
170 <span class="tooltip-txt tooltip-right tutor-mt-12">
171 <?php _e('255', 'tutor'); ?>
172 </span>
173 <input id="tutor-course-create-title" type="text" name="title" class="tutor-form-control" value="<?php echo get_the_title(); ?>" placeholder="<?php _e('ex. Learn Photoshop CS6 from scratch', 'tutor'); ?>" maxlength="255">
174 </div>
175 </div>
176
177 <div class="tutor-mb-32">
178 <label class="tutor-course-field-label tutor-fs-6 tutor-color-black"><?php _e('About Course', 'tutor'); ?></label>
179 <div class="tutor-mb-16">
180 <?php
181 $editor_settings = array(
182 'media_buttons' => false,
183 'quicktags' => false,
184 'editor_height' => 150,
185 'textarea_name' => 'content',
186 'statusbar' => false,
187 );
188 wp_editor($post->post_content, 'course_description', $editor_settings);
189 ?>
190 </div>
191 </div>
192
193 <?php do_action('tutor/frontend_course_edit/after/description', $post); ?>
194
195 <div class="tutor-frontend-builder-item-scope">
196 <div class="tutor-form-group">
197 <label class="tutor-form-label tutor-fs-6">
198 <?php _e('Choose a category', 'tutor'); ?>
199 </label>
200 <div class="tutor-form-field-course-categories">
201 <?php
202 // echo tutor_course_categories_checkbox($course_id);
203 echo tutor_course_categories_dropdown($course_id, array('classes' => 'tutor_select2'));
204 ?>
205 </div>
206 </div>
207 </div>
208
209 <?php do_action('tutor/frontend_course_edit/after/category', $post); ?>
210
211 <?php
212 $monetize_by = tutils()->get_option('monetize_by');
213 if ($monetize_by === 'wc' || $monetize_by === 'edd') {
214 $course_price = tutor_utils()->get_raw_course_price(get_the_ID());
215 $currency_symbol = tutor_utils()->currency_symbol();
216
217 $_tutor_course_price_type = tutils()->price_type();
218 ?>
219 <div class="tutor-row tutor-align-center tutor-mb-32">
220 <div class="tutor-col-12">
221 <label class="tutor-form-label tutor-fs-6"><?php _e('Course Price', 'tutor'); ?></label>
222 </div>
223 <div class="tutor-col-6 tutor-col-sm-5 tutor-col-lg-4">
224 <div class="tutor-form-check tutor-align-center tutor-d-flex">
225 <input type="radio" id="tutor_price_paid" class="tutor-form-check-input tutor-flex-shrink-0" name="tutor_course_price_type" value="paid" <?php checked($_tutor_course_price_type, 'paid'); ?> />
226 <label for="tutor_price_paid" class="tutor-amount-field">
227 <div class="tutor-input-group">
228 <span class="tutor-input-group-addon">
229 <?php echo $currency_symbol; ?>
230 </span>
231 <input type="number" class="tutor-form-number-verify tutor-form-control" name="course_price" value="<?php echo $course_price->regular_price; ?>" placeholder="<?php _e('Set course price', 'tutor'); ?>" step="0.1" min="0">
232 </div>
233 </label>
234 </div>
235 </div>
236 <div class="tutor-col-6 tutor-col-sm-5 tutor-col-lg-4">
237 <div class="tutor-form-check tutor-align-center">
238 <input type="radio" id="tutor_price_free" class="tutor-form-check-input tutor-flex-shrink-0" name="tutor_course_price_type" value="free" <?php $_tutor_course_price_type ? checked($_tutor_course_price_type, 'free') : checked('true', 'true'); ?> />
239 <label for="tutor_price_free" class="tutor-fs-6">
240 <?php _e('Free', 'tutor'); ?>
241 </label>
242 </div>
243 </div>
244 </div>
245 <?php
246 }
247 ?>
248
249 <div class="tutor-mb-32">
250 <label class="tutor-course-field-label tutor-fs-6"><?php _e('Course Thumbnail', 'tutor'); ?></label>
251 <div class="tutor-mb-16">
252 <?php
253 tutor_load_template_from_custom_path(
254 tutor()->path . '/views/fragments/thumbnail-uploader.php',
255 array(
256 'media_id' => get_post_thumbnail_id($course_id),
257 'input_name' => 'tutor_course_thumbnail_id',
258 'placeholder' => tutor()->url . '/assets/images/thumbnail-placeholder.svg',
259 'borderless' => true,
260 'background' => '#E3E6EB',
261 'border' => '#E3E6EB',
262 ),
263 false
264 );
265 ?>
266 </div>
267 </div>
268 <?php do_action('tutor/frontend_course_edit/after/thumbnail', $post); ?>
269 </div>
270 </div>
271
272 <?php do_action('tutor/dashboard_course_builder_form_field_after', $post); ?>
273
274 </div>
275
276 <!-- Course builder tips right sidebar -->
277 <div class="tutor-col-12 tutor-col-lg-4 tutor-mb-32 tutor-pl-40">
278 <div class="tutor-course-builder-upload-tips">
279 <h3 class="tutor-fs-5 tutor-fw-medium tutor-color-secondary tutor-mb-20">
280 <?php _e('Course Upload Tips', 'tutor'); ?>
281 </h3>
282 <ul>
283 <li class="tutor-mb-20"><?php _e('Set the Course Price option or make it free.', 'tutor'); ?></li>
284 <li class="tutor-mb-20"><?php _e('Standard size for the course thumbnail is 700x430.', 'tutor'); ?></li>
285 <li class="tutor-mb-20"><?php _e('Video section controls the course overview video.', 'tutor'); ?></li>
286 <li class="tutor-mb-20"><?php _e('Course Builder is where you create & organize a course.', 'tutor'); ?></li>
287 <li class="tutor-mb-20"><?php _e('Add Topics in the Course Builder section to create lessons, quizzes, and assignments.', 'tutor'); ?></li>
288 <li class="tutor-mb-20"><?php _e('Prerequisites refers to the fundamental courses to complete before taking this particular course.', 'tutor'); ?></li>
289 <li class="tutor-mb-20"><?php _e('Information from the Additional Data section shows up on the course single page.', 'tutor'); ?></li>
290 </ul>
291 </div>
292 </div>
293 </div>
294 </div>
295 </form>
296 <?php do_action('tutor/dashboard_course_builder_after'); ?>
297
298
299 <?php
300 do_action('tutor_load_template_after', 'dashboard.create-course', null);
301 get_tutor_footer(true); ?>