course
6 years ago
announcements-metabox.php
6 years ago
course-add-edd-product-metabox.php
6 years ago
course-add-product-metabox.php
6 years ago
course-additional-data.php
6 years ago
course-contents.php
6 years ago
course-level-metabox.php
6 years ago
course-topics.php
6 years ago
instructors-metabox.php
6 years ago
lesson-attachments-metabox.php
6 years ago
lesson-metabox.php
6 years ago
user-profile-fields.php
6 years ago
video-metabox.php
6 years ago
instructors-metabox.php
83 lines
| 1 | <div class="tutor-course-instructors-metabox-wrap"> |
| 2 | <?php |
| 3 | $instructors = tutor_utils()->get_instructors_by_course(); |
| 4 | ?> |
| 5 | |
| 6 | <div class="tutor-course-available-instructors"> |
| 7 | <?php |
| 8 | global $post; |
| 9 | |
| 10 | $t = wp_get_current_user(); |
| 11 | |
| 12 | $instructor_crown_src = tutor()->url.'assets/images/crown.svg'; |
| 13 | $authorTag = ''; |
| 14 | |
| 15 | if ($post->post_author == $t->ID){ |
| 16 | $authorTag = '<img src="'.$instructor_crown_src.'"><i class="instructor-name-tooltip" title="'. __("Author", "tutor") .'">'. __("Author", "tutor") .'</i>'; |
| 17 | } |
| 18 | |
| 19 | $currentInstructorHtml = '<div id="added-instructor-id-'.$t->ID.'" class="added-instructor-item added-instructor-item-'.$t->ID.'" data-instructor-id="'.$t->ID.'"> |
| 20 | <div class="instructor-icon">'.get_avatar($t->ID, 45).'</div> |
| 21 | <div class="instructor-name"> '.$t->display_name.' '.$authorTag.' </div> |
| 22 | </div>'; |
| 23 | echo $currentInstructorHtml; |
| 24 | |
| 25 | if (is_array($instructors) && count($instructors)){ |
| 26 | foreach ($instructors as $instructor){ |
| 27 | if ($t->ID == $instructor->ID){ |
| 28 | continue; |
| 29 | } |
| 30 | |
| 31 | if ($post->post_author == $instructor->ID){ |
| 32 | $authorTag = '<img src="'.$instructor_crown_src.'"><i class="instructor-name-tooltip" title="'. __("Author", "tutor") .'">'. __("Author", "tutor") .'</i>'; |
| 33 | } |
| 34 | ?> |
| 35 | <div id="added-instructor-id-<?php echo $instructor->ID; ?>" class="added-instructor-item added-instructor-item-<?php echo $instructor->ID; ?>" data-instructor-id="<?php echo $instructor->ID; ?>"> |
| 36 | <span class="instructor-icon"> |
| 37 | <?php echo get_avatar($instructor->ID, 30); ?> |
| 38 | </span> |
| 39 | <span class="instructor-name"> <?php echo $instructor->display_name.' '.$authorTag; ?> </span> |
| 40 | <span class="instructor-control"> |
| 41 | <a href="javascript:;" class="tutor-instructor-delete-btn"><i class="tutor-icon-line-cross"></i></a> |
| 42 | </span> |
| 43 | </div> |
| 44 | <?php |
| 45 | } |
| 46 | } |
| 47 | ?> |
| 48 | </div> |
| 49 | |
| 50 | <div class="tutor-add-instructor-button-wrap"> |
| 51 | <button type="button" class="tutor-btn tutor-add-instructor-btn bordered-btn"> <i class="tutor-icon-add-friend"></i> <?php _e('Add More Instructors', 'tutor'); ?> </button> |
| 52 | </div> |
| 53 | |
| 54 | <?php |
| 55 | /* if ( ! defined('TUTOR_MT_VERSION')){ |
| 56 | echo '<p>'. sprintf( __('To add unlimited multiple instructors in your course, get %sTutor LMS Pro%s addon ', 'tutor'), '<a href="https://www.themeum.com/product/tutor-lms" target="_blank">', "</a>" ) .'</p>'; |
| 57 | }*/ |
| 58 | ?> |
| 59 | </div> |
| 60 | |
| 61 | |
| 62 | <div class="tutor-modal-wrap tutor-instructors-modal-wrap"> |
| 63 | <div class="tutor-modal-content"> |
| 64 | <div class="modal-header"> |
| 65 | <div class="modal-title"> |
| 66 | <h1><?php _e("Add instructors", "tutor") ?></h1> |
| 67 | </div> |
| 68 | <div class="lesson-modal-close-wrap"> |
| 69 | <a href="javascript:;" class="modal-close-btn"><i class="tutor-icon-line-cross"></i></a> |
| 70 | </div> |
| 71 | </div> |
| 72 | <div class="modal-content-body"> |
| 73 | |
| 74 | <div class="search-bar"> |
| 75 | <input type="text" class="tutor-modal-search-input" placeholder="<?php _e('Search instructors...'); ?>"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <div class="modal-container"></div> |
| 79 | <div class="modal-footer has-padding"> |
| 80 | <button type="button" class="tutor-btn add_instructor_to_course_btn"><?php _e('Add Instructors', 'tutor'); ?></button> |
| 81 | </div> |
| 82 | </div> |
| 83 | </div> |