course
3 years ago
course-add-edd-product-metabox.php
3 years ago
course-add-product-metabox.php
3 years ago
course-additional-data.php
3 years ago
course-contents.php
3 years ago
course-level-metabox.php
3 years ago
course-topics.php
3 years ago
instructors-metabox.php
3 years ago
lesson-attachments-metabox.php
3 years ago
lesson-metabox.php
3 years ago
product-selection.php
3 years ago
settings-tabs.php
3 years ago
user-profile-fields.php
3 years ago
video-metabox.php
3 years ago
course-additional-data.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Course additional data meta box view |
| 4 | * |
| 5 | * @package Tutor\Views |
| 6 | * @subpackage Tutor\MetaBox |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.0.0 |
| 10 | */ |
| 11 | |
| 12 | $course_id = 0; |
| 13 | if ( is_admin() ) { |
| 14 | $course_id = get_the_ID(); |
| 15 | } else { |
| 16 | $course_id = isset( $_GET['course_ID'] ) ? $_GET['course_ID'] : get_the_ID(); |
| 17 | } |
| 18 | // check if current post is courses. |
| 19 | if ( get_post_type( $course_id ) != tutor()->course_post_type ) { |
| 20 | die( __( 'Invalid post type', 'tutor' ) ); |
| 21 | } |
| 22 | |
| 23 | // Extract: $duration, $durationHours, $durationMinutes, $durationSeconds. |
| 24 | extract( tutor_utils()->get_course_duration( $course_id, true ) ); |
| 25 | |
| 26 | $benefits = get_post_meta( $course_id, '_tutor_course_benefits', true ); |
| 27 | $requirements = get_post_meta( $course_id, '_tutor_course_requirements', true ); |
| 28 | $target_audience = get_post_meta( $course_id, '_tutor_course_target_audience', true ); |
| 29 | $material_includes = get_post_meta( $course_id, '_tutor_course_material_includes', true ); |
| 30 | ?> |
| 31 | |
| 32 | |
| 33 | <?php do_action( 'tutor_course_metabox_before_additional_data' ); ?> |
| 34 | |
| 35 | <div class="tutor-mb-32"> |
| 36 | <label class="tutor-fs-6 tutor-fw-medium tutor-color-black"> |
| 37 | <?php esc_html_e( 'What Will I Learn?', 'tutor' ); ?> |
| 38 | </label> |
| 39 | <textarea class="tutor-form-control tutor-form-control-auto-height tutor-mt-12" name="course_benefits" rows="2" placeholder="<?php esc_attr_e( 'Write here the course benefits (One per line)', 'tutor' ); ?>"><?php echo esc_textarea( $benefits ); ?></textarea> |
| 40 | </div> |
| 41 | |
| 42 | <div class="tutor-mb-32"> |
| 43 | <label class="tutor-fs-6 tutor-fw-medium tutor-color-black"> |
| 44 | <?php esc_html_e( 'Targeted Audience', 'tutor' ); ?> <br /> |
| 45 | </label> |
| 46 | <textarea class="tutor-form-control tutor-form-control-auto-height tutor-mt-12" name="course_target_audience" rows="2" placeholder="<?php esc_attr_e( 'Specify the target audience that will benefit the most from the course. (One line per target audience.)', 'tutor' ); ?>"><?php echo esc_textarea( $target_audience ); ?></textarea> |
| 47 | </div> |
| 48 | |
| 49 | <div class="tutor-row tutor-mb-32"> |
| 50 | <div class="tutor-col-12 tutor-mb-12"> |
| 51 | <label class="tutor-fs-6 tutor-fw-medium tutor-color-black"><?php esc_html_e( 'Total Course Duration', 'tutor' ); ?></label> |
| 52 | </div> |
| 53 | <div class="tutor-col-6 tutor-col-sm-4 tutor-col-md-3"> |
| 54 | <input class="tutor-form-control tutor-mb-5" type="number" min="0" value="<?php echo esc_attr( $durationHours ? $durationHours : '00' ); ?>" name="course_duration[hours]"> |
| 55 | <span class="tutor-fs-7 tutor-color-muted"><?php _e( 'Hour', 'tutor' ); ?></span> |
| 56 | </div> |
| 57 | <div class="tutor-col-6 tutor-col-sm-4 tutor-col-md-3"> |
| 58 | <input class="tutor-form-control tutor-mb-4 tutor-number-validation" type="number" min="0" data-min="0" data-max="59" value="<?php echo esc_attr( $durationMinutes ? $durationMinutes : '00' ); ?>" name="course_duration[minutes]"> |
| 59 | <span class="tutor-fs-7 tutor-color-muted"><?php esc_html_e( 'Minute', 'tutor' ); ?></span> |
| 60 | </div> |
| 61 | <input type="hidden" value="<?php echo esc_attr( $durationSeconds ? $durationSeconds : '00' ); ?>" name="course_duration[seconds]"> |
| 62 | </div> |
| 63 | |
| 64 | <div class="tutor-mb-32"> |
| 65 | <label class="tutor-fs-6 tutor-fw-medium tutor-color-black"> |
| 66 | <?php esc_html_e( 'Materials Included', 'tutor' ); ?> <br /> |
| 67 | </label> |
| 68 | <textarea class="tutor-form-control tutor-form-control-auto-height tutor-mt-12" name="course_material_includes" rows="5" placeholder="<?php esc_attr_e( 'A list of assets you will be providing for the students in this course (One per line)', 'tutor' ); ?>"><?php echo esc_textarea( $material_includes ); ?></textarea> |
| 69 | </div> |
| 70 | |
| 71 | <div class="tutor-mb-32"> |
| 72 | <label class="tutor-fs-6 tutor-fw-medium tutor-color-black"> |
| 73 | <?php esc_html_e( 'Requirements/Instructions', 'tutor' ); ?> <br /> |
| 74 | </label> |
| 75 | <textarea class="tutor-form-control tutor-form-control-auto-height tutor-mt-12" name="course_requirements" rows="2" placeholder="<?php esc_attr_e( 'Additional requirements or special instructions for the students (One per line)', 'tutor' ); ?>"><?php echo esc_textarea( $requirements ); ?></textarea> |
| 76 | </div> |
| 77 | |
| 78 | <?php if ( ! is_admin() ) : ?> |
| 79 | <div class="tutor-mb-32"> |
| 80 | <label class="tutor-form-label tutor-fs-6 tutor-color-black"><?php _e( 'Course Tag', 'tutor' ); ?></label> |
| 81 | <div class="tutor-mb-16"> |
| 82 | <?php |
| 83 | //phpcs:ignore -- contain safe data |
| 84 | echo tutor_course_tags_dropdown( $course_id, array( 'classes' => 'tutor_select2' ) ); |
| 85 | ?> |
| 86 | </div> |
| 87 | </div> |
| 88 | <?php endif; ?> |
| 89 | |
| 90 | <input type="hidden" name="_tutor_course_additional_data_edit" value="true" /> |
| 91 | |
| 92 | <?php do_action( 'tutor_course_metabox_after_additional_data' ); ?> |
| 93 |