Version Description
06 Feb, 2019 =
Alpha Release
=
Download this release
Release Info
Developer | themeum |
Plugin | Tutor LMS – eLearning and online course solution |
Version | 1.0.0-alpha |
Comparing to | |
See all releases |
Version 1.0.0-alpha
- assets/css/tutor-admin.css +1114 -0
- assets/css/tutor-front.css +2369 -0
- assets/icons/css/tutor-icon.css +304 -0
- assets/icons/font/tutor.svg +77 -0
- assets/icons/font/tutor.ttf +0 -0
- assets/icons/font/tutor.woff +0 -0
- assets/images/image.png +0 -0
- assets/images/placeholder.jpg +0 -0
- assets/images/play-button.png +0 -0
- assets/images/spinner.gif +0 -0
- assets/images/tutor-plugin.png +0 -0
- assets/js/gutenberg_blocks.js +94 -0
- assets/js/mce-button.js +35 -0
- assets/js/tutor-admin.js +1036 -0
- assets/js/tutor-front.js +387 -0
- assets/packages/plyr/plyr.css +1 -0
- assets/packages/plyr/plyr.min.js +2 -0
- assets/packages/plyr/plyr.polyfilled.min.js +2 -0
- assets/packages/select2/select2.min.css +1 -0
- assets/packages/select2/select2.min.js +1 -0
- classes/Addons.php +59 -0
- classes/Admin.php +395 -0
- classes/Ajax.php +260 -0
- classes/Assets.php +129 -0
- classes/Course.php +509 -0
- classes/Gutenberg.php +78 -0
- classes/Instructor.php +138 -0
- classes/Instructors_List.php +178 -0
- classes/Lesson.php +326 -0
- classes/Options.php +353 -0
- classes/Post_types.php +283 -0
- classes/Q_and_A.php +54 -0
- classes/Question.php +303 -0
- classes/Question_Answers_List.php +137 -0
- classes/Quiz.php +520 -0
- classes/Quiz_Attempts_List.php +176 -0
- classes/Rewrite_Rules.php +117 -0
- classes/Shortcode.php +73 -0
- classes/Student.php +105 -0
- classes/Students_List.php +131 -0
- classes/Template.php +321 -0
- classes/Theme_Compatibility.php +29 -0
- classes/Tools.php +26 -0
- classes/Tutor_Base.php +32 -0
- classes/Tutor_List_Table.php +1326 -0
- classes/User.php +29 -0
- classes/Utils.php +2838 -0
- classes/Video_Stream.php +131 -0
- classes/init.php +304 -0
- includes/theme-compatibility/twentyfifteen/assets/css/style.css +11 -0
- includes/theme-compatibility/twentyfifteen/functions.php +16 -0
- includes/theme-compatibility/twentyseventeen/assets/css/style.css +38 -0
- includes/theme-compatibility/twentyseventeen/functions.php +16 -0
- includes/tutor-template-functions.php +1160 -0
- includes/tutor-template-hook.php +26 -0
- readme.txt +116 -0
- templates/archive-course.php +57 -0
- templates/course-none.php +13 -0
- templates/dashboard/instructor/apply_for_instructor.php +13 -0
- templates/dashboard/instructor/logged-in.php +21 -0
- templates/dashboard/instructor/registration.php +114 -0
- templates/dashboard/student/active-courses.php +46 -0
- templates/dashboard/student/completed-courses.php +48 -0
- templates/dashboard/student/dashboard.php +22 -0
- templates/dashboard/student/index.php +49 -0
- templates/dashboard/student/logged-in.php +1 -0
- templates/dashboard/student/my-courses.php +53 -0
- templates/dashboard/student/registration.php +114 -0
- templates/dashboard/student/wishlist.php +40 -0
- templates/email/to_instructor_asked_question_by_student.php +9 -0
- templates/email/to_instructor_course_completed.php +5 -0
- templates/email/to_instructor_course_enrolled.php +5 -0
- templates/email/to_instructor_lesson_completed.php +5 -0
- templates/email/to_student_course_completed.php +5 -0
- templates/email/to_student_quiz_completed.php +8 -0
- templates/global/attachments.php +38 -0
- templates/global/course-archive-filter-bar.php +22 -0
- templates/global/login.php +67 -0
- templates/login.php +37 -0
- templates/loop/add-to-cart-edd.php +7 -0
- templates/loop/add-to-cart-woocommerce.php +61 -0
- templates/loop/course-author.php +19 -0
- templates/loop/course-price-edd.php +26 -0
- templates/loop/course-price-woocommerce.php +30 -0
- templates/loop/course-price.php +30 -0
- templates/loop/course.php +50 -0
- templates/loop/end_content_wrap.php +1 -0
- templates/loop/footer.php +9 -0
- templates/loop/header.php +19 -0
- templates/loop/loop-after-content.php +24 -0
- templates/loop/loop-before-content.php +24 -0
- templates/loop/loop-end.php +23 -0
- templates/loop/loop-start.php +18 -0
- templates/loop/meta.php +31 -0
- templates/loop/rating.php +21 -0
- templates/loop/start_content_wrap.php +1 -0
- templates/loop/thumbnail.php +12 -0
- templates/loop/title.php +14 -0
- templates/loop/tutor-pagination.php +32 -0
- templates/profile/bio.php +14 -0
- templates/profile/courses_taken.php +41 -0
- templates/profile/enrolled_course.php +39 -0
- templates/profile/reviews_wrote.php +65 -0
- templates/single-course-enrolled-announcements.php +40 -0
- templates/single-course-enrolled-overview.php +38 -0
- templates/single-course-enrolled-questions.php +39 -0
- templates/single-course-enrolled.php +46 -0
- templates/single-course.php +51 -0
- templates/single-lesson.php +31 -0
- templates/single-preview-lesson.php +32 -0
- templates/single-quiz.php +36 -0
- templates/single/course/add-to-cart-edd.php +19 -0
- templates/single/course/add-to-cart-woocommerce.php +31 -0
- templates/single/course/add-to-cart.php +45 -0
- templates/single/course/complete_form.php +32 -0
- templates/single/course/course-benefits.php +44 -0
- templates/single/course/course-content.php +33 -0
- templates/single/course/course-enroll-box.php +32 -0
- templates/single/course/course-enrolled-box.php +49 -0
- templates/single/course/course-requirements.php +42 -0
- templates/single/course/course-target-audience.php +41 -0
- templates/single/course/course-topics.php +106 -0
- templates/single/course/enrolled/announcements.php +53 -0
- templates/single/course/enrolled/completing-progress.php +28 -0
- templates/single/course/enrolled/lead-info.php +137 -0
- templates/single/course/enrolled/nav.php +35 -0
- templates/single/course/enrolled/question_and_answer.php +149 -0
- templates/single/course/instructors.php +88 -0
- templates/single/course/lead-info.php +120 -0
- templates/single/course/login.php +23 -0
- templates/single/course/material-includes.php +39 -0
- templates/single/course/q_and_a_turned_off.php +15 -0
- templates/single/course/review-form.php +49 -0
- templates/single/course/reviews.php +80 -0
- templates/single/course/tags.php +34 -0
- templates/single/course/wc-price-html.php +25 -0
- templates/single/lesson/complete_form.php +32 -0
- templates/single/lesson/content.php +61 -0
- templates/single/lesson/lesson_sidebar.php +119 -0
assets/css/tutor-admin.css
ADDED
@@ -0,0 +1,1114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.8.24 - 2012-09-28
|
2 |
+
* https://github.com/jquery/jquery-ui
|
3 |
+
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.tabs.css, jquery.ui.theme.css
|
4 |
+
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
|
5 |
+
|
6 |
+
/** Slider CSS */
|
7 |
+
@import "../icons/css/tutor-icon.css";
|
8 |
+
|
9 |
+
.ui-slider { position: relative; text-align: left; }
|
10 |
+
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
11 |
+
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
12 |
+
|
13 |
+
.ui-slider-horizontal { height: .8em; }
|
14 |
+
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
15 |
+
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
16 |
+
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
17 |
+
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
18 |
+
|
19 |
+
.ui-slider-vertical { width: .8em; height: 100px; }
|
20 |
+
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
21 |
+
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
22 |
+
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
23 |
+
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
24 |
+
/* Component containers
|
25 |
+
----------------------------------*/
|
26 |
+
|
27 |
+
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff; color: #222222; }
|
28 |
+
.ui-widget-content a { color: #222222; }
|
29 |
+
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc; color: #222222; font-weight: bold; }
|
30 |
+
.ui-widget-header a { color: #222222; }
|
31 |
+
|
32 |
+
/* Interaction states
|
33 |
+
----------------------------------*/
|
34 |
+
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6; font-weight: normal; color: #555555; }
|
35 |
+
/* Interaction Cues
|
36 |
+
----------------------------------*/
|
37 |
+
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee; color: #363636; }
|
38 |
+
|
39 |
+
/**
|
40 |
+
TUTOR CSS
|
41 |
+
*/
|
42 |
+
|
43 |
+
.tutor-option-nav-tabs{
|
44 |
+
|
45 |
+
}
|
46 |
+
.tutor-option-nav-tabs li{
|
47 |
+
position: relative;
|
48 |
+
display: inline-block;
|
49 |
+
margin-right: 20px;
|
50 |
+
}
|
51 |
+
.tutor-option-nav-tabs li:after {
|
52 |
+
content: "|";
|
53 |
+
position: absolute;
|
54 |
+
top: 0;
|
55 |
+
right: -10px;
|
56 |
+
}
|
57 |
+
.tutor-option-nav-tabs li:last-child:after {
|
58 |
+
content: "";
|
59 |
+
}
|
60 |
+
.tutor-option-nav-tabs li a{
|
61 |
+
display: block;
|
62 |
+
font-weight: bold;
|
63 |
+
text-decoration: none;
|
64 |
+
}
|
65 |
+
.tutor-option-nav-tabs li.current a{
|
66 |
+
color: #333333;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
Option Field
|
71 |
+
*/
|
72 |
+
|
73 |
+
.tutor-option-field-row {
|
74 |
+
border-bottom: 1px solid #e4e4e4;
|
75 |
+
padding: 30px 0;
|
76 |
+
font-size: 14px;
|
77 |
+
line-height: 1.3
|
78 |
+
}
|
79 |
+
.tutor-option-field-row:last-child {
|
80 |
+
border-bottom: none;
|
81 |
+
}
|
82 |
+
.tutor-option-field-row input[type=text],.tutor-option-field-row input[type=email],.tutor-option-field-row input[type=number],.tutor-option-field-row input[type=password], .tutor-option-field-row textarea, .tutor-option-field-row .tutor-field-type-slider {
|
83 |
+
background-color: #fff;
|
84 |
+
border: 1px solid #ddd;
|
85 |
+
border-radius: 3px;
|
86 |
+
box-shadow: none;
|
87 |
+
color: #333;
|
88 |
+
display: inline-block;
|
89 |
+
vertical-align: middle;
|
90 |
+
padding: 7px 12px;
|
91 |
+
margin: 0 10px 0 0;
|
92 |
+
width: 400px;
|
93 |
+
min-height: 35px
|
94 |
+
}
|
95 |
+
.tutor-option-field {
|
96 |
+
display: block;
|
97 |
+
margin: 0 0 0 200px;
|
98 |
+
max-width: 800px
|
99 |
+
}
|
100 |
+
.tutor-option-field-label {
|
101 |
+
display: block;
|
102 |
+
float: left;
|
103 |
+
width: 200px;
|
104 |
+
}
|
105 |
+
.tutor-option-field-label label {
|
106 |
+
display: block;
|
107 |
+
font-weight: 600
|
108 |
+
}
|
109 |
+
.tutor-option-field p.desc {
|
110 |
+
font-style: italic;
|
111 |
+
color: #666;
|
112 |
+
font-size: 12px;
|
113 |
+
line-height: 1.5;
|
114 |
+
}
|
115 |
+
.tutor-option-field-row h2{
|
116 |
+
color: #444;
|
117 |
+
font-size: 18px;
|
118 |
+
font-weight: 700;
|
119 |
+
margin: 0;
|
120 |
+
}
|
121 |
+
.tutor-option-field-row .option-media-wrap{
|
122 |
+
margin-bottom: 10px;
|
123 |
+
}
|
124 |
+
.tutor-option-field-row .option-media-wrap img{
|
125 |
+
max-height: 100px;
|
126 |
+
width: auto;
|
127 |
+
padding: 5px;
|
128 |
+
border: 1px solid #CCCCCC;
|
129 |
+
}
|
130 |
+
/**
|
131 |
+
Group Field Option
|
132 |
+
*/
|
133 |
+
.tutor-option-group-field {
|
134 |
+
display: inline-block;
|
135 |
+
vertical-align: top;
|
136 |
+
}
|
137 |
+
.tutor-option-group-field input[type=text],.tutor-option-group-field input[type=email],.tutor-option-group-field input[type=number],.tutor-option-group-field input[type=password], .tutor-option-group-field textarea, .tutor-option-group-field .tutor-field-type-slider, .tutor-option-group-field select {
|
138 |
+
width: 100px;
|
139 |
+
margin-right: 5px;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Course adding page
|
144 |
+
* Course Builder
|
145 |
+
*/
|
146 |
+
#tutor-course-topics a{
|
147 |
+
text-decoration: none;
|
148 |
+
}
|
149 |
+
#tutor-course-topics .tutor-topics-wrap{
|
150 |
+
border-bottom: 1px solid #E7E7E7;
|
151 |
+
padding-bottom: 0;
|
152 |
+
margin: 0;
|
153 |
+
}
|
154 |
+
#tutor-course-topics .tutor-lesson {
|
155 |
+
padding: 10px;
|
156 |
+
margin-bottom: 5px;
|
157 |
+
border: 1px solid #D9D9D9;
|
158 |
+
}
|
159 |
+
#tutor-course-topics .drop-lessons{
|
160 |
+
border: 1px dashed #adabab96;
|
161 |
+
padding: 12px 15px;
|
162 |
+
background-color: #f9f9f9;
|
163 |
+
color: #777777;
|
164 |
+
text-align: center;
|
165 |
+
}
|
166 |
+
.tutor-lessons.ui-sortable {
|
167 |
+
min-height: 20px;
|
168 |
+
}
|
169 |
+
#tutor-course-topics .drop-lessons p{
|
170 |
+
margin: 0;
|
171 |
+
}
|
172 |
+
#tutor-course-topics .tutor-lesson:hover{
|
173 |
+
background-color: #EEEEEE;
|
174 |
+
}
|
175 |
+
#tutor-course-topics .tutor-lessons {
|
176 |
+
padding-left: 0;
|
177 |
+
}
|
178 |
+
#tutor-course-topics .tutor-lesson-top, #tutor-course-topics .tutor-lesson-top i {
|
179 |
+
font-size: 15px;
|
180 |
+
}
|
181 |
+
#tutor-course-topics .tutor-lesson-top{
|
182 |
+
display: flex;
|
183 |
+
font-size: 14px;
|
184 |
+
}
|
185 |
+
#tutor-course-topics .tutor-lesson-top .open-tutor-lesson-modal{
|
186 |
+
flex: 1;
|
187 |
+
}
|
188 |
+
#tutor-course-topics .tutor-lesson-top i{
|
189 |
+
margin-right: 10px;
|
190 |
+
cursor: ns-resize;
|
191 |
+
}
|
192 |
+
#tutor-course-topics .tutor-lesson-top a{
|
193 |
+
color: #393C40;
|
194 |
+
}
|
195 |
+
.tutor-topics-wrap, .tutor-lesson{
|
196 |
+
background-color: #ffffff;
|
197 |
+
}
|
198 |
+
.tutor-topics-wrap, .course-move-handle{
|
199 |
+
margin-right: 5px;
|
200 |
+
}
|
201 |
+
.course-move-handle{
|
202 |
+
cursor: row-resize;
|
203 |
+
}
|
204 |
+
.new-topic-btn-wrap {
|
205 |
+
padding: 20px;
|
206 |
+
}
|
207 |
+
p.course-empty-content {
|
208 |
+
padding-left: 20px;
|
209 |
+
}
|
210 |
+
.tutor_btn_lg{
|
211 |
+
line-height: 45px;
|
212 |
+
background-color: #3057D5;
|
213 |
+
color: #ffffff;
|
214 |
+
padding: 0 20px;
|
215 |
+
display: inline-block;
|
216 |
+
border-radius: 2px;
|
217 |
+
font-size: 14px;
|
218 |
+
font-weight: 300;
|
219 |
+
border: none;
|
220 |
+
box-shadow: none;
|
221 |
+
cursor: pointer;
|
222 |
+
}
|
223 |
+
.tutor_btn_lg:focus{
|
224 |
+
box-shadow: none;
|
225 |
+
border: none;
|
226 |
+
outline: none;
|
227 |
+
}
|
228 |
+
.tutor_btn_lg:focus,
|
229 |
+
.tutor_btn_lg:hover{
|
230 |
+
background-color: #2149C9;
|
231 |
+
color: #ffffff;
|
232 |
+
}
|
233 |
+
|
234 |
+
.ui-sortable-placeholder{
|
235 |
+
visibility: visible;
|
236 |
+
background-color: #dddd;
|
237 |
+
}
|
238 |
+
.tutor-untopics-lessons{
|
239 |
+
margin-top: 50px;
|
240 |
+
border: 1px solid #eee;
|
241 |
+
padding: 20px;
|
242 |
+
margin-bottom: 20px;
|
243 |
+
background-color: #fbfbfb;
|
244 |
+
}
|
245 |
+
.tutor-untopics-lessons h3{
|
246 |
+
font-weight: 300;
|
247 |
+
}
|
248 |
+
.tutor-untopics-lessons .tutor-lessons{
|
249 |
+
padding-left: 0 !important;
|
250 |
+
}
|
251 |
+
.create-new-lesson-wrap {
|
252 |
+
text-align: center;
|
253 |
+
}
|
254 |
+
.tutor-metabox-add-topics, .tutor-topics-edit-form {
|
255 |
+
background: #f1f1f1;
|
256 |
+
padding: 20px;
|
257 |
+
}
|
258 |
+
.tutor-metabox-add-topics .tutor-option-field-row{
|
259 |
+
padding: 15px 0;
|
260 |
+
}
|
261 |
+
.tutor-metabox-add-topics .tutor-option-field-row:last-child, .tutor-topics-edit-form .tutor-option-field-row:last-child{
|
262 |
+
border-bottom: none;
|
263 |
+
}
|
264 |
+
.topic-edit-icon{
|
265 |
+
cursor: pointer;
|
266 |
+
}
|
267 |
+
.tutor-topic-title{
|
268 |
+
display: flex;
|
269 |
+
font-size: 16px;
|
270 |
+
font-weight: 300;
|
271 |
+
margin: 0;
|
272 |
+
line-height: 40px;
|
273 |
+
padding-left: 15px;
|
274 |
+
}
|
275 |
+
.tutor-topic-title a{
|
276 |
+
color: #393C40;
|
277 |
+
}
|
278 |
+
|
279 |
+
.tutor-topic-title .topic-inner-title{
|
280 |
+
flex: 1 0 auto;
|
281 |
+
}
|
282 |
+
.tutor-topic-title span{
|
283 |
+
padding: 0 5px;
|
284 |
+
}
|
285 |
+
.tutor-topic-title span.expand-collapse-wrap {
|
286 |
+
border-left: 1px solid #E7E7E7;
|
287 |
+
}
|
288 |
+
.tutor-topic-title span.expand-collapse-wrap a{
|
289 |
+
display: block;
|
290 |
+
padding: 0 13px;
|
291 |
+
}
|
292 |
+
.topic-delete-btn{
|
293 |
+
float: right;
|
294 |
+
}
|
295 |
+
.text-muted{
|
296 |
+
color: #cccccc;
|
297 |
+
}
|
298 |
+
.topic-delete-btn a{
|
299 |
+
padding: 0 10px;
|
300 |
+
}
|
301 |
+
.topic-delete-btn a:hover {
|
302 |
+
color: #ff0000;
|
303 |
+
}
|
304 |
+
.topic-delete-btn .dashicons{
|
305 |
+
width: 12px;
|
306 |
+
height: 12px;
|
307 |
+
font-size: 12px;
|
308 |
+
}
|
309 |
+
|
310 |
+
#tutor-course-topics{
|
311 |
+
position: relative;
|
312 |
+
}
|
313 |
+
#tutor-course-topics .inside{
|
314 |
+
padding: 0;
|
315 |
+
margin: 0;
|
316 |
+
}
|
317 |
+
#tutor-course-topics a:focus{
|
318 |
+
box-shadow: none;
|
319 |
+
}
|
320 |
+
#tutor-course-topics .toggle-indicator:before{
|
321 |
+
margin-top: 20px;
|
322 |
+
}
|
323 |
+
.tutor-course-builder-header {
|
324 |
+
line-height: 50px;
|
325 |
+
position: absolute;
|
326 |
+
top: -56px;
|
327 |
+
right: 40px;
|
328 |
+
}
|
329 |
+
.tutor-topics-wrap:nth-child(2n) {
|
330 |
+
background: #F8F8F8;
|
331 |
+
}
|
332 |
+
#tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body{
|
333 |
+
background: #E9E9E9;
|
334 |
+
padding: 15px 20px;
|
335 |
+
}
|
336 |
+
#tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body .create-lesson-in-topic-btn{
|
337 |
+
line-height: 38px;
|
338 |
+
background-color: #0285BA;
|
339 |
+
color: #ffffff;
|
340 |
+
display: inline-block;
|
341 |
+
padding: 0 20px;
|
342 |
+
border: 1px solid #016799;
|
343 |
+
border-radius: 2px;
|
344 |
+
margin-right: 20px;
|
345 |
+
}
|
346 |
+
#tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body .tutor-add-quiz-btn{
|
347 |
+
background-color: #FFFFFF;
|
348 |
+
border: 1px solid #C6C9CF;
|
349 |
+
line-height: 38px;
|
350 |
+
padding: 0 20px;
|
351 |
+
display: inline-block;
|
352 |
+
border-radius: 2px;
|
353 |
+
cursor: pointer;
|
354 |
+
}
|
355 |
+
|
356 |
+
|
357 |
+
/**
|
358 |
+
Meta Box Heading
|
359 |
+
*/
|
360 |
+
|
361 |
+
#tutor-course-topics h2, #tutor-instructors h2{
|
362 |
+
padding: 15px;
|
363 |
+
line-height: 30px;
|
364 |
+
}
|
365 |
+
#tutor-course-topics h2:before, #tutor-instructors h2:before {
|
366 |
+
color: #3057D5;
|
367 |
+
font-family: 'tutor' !important;
|
368 |
+
speak: none;
|
369 |
+
font-style: normal;
|
370 |
+
font-weight: normal;
|
371 |
+
font-variant: normal;
|
372 |
+
text-transform: none;
|
373 |
+
line-height: 1;
|
374 |
+
-webkit-font-smoothing: antialiased;
|
375 |
+
-moz-osx-font-smoothing: grayscale;
|
376 |
+
margin-right: 10px;
|
377 |
+
}
|
378 |
+
#tutor-course-topics h2:before{
|
379 |
+
content: '\e936';
|
380 |
+
}
|
381 |
+
#tutor-instructors h2:before{
|
382 |
+
content: '\e93c';
|
383 |
+
}
|
384 |
+
/**
|
385 |
+
End Metabox Heading
|
386 |
+
*/
|
387 |
+
|
388 |
+
.video_source_wrap_html5{
|
389 |
+
width: 100px;
|
390 |
+
text-align: center;
|
391 |
+
}
|
392 |
+
.video_source_wrap_html5 a{
|
393 |
+
border: 1px solid #e4e4e4;
|
394 |
+
text-align: center;
|
395 |
+
display: block;
|
396 |
+
padding: 30px;
|
397 |
+
}
|
398 |
+
.video_source_wrap_html5 a i{
|
399 |
+
font-size: 30px;
|
400 |
+
width: 40px;
|
401 |
+
height: 40px;
|
402 |
+
}
|
403 |
+
.video-poster-img img{
|
404 |
+
max-width: 200px;
|
405 |
+
height: auto;
|
406 |
+
}
|
407 |
+
.tutor-added-attachments-wrap{
|
408 |
+
margin-bottom: 50px;
|
409 |
+
}
|
410 |
+
.tutor-added-attachments-wrap a{
|
411 |
+
text-decoration: none;
|
412 |
+
}
|
413 |
+
a.tutor-delete-attachment {
|
414 |
+
border: 1px solid #ff0000;
|
415 |
+
padding: 5px;
|
416 |
+
border-radius: 50%;
|
417 |
+
display: inline-block;
|
418 |
+
line-height: 7px;
|
419 |
+
color: #ff0000;
|
420 |
+
}
|
421 |
+
|
422 |
+
a.tutor-delete-attachment:hover {
|
423 |
+
background-color: #ff0000;
|
424 |
+
color: #ffffff;
|
425 |
+
}
|
426 |
+
|
427 |
+
.tutor-status-context{
|
428 |
+
padding: 5px 10px;
|
429 |
+
margin: 5px 0;
|
430 |
+
display: inline-block;
|
431 |
+
}
|
432 |
+
|
433 |
+
.tutor-status-pending-context, .quiz_started{
|
434 |
+
background-color: #EEEEEE;
|
435 |
+
}
|
436 |
+
|
437 |
+
a.tutor-button{
|
438 |
+
padding: 10px 20px;
|
439 |
+
text-decoration: none;
|
440 |
+
margin-right: 20px;
|
441 |
+
}
|
442 |
+
.tutor-status-approved-context, .quiz_finished, .tutor-button.button-success {
|
443 |
+
background-color: #008000;
|
444 |
+
color: #ffffff;
|
445 |
+
}
|
446 |
+
.tutor-status-blocked-context, .quiz_timeout, .tutor-button.button-danger {
|
447 |
+
background-color: #ff0000;
|
448 |
+
color: #ffffff;
|
449 |
+
}
|
450 |
+
.tutor-button.button-warning {
|
451 |
+
background-color: #ffb36d;
|
452 |
+
color: #ffffff;
|
453 |
+
}
|
454 |
+
.tutor-button{
|
455 |
+
border: 0;
|
456 |
+
box-shadow: none !important;
|
457 |
+
}
|
458 |
+
.tutor-button .dashicons{
|
459 |
+
border: 0;
|
460 |
+
box-shadow: none !important;
|
461 |
+
line-height: inherit;
|
462 |
+
}
|
463 |
+
.tutor-status-approved-context, .tutor-status-blocked-context{
|
464 |
+
display: inline-block;
|
465 |
+
}
|
466 |
+
table.tutor_status_table td.help {
|
467 |
+
width: 1em;
|
468 |
+
}
|
469 |
+
table.tutor_status_table td:first-child {
|
470 |
+
width: 25%;
|
471 |
+
}
|
472 |
+
table.tutor_status_table h2{
|
473 |
+
font-size: 16px;
|
474 |
+
margin: 0;
|
475 |
+
}
|
476 |
+
table.tutor_status_table td mark.yes, table.tutor_status_table th mark.yes {
|
477 |
+
color: #06d004;
|
478 |
+
background-color: transparent;
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
+
/*
|
483 |
+
|
484 |
+
.tutor-help-tip {
|
485 |
+
color: #666;
|
486 |
+
display: inline-block;
|
487 |
+
font-size: 1.1em;
|
488 |
+
font-style: normal;
|
489 |
+
height: 16px;
|
490 |
+
line-height: 16px;
|
491 |
+
position: relative;
|
492 |
+
vertical-align: middle;
|
493 |
+
width: 16px;
|
494 |
+
}
|
495 |
+
.tutor-help-tip::after {
|
496 |
+
font-family: Dashicons;
|
497 |
+
speak: none;
|
498 |
+
font-weight: 400;
|
499 |
+
text-transform: none;
|
500 |
+
line-height: 1;
|
501 |
+
-webkit-font-smoothing: antialiased;
|
502 |
+
text-indent: 0px;
|
503 |
+
position: absolute;
|
504 |
+
top: 0px;
|
505 |
+
left: 0px;
|
506 |
+
width: 100%;
|
507 |
+
height: 100%;
|
508 |
+
text-align: center;
|
509 |
+
content: "";
|
510 |
+
cursor: help;
|
511 |
+
font-variant: normal;
|
512 |
+
margin: 0px;
|
513 |
+
}*/
|
514 |
+
|
515 |
+
|
516 |
+
.tutor-text-avatar{
|
517 |
+
border-radius: 50%;
|
518 |
+
/*border: 1px solid #686f7a;*/
|
519 |
+
width: 40px;
|
520 |
+
height: 40px;
|
521 |
+
text-align: center;
|
522 |
+
display: block;
|
523 |
+
line-height: 40px;
|
524 |
+
color: #ffffff;
|
525 |
+
font-size: 14px;
|
526 |
+
}
|
527 |
+
.tutor_original_question{
|
528 |
+
display: flex;
|
529 |
+
margin-bottom: 5px;
|
530 |
+
padding: 20px;
|
531 |
+
}
|
532 |
+
.tutor_original_question .question-left{
|
533 |
+
flex: 0 0 60px;
|
534 |
+
}
|
535 |
+
.tutor_original_question .question-left img{
|
536 |
+
max-width: 60px;
|
537 |
+
height: auto;
|
538 |
+
margin-right: 10px;
|
539 |
+
border: 1px solid #eeee88;
|
540 |
+
padding: 3px;
|
541 |
+
}
|
542 |
+
.question-right {
|
543 |
+
width: 100%;
|
544 |
+
}
|
545 |
+
.tutor_admin_answers_list_wrap .tutor_original_question{
|
546 |
+
margin-left: 50px;
|
547 |
+
}
|
548 |
+
.tutor-bg-white{
|
549 |
+
background-color: #ffffff;
|
550 |
+
}
|
551 |
+
.tutor-bg-light{
|
552 |
+
background-color: #FDFDFD;
|
553 |
+
}
|
554 |
+
.tutor-announcement {
|
555 |
+
border: 1px solid #eee;
|
556 |
+
padding: 10px;
|
557 |
+
margin-bottom: 10px;
|
558 |
+
}
|
559 |
+
.announcement-delete-btn{
|
560 |
+
float: right;
|
561 |
+
}
|
562 |
+
.announcement-delete-btn a{
|
563 |
+
display: block;
|
564 |
+
border: 1px solid #ff0000;
|
565 |
+
color: #ff0000;
|
566 |
+
padding: 6px;
|
567 |
+
border-radius: 50%;
|
568 |
+
text-decoration: none;
|
569 |
+
}
|
570 |
+
.announcement-delete-btn a:hover {
|
571 |
+
color: #ffffff;
|
572 |
+
background-color: #ff0000;
|
573 |
+
}
|
574 |
+
.tutor-label-success{
|
575 |
+
background-color: #06d004;
|
576 |
+
color: #ffffff;
|
577 |
+
padding: 3px 7px;
|
578 |
+
}
|
579 |
+
.tutor-addons .plugin-card-bottom .plugin-version{
|
580 |
+
display: inline-block;
|
581 |
+
}
|
582 |
+
.tutor-addons .addon-regular-price{
|
583 |
+
color: #CCCCCC;
|
584 |
+
padding: 3px;
|
585 |
+
}
|
586 |
+
.tutor-addons .addon-current-price{
|
587 |
+
color: #25bd25;
|
588 |
+
font-size: 18px;
|
589 |
+
padding: 3px;
|
590 |
+
}
|
591 |
+
.tutor-addons-last-checked-time{
|
592 |
+
color: #6f5757 !important;
|
593 |
+
}
|
594 |
+
.tutor-addons .wp-filter{
|
595 |
+
margin: 10px 0 0;
|
596 |
+
}
|
597 |
+
|
598 |
+
/**
|
599 |
+
Add-ons list
|
600 |
+
*/
|
601 |
+
.tutor-addons-list {
|
602 |
+
background-color: #fff;
|
603 |
+
min-height: 500px;
|
604 |
+
padding: 20px;
|
605 |
+
}
|
606 |
+
h3.addon-list-heading{
|
607 |
+
background-color: #eeeeee;
|
608 |
+
padding: 10px;
|
609 |
+
}
|
610 |
+
table.tutor-addons-list-table{
|
611 |
+
width: 100%;
|
612 |
+
}
|
613 |
+
table.tutor-addons-list-table tr{
|
614 |
+
}
|
615 |
+
table.tutor-addons-list-table td, table.tutor-addons-list-table th{
|
616 |
+
padding: 10px;
|
617 |
+
border-bottom: 1px solid #eeeeee;
|
618 |
+
text-align: left;
|
619 |
+
|
620 |
+
}
|
621 |
+
|
622 |
+
|
623 |
+
|
624 |
+
.btn-switch {
|
625 |
+
display: inline-block;
|
626 |
+
height: 22px;
|
627 |
+
position: relative;
|
628 |
+
width: 40px;
|
629 |
+
}
|
630 |
+
.btn-switch input {
|
631 |
+
display:none;
|
632 |
+
}
|
633 |
+
.btn-slider {
|
634 |
+
background-color: #ccc;
|
635 |
+
bottom: 0;
|
636 |
+
cursor: pointer;
|
637 |
+
left: 0;
|
638 |
+
position: absolute;
|
639 |
+
right: 0;
|
640 |
+
top: 0;
|
641 |
+
transition: .4s;
|
642 |
+
}
|
643 |
+
.btn-slider:before {
|
644 |
+
background-color: #fff;
|
645 |
+
bottom: 3px;
|
646 |
+
content: "";
|
647 |
+
height: 16px;
|
648 |
+
left: 4px;
|
649 |
+
position: absolute;
|
650 |
+
transition: .4s;
|
651 |
+
width: 16px;
|
652 |
+
}
|
653 |
+
input:checked + .btn-slider {
|
654 |
+
background-color: #0073aa;
|
655 |
+
}
|
656 |
+
input:checked + .btn-slider:before {
|
657 |
+
transform: translateX(16px);
|
658 |
+
}
|
659 |
+
.btn-slider.btn-round {
|
660 |
+
border-radius: 34px;
|
661 |
+
}
|
662 |
+
.btn-slider.btn-round:before {
|
663 |
+
border-radius: 50%;
|
664 |
+
}
|
665 |
+
|
666 |
+
|
667 |
+
|
668 |
+
/**
|
669 |
+
Quiz-question
|
670 |
+
*/
|
671 |
+
.quiz-question-form-wrap{
|
672 |
+
margin-top: 20px;
|
673 |
+
margin-bottom: 20px;
|
674 |
+
}
|
675 |
+
.quiz-question-flex-wrap, .tutor-flex-row{
|
676 |
+
display: flex;
|
677 |
+
flex-direction: row;
|
678 |
+
}
|
679 |
+
.tutor-flex-col{
|
680 |
+
margin: 0 20px;
|
681 |
+
}
|
682 |
+
.tutor-flex-col:first-child{
|
683 |
+
margin-left: 0;
|
684 |
+
}
|
685 |
+
.tutor-flex-col:last-child{
|
686 |
+
margin-right: 0;
|
687 |
+
}
|
688 |
+
.quiz-question-field{
|
689 |
+
padding: 10px 20px;
|
690 |
+
}
|
691 |
+
.quiz-question-field input[type=text],.quiz-question-field input[type=email],.quiz-question-field input[type=number],.quiz-question-field input[type=password], .quiz-question-field textarea{
|
692 |
+
border: 1px solid #ddd;
|
693 |
+
border-radius: 3px;
|
694 |
+
box-shadow: none;
|
695 |
+
color: #333;
|
696 |
+
display: inline-block;
|
697 |
+
vertical-align: middle;
|
698 |
+
padding: 7px 12px;
|
699 |
+
margin: 0 10px 0 0;
|
700 |
+
width: 100%;
|
701 |
+
min-height: 35px
|
702 |
+
}
|
703 |
+
.quiz-question-field textarea{
|
704 |
+
min-height: 100px;
|
705 |
+
}
|
706 |
+
.quiz-question-field:nth-child(2n+1) {
|
707 |
+
background: #f4f4f4;
|
708 |
+
}
|
709 |
+
.question-details{
|
710 |
+
border: 1px solid #EEEEEE;
|
711 |
+
margin-right: 10px;
|
712 |
+
}
|
713 |
+
.answer-details{
|
714 |
+
margin-left: 10px;
|
715 |
+
}
|
716 |
+
.question-details, .answer-details{
|
717 |
+
width: 100%;
|
718 |
+
}
|
719 |
+
.quiz-question-field label{
|
720 |
+
font-weight: bold;
|
721 |
+
}
|
722 |
+
.quiz-question-field .desc{
|
723 |
+
font-style: italic;
|
724 |
+
font-size: 12px;
|
725 |
+
color: #666666;
|
726 |
+
}
|
727 |
+
table.multi-answers-options{
|
728 |
+
border: 1px solid #EEEEEE;
|
729 |
+
width: 100%;
|
730 |
+
border-collapse: collapse;
|
731 |
+
border-spacing: 0;
|
732 |
+
}
|
733 |
+
|
734 |
+
table.multi-answers-options th, table.multi-answers-options td{
|
735 |
+
text-align: left;
|
736 |
+
padding: 10px 5px;
|
737 |
+
}
|
738 |
+
table.multi-answers-options tr:nth-child(2n+1){
|
739 |
+
background: #f4f4f4;
|
740 |
+
}
|
741 |
+
table.multi-answers-options td input[type=text]{
|
742 |
+
border: none;
|
743 |
+
box-shadow: none;
|
744 |
+
background-color: transparent;
|
745 |
+
width: 100%;
|
746 |
+
}
|
747 |
+
table.multi-answers-options a{
|
748 |
+
text-decoration: none;
|
749 |
+
color: #FF0000;
|
750 |
+
}
|
751 |
+
|
752 |
+
|
753 |
+
.add_answer_option_wrap {
|
754 |
+
margin: 20px 0;
|
755 |
+
}
|
756 |
+
|
757 |
+
.tutor-add-question-wrap{
|
758 |
+
margin: 20px 0;
|
759 |
+
background-color: #f4f4f4;
|
760 |
+
padding: 10px;
|
761 |
+
}
|
762 |
+
.tutor-add-question-wrap input[type=text]{
|
763 |
+
border: 1px solid #ddd;
|
764 |
+
border-radius: 0;
|
765 |
+
box-shadow: none;
|
766 |
+
color: #333;
|
767 |
+
display: inline-block;
|
768 |
+
vertical-align: middle;
|
769 |
+
padding: 7px 12px;
|
770 |
+
margin: 0;
|
771 |
+
width: 300px;
|
772 |
+
min-height: 35px
|
773 |
+
}
|
774 |
+
.tutor-add-question-wrap select {
|
775 |
+
margin: 0;
|
776 |
+
padding: 0;
|
777 |
+
border-radius: 0;
|
778 |
+
border: none;
|
779 |
+
box-shadow: none;
|
780 |
+
height: 35px;
|
781 |
+
}
|
782 |
+
.tutor-add-question-wrap .button{
|
783 |
+
height: 35px;
|
784 |
+
margin-left: 10px;
|
785 |
+
}
|
786 |
+
.single-question-item {
|
787 |
+
margin: 1px 0;
|
788 |
+
}
|
789 |
+
.tutor-question-item-head{
|
790 |
+
display: flex;
|
791 |
+
flex-direction: row;
|
792 |
+
line-height: 50px;
|
793 |
+
justify-content: space-between;
|
794 |
+
/*padding: 20px;*/
|
795 |
+
}
|
796 |
+
|
797 |
+
.tutor-question-item-head > div{
|
798 |
+
padding: 0 10px;
|
799 |
+
}
|
800 |
+
.tutor-question-item-head .question-title {
|
801 |
+
flex-basis: 0;
|
802 |
+
flex-grow: 1;
|
803 |
+
}
|
804 |
+
.tutor-question-item-head i{
|
805 |
+
line-height: 50px;
|
806 |
+
|
807 |
+
}
|
808 |
+
.single-question-item .tutor-question-item-head{
|
809 |
+
background-color: #fcfcfc;
|
810 |
+
}
|
811 |
+
.single-question-item:nth-child(2n+1) .tutor-question-item-head{
|
812 |
+
background-color: #f4f4f4;
|
813 |
+
}
|
814 |
+
.tutor-question-item-head a{
|
815 |
+
text-decoration: none;
|
816 |
+
}
|
817 |
+
|
818 |
+
.question-action-btn.trash{
|
819 |
+
color: #FF0000;
|
820 |
+
}
|
821 |
+
.question-action-btn.down{
|
822 |
+
background-color: #000000;
|
823 |
+
color: #ffffff;
|
824 |
+
padding: 0 10px;
|
825 |
+
}
|
826 |
+
.question-action-btn.down:hover {
|
827 |
+
background-color: #333333;
|
828 |
+
}
|
829 |
+
.question-actions-wrap{
|
830 |
+
padding-right: 0 !important;
|
831 |
+
}
|
832 |
+
.question-actions-wrap a{
|
833 |
+
display: inline-block;
|
834 |
+
}
|
835 |
+
.tutor-loading-icon-wrap.button{
|
836 |
+
vertical-align: unset;
|
837 |
+
border: none;
|
838 |
+
background-color: transparent;
|
839 |
+
box-shadow: none;
|
840 |
+
}
|
841 |
+
|
842 |
+
.tutor-input-text-error{
|
843 |
+
border: 1px solid #FF0000 !important;
|
844 |
+
}
|
845 |
+
|
846 |
+
|
847 |
+
/**
|
848 |
+
Quiz Modal
|
849 |
+
*/
|
850 |
+
|
851 |
+
.tutor-modal-wrap {
|
852 |
+
opacity: 0;
|
853 |
+
display: none;
|
854 |
+
position: fixed;
|
855 |
+
top: 0;
|
856 |
+
left: 0;
|
857 |
+
right: 0;
|
858 |
+
bottom: 0;
|
859 |
+
z-index: -1;
|
860 |
+
background-color: rgba(0, 0, 0, 0.5);
|
861 |
+
}
|
862 |
+
.tutor-modal-wrap.show {
|
863 |
+
display: block;
|
864 |
+
opacity: 1;
|
865 |
+
z-index: 99999;
|
866 |
+
}
|
867 |
+
.tutor-modal-wrap.loading .tutor-modal-content:before {
|
868 |
+
position: absolute;
|
869 |
+
top: 0;
|
870 |
+
left: 0;
|
871 |
+
right: 0;
|
872 |
+
bottom: 0;
|
873 |
+
display: block;
|
874 |
+
content: '';
|
875 |
+
z-index: 9;
|
876 |
+
background: url("../images/spinner.gif") no-repeat center center; }
|
877 |
+
.tutor-modal-wrap .tutor-modal-content {
|
878 |
+
max-height: 90%;
|
879 |
+
overflow-y: scroll;
|
880 |
+
overflow-x: hidden;
|
881 |
+
background-color: #fff;
|
882 |
+
max-width: 800px;
|
883 |
+
margin: 50px auto;
|
884 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
885 |
+
position: relative;
|
886 |
+
transition: all 200ms ease-out;
|
887 |
+
}
|
888 |
+
.tutor-modal-wrap .modal-footer {
|
889 |
+
padding: 20px;
|
890 |
+
border-top: 1px solid #eee;
|
891 |
+
}
|
892 |
+
.tutor-modal-wrap .modal-container{
|
893 |
+
min-height: 200px;
|
894 |
+
padding: 20px;
|
895 |
+
}
|
896 |
+
.tutor-modal-wrap .modal-container p{
|
897 |
+
margin: 5px 0;
|
898 |
+
}
|
899 |
+
.tutor-modal-wrap .modal-header {
|
900 |
+
display: flex;
|
901 |
+
}
|
902 |
+
.tutor-modal-wrap .search-bar {
|
903 |
+
flex-basis: 0;
|
904 |
+
flex-grow: 1;
|
905 |
+
padding-top: 10px;
|
906 |
+
padding-left: 20px;
|
907 |
+
padding-right: 20px;
|
908 |
+
}
|
909 |
+
.tutor-modal-wrap .search-bar input[type="text"] {
|
910 |
+
width: 100%;
|
911 |
+
border: 1px solid #eee;
|
912 |
+
box-shadow: none;
|
913 |
+
padding: 10px;
|
914 |
+
}
|
915 |
+
.tutor-modal-wrap .modal-close-wrap a.modal-close-btn {
|
916 |
+
width: 50px;
|
917 |
+
height: 50px;
|
918 |
+
background: #000;
|
919 |
+
display: inline-block;
|
920 |
+
text-align: center;
|
921 |
+
line-height: 47px;
|
922 |
+
color: #fff;
|
923 |
+
font-size: 25px;
|
924 |
+
}
|
925 |
+
/**
|
926 |
+
#End Quiz Modal
|
927 |
+
*/
|
928 |
+
|
929 |
+
.tutor-available-quizzes .added-quiz-item {
|
930 |
+
background-color: #f5f5f5;
|
931 |
+
padding: 10px;
|
932 |
+
margin-bottom: 2px;
|
933 |
+
display: flex;
|
934 |
+
}
|
935 |
+
.tutor-available-quizzes .added-quiz-item .quiz-name {
|
936 |
+
flex-basis: 0;
|
937 |
+
flex-grow: 1;
|
938 |
+
}
|
939 |
+
.tutor-add-quiz-button-wrap {
|
940 |
+
margin: 20px 0;
|
941 |
+
}
|
942 |
+
.tutor-quiz-delete-btn{
|
943 |
+
color: #FF0000;
|
944 |
+
}
|
945 |
+
p.quiz-search-suggest-text{
|
946 |
+
margin-top: 30px;
|
947 |
+
font-style: italic;
|
948 |
+
font-size: 12px;
|
949 |
+
}
|
950 |
+
span.result-pass{
|
951 |
+
padding: 5px 10px;
|
952 |
+
background-color: #04a704;
|
953 |
+
color: #ffffff;
|
954 |
+
}
|
955 |
+
span.result-fail{
|
956 |
+
padding: 5px 10px;
|
957 |
+
background-color: #FF0000;
|
958 |
+
color: #ffffff;
|
959 |
+
}
|
960 |
+
|
961 |
+
.tutor-quiz-attempt-info-row{
|
962 |
+
margin: 30px 0;
|
963 |
+
display: flex;
|
964 |
+
}
|
965 |
+
.tutor-quiz-attempt-info-row p{
|
966 |
+
font-size: 14px;
|
967 |
+
}
|
968 |
+
.tutor-quiz-attempt-info-row p.text-notified{
|
969 |
+
font-size: 12px;
|
970 |
+
color: #584dffe6;
|
971 |
+
}
|
972 |
+
.tutor-attempt-student-info, .quiz-attempt-student-info{
|
973 |
+
background-color: #ffffff;
|
974 |
+
width: 50%;
|
975 |
+
padding: 20px;
|
976 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
977 |
+
}
|
978 |
+
.tutor-attempt-student-info{
|
979 |
+
margin-right: 20px;
|
980 |
+
}
|
981 |
+
.quiz-attempt-student-info{
|
982 |
+
margin-left: 20px;
|
983 |
+
}
|
984 |
+
|
985 |
+
.tutor-quiz-attempt-info-row .quiz-attempt-info-row{
|
986 |
+
display: flex;
|
987 |
+
}
|
988 |
+
|
989 |
+
.tutor-quiz-attempt-info-row .quiz-attempt-info-row .attempt-property-name{
|
990 |
+
width: 25%;
|
991 |
+
}
|
992 |
+
.tutor-emails-lists-wrap{
|
993 |
+
background-color: #ffffff;
|
994 |
+
padding: 20px;
|
995 |
+
}
|
996 |
+
.tutor-emails-lists-wrap .wp-list-table td{
|
997 |
+
padding: 10px 20px;
|
998 |
+
}
|
999 |
+
.tutor-course-available-instructors .added-instructor-item {
|
1000 |
+
background-color: #F8F8F8;
|
1001 |
+
padding: 5px;
|
1002 |
+
margin-bottom: 2px;
|
1003 |
+
display: inline-flex;
|
1004 |
+
border: 1px solid #E8E8E8;
|
1005 |
+
border-radius: 3px;
|
1006 |
+
line-height: 30px;
|
1007 |
+
width: 47%;
|
1008 |
+
margin-right: 20px;
|
1009 |
+
margin-top: 10px;
|
1010 |
+
|
1011 |
+
}
|
1012 |
+
.tutor-course-available-instructors .added-instructor-item .instructor-icon {
|
1013 |
+
line-height: initial;
|
1014 |
+
margin-right: 12px;
|
1015 |
+
}
|
1016 |
+
.tutor-course-available-instructors .added-instructor-item .instructor-name {
|
1017 |
+
flex-basis: 0;
|
1018 |
+
flex-grow: 1;
|
1019 |
+
}
|
1020 |
+
.tutor-instructor-delete-btn{
|
1021 |
+
color: #393C40;
|
1022 |
+
text-decoration: none;
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
|
1026 |
+
/**
|
1027 |
+
Uninstall
|
1028 |
+
*/
|
1029 |
+
.wrap.tutor-uninstall-wrap {
|
1030 |
+
background: #fff;
|
1031 |
+
padding: 20px;
|
1032 |
+
}
|
1033 |
+
.tutor-uninstall-btn-group{
|
1034 |
+
margin: 50px 0;
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
/**
|
1038 |
+
Updating Messsage
|
1039 |
+
*/
|
1040 |
+
.tutor-updating-message:before{
|
1041 |
+
display: inline-block;
|
1042 |
+
font-family: 'tutor';
|
1043 |
+
-webkit-font-smoothing: antialiased;
|
1044 |
+
-moz-osx-font-smoothing: grayscale;
|
1045 |
+
vertical-align: top;
|
1046 |
+
/*color: #f56e28;*/
|
1047 |
+
content: "\e91d";
|
1048 |
+
-webkit-animation: rotation 2s infinite linear;
|
1049 |
+
animation: rotation 2s infinite linear;
|
1050 |
+
margin-right: 6px;
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
|
1054 |
+
/**
|
1055 |
+
Lesson Edit Modal
|
1056 |
+
*/
|
1057 |
+
.lesson-modal-close-wrap a{
|
1058 |
+
position: absolute;
|
1059 |
+
right: 0;
|
1060 |
+
top: 0;
|
1061 |
+
color: #fff;
|
1062 |
+
background: #000;
|
1063 |
+
padding: 20px;
|
1064 |
+
line-height: 8px;
|
1065 |
+
font-size: 12px;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
.lesson-modal-form-wrap .lesson-modal-field-row{
|
1069 |
+
padding: 10px 0;
|
1070 |
+
}
|
1071 |
+
.lesson-modal-field.tutor-lesson-modal-title-wrap{
|
1072 |
+
width: 95%;
|
1073 |
+
}
|
1074 |
+
.lesson-modal-field-row input[type=text]{
|
1075 |
+
background-color: #fff;
|
1076 |
+
border: 1px solid #ddd;
|
1077 |
+
border-radius: 3px;
|
1078 |
+
box-shadow: none;
|
1079 |
+
color: #333;
|
1080 |
+
display: inline-block;
|
1081 |
+
vertical-align: middle;
|
1082 |
+
padding: 7px 12px;
|
1083 |
+
margin: 0 10px 0 0;
|
1084 |
+
min-width: 400px;
|
1085 |
+
min-height: 35px
|
1086 |
+
}
|
1087 |
+
.tutor-lesson-modal-title-wrap input{
|
1088 |
+
width: 100%;
|
1089 |
+
}
|
1090 |
+
.lesson-modal-form-wrap .tutor-option-field-row{
|
1091 |
+
padding: 10px 0;
|
1092 |
+
}
|
1093 |
+
.lesson-modal-form-wrap .tutor-option-field-row:last-child {
|
1094 |
+
border-bottom: none;
|
1095 |
+
}
|
1096 |
+
.lesson-modal-form-wrap {
|
1097 |
+
padding-bottom: 48px;
|
1098 |
+
}
|
1099 |
+
.tutor-lesson-modal-wrap .modal-footer{
|
1100 |
+
padding: 10px 0;
|
1101 |
+
background-color: #fff;
|
1102 |
+
width: 750px;
|
1103 |
+
position: sticky;
|
1104 |
+
bottom: 0;
|
1105 |
+
position: -webkit-sticky;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
.tutor-lesson-modal-wrap .tutor-thumbnail-wrap img{
|
1109 |
+
max-width: 150px;
|
1110 |
+
height: auto;
|
1111 |
+
}
|
1112 |
+
.tutor-get-pro-text {
|
1113 |
+
color: #e02424;
|
1114 |
+
}
|
assets/css/tutor-front.css
ADDED
@@ -0,0 +1,2369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../icons/css/tutor-icon.css";
|
2 |
+
|
3 |
+
/*common*/
|
4 |
+
.tutor-wrap{
|
5 |
+
color: #4B5981;
|
6 |
+
}
|
7 |
+
/*
|
8 |
+
.tutor-container{
|
9 |
+
padding-left: 15px;
|
10 |
+
padding-right: 15px;
|
11 |
+
max-width: 1170px;
|
12 |
+
margin-right: auto;
|
13 |
+
margin-left: auto;
|
14 |
+
}*/
|
15 |
+
.tutor-row{
|
16 |
+
display: -ms-flexbox;
|
17 |
+
display: flex;
|
18 |
+
-ms-flex-wrap: wrap;
|
19 |
+
flex-wrap: wrap;
|
20 |
+
margin-right: -15px;
|
21 |
+
margin-left: -15px;
|
22 |
+
}
|
23 |
+
.tutor-col-auto, .tutor-col, .tutor-col-3, .tutor-col-4, .tutor-col-6, .tutor-col-8, .tutor-col-9, .tutor-col-12{
|
24 |
+
position: relative;
|
25 |
+
width: 100%;
|
26 |
+
min-height: 1px;
|
27 |
+
padding-right: 15px;
|
28 |
+
padding-left: 15px;
|
29 |
+
}
|
30 |
+
.tutor-col{
|
31 |
+
-ms-flex-preferred-size: 0;
|
32 |
+
flex-basis: 0;
|
33 |
+
-ms-flex-positive: 1;
|
34 |
+
flex-grow: 1;
|
35 |
+
max-width: 100%;
|
36 |
+
}
|
37 |
+
.tutor-col-auto {
|
38 |
+
-ms-flex: 0 0 auto;
|
39 |
+
flex: 0 0 auto;
|
40 |
+
width: auto;
|
41 |
+
max-width: none;
|
42 |
+
}
|
43 |
+
.tutor-col-3{
|
44 |
+
-ms-flex: 0 0 25%;
|
45 |
+
flex: 0 0 25%;
|
46 |
+
max-width: 25%;
|
47 |
+
}
|
48 |
+
.tutor-col-4{
|
49 |
+
-ms-flex: 0 0 33.333333%;
|
50 |
+
flex: 0 0 33.333333%;
|
51 |
+
max-width: 33.333333%;
|
52 |
+
}
|
53 |
+
.tutor-col-6{
|
54 |
+
-ms-flex: 0 0 50%;
|
55 |
+
flex: 0 0 50%;
|
56 |
+
max-width: 50%;
|
57 |
+
}
|
58 |
+
.tutor-col-8{
|
59 |
+
-ms-flex: 0 0 66.666666%;
|
60 |
+
flex: 0 0 66.666666%;
|
61 |
+
max-width: 66.666666%;
|
62 |
+
}
|
63 |
+
.tutor-col-9{
|
64 |
+
-ms-flex: 75%;
|
65 |
+
flex: 0 0 75%;
|
66 |
+
max-width: 75%;
|
67 |
+
}
|
68 |
+
.tutor-col-12{
|
69 |
+
-ms-flex: 100%;
|
70 |
+
flex: 0 0 100%;
|
71 |
+
max-width: 100%;
|
72 |
+
}
|
73 |
+
@media (max-width: 991px) {
|
74 |
+
.tutor-col-auto, .tutor-col, .tutor-col-3, .tutor-col-4, .tutor-col-6, .tutor-col-8, .tutor-col-9{
|
75 |
+
-ms-flex: 50%;
|
76 |
+
flex: 0 0 50%;
|
77 |
+
max-width: 50%;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
@media (max-width: 767px) {
|
81 |
+
.tutor-col-auto, .tutor-col, .tutor-col-3, .tutor-col-4, .tutor-col-6, .tutor-col-8, .tutor-col-9{
|
82 |
+
-ms-flex: 100%;
|
83 |
+
flex: 0 0 100%;
|
84 |
+
max-width: 100%;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
.tutor-custom-list-style{
|
90 |
+
list-style: none;
|
91 |
+
margin: 0;
|
92 |
+
padding: 0;
|
93 |
+
font-size: 14px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.tutor-custom-list-style li{
|
97 |
+
position: relative;
|
98 |
+
margin-bottom: 5px;
|
99 |
+
line-height: 30px;
|
100 |
+
padding-left: 25px;
|
101 |
+
}
|
102 |
+
|
103 |
+
.tutor-custom-list-style li::before{
|
104 |
+
content: '\e90f';
|
105 |
+
position: absolute;
|
106 |
+
left: 0;
|
107 |
+
font-family: 'tutor';
|
108 |
+
color: #1B52D8;
|
109 |
+
}
|
110 |
+
|
111 |
+
.tutor-mb-10{
|
112 |
+
margin-bottom: 10px;
|
113 |
+
}
|
114 |
+
.tutor-mb-20{
|
115 |
+
margin-bottom: 20px;
|
116 |
+
}
|
117 |
+
.tutor-mb-30{
|
118 |
+
margin-bottom: 30px;
|
119 |
+
}
|
120 |
+
.tutor-mb-40{
|
121 |
+
margin-bottom: 40px;
|
122 |
+
}
|
123 |
+
|
124 |
+
/********************/
|
125 |
+
/*start single course*/
|
126 |
+
/********************/
|
127 |
+
|
128 |
+
.tutor-course-content-content{
|
129 |
+
font-size: 14px;
|
130 |
+
line-height: 21px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.tutor-single-course-segment{
|
134 |
+
margin-bottom: 45px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.tutor-full-width-course-top h4,
|
138 |
+
.tutor-full-width-course-top h5,
|
139 |
+
.tutor-full-width-course-top h6{
|
140 |
+
color: #8C94A8;
|
141 |
+
font-weight: 400;
|
142 |
+
}
|
143 |
+
.tutor-full-width-course-top h6{
|
144 |
+
font-size: 14px;
|
145 |
+
}
|
146 |
+
.tutor-single-course-segment .tutor-segment-title,
|
147 |
+
.tutor-segment-title{
|
148 |
+
font-size: 18px;
|
149 |
+
line-height: 23px;
|
150 |
+
font-weight: 500;
|
151 |
+
margin-bottom: 13px;
|
152 |
+
}
|
153 |
+
.tutor-leadinfo-top-meta{
|
154 |
+
font-size: 14px;
|
155 |
+
margin-bottom: 10px;
|
156 |
+
}
|
157 |
+
.tutor-leadinfo-top-meta span{
|
158 |
+
display: inline-block;
|
159 |
+
margin-right: 10px;
|
160 |
+
}
|
161 |
+
|
162 |
+
|
163 |
+
.tutor-leadinfo-top-meta i{
|
164 |
+
margin-right: 4px;
|
165 |
+
}
|
166 |
+
|
167 |
+
.tutor-single-course-rating{
|
168 |
+
color: #F8C51C;
|
169 |
+
font-size: 16px;
|
170 |
+
}
|
171 |
+
.tutor-single-course-rating .tutor-single-rating-count{
|
172 |
+
color: #4B5981;
|
173 |
+
}
|
174 |
+
.tutor-single-course-rating .tutor-single-rating-count i{
|
175 |
+
color: #B1B8C9;
|
176 |
+
font-style: normal;
|
177 |
+
display: inline-block;
|
178 |
+
margin-left: 4px;
|
179 |
+
}
|
180 |
+
.tutor-leadinfo-top-meta span i::before{
|
181 |
+
margin-left: 0;
|
182 |
+
}
|
183 |
+
.tutor-course-header-h1{
|
184 |
+
font-size: 36px;
|
185 |
+
line-height: 46px;
|
186 |
+
color: #4B5981;
|
187 |
+
font-weight: 500;
|
188 |
+
margin: 0 0 29px;
|
189 |
+
padding: 0;
|
190 |
+
}
|
191 |
+
.tutor-course-summery{
|
192 |
+
margin-bottom: 40px;
|
193 |
+
font-size: 14px;
|
194 |
+
}
|
195 |
+
|
196 |
+
/*tutor course meta*/
|
197 |
+
|
198 |
+
.tutor-single-course-meta{
|
199 |
+
color: #4B5981;
|
200 |
+
font-size: 14px;
|
201 |
+
}
|
202 |
+
.tutor-single-course-meta ul{
|
203 |
+
list-style: none;
|
204 |
+
margin: 0;
|
205 |
+
padding: 10px 0;
|
206 |
+
overflow: hidden;
|
207 |
+
line-height: 21px;
|
208 |
+
}
|
209 |
+
.tutor-single-course-meta.tutor-meta-top ul{
|
210 |
+
padding-top: 5px;
|
211 |
+
padding-bottom: 15px;
|
212 |
+
}
|
213 |
+
.tutor-single-course-meta ul li{
|
214 |
+
float: left;
|
215 |
+
vertical-align: top;
|
216 |
+
margin-right: 40px;
|
217 |
+
margin-top: 5px;
|
218 |
+
margin-bottom: 5px;
|
219 |
+
}
|
220 |
+
|
221 |
+
.tutor-single-course-meta .tutor-single-course-avatar img{
|
222 |
+
height: 21px;
|
223 |
+
width: 21px;
|
224 |
+
display: block;
|
225 |
+
border-radius: 50%;
|
226 |
+
margin-right: 3px;
|
227 |
+
}
|
228 |
+
|
229 |
+
.tutor-single-course-meta ul li .tutor-single-course-avatar span{
|
230 |
+
height: 21px;
|
231 |
+
width: 21px;
|
232 |
+
font-size: 9px;
|
233 |
+
text-align: center;
|
234 |
+
line-height: 21px;
|
235 |
+
border-radius: 50%;
|
236 |
+
display: block;
|
237 |
+
color: #ffffff;
|
238 |
+
}
|
239 |
+
.tutor-single-course-meta ul li > div{
|
240 |
+
display: inline-block;
|
241 |
+
vertical-align: top;
|
242 |
+
}
|
243 |
+
.tutor-single-course-meta ul li strong{
|
244 |
+
margin: 0;
|
245 |
+
display: inline-block;
|
246 |
+
line-height: 21px;
|
247 |
+
font-weight: 400;
|
248 |
+
color: #8C94A8;
|
249 |
+
font-size: 14px;
|
250 |
+
}
|
251 |
+
.tutor-single-course-meta ul li span,
|
252 |
+
.tutor-single-course-meta ul li a{
|
253 |
+
color: #4B5981;
|
254 |
+
}
|
255 |
+
.tutor-single-course-meta.tutor-lead-meta{
|
256 |
+
margin-bottom: 33px;
|
257 |
+
border-top: 1px solid #DCDFE5;
|
258 |
+
border-bottom: 1px solid #DCDFE5;
|
259 |
+
}
|
260 |
+
|
261 |
+
@media (max-width: 991px) {
|
262 |
+
.tutor-single-course-meta.tutor-lead-meta{
|
263 |
+
border-bottom: none;
|
264 |
+
}
|
265 |
+
.tutor-single-course-meta.tutor-lead-meta ul{
|
266 |
+
padding-bottom: 0;
|
267 |
+
}
|
268 |
+
.tutor-single-course-meta.tutor-lead-meta ul li{
|
269 |
+
margin: 5px;
|
270 |
+
padding: 5px 15px;
|
271 |
+
border: 1px solid #ddd;
|
272 |
+
border-radius: 4px;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
.tutor-single-course-meta.tutor-lead-meta ul li strong{
|
277 |
+
display: block;
|
278 |
+
margin-bottom: 5px;
|
279 |
+
color: #B1B8C9;
|
280 |
+
}
|
281 |
+
.tutor-single-course-meta.tutor-lead-meta ul li a{
|
282 |
+
color: #4B5981;
|
283 |
+
}
|
284 |
+
|
285 |
+
.tutor-single-course-meta.tutor-lead-meta ul li a:not(:last-child)::after{
|
286 |
+
content: ', ';
|
287 |
+
}
|
288 |
+
/*benifit*/
|
289 |
+
.tutor-course-benefits-content ul{
|
290 |
+
list-style: none;
|
291 |
+
display: block;
|
292 |
+
overflow: hidden;
|
293 |
+
column-count: 2;
|
294 |
+
column-gap: 30px;
|
295 |
+
margin: 0;
|
296 |
+
font-size: 14px;
|
297 |
+
}
|
298 |
+
|
299 |
+
/*.tutor-course-topics-wrap*/
|
300 |
+
|
301 |
+
.tutor-course-topics-header{
|
302 |
+
display: flex;
|
303 |
+
flex-wrap: wrap;
|
304 |
+
justify-content: space-between;
|
305 |
+
margin-bottom: 8px;
|
306 |
+
}
|
307 |
+
.tutor-course-topics-header .tutor-course-topics-header-right span:not(:first-child){
|
308 |
+
margin-left: 45px;
|
309 |
+
}
|
310 |
+
.tutor-course-topics-contents h4{
|
311 |
+
font-size: 14px;
|
312 |
+
font-weight: 400;
|
313 |
+
margin-bottom: 0;
|
314 |
+
color: #4B5981;
|
315 |
+
}
|
316 |
+
.tutor-course-topics-contents .tutor-course-title{
|
317 |
+
cursor: pointer;
|
318 |
+
}
|
319 |
+
.tutor-course-topics-contents .tutor-course-title h4{
|
320 |
+
color: #1B52D8;
|
321 |
+
font-size: 16px;
|
322 |
+
line-height: 25px;
|
323 |
+
overflow: hidden;
|
324 |
+
}
|
325 |
+
|
326 |
+
.tutor-course-topic.tutor-active .tutor-course-title h4 > i::before{
|
327 |
+
content: "\e910";
|
328 |
+
}
|
329 |
+
|
330 |
+
.tutor-course-topics-contents .tutor-course-title h4 i{
|
331 |
+
font-size: 15px;
|
332 |
+
line-height: 25px;
|
333 |
+
float: left;
|
334 |
+
margin-right: 10px;
|
335 |
+
}
|
336 |
+
.tutor-course-topics-contents .tutor-course-topic{
|
337 |
+
border: 1px solid #DCE4E6;
|
338 |
+
margin-bottom: 20px;
|
339 |
+
border-radius: 5px;
|
340 |
+
}
|
341 |
+
.tutor-course-title,
|
342 |
+
.tutor-course-lesson{
|
343 |
+
padding: 14px 20px;
|
344 |
+
}
|
345 |
+
.tutor-course-lesson{
|
346 |
+
border-top: 1px solid #DCE4E6;
|
347 |
+
}
|
348 |
+
.tutor-course-topics-contents .tutor-course-topic .tutor-course-lessons{
|
349 |
+
display: none;
|
350 |
+
}
|
351 |
+
.tutor-course-lesson h5{
|
352 |
+
line-height: 22px;
|
353 |
+
font-size: 14px;
|
354 |
+
margin-bottom: 0;
|
355 |
+
display: flex;
|
356 |
+
}
|
357 |
+
.tutor-course-lesson h5 i{
|
358 |
+
line-height: 22px;
|
359 |
+
display: inline-block;
|
360 |
+
vertical-align: text-top;
|
361 |
+
margin-right: 10px;
|
362 |
+
color: #B1B8C9;
|
363 |
+
}
|
364 |
+
.tutor-course-lesson .lesson-preview-title {
|
365 |
+
flex: 1 0 0;
|
366 |
+
}
|
367 |
+
|
368 |
+
/********************/
|
369 |
+
/*end single course*/
|
370 |
+
/********************/
|
371 |
+
|
372 |
+
/**
|
373 |
+
Icon Css
|
374 |
+
*/
|
375 |
+
div[class*="tutor-course-col"] {
|
376 |
+
padding-left: 15px;
|
377 |
+
padding-right: 15px;
|
378 |
+
}
|
379 |
+
.tutor-course-loop{
|
380 |
+
background: #fff;
|
381 |
+
color: #29303b;
|
382 |
+
font-size: small;
|
383 |
+
overflow: hidden;
|
384 |
+
position: relative;
|
385 |
+
vertical-align: top;
|
386 |
+
margin-bottom: 30px;
|
387 |
+
border-radius: 4px;
|
388 |
+
transition: 300ms;
|
389 |
+
border: 1px solid #DCDFE5;
|
390 |
+
}
|
391 |
+
.tutor-course-header{
|
392 |
+
position: relative;
|
393 |
+
}
|
394 |
+
|
395 |
+
.tutor-course-loop-header-meta{
|
396 |
+
position: absolute;
|
397 |
+
left: 0;
|
398 |
+
top: 13px;
|
399 |
+
width: 100%;
|
400 |
+
padding-left: 13px;
|
401 |
+
padding-right: 13px;
|
402 |
+
overflow: hidden;
|
403 |
+
}
|
404 |
+
|
405 |
+
.tutor-course-loop-header-meta .tutor-course-wishlist{
|
406 |
+
float: right;
|
407 |
+
background: #fff;
|
408 |
+
font-size: 19px;
|
409 |
+
padding: 5px 5px;
|
410 |
+
border-radius: 3px;
|
411 |
+
}
|
412 |
+
|
413 |
+
.tutor-course-loop-header-meta .tutor-course-wishlist a{
|
414 |
+
display: block;
|
415 |
+
color: #1B52D8;
|
416 |
+
}
|
417 |
+
.tutor-course-loop-header-meta .tutor-course-wishlist a:focus{
|
418 |
+
outline: none;
|
419 |
+
}
|
420 |
+
.tutor-course-loop-header-meta .tutor-course-wishlist a.has-wish-listed::before{
|
421 |
+
content: "\e908";
|
422 |
+
}
|
423 |
+
.tutor-course-loop-header-meta .tutor-course-wishlist a.updating-icon::before{
|
424 |
+
content: '\e91d';
|
425 |
+
margin-right: 0;
|
426 |
+
}
|
427 |
+
.tutor-course-loop-level{
|
428 |
+
display: inline-block;
|
429 |
+
background: #9013FE;
|
430 |
+
padding: 0 10px;
|
431 |
+
color: #fff;
|
432 |
+
font-size: 12px;
|
433 |
+
line-height: 21px;
|
434 |
+
border-radius: 2px;
|
435 |
+
box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
|
436 |
+
}
|
437 |
+
|
438 |
+
.tutor-course-loop:hover{
|
439 |
+
box-shadow: 0 4px 23px rgba(0,0,0,.1);
|
440 |
+
}
|
441 |
+
.tutor-course-loop p{
|
442 |
+
margin: 0;
|
443 |
+
}
|
444 |
+
.tutor-course-loop .tutor-course-header a,
|
445 |
+
.tutor-course-loop .tutor-course-header a img{
|
446 |
+
display: block;
|
447 |
+
border-top-left-radius: 4px;
|
448 |
+
border-top-right-radius: 4px;
|
449 |
+
}
|
450 |
+
.tutor-loop-course-container{
|
451 |
+
padding: 20px 15px;
|
452 |
+
}
|
453 |
+
.tutor-loop-rating-wrap{
|
454 |
+
color: #F8C51C;
|
455 |
+
margin-bottom: 2px;
|
456 |
+
font-size: 16px;
|
457 |
+
}
|
458 |
+
.tutor-loop-rating-wrap i::before{
|
459 |
+
margin-right: 3px;
|
460 |
+
margin-left: 0;
|
461 |
+
}
|
462 |
+
.tutor-course-loop-title a h2{
|
463 |
+
font-size: 22px;
|
464 |
+
line-height: 26px;
|
465 |
+
font-weight: 600;
|
466 |
+
margin-bottom: 17px;
|
467 |
+
color: #4B5981;
|
468 |
+
}
|
469 |
+
.tutor-loop-course-footer{
|
470 |
+
padding: 10px 15px;
|
471 |
+
border-top: 1px solid #DCDFE5;
|
472 |
+
color: #838791;
|
473 |
+
font-size: 12px;
|
474 |
+
line-height: 17px;
|
475 |
+
line-height: 25px;
|
476 |
+
border-bottom-left-radius: 4px;
|
477 |
+
border-bottom-right-radius: 4px;
|
478 |
+
position: relative;
|
479 |
+
}
|
480 |
+
.tutor-loop-course-footer::after{
|
481 |
+
content: '';
|
482 |
+
display: table;
|
483 |
+
clear: both;
|
484 |
+
}
|
485 |
+
|
486 |
+
.tutor-loop-course-footer i{
|
487 |
+
font-size: 15px;
|
488 |
+
color: #8C94A8;
|
489 |
+
line-height: 25px;
|
490 |
+
vertical-align: middle;
|
491 |
+
margin-right: 3px;
|
492 |
+
}
|
493 |
+
.tutor-loop-course-footer i:not(:first-child){
|
494 |
+
margin-left: 12px;
|
495 |
+
}
|
496 |
+
|
497 |
+
.tutor-loop-course-footer span{
|
498 |
+
display: inline-block;
|
499 |
+
line-height: 25px;
|
500 |
+
}
|
501 |
+
|
502 |
+
.tutor-course-loop-price{
|
503 |
+
float: right;
|
504 |
+
color: #4B5981;
|
505 |
+
font-size: 17px;
|
506 |
+
font-weight: 600;
|
507 |
+
}
|
508 |
+
.tutor-course-loop-price .price del{
|
509 |
+
font-size: 12px;
|
510 |
+
opacity: 1;
|
511 |
+
font-weight: 400;
|
512 |
+
}
|
513 |
+
|
514 |
+
.tutor-course-loop-price .price del span{
|
515 |
+
text-decoration: line-through;
|
516 |
+
color: #8C94A8;
|
517 |
+
}
|
518 |
+
|
519 |
+
.tutor-course-loop-price .price del + ins{
|
520 |
+
background: transparent;
|
521 |
+
margin-left: 0;
|
522 |
+
}
|
523 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap{
|
524 |
+
position: absolute;
|
525 |
+
left: -1px;
|
526 |
+
top: 0;
|
527 |
+
width: calc(100% + 2px);
|
528 |
+
height: calc(100% + 1px);
|
529 |
+
color: #fff;
|
530 |
+
text-align: center;
|
531 |
+
top: 0;
|
532 |
+
opacity: 0;
|
533 |
+
transition: 100ms;
|
534 |
+
border-bottom-left-radius: 4px;
|
535 |
+
border-bottom-right-radius: 4px;
|
536 |
+
background: blue;
|
537 |
+
}
|
538 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap a{
|
539 |
+
color: #fff;
|
540 |
+
font-size: 14px;
|
541 |
+
text-transform: uppercase;
|
542 |
+
line-height: 46px;
|
543 |
+
font-weight: 600;
|
544 |
+
-webkit-animation: rotate_cs 5s infinite; /* Safari 4.0 - 8.0 */
|
545 |
+
animation: rotate_cs 5s infinite;
|
546 |
+
padding: 0;
|
547 |
+
display: block;
|
548 |
+
width: 100%;
|
549 |
+
line-height: 48px;
|
550 |
+
background: blue;
|
551 |
+
}
|
552 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap a.added{
|
553 |
+
display: none;
|
554 |
+
}
|
555 |
+
|
556 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap a.added_to_cart{
|
557 |
+
background-color: #000000;
|
558 |
+
}
|
559 |
+
|
560 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap a::before{
|
561 |
+
content: '\e915';
|
562 |
+
font-family: "tutor";
|
563 |
+
margin-right: 5px;
|
564 |
+
}
|
565 |
+
|
566 |
+
|
567 |
+
.tutor-loop-course-footer .tutor-loop-cart-btn-wrap a.added_to_cart::before{
|
568 |
+
display: none;
|
569 |
+
}
|
570 |
+
|
571 |
+
|
572 |
+
/* Standard syntax */
|
573 |
+
@keyframes mymove {
|
574 |
+
from {
|
575 |
+
transform: rotate(0deg);
|
576 |
+
}
|
577 |
+
to {
|
578 |
+
transform: rotate(360deg);
|
579 |
+
}
|
580 |
+
}
|
581 |
+
.tutor-course-loop:hover .tutor-loop-course-footer .tutor-loop-cart-btn-wrap{
|
582 |
+
opacity: 1;
|
583 |
+
}
|
584 |
+
/* layout*/
|
585 |
+
.tutor-course-col-4{
|
586 |
+
width: 25%;
|
587 |
+
}
|
588 |
+
.tutor-course-col-3{
|
589 |
+
width: 33.33%;
|
590 |
+
}
|
591 |
+
.tutor-course-col-2{
|
592 |
+
width: 50%;
|
593 |
+
}
|
594 |
+
.tutor-course-col-1{
|
595 |
+
width: 100%;
|
596 |
+
}
|
597 |
+
.tutor-course-col-1 .tutor-course-loop{
|
598 |
+
width: 100%;
|
599 |
+
}
|
600 |
+
.tutor-course-col-5{
|
601 |
+
width: 20%;
|
602 |
+
}
|
603 |
+
.tutor-course-col-6{
|
604 |
+
width: 16.66%;
|
605 |
+
}
|
606 |
+
|
607 |
+
@media (max-width: 767px) {
|
608 |
+
.tutor-course-col-6,
|
609 |
+
.tutor-course-col-5,
|
610 |
+
.tutor-course-col-4,
|
611 |
+
.tutor-course-col-3,
|
612 |
+
.tutor-course-col-2{
|
613 |
+
width: 50%;
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
@media (max-width: 575px) {
|
618 |
+
.tutor-course-col-6,
|
619 |
+
.tutor-course-col-5,
|
620 |
+
.tutor-course-col-4,
|
621 |
+
.tutor-course-col-3,
|
622 |
+
.tutor-course-col-2{
|
623 |
+
width: 100%;
|
624 |
+
}
|
625 |
+
}
|
626 |
+
|
627 |
+
.tutor-course-loop-title h2{
|
628 |
+
font-size: 1rem;
|
629 |
+
}
|
630 |
+
.tutor-course-filter-wrap{
|
631 |
+
clear: both;
|
632 |
+
margin-bottom: 20px;
|
633 |
+
}
|
634 |
+
.tutor-course-archive-results-wrap{
|
635 |
+
float: left;
|
636 |
+
width: 45%;
|
637 |
+
}
|
638 |
+
.tutor-course-archive-filters-wrap{
|
639 |
+
float: right;
|
640 |
+
width: 45%;
|
641 |
+
text-align: right;
|
642 |
+
}
|
643 |
+
.tutor-courses{
|
644 |
+
clear: both;
|
645 |
+
display: flex;
|
646 |
+
flex-wrap: wrap;
|
647 |
+
margin-left: -15px;
|
648 |
+
margin-right: -15px;
|
649 |
+
padding: 0;
|
650 |
+
}
|
651 |
+
.clearfix:before, .clearfix:after{
|
652 |
+
display: block;
|
653 |
+
clear: both;
|
654 |
+
content: "";
|
655 |
+
}
|
656 |
+
.tutor-loop-author, .tutor-meta{
|
657 |
+
color: #bac0cf;
|
658 |
+
}
|
659 |
+
.tutor-text-mute{
|
660 |
+
color: #bac0cf;
|
661 |
+
}
|
662 |
+
|
663 |
+
.tutor-loop-author{
|
664 |
+
overflow: hidden;
|
665 |
+
}
|
666 |
+
|
667 |
+
.tutor-loop-author .tutor-single-course-avatar img{
|
668 |
+
width: 25px;
|
669 |
+
height: 25px;
|
670 |
+
display: block;
|
671 |
+
border-radius: 50%;
|
672 |
+
margin-right: 6px;
|
673 |
+
}
|
674 |
+
.tutor-loop-author .tutor-single-course-avatar .tutor-text-avatar{
|
675 |
+
height: 25px;
|
676 |
+
width: 25px;
|
677 |
+
display: inline-block;
|
678 |
+
border-radius: 50%;
|
679 |
+
text-align: center;
|
680 |
+
line-height: 25px;
|
681 |
+
font-size: 11px;
|
682 |
+
margin-right: 6px;
|
683 |
+
}
|
684 |
+
|
685 |
+
.tutor-loop-author > div{
|
686 |
+
display: inline-block;
|
687 |
+
float: left;
|
688 |
+
}
|
689 |
+
|
690 |
+
.tutor-loop-author > div span,
|
691 |
+
.tutor-loop-author > div a{
|
692 |
+
color: #4B5981;
|
693 |
+
}
|
694 |
+
|
695 |
+
.tutor-loop-author > div strong{
|
696 |
+
display: inline-block;
|
697 |
+
margin: 0 2px 0 2px;
|
698 |
+
font-size: 14px;
|
699 |
+
color: #8C94A8;
|
700 |
+
font-weight: 600;
|
701 |
+
line-height: 25px;
|
702 |
+
}
|
703 |
+
|
704 |
+
.tutor-course-lising-category a:not(:last-child):after{
|
705 |
+
content: ', ';
|
706 |
+
}
|
707 |
+
|
708 |
+
/**
|
709 |
+
Topicstutor-course-title
|
710 |
+
*/
|
711 |
+
.tutor-course-enroll-wrap{
|
712 |
+
padding: 20px 0;
|
713 |
+
}
|
714 |
+
.tutor-wrap .tutor-course-enrolled-wrap{
|
715 |
+
background: #ecffec;
|
716 |
+
padding: 20px;
|
717 |
+
border: 1px solid #b7d6b7;
|
718 |
+
}
|
719 |
+
.tutor-notice-warning{
|
720 |
+
background-color: #fcf8e3;
|
721 |
+
border-color: #faebcc;
|
722 |
+
padding: 20px;
|
723 |
+
margin-bottom: 10px;
|
724 |
+
}
|
725 |
+
.single_add_to_cart_button,
|
726 |
+
a.tutor-button,
|
727 |
+
.tutor-button,
|
728 |
+
a.tutor-btn,
|
729 |
+
.tutor-btn{
|
730 |
+
color: #fff;
|
731 |
+
background-color: #1B52D8;
|
732 |
+
border-color: #1B52D8;
|
733 |
+
display: inline-block;
|
734 |
+
padding: 15px 30px;
|
735 |
+
border-radius: 4px;
|
736 |
+
text-transform: uppercase;
|
737 |
+
line-height: 1.4;
|
738 |
+
font-size: 14px;
|
739 |
+
}
|
740 |
+
a.tutor-button:hover,
|
741 |
+
.tutor-button:hover,
|
742 |
+
a.tutor-btn:hover,
|
743 |
+
.tutor-btn:hover {
|
744 |
+
background-color: #1B52D8;
|
745 |
+
border-color: #1B52D8;
|
746 |
+
color: #fff;
|
747 |
+
filter: brightness(.9);
|
748 |
+
}
|
749 |
+
|
750 |
+
.tutor-button.tutor-danger{
|
751 |
+
background-color: #E53935;
|
752 |
+
border-color: #E53935;
|
753 |
+
}
|
754 |
+
.tutor-button.tutor-success{
|
755 |
+
background: #86B223;
|
756 |
+
border-color: #86B223;
|
757 |
+
}
|
758 |
+
|
759 |
+
.course-enrolled-nav-wrap{
|
760 |
+
border-bottom: 1px solid #dedfe0;
|
761 |
+
margin-bottom: 45px;
|
762 |
+
}
|
763 |
+
.tutor-wrap nav.course-enrolled-nav ul{
|
764 |
+
list-style: none;
|
765 |
+
margin: 0 0 -1px;
|
766 |
+
}
|
767 |
+
.tutor-wrap nav.course-enrolled-nav ul li{
|
768 |
+
display: inline-block;
|
769 |
+
}
|
770 |
+
.tutor-wrap nav.course-enrolled-nav ul li a{
|
771 |
+
display: block;
|
772 |
+
font-size: 16px;
|
773 |
+
padding: 5px 0 20px;
|
774 |
+
margin-right: 20px;
|
775 |
+
color: #B1B8C9;
|
776 |
+
border-bottom: 2px solid transparent;
|
777 |
+
}
|
778 |
+
.tutor-wrap nav.course-enrolled-nav ul li.active a{
|
779 |
+
border-bottom: 2px solid #1B52D8;
|
780 |
+
color: #4B5981;
|
781 |
+
}
|
782 |
+
/* *********************** */
|
783 |
+
/* Tutor Student Dashboard */
|
784 |
+
/* *********************** */
|
785 |
+
|
786 |
+
.tutor-dashboard-avater img{
|
787 |
+
width: 70px;
|
788 |
+
height: 70px;
|
789 |
+
display: block;
|
790 |
+
border-radius: 50%;
|
791 |
+
}
|
792 |
+
|
793 |
+
.tutor-dashboard-student-info h4{
|
794 |
+
font-size: 18px;
|
795 |
+
color: #8C94A8;
|
796 |
+
margin-bottom: 0;
|
797 |
+
}
|
798 |
+
|
799 |
+
|
800 |
+
.tutor-dashboard-student-info h4 a{
|
801 |
+
color: #4B5981;
|
802 |
+
}
|
803 |
+
|
804 |
+
.tutor-dashboard-user-role{
|
805 |
+
font-size: 14px;
|
806 |
+
font-weight: 400;
|
807 |
+
}
|
808 |
+
|
809 |
+
.tutor-dashboard-student-meta ul{
|
810 |
+
list-style: none;
|
811 |
+
margin: 20px 0 40px;
|
812 |
+
padding: 15px 0;
|
813 |
+
border-top: 1px solid #DCDFE5;
|
814 |
+
border-bottom: 1px solid #DCDFE5;
|
815 |
+
font-size: 14px;
|
816 |
+
}
|
817 |
+
|
818 |
+
.tutor-dashboard-student-meta ul li{
|
819 |
+
display: inline-block;
|
820 |
+
color: #4B5981;
|
821 |
+
margin-left: 60px;
|
822 |
+
}
|
823 |
+
|
824 |
+
.tutor-dashboard-student-meta ul li:first-child{
|
825 |
+
margin-left: 0;
|
826 |
+
}
|
827 |
+
@media (max-width: 767px){
|
828 |
+
.tutor-dashboard-student-meta ul{
|
829 |
+
display: block;
|
830 |
+
border: none;
|
831 |
+
padding: 0;
|
832 |
+
}
|
833 |
+
.tutor-dashboard-student-meta ul li{
|
834 |
+
display: inline-block;
|
835 |
+
color: #4B5981;
|
836 |
+
margin: 5px;
|
837 |
+
border: 1px solid #dddddd;
|
838 |
+
padding: 5px 10px;
|
839 |
+
border-radius: 4px;
|
840 |
+
margin-left: 5px;
|
841 |
+
}
|
842 |
+
}
|
843 |
+
.tutor-dashboard-student-meta ul li strong{
|
844 |
+
display: block;
|
845 |
+
color: #B1B8C9;
|
846 |
+
font-weight: 400;
|
847 |
+
}
|
848 |
+
|
849 |
+
|
850 |
+
.tutor-dashboard-permalinks{
|
851 |
+
list-style: none;
|
852 |
+
margin: 0 0 20px;
|
853 |
+
border: 1px solid #E8EFF1;
|
854 |
+
border-radius: 4px;
|
855 |
+
font-size: 14px;
|
856 |
+
padding: 0;
|
857 |
+
}
|
858 |
+
.tutor-dashboard-permalinks li:not(:last-child){
|
859 |
+
border-bottom: 1px solid #E8EFF1;
|
860 |
+
}
|
861 |
+
|
862 |
+
@media (max-width: 991px) {
|
863 |
+
ul.tutor-dashboard-permalinks li{
|
864 |
+
display: inline-block;
|
865 |
+
border-bottom: none !important;
|
866 |
+
border-right: 1px solid #E8EFF1;
|
867 |
+
}
|
868 |
+
ul.tutor-dashboard-permalinks li:last-child{
|
869 |
+
border-right-color: transparent;
|
870 |
+
}
|
871 |
+
.tutor-dashboard-student .tutor-col-3,
|
872 |
+
.tutor-dashboard-student .tutor-col-9{
|
873 |
+
flex: 0 0 100%;
|
874 |
+
max-width: 100%;
|
875 |
+
}
|
876 |
+
}
|
877 |
+
|
878 |
+
|
879 |
+
|
880 |
+
.tutor-dashboard-permalinks li a{
|
881 |
+
display: block;
|
882 |
+
color: #4B5981;
|
883 |
+
padding: 10px 20px;
|
884 |
+
line-height: 28px;
|
885 |
+
}
|
886 |
+
.tutor-dashboard-content h1{
|
887 |
+
color: #8C94A8;
|
888 |
+
font-size: 18px;
|
889 |
+
font-weight: 500;
|
890 |
+
line-height: 23px;
|
891 |
+
margin-bottom: 17px;
|
892 |
+
}
|
893 |
+
|
894 |
+
/*.tutor-dashboard-content-inner:not(:empty){}*/
|
895 |
+
|
896 |
+
|
897 |
+
.tutor-dashboard-content-inner .tutor-mycourse-wrap{
|
898 |
+
padding: 20px;
|
899 |
+
border: 1px solid #DCDFE5;
|
900 |
+
border-radius: 4px;
|
901 |
+
margin-bottom: 30px;
|
902 |
+
}
|
903 |
+
|
904 |
+
.tutor-mycourse-rating{
|
905 |
+
color: #F8C51C;
|
906 |
+
font-size: 12px;
|
907 |
+
}
|
908 |
+
|
909 |
+
.tutor-mycourse-rating i{
|
910 |
+
margin-right: 4px;
|
911 |
+
}
|
912 |
+
|
913 |
+
.tutor-dashboard-content-inner{
|
914 |
+
font-size: 14px;
|
915 |
+
}
|
916 |
+
|
917 |
+
.tutor-dashboard-content-inner .tutor-mycourse-wrap p:last-child{
|
918 |
+
margin-bottom: 0;
|
919 |
+
}
|
920 |
+
|
921 |
+
.tutor-dashboard-content-inner h3 a{
|
922 |
+
color: #4B5981;
|
923 |
+
font-size: 22px;
|
924 |
+
line-height: 28px;
|
925 |
+
font-weight: 600;
|
926 |
+
display: block;
|
927 |
+
}
|
928 |
+
|
929 |
+
.tutor-dashboard-content-inner .tutor-course-metadata ul{
|
930 |
+
display: block;
|
931 |
+
list-style: none;
|
932 |
+
margin: 0 0 25px;
|
933 |
+
padding: 0;
|
934 |
+
font-size: 14px;
|
935 |
+
}
|
936 |
+
|
937 |
+
.tutor-dashboard-content-inner .tutor-progress-bar-wrap{
|
938 |
+
margin-bottom: 20px;
|
939 |
+
}
|
940 |
+
.tutor-dashboard-content-inner .tutor-course-metadata li{
|
941 |
+
display: inline-block;
|
942 |
+
color: #8C94A8;
|
943 |
+
margin-left: 20px;
|
944 |
+
}
|
945 |
+
|
946 |
+
.tutor-dashboard-content-inner .tutor-course-metadata li:first-child{
|
947 |
+
margin-left: 0;
|
948 |
+
}
|
949 |
+
|
950 |
+
.tutor-dashboard-content-inner .tutor-course-metadata li span{
|
951 |
+
color: #4B5981;
|
952 |
+
margin-left: 5px;
|
953 |
+
}
|
954 |
+
|
955 |
+
/* *********************** */
|
956 |
+
/* End Tutor Student Dashboard */
|
957 |
+
/************************ */
|
958 |
+
/**
|
959 |
+
Instructor
|
960 |
+
*/
|
961 |
+
.single-instructor-wrap{
|
962 |
+
border: 1px solid #e8eff1;
|
963 |
+
margin-bottom: 30px;
|
964 |
+
font-size: 14px;
|
965 |
+
border-radius: 4px;
|
966 |
+
}
|
967 |
+
.single-instructor-wrap .single-instructor-top{
|
968 |
+
overflow: hidden;
|
969 |
+
padding: 20px;
|
970 |
+
border-bottom: 1px solid #e8eff1;
|
971 |
+
}
|
972 |
+
.single-instructor-wrap .single-instructor-top h3,
|
973 |
+
.single-instructor-wrap .single-instructor-top h4 {
|
974 |
+
margin: 0;
|
975 |
+
padding: 0;
|
976 |
+
}
|
977 |
+
.single-instructor-wrap .tutor-instructor-left{
|
978 |
+
float: left;
|
979 |
+
overflow: hidden;
|
980 |
+
}
|
981 |
+
.single-instructor-wrap .instructor-avatar{
|
982 |
+
float: left;
|
983 |
+
}
|
984 |
+
.single-instructor-wrap .instructor-avatar img{
|
985 |
+
max-width: 50px;
|
986 |
+
height: auto;
|
987 |
+
border-radius: 50%;
|
988 |
+
}
|
989 |
+
.single-instructor-wrap .instructor-name{
|
990 |
+
float: left;
|
991 |
+
padding-left: 20px;
|
992 |
+
max-width: 130px;
|
993 |
+
}
|
994 |
+
.single-instructor-wrap .instructor-name h3{
|
995 |
+
font-size: 16px;
|
996 |
+
color: #4B5981;
|
997 |
+
font-weight: 600;
|
998 |
+
}
|
999 |
+
.single-instructor-wrap .instructor-name h3 a{
|
1000 |
+
font-weight: 500;
|
1001 |
+
color: #4B5981;
|
1002 |
+
}
|
1003 |
+
.single-instructor-wrap .instructor-name h4{
|
1004 |
+
font-weight: 400;
|
1005 |
+
font-size: 14px;
|
1006 |
+
color: #B1B8C9;
|
1007 |
+
}
|
1008 |
+
.single-instructor-wrap .instructor-bio{
|
1009 |
+
padding-left: 220px;
|
1010 |
+
font-size: 14px;
|
1011 |
+
}
|
1012 |
+
.single-instructor-wrap .single-instructor-bottom{
|
1013 |
+
padding: 15px 20px;
|
1014 |
+
text-align: right;
|
1015 |
+
overflow: hidden;
|
1016 |
+
}
|
1017 |
+
.single-instructor-wrap .single-instructor-bottom p{
|
1018 |
+
margin: 0;
|
1019 |
+
}
|
1020 |
+
.single-instructor-wrap .single-instructor-bottom .ratings{
|
1021 |
+
float: left;
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
.single-instructor-wrap .single-instructor-bottom .ratings i{
|
1025 |
+
margin-right: 4px;
|
1026 |
+
}
|
1027 |
+
.single-instructor-wrap .single-instructor-bottom .courses,
|
1028 |
+
.single-instructor-wrap .single-instructor-bottom .students{
|
1029 |
+
display: inline-block;
|
1030 |
+
margin-left: 20px;
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
|
1034 |
+
.single-instructor-wrap .single-instructor-bottom .courses i,
|
1035 |
+
.single-instructor-wrap .single-instructor-bottom .students i{
|
1036 |
+
font-size: 18px;
|
1037 |
+
display: inline-block;
|
1038 |
+
margin-right: 2px;
|
1039 |
+
vertical-align: middle;
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
.single-instructor-wrap .single-instructor-bottom .ratings .rating-total-meta{
|
1043 |
+
color: #bac0cf;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
.single-instructor-wrap .single-instructor-bottom .ratings .rating-generated{
|
1047 |
+
color: #f8c51c;
|
1048 |
+
}
|
1049 |
+
|
1050 |
+
/* *********************** */
|
1051 |
+
/* Single Lesson */
|
1052 |
+
/************************ */
|
1053 |
+
|
1054 |
+
/*lesson list*/
|
1055 |
+
.tutor-single-lesson-button-group,
|
1056 |
+
.tutor-topics-lesson-list .tutor-topics-in-single-lesson{
|
1057 |
+
border-radius: 4px;
|
1058 |
+
margin-bottom: 30px;
|
1059 |
+
border: 1px solid #E8EFF1;
|
1060 |
+
}
|
1061 |
+
.tutor-single-lesson-wrap{
|
1062 |
+
display: flex;
|
1063 |
+
}
|
1064 |
+
.tutor-lesson-sidebar{
|
1065 |
+
flex: 0 0 400px;
|
1066 |
+
}
|
1067 |
+
.tutor-lesson-content {
|
1068 |
+
flex: 1;
|
1069 |
+
}
|
1070 |
+
.tutor-single-lesson-button-group .tutor-single-lesson-button a,
|
1071 |
+
.tutor-topics-in-single-lesson .tutor-single-lesson-items a{
|
1072 |
+
padding: 14px 75px 14px 17px;
|
1073 |
+
font-size: 14px;
|
1074 |
+
display: flex;
|
1075 |
+
color: #4B5981;
|
1076 |
+
position: relative;
|
1077 |
+
border-top: 1px solid #E8EFF1;
|
1078 |
+
}
|
1079 |
+
.tutor-single-lesson-button-group .tutor-single-lesson-button:first-child a{
|
1080 |
+
border-top: none;
|
1081 |
+
}
|
1082 |
+
.tutor-lessons-under-topic .tutor-single-lesson-items.active a{
|
1083 |
+
background: rgba(233, 235, 238, 0.35);
|
1084 |
+
}
|
1085 |
+
.tutor-topics-in-single-lesson{
|
1086 |
+
margin-bottom: 25px;
|
1087 |
+
background-color: #ffffff;
|
1088 |
+
padding: 10px 0;
|
1089 |
+
}
|
1090 |
+
.tutor-topics-in-single-lesson .tutor-single-lesson-items a span{
|
1091 |
+
font-size: 14px;
|
1092 |
+
margin: 0;
|
1093 |
+
display: inline;
|
1094 |
+
color: #4B5981;
|
1095 |
+
}
|
1096 |
+
.tutor-topics-in-single-lesson .tutor-topics-title h3{
|
1097 |
+
margin: 0;
|
1098 |
+
padding: 14px 17px;
|
1099 |
+
font-size: 16px;
|
1100 |
+
color: #1B52D8;
|
1101 |
+
font-weight: 500;
|
1102 |
+
}
|
1103 |
+
.tutor-topics-in-single-lesson .tutor-topics-title.has-summery h3{
|
1104 |
+
cursor: pointer;
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
.tutor-topics-in-single-lesson .tutor-topics-title h3 i{
|
1108 |
+
font-size: 10px;
|
1109 |
+
margin-left: 6px;
|
1110 |
+
}
|
1111 |
+
.tutor-topics-in-single-lesson .tutor-topics-tutor-loop-rating-wraptitle h3 i{
|
1112 |
+
font-size: 10px;
|
1113 |
+
vertical-align: middle;
|
1114 |
+
display: inline-block;
|
1115 |
+
padding: 5px;
|
1116 |
+
color: #C7C7C7;
|
1117 |
+
transition: 300ms;
|
1118 |
+
cursor: pointer;
|
1119 |
+
}
|
1120 |
+
.tutor-topics-in-single-lesson .tutor-topics-title h3 i:hover{
|
1121 |
+
color: #1B52D8;
|
1122 |
+
}
|
1123 |
+
.tutor-single-lesson-button-group .tutor-single-lesson-button a > i:first-child,
|
1124 |
+
.tutor-topics-in-single-lesson .tutor-single-lesson-items a > i:first-child{
|
1125 |
+
color: #C7C7C7;
|
1126 |
+
line-height: 22px;
|
1127 |
+
display: inline-block;
|
1128 |
+
vertical-align: middle;
|
1129 |
+
margin-right: 10px;
|
1130 |
+
}
|
1131 |
+
.tutor-topics-in-single-lesson .tutor-single-lesson-items a > i.tutor-icon-doubt{
|
1132 |
+
color: #1B52D8;
|
1133 |
+
}
|
1134 |
+
.tutor-topics-in-single-lesson .tutor-topics-summery{
|
1135 |
+
padding: 14px;
|
1136 |
+
font-size: 14px;
|
1137 |
+
border-top: 1px solid #DCE4E6;
|
1138 |
+
display: none;
|
1139 |
+
}
|
1140 |
+
.tutor-topics-lesson-list .tutor-lesson-right-icons{
|
1141 |
+
position: absolute;
|
1142 |
+
right: 15px;
|
1143 |
+
top: 14px;
|
1144 |
+
}
|
1145 |
+
.tutor-topics-lesson-list .tutor-lesson-right-icons .tutor-lesson-complete{
|
1146 |
+
height: 16px;
|
1147 |
+
width: 16px;
|
1148 |
+
border: 1px solid #E8EFF1;
|
1149 |
+
border-radius: 50%;
|
1150 |
+
font-size: 9px;
|
1151 |
+
display: inline-block;
|
1152 |
+
line-height: 16px;
|
1153 |
+
text-align: center;
|
1154 |
+
margin: 0;
|
1155 |
+
vertical-align: middle;
|
1156 |
+
margin-left: 8px;
|
1157 |
+
}
|
1158 |
+
.tutor-topics-lesson-list .tutor-single-lesson-items.active .tutor-lesson-right-icons .tutor-lesson-complete{
|
1159 |
+
border-color: #b7d6b7;
|
1160 |
+
}
|
1161 |
+
.tutor-topics-lesson-list .tutor-single-lesson-items.active .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done,
|
1162 |
+
.tutor-topics-lesson-list .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done{
|
1163 |
+
background: #86B223;
|
1164 |
+
border-color: #86B223;
|
1165 |
+
color: #fff;
|
1166 |
+
}
|
1167 |
+
.tutor-topics-lesson-list .tutor-lesson-right-icons i{
|
1168 |
+
font-style: normal;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
.tutor-single-page-top-bar{
|
1172 |
+
background-color: #1B52D8;
|
1173 |
+
height: 70px;
|
1174 |
+
margin-bottom: 50px;
|
1175 |
+
color: #ffffff;
|
1176 |
+
display: flex;
|
1177 |
+
line-height: 70px;
|
1178 |
+
}
|
1179 |
+
.tutor-single-page-top-bar a{
|
1180 |
+
color: #ffffff;
|
1181 |
+
}
|
1182 |
+
.tutor-single-page-top-bar .tutor-topbar-item{
|
1183 |
+
width: 100%;
|
1184 |
+
}
|
1185 |
+
.tutor-single-page-top-bar .tutor-topbar-content-title-wrap{
|
1186 |
+
text-align: center;
|
1187 |
+
}
|
1188 |
+
.tutor-single-page-top-bar .tutor-topbar-back-to-curse-wrap{
|
1189 |
+
text-align: right;
|
1190 |
+
margin-right: 30px;
|
1191 |
+
}
|
1192 |
+
.tutor-lesson-content-area{
|
1193 |
+
margin: 0 100px;
|
1194 |
+
}
|
1195 |
+
.tutor-lesson-sidebar-hide-bar{
|
1196 |
+
background-color: #1645B7;
|
1197 |
+
color: #ffffff;
|
1198 |
+
padding: 0 18px;
|
1199 |
+
display: inline-block;
|
1200 |
+
line-height: 70px;
|
1201 |
+
}
|
1202 |
+
.tutor-sidebar-tabs-wrap{
|
1203 |
+
border-top: 1px solid #E0E9EC;
|
1204 |
+
}
|
1205 |
+
.tutor-tabs-btn-group {
|
1206 |
+
height: 70px;
|
1207 |
+
display: flex;
|
1208 |
+
}
|
1209 |
+
.tutor-tabs-btn-group a{
|
1210 |
+
background-color: #F1F6F8;
|
1211 |
+
color: #4B5981;
|
1212 |
+
display: block;
|
1213 |
+
line-height: 70px;
|
1214 |
+
width: 100%;
|
1215 |
+
text-align: center;
|
1216 |
+
border: 1px solid #E0E9EC;
|
1217 |
+
border-top: none;
|
1218 |
+
}
|
1219 |
+
.tutor-tabs-btn-group a.active{
|
1220 |
+
background-color: #ffffff;
|
1221 |
+
border: none;
|
1222 |
+
}
|
1223 |
+
.tutor-tabs-btn-group a:focus{
|
1224 |
+
outline: none;
|
1225 |
+
}
|
1226 |
+
/*video*/
|
1227 |
+
|
1228 |
+
.tutor-single-lesson-segment{
|
1229 |
+
margin-bottom: 35px;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
.tutor-single-lesson-wrap{
|
1233 |
+
font-size: 14px;
|
1234 |
+
font-weight: 400;
|
1235 |
+
background: #F4F8FA;
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
.tutor-lesson-video-wrap .plyr--video{
|
1239 |
+
border-radius: 4px;
|
1240 |
+
}
|
1241 |
+
|
1242 |
+
/*attachment*/
|
1243 |
+
|
1244 |
+
|
1245 |
+
.tutor-attachments-wrap{
|
1246 |
+
margin: -3px -3px 15px -3px;
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
.tutor-attachments-wrap .tutor-lesson-attachment{
|
1250 |
+
display: inline-block;
|
1251 |
+
border: 1px solid #E8EFF1;
|
1252 |
+
border-radius: 4px;
|
1253 |
+
padding: 10px 16px 10px 12px;
|
1254 |
+
overflow: hidden;
|
1255 |
+
background: #F4F7F8;
|
1256 |
+
margin: 3px;
|
1257 |
+
transition: 300ms;
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
.tutor-attachments-wrap .tutor-lesson-attachment:hover{
|
1261 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
.tutor-attachments-wrap .tutor-attachment-icon{
|
1265 |
+
font-size: 30px;
|
1266 |
+
float: left;
|
1267 |
+
color: #4B5981;
|
1268 |
+
}
|
1269 |
+
.tutor-attachments-wrap .tutor-attachment-icon i{
|
1270 |
+
display: block;
|
1271 |
+
}
|
1272 |
+
.tutor-attachment-info {
|
1273 |
+
padding-left: 10px;
|
1274 |
+
float: left;
|
1275 |
+
}
|
1276 |
+
.tutor-attachment-info span{
|
1277 |
+
display: block;
|
1278 |
+
font-size: 14px;
|
1279 |
+
line-height: 16px;
|
1280 |
+
color: #4B5981;
|
1281 |
+
}
|
1282 |
+
.tutor-attachment-info span + span{
|
1283 |
+
font-size: 11px;
|
1284 |
+
color: #B1B8C9;
|
1285 |
+
}
|
1286 |
+
/*course status*/
|
1287 |
+
.tutor-progress-bar-wrap{
|
1288 |
+
width: 100%;
|
1289 |
+
margin: 0;
|
1290 |
+
font-size: 14px;
|
1291 |
+
margin-bottom: 30px;
|
1292 |
+
display: flex;
|
1293 |
+
}
|
1294 |
+
.tutor-progress-bar{
|
1295 |
+
background-color: #ffffff;
|
1296 |
+
height: 8px;
|
1297 |
+
color: #000000;
|
1298 |
+
line-height: 25px;
|
1299 |
+
position: relative;
|
1300 |
+
border-radius: 0px;
|
1301 |
+
background: #f1f1f1;
|
1302 |
+
-ms-flex-preferred-size: 0;
|
1303 |
+
flex-basis: 0;
|
1304 |
+
-ms-flex-positive: 1;
|
1305 |
+
flex-grow: 1;
|
1306 |
+
max-width: 100%;
|
1307 |
+
border-radius: 30px;
|
1308 |
+
margin-top: 7.5px;
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
.tutor-progress-bar .tutor-progress-filled{
|
1312 |
+
background-color: #1B52D8;
|
1313 |
+
height: 8px;
|
1314 |
+
border-radius: 30px;
|
1315 |
+
width: var(--tutor-progress-left);
|
1316 |
+
}
|
1317 |
+
|
1318 |
+
.tutor-progress-bar .tutor-progress-filled::after{
|
1319 |
+
content: '';
|
1320 |
+
position: absolute;
|
1321 |
+
height: 20px;
|
1322 |
+
width: 20px;
|
1323 |
+
border: 5px solid #1B52D8;
|
1324 |
+
border-radius: 50%;
|
1325 |
+
background: #fff;
|
1326 |
+
left: var(--tutor-progress-left);
|
1327 |
+
transform: translateY(-50%) translateX(-50%);
|
1328 |
+
top: 50%;
|
1329 |
+
box-sizing: border-box;
|
1330 |
+
}
|
1331 |
+
|
1332 |
+
.tutor-progress-percent{
|
1333 |
+
-ms-flex: 0 0 auto;
|
1334 |
+
flex: 0 0 auto;
|
1335 |
+
width: auto;
|
1336 |
+
max-width: none;
|
1337 |
+
padding-left: 20px;
|
1338 |
+
}
|
1339 |
+
.tutor-course-purchase-box{
|
1340 |
+
margin-bottom: 0;
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
.tutor-price-preview-box .tutor-course-purchase-box button{
|
1344 |
+
display: block;
|
1345 |
+
width: 100%;
|
1346 |
+
background: #1B52D8;
|
1347 |
+
border-radius: 3px;
|
1348 |
+
text-transform: uppercase;
|
1349 |
+
font-size: 14px;
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
.tutor-price-preview-box .tutor-course-purchase-box button i{
|
1353 |
+
margin-right: 8px;
|
1354 |
+
}
|
1355 |
+
|
1356 |
+
.tutor-price-preview-box .tutor-course-enrolled-wrap,
|
1357 |
+
.tutor-price-preview-box .tutor-course-login-wrap,
|
1358 |
+
.tutor-price-preview-box .tutor-course-login-wrap form,
|
1359 |
+
.tutor-course-purchase-box form{
|
1360 |
+
margin-bottom: 0;
|
1361 |
+
}
|
1362 |
+
.tutor-price-preview-box .tutor-course-material-includes-wrap{
|
1363 |
+
margin-bottom: 25px;
|
1364 |
+
}
|
1365 |
+
|
1366 |
+
.tutor-alert-warning{
|
1367 |
+
padding: 10px;
|
1368 |
+
color: #8a6d3b;
|
1369 |
+
background-color: #fcf8e3;
|
1370 |
+
border-color: #faebcc;
|
1371 |
+
}
|
1372 |
+
.tutor-lead-info-btn-group{
|
1373 |
+
display: block;
|
1374 |
+
overflow: hidden;
|
1375 |
+
margin: -10px -10px 35px;
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap{
|
1379 |
+
display: inline-block;
|
1380 |
+
}
|
1381 |
+
|
1382 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap form{
|
1383 |
+
margin: 0;
|
1384 |
+
}
|
1385 |
+
|
1386 |
+
.tutor-lead-info-btn-group a.tutor-button,
|
1387 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap button{
|
1388 |
+
display: block;
|
1389 |
+
padding: 14px 20px;
|
1390 |
+
border: none;
|
1391 |
+
font-weight: normal;
|
1392 |
+
font-size: 14px;
|
1393 |
+
text-align: center;
|
1394 |
+
border-radius: 4px;
|
1395 |
+
text-transform: uppercase;
|
1396 |
+
line-height: 1;
|
1397 |
+
background: #1B52D8;
|
1398 |
+
color: #fff;
|
1399 |
+
transition: 300ms;
|
1400 |
+
}
|
1401 |
+
.tutor-lead-info-btn-group a.tutor-button,
|
1402 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap{
|
1403 |
+
width: calc(50% - 22px);
|
1404 |
+
text-align: center;
|
1405 |
+
margin: 10px;
|
1406 |
+
display: inline-block;
|
1407 |
+
}
|
1408 |
+
|
1409 |
+
@media (max-width: 991px) {
|
1410 |
+
.tutor-lead-info-btn-group a.tutor-button,
|
1411 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap{
|
1412 |
+
width: auto;
|
1413 |
+
}
|
1414 |
+
}
|
1415 |
+
|
1416 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap button{
|
1417 |
+
display: block;
|
1418 |
+
width: 100%;
|
1419 |
+
background: #E8EFF1;
|
1420 |
+
color: #B1B8C9;
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
.tutor-lead-info-btn-group a.tutor-button:hover{
|
1424 |
+
background: #1b4cab;
|
1425 |
+
color: #ffffff;
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
.tutor-lead-info-btn-group .tutor-course-compelte-form-wrap button:hover{
|
1429 |
+
background: #1B52D8;
|
1430 |
+
color: #ffffff;
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
.tutor-single-add-to-cart-box .tutor-enroll-form{
|
1434 |
+
margin: 0;
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
.tutor-single-add-to-cart-box .tutor-enroll-form .tutor-course-enroll-wrap{
|
1438 |
+
padding: 0;
|
1439 |
+
}
|
1440 |
+
.tutor-single-add-to-cart-box .tutor-enroll-form .tutor-course-enroll-wrap button{
|
1441 |
+
display: block;
|
1442 |
+
width: 100%;
|
1443 |
+
text-align: center;
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
/*******************/
|
1447 |
+
/*tutor review form*/
|
1448 |
+
/*******************/
|
1449 |
+
.tutor-course-enrolled-review-wrap .write-course-review-link-btn{
|
1450 |
+
color: #fff;
|
1451 |
+
background-color: #1B52D8;
|
1452 |
+
border-color: #1B52D8;
|
1453 |
+
display: inline-block;
|
1454 |
+
padding: 15px 30px;
|
1455 |
+
border-radius: 4px;
|
1456 |
+
text-transform: uppercase;
|
1457 |
+
line-height: 1;
|
1458 |
+
font-size: 14px;
|
1459 |
+
}
|
1460 |
+
|
1461 |
+
.tutor-course-enrolled-review-wrap .tutor-form-group{
|
1462 |
+
margin-bottom: 10px;
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
.tutor-course-enrolled-review-wrap .tutor-form-group textarea{
|
1466 |
+
height: 120px;
|
1467 |
+
background: #f7f7f7;
|
1468 |
+
border: 1px solid #ddd;
|
1469 |
+
box-shadow: none;
|
1470 |
+
border-radius: 4px;
|
1471 |
+
line-height: 1.5;
|
1472 |
+
text-indent: 0;
|
1473 |
+
padding: 15px;
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
|
1477 |
+
|
1478 |
+
/*******************/
|
1479 |
+
/*end tutor review form*/
|
1480 |
+
/*******************/
|
1481 |
+
|
1482 |
+
/**
|
1483 |
+
Tutor Dashboard Content
|
1484 |
+
*/
|
1485 |
+
|
1486 |
+
/*
|
1487 |
+
Form CSS
|
1488 |
+
*/
|
1489 |
+
.tutor-form-row{
|
1490 |
+
display: flex;
|
1491 |
+
margin-left: -15px;
|
1492 |
+
margin-right: -15px;
|
1493 |
+
}
|
1494 |
+
|
1495 |
+
.tutor-form-col-4,
|
1496 |
+
.tutor-form-col-6,
|
1497 |
+
.tutor-form-col-12{
|
1498 |
+
padding-left: 15px;
|
1499 |
+
padding-right: 15px;
|
1500 |
+
}
|
1501 |
+
.tutor-form-col-6{
|
1502 |
+
-ms-flex: 0 0 50%;
|
1503 |
+
flex: 0 0 50%;
|
1504 |
+
max-width: 50%;
|
1505 |
+
}
|
1506 |
+
.tutor-form-col-12{
|
1507 |
+
-ms-flex: 0 0 100%;
|
1508 |
+
flex: 0 0 100%;
|
1509 |
+
max-width: 100%;
|
1510 |
+
}
|
1511 |
+
.tutor-form-col-4{
|
1512 |
+
-ms-flex: 0 0 33.3333%;
|
1513 |
+
flex: 0 0 33.3333%;
|
1514 |
+
max-width: 33.3333%;
|
1515 |
+
}
|
1516 |
+
|
1517 |
+
@media (max-width: 768px) {
|
1518 |
+
.tutor-form-row{
|
1519 |
+
flex-wrap: wrap;
|
1520 |
+
}
|
1521 |
+
.tutor-form-col-4,
|
1522 |
+
.tutor-form-col-6,
|
1523 |
+
.tutor-form-col-12{
|
1524 |
+
flex: 0 0 100%;
|
1525 |
+
max-width: 100%;
|
1526 |
+
}
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
ul.tutor-required-fields{
|
1530 |
+
list-style: none;
|
1531 |
+
padding: 10px;
|
1532 |
+
margin: 0;
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
.tutor-ratings-wrap {
|
1536 |
+
color: #f4c150;
|
1537 |
+
margin-top: 20px;
|
1538 |
+
display: block;
|
1539 |
+
}
|
1540 |
+
.tutor-ratings-wrap i{
|
1541 |
+
cursor: pointer;
|
1542 |
+
margin-right: 4px;
|
1543 |
+
}
|
1544 |
+
.tutor-queston-and-answer-wrap{
|
1545 |
+
margin: 20px 0;
|
1546 |
+
}
|
1547 |
+
.tutor-question-top{
|
1548 |
+
display: flex;
|
1549 |
+
justify-content: space-between;
|
1550 |
+
margin-bottom: 20px;
|
1551 |
+
flex-direction: row-reverse;
|
1552 |
+
}
|
1553 |
+
.tutor-ask-question-btn{
|
1554 |
+
text-align: right;
|
1555 |
+
}
|
1556 |
+
.tutor-question-search-form{
|
1557 |
+
flex: 0 0 75%;
|
1558 |
+
}
|
1559 |
+
.tutor-question-search-form form {
|
1560 |
+
display: flex;
|
1561 |
+
}
|
1562 |
+
.tutor-question-search-form input[type="text"] {
|
1563 |
+
max-width: 60%;
|
1564 |
+
}
|
1565 |
+
.tutor-add-question-wrap{
|
1566 |
+
margin: 20px 0;
|
1567 |
+
}
|
1568 |
+
.tutor-add-question-wrap .tutor-form-group{
|
1569 |
+
margin-bottom: 10px;
|
1570 |
+
}
|
1571 |
+
.tutor_question_cancel{
|
1572 |
+
margin-right: 5px;
|
1573 |
+
}
|
1574 |
+
.updating-icon:before{
|
1575 |
+
font-family: 'tutor';
|
1576 |
+
margin-right: 5px;
|
1577 |
+
content: "\e91d";
|
1578 |
+
-moz-animation: spin 2s infinite linear;
|
1579 |
+
-o-animation: spin 2s infinite linear;
|
1580 |
+
-webkit-animation: spin 2s infinite linear;
|
1581 |
+
animation: spin 2s infinite linear;
|
1582 |
+
display: inline-block;
|
1583 |
+
}
|
1584 |
+
.loading-lesson:before{
|
1585 |
+
font-family: 'tutor';
|
1586 |
+
margin-right: 5px;
|
1587 |
+
content: "\e91d";
|
1588 |
+
-moz-animation: spin 2s infinite linear;
|
1589 |
+
-o-animation: spin 2s infinite linear;
|
1590 |
+
-webkit-animation: spin 2s infinite linear;
|
1591 |
+
animation: spin 2s infinite linear;
|
1592 |
+
display: inline-block;
|
1593 |
+
z-index: 9;
|
1594 |
+
position: absolute;
|
1595 |
+
left: 50%;
|
1596 |
+
top: 150px;
|
1597 |
+
font-size: 50px;
|
1598 |
+
}
|
1599 |
+
.loading-lesson:after {
|
1600 |
+
position: absolute;
|
1601 |
+
content: "";
|
1602 |
+
top: 0;
|
1603 |
+
background: rgba(255,255,255, 0.8);
|
1604 |
+
width: 100%;
|
1605 |
+
height: 99%;
|
1606 |
+
}
|
1607 |
+
/**
|
1608 |
+
Course question and answer
|
1609 |
+
*/
|
1610 |
+
|
1611 |
+
|
1612 |
+
/* ********************* */
|
1613 |
+
/* Question and Answer */
|
1614 |
+
/* ********************* */
|
1615 |
+
|
1616 |
+
/*.tutor-question-wrap{*/
|
1617 |
+
|
1618 |
+
/*}*/
|
1619 |
+
|
1620 |
+
.tutor_question_area {
|
1621 |
+
padding: 25px 20px;
|
1622 |
+
background: #F4F7F8;
|
1623 |
+
border-radius: 4px;
|
1624 |
+
}
|
1625 |
+
|
1626 |
+
.tutor_question_area p:last-child{
|
1627 |
+
margin-bottom: 0;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
.tutor_add_answer_row{
|
1631 |
+
text-align: right;
|
1632 |
+
margin-top: 20px;
|
1633 |
+
}
|
1634 |
+
|
1635 |
+
.tutor_add_answer_row .tutor-form-group:last-child{
|
1636 |
+
margin-top: 20px;
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
.tutor_admin_answers_list_wrap + .tutor_add_answer_row,
|
1640 |
+
.tutor_admin_answers_list_wrap{
|
1641 |
+
margin-left: 100px;
|
1642 |
+
}
|
1643 |
+
|
1644 |
+
@media (max-width: 991px) {
|
1645 |
+
.tutor_admin_answers_list_wrap + .tutor_add_answer_row,
|
1646 |
+
.tutor_admin_answers_list_wrap{
|
1647 |
+
margin-left: 30px;
|
1648 |
+
}
|
1649 |
+
}
|
1650 |
+
|
1651 |
+
.tutor_original_question{
|
1652 |
+
margin-bottom: 30px;
|
1653 |
+
}
|
1654 |
+
.tutor_admin_answers_list_wrap .tutor_individual_answer{
|
1655 |
+
margin-bottom: 40px;
|
1656 |
+
}
|
1657 |
+
|
1658 |
+
.tutor_admin_answers_list_wrap .tutor_question_area{
|
1659 |
+
background: #EDF9F1;
|
1660 |
+
}
|
1661 |
+
|
1662 |
+
.question-top-meta .tutor-question-avater a{
|
1663 |
+
display: inline-block;
|
1664 |
+
}
|
1665 |
+
.question-top-meta .tutor-question-avater a span{
|
1666 |
+
height: 50px;
|
1667 |
+
width: 50px;
|
1668 |
+
border-radius: 50%;
|
1669 |
+
display: block;
|
1670 |
+
line-height: 50px;
|
1671 |
+
text-align: center;
|
1672 |
+
font-size: 17px;
|
1673 |
+
}
|
1674 |
+
|
1675 |
+
.question-top-meta .tutor-question-avater a img{
|
1676 |
+
width: 50px;
|
1677 |
+
height: 50px;
|
1678 |
+
border-radius: 50%;
|
1679 |
+
}
|
1680 |
+
|
1681 |
+
.question-top-meta{
|
1682 |
+
overflow: hidden;
|
1683 |
+
margin-bottom: 20px;
|
1684 |
+
}
|
1685 |
+
.question-top-meta .tutor-question-avater{
|
1686 |
+
float: left;
|
1687 |
+
}
|
1688 |
+
.question-top-meta .review-meta{
|
1689 |
+
float: left;
|
1690 |
+
margin-bottom: 0;
|
1691 |
+
margin-left: 10px;
|
1692 |
+
}
|
1693 |
+
.question-top-meta .review-meta a{
|
1694 |
+
display: block;
|
1695 |
+
font-size: 18px;
|
1696 |
+
color: #4B5981;
|
1697 |
+
line-height: 20px;
|
1698 |
+
}
|
1699 |
+
.question-top-meta .review-meta span{
|
1700 |
+
color: #B1B8C9;
|
1701 |
+
font-size: 14px;
|
1702 |
+
vertical-align: text-top;
|
1703 |
+
display: block;
|
1704 |
+
}
|
1705 |
+
.tutor_wp_editor_wrap .tutor-form-group a.tutor-button{
|
1706 |
+
margin-right: 6px;
|
1707 |
+
}
|
1708 |
+
|
1709 |
+
/*anouncement*/
|
1710 |
+
|
1711 |
+
|
1712 |
+
.tutor-no-announcements {
|
1713 |
+
text-align: center;
|
1714 |
+
}
|
1715 |
+
.tutor-announcement-meta{
|
1716 |
+
margin-bottom: 10px;
|
1717 |
+
font-size: 13px;
|
1718 |
+
}
|
1719 |
+
.tutor-announcement {
|
1720 |
+
border: 1px solid #eee;
|
1721 |
+
padding: 20px;
|
1722 |
+
margin-bottom: 30px;
|
1723 |
+
border-radius: 4px;
|
1724 |
+
|
1725 |
+
}
|
1726 |
+
.announcement-delete-btn{
|
1727 |
+
float: right;
|
1728 |
+
}
|
1729 |
+
|
1730 |
+
.tutor-announcement-title-wrap h3{
|
1731 |
+
color: #4B5981;
|
1732 |
+
font-weight: 500;
|
1733 |
+
margin-bottom: 10px;
|
1734 |
+
}
|
1735 |
+
|
1736 |
+
|
1737 |
+
/* ********************* */
|
1738 |
+
/* Single Quiz */
|
1739 |
+
/* ********************* */
|
1740 |
+
|
1741 |
+
.tutor-quiz-header span{
|
1742 |
+
background: #F88F1C;
|
1743 |
+
color: #ffffff;
|
1744 |
+
display: inline-block;
|
1745 |
+
padding: 4px 10px;
|
1746 |
+
border-radius: 4px;
|
1747 |
+
line-height: 1;
|
1748 |
+
text-transform: uppercase;
|
1749 |
+
font-size: 10px;
|
1750 |
+
}
|
1751 |
+
|
1752 |
+
.tutor-quiz-header h2{
|
1753 |
+
color: #4B5981;
|
1754 |
+
font-size: 36px;
|
1755 |
+
line-height: 46px;
|
1756 |
+
font-weight: 500;
|
1757 |
+
margin-bottom: 15px;
|
1758 |
+
}
|
1759 |
+
|
1760 |
+
.tutor-quiz-header h5{
|
1761 |
+
font-size: 14px;
|
1762 |
+
color: #8C94A8;
|
1763 |
+
}
|
1764 |
+
.tutor-quiz-header h5 a{
|
1765 |
+
color: #4B5981;
|
1766 |
+
font-size: 14px;
|
1767 |
+
font-weight: 500;
|
1768 |
+
}
|
1769 |
+
.tutor-quiz-header .tutor-quiz-meta{
|
1770 |
+
list-style: none;
|
1771 |
+
margin: 20px 0 40px;
|
1772 |
+
padding: 15px 0;
|
1773 |
+
border-top: 1px solid #DCDFE5;
|
1774 |
+
border-bottom: 1px solid #DCDFE5;
|
1775 |
+
display: flex;
|
1776 |
+
justify-content: space-between;
|
1777 |
+
font-size: 14px;
|
1778 |
+
}
|
1779 |
+
|
1780 |
+
|
1781 |
+
.tutor-quiz-header .tutor-quiz-meta li{
|
1782 |
+
display: inline-block;
|
1783 |
+
color: #4B5981;
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
|
1787 |
+
@media (max-width: 767px) {
|
1788 |
+
.tutor-quiz-header .tutor-quiz-meta{
|
1789 |
+
display: block;
|
1790 |
+
border: none;
|
1791 |
+
padding: 0;
|
1792 |
+
}
|
1793 |
+
.tutor-quiz-header .tutor-quiz-meta li{
|
1794 |
+
display: inline-block;
|
1795 |
+
color: #4B5981;
|
1796 |
+
margin: 5px;
|
1797 |
+
border: 1px solid #dddddd;
|
1798 |
+
padding: 5px 10px;
|
1799 |
+
border-radius: 4px;
|
1800 |
+
}
|
1801 |
+
}
|
1802 |
+
|
1803 |
+
.tutor-quiz-header .tutor-quiz-meta li strong{
|
1804 |
+
display: block;
|
1805 |
+
color: #B1B8C9;
|
1806 |
+
font-weight: 400;
|
1807 |
+
}
|
1808 |
+
|
1809 |
+
.tutor-quiz-attempt-history{
|
1810 |
+
overflow-x: auto;
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
.tutor-quiz-attempt-history-title{
|
1814 |
+
font-size: 18px;
|
1815 |
+
color: #8C94A8;
|
1816 |
+
line-height: 23px;
|
1817 |
+
font-weight: 500;
|
1818 |
+
margin-bottom: 15px;
|
1819 |
+
margin-top: 70px;
|
1820 |
+
}
|
1821 |
+
|
1822 |
+
.tutor-quiz-attempt-history table{
|
1823 |
+
border-collapse: collapse;
|
1824 |
+
border-radius: 4px;
|
1825 |
+
font-size: 14px;
|
1826 |
+
}
|
1827 |
+
.tutor-quiz-attempt-history th{
|
1828 |
+
font-weight: 400;
|
1829 |
+
}
|
1830 |
+
.tutor-quiz-attempt-history table,
|
1831 |
+
.tutor-quiz-attempt-history th,
|
1832 |
+
.tutor-quiz-attempt-history td{
|
1833 |
+
border: 1px solid #E8EFF1;
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
|
1837 |
+
.tutor-quiz-attempt-history table span.result-fail,
|
1838 |
+
.tutor-quiz-attempt-history table span.result-pass{
|
1839 |
+
display: inline-block;
|
1840 |
+
color: #fff;
|
1841 |
+
border-radius: 2px;
|
1842 |
+
width: 47px;
|
1843 |
+
height: 26px;
|
1844 |
+
line-height: 26px;
|
1845 |
+
text-align: center;
|
1846 |
+
}
|
1847 |
+
|
1848 |
+
.tutor-quiz-attempt-history table span.result-fail{
|
1849 |
+
background: #DF3247;
|
1850 |
+
}
|
1851 |
+
|
1852 |
+
.tutor-quiz-attempt-history table span.result-pass{
|
1853 |
+
background: #99C335;
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
.quiz-head-meta-info{
|
1857 |
+
font-size: 14px;
|
1858 |
+
color: #8C94A8;
|
1859 |
+
margin-bottom: 40px;
|
1860 |
+
}
|
1861 |
+
|
1862 |
+
.quiz-head-meta-info span{
|
1863 |
+
color: #4B5981;
|
1864 |
+
}
|
1865 |
+
|
1866 |
+
.tutor-quiz-single-wrap .question-text{
|
1867 |
+
color: #4B5981;
|
1868 |
+
font-size: 20px;
|
1869 |
+
font-weight: 600;
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
.tutor-quiz-answare-wrap{
|
1873 |
+
margin-bottom: 40px;
|
1874 |
+
}
|
1875 |
+
|
1876 |
+
.tutor-quiz-answare-wrap label{
|
1877 |
+
display: block;
|
1878 |
+
position: relative;
|
1879 |
+
padding-left: 30px;
|
1880 |
+
margin-bottom: 15px;
|
1881 |
+
font-size: 14px;
|
1882 |
+
cursor: pointer;
|
1883 |
+
}
|
1884 |
+
.tutor-quiz-answare-wrap label input{
|
1885 |
+
display: none;
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
.tutor-quiz-answare-wrap label input + span{
|
1889 |
+
line-height: 20px;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
.tutor-quiz-answare-wrap label input + span::before{
|
1893 |
+
content: '';
|
1894 |
+
width: 20px;
|
1895 |
+
height: 20px;
|
1896 |
+
border: 1px solid #DEDEDE;
|
1897 |
+
display: inline-block;
|
1898 |
+
border-radius: 2px;
|
1899 |
+
position: absolute;
|
1900 |
+
left: 0;
|
1901 |
+
top: 50%;
|
1902 |
+
transform: translateY(-50%);
|
1903 |
+
}
|
1904 |
+
|
1905 |
+
.tutor-quiz-answare-wrap label input:checked + span::before{
|
1906 |
+
background: #1B52D8;
|
1907 |
+
border-color: #1B52D8;
|
1908 |
+
}
|
1909 |
+
|
1910 |
+
|
1911 |
+
.tutor-quiz-answare-wrap label input:checked + span::after{
|
1912 |
+
content: '\e90f';
|
1913 |
+
position: absolute;
|
1914 |
+
left: 0;
|
1915 |
+
top: 0;
|
1916 |
+
font-family: 'tutor';
|
1917 |
+
color: #fff;
|
1918 |
+
top: 50%;
|
1919 |
+
transform: translateY(-50%);
|
1920 |
+
left: 4px;
|
1921 |
+
font-size: 14px;
|
1922 |
+
}
|
1923 |
+
|
1924 |
+
|
1925 |
+
.tutor-quiz-answare-wrap label input[type="radio"] + span::before{
|
1926 |
+
content: '';
|
1927 |
+
border-radius: 50%;
|
1928 |
+
}
|
1929 |
+
|
1930 |
+
.tutor-quiz-answare-wrap label input[type="radio"] + span::after{
|
1931 |
+
content: '';
|
1932 |
+
height: 10px;
|
1933 |
+
width: 10px;
|
1934 |
+
background: #fff;
|
1935 |
+
border-radius: 50%;
|
1936 |
+
left: 6px;
|
1937 |
+
}
|
1938 |
+
|
1939 |
+
/* ********************* */
|
1940 |
+
/*start global login form*/
|
1941 |
+
/* ********************* */
|
1942 |
+
|
1943 |
+
.tutor-login-wrap{
|
1944 |
+
max-width: 560px;
|
1945 |
+
margin: 0 auto;
|
1946 |
+
}
|
1947 |
+
|
1948 |
+
.tutor-login-form-wrap p{
|
1949 |
+
margin-bottom: 0;
|
1950 |
+
}
|
1951 |
+
|
1952 |
+
.tutor-login-form-wrap label{
|
1953 |
+
display: block;
|
1954 |
+
font-size: 13px;
|
1955 |
+
margin-bottom: 4px;
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
.tutor-login-form-wrap input[type="password"],
|
1959 |
+
.tutor-login-form-wrap input[type="text"]{
|
1960 |
+
width: 100%;
|
1961 |
+
display: block;
|
1962 |
+
border: 1px solid #E8EFF1;
|
1963 |
+
box-shadow: none;
|
1964 |
+
margin-bottom: 20px;
|
1965 |
+
border-radius: 4px;
|
1966 |
+
background: #ffffff;
|
1967 |
+
line-height: 48px;
|
1968 |
+
padding: 0;
|
1969 |
+
text-indent: 15px;
|
1970 |
+
}
|
1971 |
+
.tutor-login-form-wrap input[type="password"]:focus,
|
1972 |
+
.tutor-login-form-wrap input[type="text"]:focus{
|
1973 |
+
background: #ffffff;
|
1974 |
+
border-color: #1B52D8;
|
1975 |
+
}
|
1976 |
+
|
1977 |
+
.tutor-login-form-wrap input::-webkit-input-placeholder {
|
1978 |
+
color: #b0b6c8;
|
1979 |
+
opacity: 1;
|
1980 |
+
}
|
1981 |
+
.tutor-login-form-wrap input::-moz-placeholder {
|
1982 |
+
color: #b0b6c8;
|
1983 |
+
opacity: 1;
|
1984 |
+
}
|
1985 |
+
.tutor-login-form-wrap input:-ms-input-placeholder {
|
1986 |
+
color: #b0b6c8;
|
1987 |
+
opacity: 1;
|
1988 |
+
}
|
1989 |
+
.tutor-login-form-wrap input:-moz-placeholder {
|
1990 |
+
color: #b0b6c8;
|
1991 |
+
opacity: 1;
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
.tutor-login-rememeber-wrap{
|
1995 |
+
overflow: hidden;
|
1996 |
+
text-align: right;
|
1997 |
+
margin-bottom: 30px;
|
1998 |
+
}
|
1999 |
+
|
2000 |
+
.tutor-login-rememeber-wrap p{
|
2001 |
+
display: inline-block;
|
2002 |
+
float: left;
|
2003 |
+
}
|
2004 |
+
|
2005 |
+
.tutor-login-rememeber-wrap p,
|
2006 |
+
.tutor-login-rememeber-wrap label{
|
2007 |
+
margin: 0;
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
|
2011 |
+
.tutor-form-register-wrap a,
|
2012 |
+
.tutor-login-rememeber-wrap a,
|
2013 |
+
.tutor-login-rememeber-wrap label{
|
2014 |
+
color: #606C8F;
|
2015 |
+
font-size: 14px;
|
2016 |
+
vertical-align: middle;
|
2017 |
+
opacity: .5;
|
2018 |
+
transition: 300ms;
|
2019 |
+
}
|
2020 |
+
|
2021 |
+
|
2022 |
+
|
2023 |
+
.tutor-form-register-wrap a:hover,
|
2024 |
+
.tutor-login-rememeber-wrap a:hover,
|
2025 |
+
.tutor-login-rememeber-wrap label:hover{
|
2026 |
+
opacity: 1;
|
2027 |
+
}
|
2028 |
+
|
2029 |
+
|
2030 |
+
.tutor-login-form-wrap input[type="submit"]{
|
2031 |
+
color: #fff;
|
2032 |
+
background-color: #86B223;
|
2033 |
+
border-color: #86B223;
|
2034 |
+
display: inline-block;
|
2035 |
+
padding: 15px 30px;
|
2036 |
+
border-radius: 4px;
|
2037 |
+
text-transform: uppercase;
|
2038 |
+
line-height: 1;
|
2039 |
+
font-size: 14px;
|
2040 |
+
display: block;
|
2041 |
+
width: 100%;
|
2042 |
+
transition: 300ms;
|
2043 |
+
}
|
2044 |
+
.tutor-login-form-wrap input[type="submit"]:hover{
|
2045 |
+
color: #fff;
|
2046 |
+
background-color: #759c1f;
|
2047 |
+
border-color: #759c1f;
|
2048 |
+
}
|
2049 |
+
|
2050 |
+
|
2051 |
+
.tutor-login-form-wrap input[type="checkbox"]{
|
2052 |
+
margin-right: 4px;
|
2053 |
+
}
|
2054 |
+
|
2055 |
+
.tutor-form-register-wrap{
|
2056 |
+
text-align: center;
|
2057 |
+
margin-top: 15px;
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
/*course login*/
|
2061 |
+
|
2062 |
+
.tutor-course-login-wrap h4{
|
2063 |
+
font-size: 18px;
|
2064 |
+
margin-bottom: 28px;
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
/* ********************* */
|
2068 |
+
/*start registration form*/
|
2069 |
+
/* ********************* */
|
2070 |
+
|
2071 |
+
.tutor-form-group label{
|
2072 |
+
display: block;
|
2073 |
+
margin-bottom: 10px;
|
2074 |
+
font-size: 14px;
|
2075 |
+
}
|
2076 |
+
.tutor-form-group textarea,
|
2077 |
+
.tutor-form-group input:not([type="submit"]){
|
2078 |
+
width: 100%;
|
2079 |
+
display: block;
|
2080 |
+
border: 1px solid #E8EFF1;
|
2081 |
+
box-shadow: none;
|
2082 |
+
margin-bottom: 20px;
|
2083 |
+
border-radius: 4px;
|
2084 |
+
background: #ffffff;
|
2085 |
+
line-height: 48px;
|
2086 |
+
padding: 0;
|
2087 |
+
text-indent: 15px;
|
2088 |
+
transition: 300ms;
|
2089 |
+
}
|
2090 |
+
|
2091 |
+
.tutor-form-group textarea:focus,
|
2092 |
+
.tutor-form-group input:not([type="submit"]):focus{
|
2093 |
+
background: #ffffff;
|
2094 |
+
border-color: #1B52D8;
|
2095 |
+
}
|
2096 |
+
|
2097 |
+
.tutor-form-group textarea::-webkit-input-placeholder ,
|
2098 |
+
.tutor-form-group input::-webkit-input-placeholder {
|
2099 |
+
color: #b0b6c8;
|
2100 |
+
opacity: 1;
|
2101 |
+
}
|
2102 |
+
.tutor-form-group textarea::-moz-placeholder ,
|
2103 |
+
.tutor-form-group input::-moz-placeholder {
|
2104 |
+
color: #b0b6c8;
|
2105 |
+
opacity: 1;
|
2106 |
+
}
|
2107 |
+
.tutor-form-group textarea:-ms-input-placeholder ,
|
2108 |
+
.tutor-form-group input:-ms-input-placeholder {
|
2109 |
+
color: #b0b6c8;
|
2110 |
+
opacity: 1;
|
2111 |
+
}
|
2112 |
+
.tutor-form-group textarea:-moz-placeholder ,
|
2113 |
+
.tutor-form-group input:-moz-placeholder {
|
2114 |
+
color: #b0b6c8;
|
2115 |
+
opacity: 1;
|
2116 |
+
}
|
2117 |
+
|
2118 |
+
.tutor-form-group.tutor-reg-form-btn-wrap{
|
2119 |
+
text-align: right;
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
.tutor-form-group.tutor-reg-form-btn-wrap .tutor-button{
|
2123 |
+
background: #86B223;
|
2124 |
+
border-color: #86B223;
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
/* ********************* */
|
2128 |
+
/* Tutor Price Preview Box */
|
2129 |
+
/* ********************* */
|
2130 |
+
|
2131 |
+
.tutor-price-preview-box{
|
2132 |
+
border: 1px solid #DCDFE5;
|
2133 |
+
padding: 20px;
|
2134 |
+
margin-bottom: 30px;
|
2135 |
+
border-radius: 4px;
|
2136 |
+
overflow: hidden;
|
2137 |
+
}
|
2138 |
+
|
2139 |
+
.tutor-price-box-thumbnail{
|
2140 |
+
margin: -20px -20px 25px;
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
.tutor-price-box-description h6{
|
2144 |
+
font-size: 23px;
|
2145 |
+
margin: 15px 0 5px;
|
2146 |
+
}
|
2147 |
+
|
2148 |
+
.tutor-price-box-description ul{
|
2149 |
+
list-style: none;
|
2150 |
+
}
|
2151 |
+
|
2152 |
+
.tutor-course-purchase-box a{
|
2153 |
+
display: block;
|
2154 |
+
text-align: center;
|
2155 |
+
margin-top: 6px;
|
2156 |
+
}
|
2157 |
+
|
2158 |
+
.tutor-price-preview-box .price{
|
2159 |
+
font-size: 35px;
|
2160 |
+
font-weight: 500;
|
2161 |
+
margin-bottom: 0;
|
2162 |
+
overflow: hidden;
|
2163 |
+
line-height: 1;
|
2164 |
+
margin-bottom: 20px;
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
.tutor-price-preview-box .price del{
|
2168 |
+
font-size: 14px;
|
2169 |
+
}
|
2170 |
+
|
2171 |
+
|
2172 |
+
.tutor-price-preview-box .price del + ins{
|
2173 |
+
margin-left: 0;
|
2174 |
+
float: left;
|
2175 |
+
}
|
2176 |
+
|
2177 |
+
/* ************************ */
|
2178 |
+
/* Tutor Course Review Wrap */
|
2179 |
+
/* ************************ */
|
2180 |
+
|
2181 |
+
.tutor-course-reviews-wrap{
|
2182 |
+
border: 1px solid #E8EFF1;
|
2183 |
+
border-radius: 4px;
|
2184 |
+
}
|
2185 |
+
|
2186 |
+
.tutor-course-avg-rating-total{
|
2187 |
+
color: #B1B8C9;
|
2188 |
+
font-size: 14px;
|
2189 |
+
}
|
2190 |
+
.tutor-course-avg-rating-total span{
|
2191 |
+
color: #4B5981;
|
2192 |
+
}
|
2193 |
+
|
2194 |
+
.tutor-review-individual-item {
|
2195 |
+
font-size: 14px;
|
2196 |
+
border-top: 1px solid #E8EFF1;
|
2197 |
+
padding: 20px;
|
2198 |
+
overflow: hidden;
|
2199 |
+
}
|
2200 |
+
.tutor-review-individual-item p{
|
2201 |
+
margin: 0;
|
2202 |
+
padding: 0;
|
2203 |
+
}
|
2204 |
+
.course-avg-rating-wrap{
|
2205 |
+
padding: 20px 20px 20px 40px;
|
2206 |
+
}
|
2207 |
+
.tutor-review-individual-item .review-left{
|
2208 |
+
width: 230px;
|
2209 |
+
float: left;
|
2210 |
+
overflow: hidden;
|
2211 |
+
}
|
2212 |
+
|
2213 |
+
.tutor-review-individual-item .review-content{
|
2214 |
+
padding-left: 230px;
|
2215 |
+
}
|
2216 |
+
|
2217 |
+
@media (max-width: 991px) {
|
2218 |
+
.tutor-review-individual-item .review-left{
|
2219 |
+
width: 100%;
|
2220 |
+
float: none;
|
2221 |
+
margin-bottom: 25px;
|
2222 |
+
}
|
2223 |
+
.tutor-review-individual-item .review-content{
|
2224 |
+
padding-left: 0;
|
2225 |
+
}
|
2226 |
+
}
|
2227 |
+
|
2228 |
+
@media (max-width: 767px) {
|
2229 |
+
.tutor-single-course-sidebar{
|
2230 |
+
margin-top: 30px;
|
2231 |
+
}
|
2232 |
+
}
|
2233 |
+
|
2234 |
+
.tutor-review-individual-item .review-avatar{
|
2235 |
+
width: 50px;
|
2236 |
+
float: left;;
|
2237 |
+
}
|
2238 |
+
.tutor-review-individual-item .review-avatar img{
|
2239 |
+
border-radius: 50%;
|
2240 |
+
margin: 0;
|
2241 |
+
border: none;
|
2242 |
+
max-width: 100%;
|
2243 |
+
height: auto;
|
2244 |
+
}
|
2245 |
+
.tutor-review-individual-item .tutor-review-user-info{
|
2246 |
+
float: left;
|
2247 |
+
padding-left: 20px;
|
2248 |
+
}
|
2249 |
+
.tutor-review-individual-item .tutor-review-user-info p{
|
2250 |
+
margin-bottom: 0;
|
2251 |
+
}
|
2252 |
+
.review-avatar .tutor-text-avatar,
|
2253 |
+
.tutor-dashboard-avater .tutor-text-avatar,
|
2254 |
+
.instructor-avatar .tutor-text-avatar{
|
2255 |
+
border-radius: 50%;
|
2256 |
+
width: 50px;
|
2257 |
+
height: 50px;
|
2258 |
+
text-align: center;
|
2259 |
+
display: block;
|
2260 |
+
line-height: 50px;
|
2261 |
+
color: #ffffff;
|
2262 |
+
font-size: 14px;
|
2263 |
+
text-shadow: 0 0 5px #000;
|
2264 |
+
}
|
2265 |
+
.course-avg-rating-wrap .course-avg-rating {
|
2266 |
+
font-size: 76px;
|
2267 |
+
line-height: 1;
|
2268 |
+
font-weight: 600;
|
2269 |
+
}
|
2270 |
+
.course-avg-rating-wrap p{
|
2271 |
+
margin: 0;
|
2272 |
+
}
|
2273 |
+
|
2274 |
+
.tutor-review-individual-item .tutor-review-name{
|
2275 |
+
font-size: 16px;
|
2276 |
+
font-weight: 600;
|
2277 |
+
}
|
2278 |
+
.tutor-review-individual-item .review-meta{
|
2279 |
+
color: #B1B8C9;
|
2280 |
+
}
|
2281 |
+
|
2282 |
+
.individual-review-rating-wrap{
|
2283 |
+
color: #F8C51C;
|
2284 |
+
}
|
2285 |
+
.individual-review-rating-wrap i,
|
2286 |
+
.course-avg-rating-html i{
|
2287 |
+
margin-right: 4px;
|
2288 |
+
color: #F8C51C;
|
2289 |
+
}
|
2290 |
+
|
2291 |
+
|
2292 |
+
|
2293 |
+
/* ********************* */
|
2294 |
+
/* Tutor Pagination Wrap */
|
2295 |
+
/* ********************* */
|
2296 |
+
|
2297 |
+
.tutor-pagination-wrap{
|
2298 |
+
text-align: center;
|
2299 |
+
padding: 5px;
|
2300 |
+
margin-top: 30px;
|
2301 |
+
}
|
2302 |
+
.tutor-pagination-wrap a,
|
2303 |
+
.tutor-pagination-wrap span{
|
2304 |
+
padding: 3px 10px;
|
2305 |
+
border: 1px solid #dddddd;
|
2306 |
+
display: inline-block;
|
2307 |
+
color: #4B5981;
|
2308 |
+
}
|
2309 |
+
.tutor-pagination-wrap span{
|
2310 |
+
color: #1B52D8;
|
2311 |
+
border-color: #1B52D8;
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
|
2315 |
+
/* ********************* */
|
2316 |
+
/* Tutor Course Tags */
|
2317 |
+
/* ********************* */
|
2318 |
+
|
2319 |
+
.tutor-course-tags{
|
2320 |
+
margin: -5px;
|
2321 |
+
}
|
2322 |
+
.tutor-course-tags a{
|
2323 |
+
padding: 6px 15px;
|
2324 |
+
background: #E8EFF1;
|
2325 |
+
display: inline-block;
|
2326 |
+
margin: 5px;
|
2327 |
+
color: #4B5981;
|
2328 |
+
border-radius: 2px;
|
2329 |
+
transition: 300ms;
|
2330 |
+
|
2331 |
+
}
|
2332 |
+
.tutor-course-tags a:hover{
|
2333 |
+
color: #000;
|
2334 |
+
}
|
2335 |
+
.certificate-download-btn{
|
2336 |
+
margin-top: 20px;
|
2337 |
+
}
|
2338 |
+
|
2339 |
+
/**
|
2340 |
+
Addon Support
|
2341 |
+
Course Prerequisites
|
2342 |
+
*/
|
2343 |
+
.course-prerequisites-warning {
|
2344 |
+
background: #fff3dc;
|
2345 |
+
padding: 15px;
|
2346 |
+
margin-bottom: 20px;
|
2347 |
+
color: #5f5b49;
|
2348 |
+
}
|
2349 |
+
ul.prerequisites-course-lists{
|
2350 |
+
list-style: none;
|
2351 |
+
}
|
2352 |
+
a.prerequisites-course-item {
|
2353 |
+
background-color: #f0f0f0;
|
2354 |
+
display: flex;
|
2355 |
+
margin-bottom: 2px;
|
2356 |
+
padding: 10px;
|
2357 |
+
position: relative;
|
2358 |
+
}
|
2359 |
+
a.prerequisites-course-item span.prerequisites-course-feature-image{
|
2360 |
+
max-width: 60px;
|
2361 |
+
margin-right: 10px;
|
2362 |
+
}
|
2363 |
+
.is-complete-prerequisites-course {
|
2364 |
+
position: absolute;
|
2365 |
+
background: #51d849;
|
2366 |
+
color: #fff;
|
2367 |
+
padding: 0 5px;
|
2368 |
+
font-size: 12px;
|
2369 |
+
}
|
assets/icons/css/tutor-icon.css
ADDED
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'tutor';
|
3 |
+
src:
|
4 |
+
url('../font/tutor.ttf?cokwi4') format('truetype'),
|
5 |
+
url('../font/tutor.woff?cokwi4') format('woff'),
|
6 |
+
url('../font/tutor.svg?cokwi4#tutor') format('svg');
|
7 |
+
font-weight: normal;
|
8 |
+
font-style: normal;
|
9 |
+
}
|
10 |
+
|
11 |
+
[class^="tutor-icon-"], [class*=" tutor-icon-"] {
|
12 |
+
/* use !important to prevent issues with browser extensions that change fonts */
|
13 |
+
font-family: 'tutor' !important;
|
14 |
+
speak: none;
|
15 |
+
font-style: normal;
|
16 |
+
font-weight: normal;
|
17 |
+
font-variant: normal;
|
18 |
+
text-transform: none;
|
19 |
+
|
20 |
+
/* Better Font Rendering =========== */
|
21 |
+
-webkit-font-smoothing: antialiased;
|
22 |
+
-moz-osx-font-smoothing: grayscale;
|
23 |
+
}
|
24 |
+
|
25 |
+
.tutor-icon-manual:before {
|
26 |
+
content: "\e936";
|
27 |
+
}
|
28 |
+
.tutor-icon-light-up:before {
|
29 |
+
content: "\e937";
|
30 |
+
}
|
31 |
+
.tutor-icon-light-down:before {
|
32 |
+
content: "\e938";
|
33 |
+
}
|
34 |
+
.tutor-icon-light-right:before {
|
35 |
+
content: "\e939";
|
36 |
+
}
|
37 |
+
.tutor-icon-light-left:before {
|
38 |
+
content: "\e93a";
|
39 |
+
}
|
40 |
+
.tutor-icon-pencil:before {
|
41 |
+
content: "\e93b";
|
42 |
+
}
|
43 |
+
.tutor-icon-man-user:before {
|
44 |
+
content: "\e93c";
|
45 |
+
}
|
46 |
+
.tutor-icon-move:before {
|
47 |
+
content: "\e93d";
|
48 |
+
}
|
49 |
+
.tutor-icon-list:before {
|
50 |
+
content: "\e93e";
|
51 |
+
}
|
52 |
+
.tutor-icon-speaker:before {
|
53 |
+
content: "\e93f";
|
54 |
+
}
|
55 |
+
.tutor-icon-video-camera:before {
|
56 |
+
content: "\e940";
|
57 |
+
}
|
58 |
+
.tutor-icon-garbage:before {
|
59 |
+
content: "\e941";
|
60 |
+
}
|
61 |
+
.tutor-icon-add-line:before {
|
62 |
+
content: "\e942";
|
63 |
+
}
|
64 |
+
.tutor-icon-clipboard:before {
|
65 |
+
content: "\e924";
|
66 |
+
}
|
67 |
+
.tutor-icon-professor:before {
|
68 |
+
content: "\e926";
|
69 |
+
}
|
70 |
+
.tutor-icon-graduate:before {
|
71 |
+
content: "\e928";
|
72 |
+
}
|
73 |
+
.tutor-icon-student:before {
|
74 |
+
content: "\e929";
|
75 |
+
}
|
76 |
+
.tutor-icon-magnifying-glass-1:before {
|
77 |
+
content: "\e92a";
|
78 |
+
}
|
79 |
+
.tutor-icon-review:before {
|
80 |
+
content: "\e92c";
|
81 |
+
}
|
82 |
+
.tutor-icon-calendar:before {
|
83 |
+
content: "\e92d";
|
84 |
+
}
|
85 |
+
.tutor-icon-open-book-1:before {
|
86 |
+
content: "\e92e";
|
87 |
+
}
|
88 |
+
.tutor-icon-conversation-1:before {
|
89 |
+
content: "\e934";
|
90 |
+
}
|
91 |
+
.tutor-icon-default:before {
|
92 |
+
content: "\e922";
|
93 |
+
}
|
94 |
+
.tutor-icon-artboard:before {
|
95 |
+
content: "\e923";
|
96 |
+
}
|
97 |
+
.tutor-icon-audio:before {
|
98 |
+
content: "\e925";
|
99 |
+
}
|
100 |
+
.tutor-icon-interactive:before {
|
101 |
+
content: "\e927";
|
102 |
+
}
|
103 |
+
.tutor-icon-code:before {
|
104 |
+
content: "\e92b";
|
105 |
+
}
|
106 |
+
.tutor-icon-image:before {
|
107 |
+
content: "\e92f";
|
108 |
+
}
|
109 |
+
.tutor-icon-spreadsheet:before {
|
110 |
+
content: "\e930";
|
111 |
+
}
|
112 |
+
.tutor-icon-text:before {
|
113 |
+
content: "\e931";
|
114 |
+
}
|
115 |
+
.tutor-icon-document:before {
|
116 |
+
content: "\e932";
|
117 |
+
}
|
118 |
+
.tutor-icon-video:before {
|
119 |
+
content: "\e933";
|
120 |
+
}
|
121 |
+
.tutor-icon-archive:before {
|
122 |
+
content: "\e935";
|
123 |
+
}
|
124 |
+
.tutor-icon-file:before {
|
125 |
+
content: "\e91e";
|
126 |
+
}
|
127 |
+
.tutor-icon-doubt:before {
|
128 |
+
content: "\e91f";
|
129 |
+
}
|
130 |
+
.tutor-icon-spinner:before {
|
131 |
+
content: "\e91d";
|
132 |
+
}
|
133 |
+
.tutor-icon-down:before {
|
134 |
+
content: "\e900";
|
135 |
+
}
|
136 |
+
.tutor-icon-up:before {
|
137 |
+
content: "\e901";
|
138 |
+
}
|
139 |
+
.tutor-icon-angle-up:before {
|
140 |
+
content: "\e902";
|
141 |
+
}
|
142 |
+
.tutor-icon-angle-down:before {
|
143 |
+
content: "\e920";
|
144 |
+
}
|
145 |
+
.tutor-icon-angle-left:before {
|
146 |
+
content: "\e921";
|
147 |
+
}
|
148 |
+
.tutor-icon-angle-right:before {
|
149 |
+
content: "\e903";
|
150 |
+
}
|
151 |
+
.tutor-icon-audio-volume:before {
|
152 |
+
content: "\e904";
|
153 |
+
}
|
154 |
+
.tutor-icon-clock:before {
|
155 |
+
content: "\e905";
|
156 |
+
}
|
157 |
+
.tutor-icon-document-alt:before {
|
158 |
+
content: "\e906";
|
159 |
+
}
|
160 |
+
.tutor-icon-facebook:before {
|
161 |
+
content: "\e907";
|
162 |
+
}
|
163 |
+
.tutor-icon-fav-full:before {
|
164 |
+
content: "\e908";
|
165 |
+
}
|
166 |
+
.tutor-icon-fav-line:before {
|
167 |
+
content: "\e909";
|
168 |
+
}
|
169 |
+
.tutor-icon-google:before {
|
170 |
+
content: "\e90a";
|
171 |
+
}
|
172 |
+
.tutor-icon-grid:before {
|
173 |
+
content: "\e90b";
|
174 |
+
}
|
175 |
+
.tutor-icon-group:before {
|
176 |
+
content: "\e90c";
|
177 |
+
}
|
178 |
+
.tutor-icon-linkdin:before {
|
179 |
+
content: "\e90d";
|
180 |
+
}
|
181 |
+
.tutor-icon-lock:before {
|
182 |
+
content: "\e90e";
|
183 |
+
}
|
184 |
+
.tutor-icon-mark:before {
|
185 |
+
content: "\e90f";
|
186 |
+
}
|
187 |
+
.tutor-icon-minus:before {
|
188 |
+
content: "\e910";
|
189 |
+
}
|
190 |
+
.tutor-icon-mortarboard:before {
|
191 |
+
content: "\e911";
|
192 |
+
}
|
193 |
+
.tutor-icon-offer:before {
|
194 |
+
content: "\e912";
|
195 |
+
}
|
196 |
+
.tutor-icon-play:before {
|
197 |
+
content: "\e913";
|
198 |
+
}
|
199 |
+
.tutor-icon-plus:before {
|
200 |
+
content: "\e914";
|
201 |
+
}
|
202 |
+
.tutor-icon-shopping-cart:before {
|
203 |
+
content: "\e915";
|
204 |
+
}
|
205 |
+
.tutor-icon-star-full:before {
|
206 |
+
content: "\e916";
|
207 |
+
}
|
208 |
+
.tutor-icon-star-half:before {
|
209 |
+
content: "\e917";
|
210 |
+
}
|
211 |
+
.tutor-icon-star-line:before {
|
212 |
+
content: "\e918";
|
213 |
+
}
|
214 |
+
.tutor-icon-tumblr:before {
|
215 |
+
content: "\e919";
|
216 |
+
}
|
217 |
+
.tutor-icon-twitter:before {
|
218 |
+
content: "\e91a";
|
219 |
+
}
|
220 |
+
.tutor-icon-user:before {
|
221 |
+
content: "\e91b";
|
222 |
+
}
|
223 |
+
.tutor-icon-youtube:before {
|
224 |
+
content: "\e91c";
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
Animation Spinner
|
229 |
+
*/
|
230 |
+
@-moz-keyframes spin {
|
231 |
+
0% {
|
232 |
+
-moz-transform: rotate(0deg);
|
233 |
+
-o-transform: rotate(0deg);
|
234 |
+
-webkit-transform: rotate(0deg);
|
235 |
+
transform: rotate(0deg);
|
236 |
+
}
|
237 |
+
|
238 |
+
100% {
|
239 |
+
-moz-transform: rotate(359deg);
|
240 |
+
-o-transform: rotate(359deg);
|
241 |
+
-webkit-transform: rotate(359deg);
|
242 |
+
transform: rotate(359deg);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
@-webkit-keyframes spin {
|
246 |
+
0% {
|
247 |
+
-moz-transform: rotate(0deg);
|
248 |
+
-o-transform: rotate(0deg);
|
249 |
+
-webkit-transform: rotate(0deg);
|
250 |
+
transform: rotate(0deg);
|
251 |
+
}
|
252 |
+
|
253 |
+
100% {
|
254 |
+
-moz-transform: rotate(359deg);
|
255 |
+
-o-transform: rotate(359deg);
|
256 |
+
-webkit-transform: rotate(359deg);
|
257 |
+
transform: rotate(359deg);
|
258 |
+
}
|
259 |
+
}
|
260 |
+
@-o-keyframes spin {
|
261 |
+
0% {
|
262 |
+
-moz-transform: rotate(0deg);
|
263 |
+
-o-transform: rotate(0deg);
|
264 |
+
-webkit-transform: rotate(0deg);
|
265 |
+
transform: rotate(0deg);
|
266 |
+
}
|
267 |
+
|
268 |
+
100% {
|
269 |
+
-moz-transform: rotate(359deg);
|
270 |
+
-o-transform: rotate(359deg);
|
271 |
+
-webkit-transform: rotate(359deg);
|
272 |
+
transform: rotate(359deg);
|
273 |
+
}
|
274 |
+
}
|
275 |
+
@-ms-keyframes spin {
|
276 |
+
0% {
|
277 |
+
-moz-transform: rotate(0deg);
|
278 |
+
-o-transform: rotate(0deg);
|
279 |
+
-webkit-transform: rotate(0deg);
|
280 |
+
transform: rotate(0deg);
|
281 |
+
}
|
282 |
+
|
283 |
+
100% {
|
284 |
+
-moz-transform: rotate(359deg);
|
285 |
+
-o-transform: rotate(359deg);
|
286 |
+
-webkit-transform: rotate(359deg);
|
287 |
+
transform: rotate(359deg);
|
288 |
+
}
|
289 |
+
}
|
290 |
+
@keyframes spin {
|
291 |
+
0% {
|
292 |
+
-moz-transform: rotate(0deg);
|
293 |
+
-o-transform: rotate(0deg);
|
294 |
+
-webkit-transform: rotate(0deg);
|
295 |
+
transform: rotate(0deg);
|
296 |
+
}
|
297 |
+
|
298 |
+
100% {
|
299 |
+
-moz-transform: rotate(359deg);
|
300 |
+
-o-transform: rotate(359deg);
|
301 |
+
-webkit-transform: rotate(359deg);
|
302 |
+
transform: rotate(359deg);
|
303 |
+
}
|
304 |
+
}
|
assets/icons/font/tutor.svg
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by IcoMoon</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="tutor" horiz-adv-x="1024">
|
7 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
+
<missing-glyph horiz-adv-x="1024" />
|
9 |
+
<glyph unicode=" " horiz-adv-x="512" d="" />
|
10 |
+
<glyph unicode="" glyph-name="down" d="M174.080 634.573h675.84c22.63 0 38.4-10.957 47.104-32.768s5.222-40.55-10.445-56.32l-337.92-337.92c-10.445-10.445-22.733-15.667-36.659-15.667-14.029 0-26.214 5.222-36.659 15.667l-337.92 337.92c-15.667 15.667-19.251 34.509-10.445 56.32 8.704 21.811 24.474 32.768 47.104 32.768z" />
|
11 |
+
<glyph unicode="" glyph-name="up" d="M849.92 226.714h-675.84c-22.63 0-38.4 10.957-47.104 32.768s-5.222 40.55 10.445 56.32l337.92 337.92c10.445 10.445 22.733 15.667 36.659 15.667 14.029 0 26.214-5.222 36.659-15.667l337.92-337.92c15.667-15.667 19.251-34.509 10.445-56.32-8.704-21.914-24.474-32.768-47.104-32.768z" />
|
12 |
+
<glyph unicode="" glyph-name="angle-up" d="M551.936 741.069l455.68-455.68c10.854-10.957 16.384-24.269 16.384-39.936s-5.53-28.979-16.486-39.936l-51.712-51.712c-10.957-10.957-24.269-16.794-39.936-17.613s-28.979 4.301-39.936 15.258l-363.93 364.134-364.032-364.032c-10.957-10.957-24.269-16.077-39.936-15.258s-28.979 6.656-39.936 17.613l-51.712 51.712c-10.957 10.957-16.486 24.269-16.486 39.936s5.53 28.979 16.486 39.936l455.68 455.68c10.957 12.595 24.269 18.739 39.936 18.739 15.667-0.102 28.979-6.349 39.936-18.842z" />
|
13 |
+
<glyph unicode="" glyph-name="angle-right" d="M805.069 408.064l-455.68-455.68c-10.957-10.957-24.269-16.486-39.936-16.486s-28.979 5.53-39.936 16.486l-51.712 51.712c-10.957 10.957-16.794 24.269-17.613 39.936s4.301 28.979 15.258 39.936l364.134 364.032-364.032 364.032c-10.957 10.957-16.077 24.269-15.258 39.936s6.656 28.979 17.613 39.936l51.712 51.712c10.854 10.854 24.166 16.384 39.834 16.384s28.979-5.53 39.936-16.486l455.68-455.68c12.493-10.957 18.739-24.269 18.739-39.936 0-15.565-6.246-28.877-18.739-39.834z" />
|
14 |
+
<glyph unicode="" glyph-name="audio-volume" d="M459.21 838.443c-13.36 5.521-28.746 2.439-39.112-7.898l-217.022-218.402h-167.166c-19.907 0-35.91-16.063-35.91-35.912v-259.189c0-19.849 16.003-35.91 35.91-35.91h166.372l217.934-218.403c6.87-6.899 16.121-10.542 25.399-10.542 4.58 0 9.338 0.881 13.713 2.731 13.477 5.521 22.199 18.647 22.199 33.15v717.197c-0.031 14.533-8.839 27.658-22.317 33.178zM832.944 447.651c0 134.54-79.956 255.722-203.751 308.841-18.235 7.81-39.404-0.618-47.157-18.881-7.839-18.204 0.587-39.317 18.821-47.128 97.486-41.754 160.294-137.068 160.294-242.832 0-105.297-62.573-200.375-159.502-242.159-18.175-7.869-26.601-28.98-18.763-47.157 5.844-13.595 19.086-21.698 33.092-21.698 4.64 0 9.515 0.939 14.154 2.966 123.267 53.117 202.812 174.035 202.812 308.049zM674.091 447.71c0 71.088-42.254 134.953-107.763 162.73-18.175 7.606-39.288-0.763-46.98-19.057-7.869-18.263 0.675-39.346 18.91-47.099 38.878-16.442 63.953-54.379 63.953-96.576 0-41.696-24.841-79.457-63.188-96.166-18.235-7.869-26.545-29.011-18.705-47.215 5.902-13.537 19.086-21.582 32.975-21.582 4.756 0 9.69 0.939 14.33 2.995 64.653 28.073 106.469 91.673 106.469 161.97zM690.21 898.581c-18.235 7.898-39.464-0.558-47.157-18.823-7.869-18.235 0.558-39.346 18.821-47.127 154.275-66.214 253.934-217.317 253.934-385.040 0-167.105-99.279-317.914-253.081-384.246-18.235-7.869-26.663-28.951-18.881-47.157 5.902-13.595 19.086-21.698 32.975-21.698 4.758 0 9.691 0.939 14.33 2.965 180.085 77.635 296.51 254.373 296.51 450.168 0.027 196.408-116.691 373.44-297.451 450.959z" />
|
15 |
+
<glyph unicode="" glyph-name="clock" d="M946.197 653.276c-51.534 120.167-139.105 207.561-260.254 259.239-60.551 25.829-123.988 39.022-190.262 39.022-66.262 0-129.232-13.069-189.716-39.022-120.145-51.541-208.105-138.879-259.73-259.239-25.869-60.3-38.478-123.474-38.478-189.748 0-66.287 12.609-129.985 38.478-190.297 51.625-120.36 139.596-208.222 259.73-259.776 60.495-25.953 123.452-39.009 189.716-39.009s129.711 13.193 190.252 39.009c121.148 51.68 208.72 139.62 260.265 259.776 25.947 60.506 39.014 124.010 39.014 190.297 0 66.274-13.055 129.243-39.015 189.748zM868.18 247.573c-38.365-65.806-90.924-118.012-157.119-156.611-65.795-38.372-137.885-57.723-215.367-57.723-58.248 0-113.829 11.22-166.742 34.209-52.912 22.977-98.597 53.185-136.813 91.397-38.217 38.223-68.634 84.362-91.379 137.374-22.678 52.819-33.668 109.038-33.668 167.307 0 77.507 19.040 149.245 57.189 214.869 38.285 65.864 90.855 118.125 156.583 156.612 65.716 38.485 137.339 57.734 214.82 57.734 77.494 0 149.571-19.362 215.367-57.734 66.195-38.6 118.641-90.86 157.119-156.611 38.478-65.739 57.713-137.363 57.713-214.869 0-77.509-19.108-149.735-57.702-215.955zM524.274 466.879v277.053c0 16.579-14.226 29.951-30.555 29.951-15.271 0-28.97-13.372-28.97-29.951v-281.331c0-0.537 1.056-2.682 1.056-4.281-1.056-9.629 1.585-17.651 7.901-24.075l157.501-159.916c10.539-10.701 30.024-10.701 40.556 0 12.112 12.3 11.315 30.146 0 41.717l-147.49 150.832z" />
|
16 |
+
<glyph unicode="" glyph-name="document-alt" d="M867.331 817.778h-28.402v-714.292c0-47.452-37.734-86.078-84.090-86.078h-516.617v-26.478c0-30.321 24.040-54.929 53.66-54.929h575.348c29.619 0 53.659 24.608 53.659 54.929v771.919c0.001 30.32-23.938 54.929-53.557 54.929zM465.727 49.778h287.716c29.624 0 53.668 24.608 53.668 54.927v771.921c0 30.32-24.044 54.929-53.668 54.929h-383.385v-18.171c0.202-1.869 0.304-3.842 0.304-5.815v-150.459c0-42.677-33.885-77.358-75.581-77.358h-147.003c-1.522 0-3.145 0.104-4.667 0.208h-18.667v-575.255c0-30.319 24.044-54.927 53.668-54.927h287.615zM476.582 236.475h-187.584c-14 0-25.363 11.631-25.363 25.959 0 14.33 11.363 25.959 25.363 25.959h187.685c14 0 25.363-11.629 25.363-25.959 0-14.328-11.464-25.959-25.464-25.959zM664.267 368.969h-375.269c-14 0-25.363 11.631-25.363 25.959 0 14.33 11.363 25.959 25.363 25.959h375.269c14 0 25.363-11.629 25.363-25.959 0-14.328-11.363-25.959-25.363-25.959zM288.999 561.586h375.269c14 0 25.363-11.63 25.363-25.959s-11.363-25.959-25.363-25.959h-375.269c-14 0-25.363 11.63-25.363 25.959s11.363 25.959 25.363 25.959zM120.033 732.444h155.786c0.108 0 0.323 0 0.43 0 26.018 0.215 47.091 21.283 47.306 47.295 0 0.107 0 0.322 0 0.43v155.86c0 14.404-11.826 23.97-24.082 23.97-5.913 0-11.826-2.15-16.772-7.094l-179.655-179.615c-15.052-15.049-4.408-40.846 16.987-40.846z" />
|
17 |
+
<glyph unicode="" glyph-name="facebook" d="M402.022-64v458.035h-154.010v181.965h154.010v143.974c0 75.981 21.299 134.963 64 177.050 42.701 41.984 99.328 62.976 169.984 62.976 57.344 0 104.038-2.662 139.981-7.987v-161.997h-96.051c-36.045 0-60.723-7.987-74.035-23.962-10.65-13.312-15.974-34.714-15.974-64v-125.952h169.984l-23.962-181.965h-145.92v-458.138h-188.006z" />
|
18 |
+
<glyph unicode="" glyph-name="fav-full" d="M141.439 926.151c8.271 12.642 19.41 21.887 33.391 27.752 8.904 4.056 18.236 6.088 27.991 6.088v0.009h666.562c9.751 0 19.074-2.032 27.98-6.088 13.99-5.86 25.124-15.117 33.391-27.752 8.265-12.635 12.404-26.616 12.404-41.961v-872.4c0-15.349-4.139-29.326-12.404-41.973-8.267-12.633-19.401-21.887-33.391-27.745-8.897-4.056-18.229-6.083-27.98-6.083-19.936 0-37.524 7.448-52.792 22.326l-280.491 286.981-280.491-286.988c-14.843-14.415-32.44-21.636-52.786-21.636-10.604 0-19.934 1.792-27.991 5.402-13.981 5.858-25.12 15.112-33.391 27.761-8.265 12.63-12.395 26.609-12.395 41.956v872.388c-0.002 15.344 4.137 29.326 12.393 41.961z" />
|
19 |
+
<glyph unicode="" glyph-name="fav-line" d="M141.439 926.151c8.271 12.642 19.41 21.887 33.391 27.752 8.904 4.056 18.236 6.088 27.991 6.088v0.009h666.562c9.751 0 19.074-2.032 27.98-6.088 13.99-5.86 25.124-15.117 33.391-27.752 8.265-12.635 12.404-26.616 12.404-41.961v-872.4c0-15.349-4.139-29.326-12.404-41.973-8.267-12.633-19.401-21.887-33.391-27.745-8.897-4.056-18.229-6.083-27.98-6.083-19.936 0-37.524 7.448-52.792 22.326l-280.491 286.981-280.491-286.988c-14.843-14.415-32.44-21.636-52.786-21.636-10.604 0-19.934 1.792-27.991 5.402-13.981 5.858-25.12 15.112-33.391 27.761-8.265 12.63-12.395 26.609-12.395 41.956v872.388c-0.002 15.344 4.137 29.326 12.393 41.961zM210.453 32.793l325.646 332.298 56.604-57.519 269.036-274.78v840.566h-651.286v-840.566z" />
|
20 |
+
<glyph unicode="" glyph-name="google" d="M1000.346 522.342c5.53-30.31 8.294-59.187 8.294-86.733 0-96.358-20.685-182.374-61.952-258.048s-99.43-134.861-174.49-177.562c-75.059-42.598-161.382-64-259.072-64-92.262 0-177.562 23.040-256 69.12s-140.698 108.339-186.88 186.88c-46.080 78.438-69.12 163.738-69.12 256 0 92.16 23.040 177.562 69.12 256s108.339 140.698 186.88 186.88c78.438 46.080 163.738 69.12 256 69.12 133.427 0 247.706-44.749 342.63-134.144l-138.342-134.144c-44.032 42.598-97.075 68.096-158.925 76.39-57.856 8.294-114.893 0-171.315-24.781-56.422-24.883-101.888-62.054-136.294-111.616-37.171-53.658-55.706-114.893-55.706-183.706 0-59.187 14.438-113.254 43.315-162.099s67.379-88.064 115.61-117.658c48.128-29.594 101.171-44.339 158.925-44.339 61.952 0 116.326 13.722 163.123 41.267 37.171 22.016 68.096 51.61 92.877 88.781 17.92 30.208 29.594 60.518 35.123 90.829h-291.021v177.562h487.219z" />
|
21 |
+
<glyph unicode="" glyph-name="grid" d="M456.98 937.265c0 12.561-10.174 22.735-22.735 22.735h-411.51c-12.561 0-22.735-10.174-22.735-22.735v-411.51c0-12.561 10.174-22.735 22.735-22.735h411.51c12.561 0 22.735 10.174 22.735 22.735v411.51zM411.51 548.49h-366.039v366.039h366.039v-366.039zM1023.091 937.265c0 12.561-10.174 22.735-22.735 22.735h-411.51c-12.561 0-22.735-10.174-22.735-22.735v-411.51c0-12.561 10.174-22.735 22.735-22.735h411.51c12.561 0 22.735 10.174 22.735 22.735v411.51zM977.62 548.49h-366.039v366.039h366.039v-366.039zM456.98 371.155c0 12.561-10.174 22.735-22.735 22.735h-411.51c-12.561 0-22.735-10.174-22.735-22.735v-411.51c0-12.561 10.174-22.735 22.735-22.735h411.51c12.561 0 22.735 10.174 22.735 22.735v411.51zM411.51-15.346h-366.039v363.766h366.039v-363.766zM1023.091 371.155c0 12.561-10.174 22.735-22.735 22.735h-411.51c-12.561 0-22.735-10.174-22.735-22.735v-411.51c0-12.561 10.174-22.735 22.735-22.735h411.51c12.561 0 22.735 10.174 22.735 22.735v411.51zM977.62-15.346h-366.039v363.766h366.039v-363.766z" />
|
22 |
+
<glyph unicode="" glyph-name="group" d="M863.277 485.303c28.24 19.844 46.939 52.854 46.939 90.061 0 60.868-49.228 110.096-110.096 110.096s-110.096-49.228-110.096-110.096c0-37.207 18.508-70.217 46.939-90.061-24.233-8.396-46.366-21.37-65.065-38.161-25.759 21.943-56.097 38.734-89.298 48.656 40.26 24.423 67.355 68.881 67.355 119.445 0 77.086-62.394 139.48-139.48 139.48s-139.48-62.585-139.48-139.48c0-50.564 26.904-95.022 67.355-119.445-32.819-9.922-62.776-26.522-88.344-48.083-18.699 16.409-40.451 29.194-64.302 37.398 28.24 19.844 46.939 52.854 46.939 90.061 0 60.868-49.228 110.096-110.096 110.096s-110.096-49.228-110.096-110.096c0-37.207 18.508-70.217 46.939-90.061-75.751-26.141-130.131-98.075-130.131-182.603v-12.593c0-0.382 0.382-0.763 0.763-0.763h233.358c-1.336-10.494-2.099-21.37-2.099-32.246v-12.975c0-56.097 45.412-101.51 101.51-101.51h295.752c56.097 0 101.51 45.412 101.51 101.51v12.975c0 10.876-0.763 21.752-2.099 32.246h234.884c0.382 0 0.763 0.382 0.763 0.763v12.593c-0.382 84.719-54.571 156.653-130.321 182.794zM720.553 575.555c0 43.886 35.681 79.567 79.567 79.567s79.567-35.681 79.567-79.567c0-43.313-34.918-78.613-78.040-79.567-0.572 0-0.954 0-1.526 0s-0.954 0-1.526 0c-43.313 0.763-78.040 36.063-78.040 79.567zM401.141 615.243c0 60.104 48.847 108.951 108.951 108.951s108.951-48.847 108.951-108.951c0-58.005-45.603-105.517-102.654-108.76-2.099 0-4.198 0-6.297 0s-4.198 0-6.297 0c-57.051 3.244-102.654 50.755-102.654 108.76zM142.406 575.555c0 43.886 35.681 79.567 79.567 79.567s79.567-35.681 79.567-79.567c0-43.313-34.918-78.613-78.040-79.567-0.572 0-0.954 0-1.526 0s-0.954 0-1.526 0c-43.122 0.763-78.040 36.063-78.040 79.567zM268.721 319.873h-208.553c8.586 81.284 77.277 145.014 160.66 145.586 0.382 0 0.763 0 1.145 0s0.763 0 1.145 0c39.688-0.191 75.941-14.883 103.99-38.734-27.476-29.766-47.893-66.401-58.387-106.852zM729.139 243.931c0-39.116-31.865-70.98-70.98-70.98h-295.752c-39.116 0-70.98 31.865-70.98 70.98v12.975c0 118.491 94.64 215.422 212.369 218.856 2.099-0.191 4.389-0.191 6.487-0.191s4.389 0 6.487 0.191c117.728-3.435 212.369-100.365 212.369-218.856v-12.975zM751.845 319.873c-10.494 40.26-30.529 76.323-57.815 106.089 28.24 24.423 64.875 39.116 104.944 39.497 0.382 0 0.763 0 1.145 0s0.763 0 1.145 0c83.383-0.572 152.074-64.302 160.66-145.586h-210.079z" />
|
23 |
+
<glyph unicode="" glyph-name="linkdin" d="M123.392 713.114c-33.485 0-62.464 12.186-86.835 36.557s-36.557 53.35-36.557 86.938c0 33.485 12.186 62.464 36.557 86.835s53.35 36.557 86.835 36.557c33.485 0 62.464-12.186 86.835-36.557s36.557-53.35 36.557-86.835c0-33.485-12.186-62.464-36.557-86.835-24.371-24.474-53.248-36.659-86.835-36.659zM228.557-64h-212.582v683.418h212.582v-683.418zM1024-64h-212.582v333.722c0 54.886-4.608 94.515-13.722 118.886-16.794 41.165-49.562 61.747-98.304 61.747s-83.046-18.33-102.81-54.886c-15.258-27.443-22.835-67.789-22.835-121.139v-338.33h-210.33v683.418h203.469v-93.696h2.253c15.258 30.515 39.629 55.603 73.114 75.469 36.557 24.371 79.258 36.557 128 36.557 99.021 0 168.346-31.232 207.974-93.696 30.515-50.278 45.67-128 45.67-233.165v-374.886z" />
|
24 |
+
<glyph unicode="" glyph-name="lock" d="M791.744 618.985h-48.716v97.433c0 136.406-107.176 243.582-243.582 243.582s-243.582-107.176-243.582-243.582v-97.433h-48.716c-53.588 0-97.433-43.845-97.433-97.433v-487.164c0-53.588 43.845-97.433 97.433-97.433h584.597c53.588 0 97.433 43.845 97.433 97.433v487.164c0 53.588-43.845 97.433-97.433 97.433zM499.446 180.537c-53.588 0-97.433 43.845-97.433 97.433s43.845 97.433 97.433 97.433c53.588 0 97.433-43.845 97.433-97.433s-43.845-97.433-97.433-97.433zM650.467 618.985h-302.042v97.433c0 82.818 68.203 151.021 151.021 151.021s151.021-68.203 151.021-151.021v-97.433z" />
|
25 |
+
<glyph unicode="" glyph-name="mark" d="M347.955 82.022l-333.926 331.981c-9.421 9.318-14.029 21.299-14.029 36.045 0 14.643 4.608 26.624 14.029 36.045l74.035 71.987c9.318 10.65 20.992 15.974 35.021 15.974s26.317-5.325 36.966-15.974l223.949-224.051 480.051 480.051c10.65 10.65 23.040 15.974 36.966 15.974s25.702-5.325 35.021-15.974l74.035-71.987c9.318-9.318 14.029-21.299 14.029-36.045 0-14.643-4.71-26.726-14.029-36.045l-590.029-587.981c-9.421-10.752-21.402-15.974-36.045-15.974s-26.726 5.222-36.045 15.974z" />
|
26 |
+
<glyph unicode="" glyph-name="minus" d="M64 512h853.333c35.346 0 64-28.654 64-64s-28.654-64-64-64h-853.333c-35.346 0-64 28.654-64 64s28.654 64 64 64z" />
|
27 |
+
<glyph unicode="" glyph-name="mortarboard" d="M702.009 81.892c-8.908 2.261-17.931-3.19-20.141-12.082l-16.618-66.474c-2.244-8.923 3.19-17.931 12.098-20.159 1.346-0.349 2.709-0.499 4.039-0.499 7.445 0 14.209 5.036 16.104 12.581l16.618 66.474c2.226 8.908-3.192 17.931-12.1 20.159zM498.562 414.764c2.16 0 4.322 0.415 6.349 1.262l182.807 75.649c8.476 3.507 12.497 13.229 8.992 21.705-3.507 8.493-13.263 12.482-21.721 9.007l-176.427-73.022-465.324 192.544v5.517c0 9.173-7.445 16.618-16.618 16.618s-16.62-7.445-16.62-16.618v-16.618c0-6.731 4.055-12.797 10.271-15.356l481.944-199.425c2.025-0.847 4.187-1.264 6.347-1.264zM696.26 244.505c-4.055 8.226-13.993 11.617-22.252 7.545-31.559-15.605-84.275-33.752-158.825-36.23v149.088c0 9.173-7.445 16.618-16.618 16.618s-16.618-7.445-16.618-16.618v-148.938c-206.354 6.581-272.945 131.587-282.519 152.394v112.874c0 9.173-7.445 16.618-16.618 16.618s-16.618-7.445-16.618-16.618v-116.331c0-2.111 0.399-4.205 1.18-6.181 2.892-7.196 73.622-176.623 331.195-176.623 90.024 0 153.109 21.837 190.168 40.152 8.238 4.070 11.613 14.024 7.525 22.25zM747.843 65.77c-9.19 0-16.618-7.445-16.618-16.618v-49.856c0-9.173 7.428-16.618 16.618-16.618s16.618 7.445 16.618 16.618v49.856c0 9.173-7.428 16.618-16.618 16.618zM980.506 664.045c-9.19 0-16.618-7.445-16.618-16.618v-5.484l-199.425-82.080v30.031l222.392 92.035c6.215 2.559 10.271 8.626 10.271 15.356s-4.055 12.78-10.254 15.356l-481.962 199.423c-4.072 1.679-8.626 1.679-12.696 0l-481.944-199.425c-6.216-2.577-10.271-8.626-10.271-15.356s4.055-12.797 10.271-15.356l481.944-199.425c2.027-0.847 4.187-1.264 6.349-1.264s4.322 0.415 6.349 1.264l174.265 72.108c8.493 3.49 12.515 13.212 9.007 21.705-3.507 8.476-13.229 12.482-21.705 8.992l-167.918-69.468-438.485 181.444 438.485 181.444 438.485-181.444-190.799-78.956-182.756 68.237c0.964 3.457 1.546 7.013 1.546 10.719 0 27.953-29.199 49.856-66.474 49.856s-66.474-21.904-66.474-49.856c0-27.953 29.199-49.856 66.474-49.856 16.636 0 31.476 4.538 43.009 11.849l189.652-70.813v-409.421c-19.294-6.896-33.238-25.16-33.238-46.799 0-27.487 22.369-49.856 49.856-49.856s49.856 22.369 49.856 49.856c0 21.637-13.942 39.901-33.238 46.799v94.328c47.712 36.013 64.813 83.975 65.561 86.101 0.598 1.745 0.913 3.589 0.913 5.434v116.331c0 9.173-7.428 16.618-16.618 16.618s-16.618-7.445-16.618-16.618v-113.257c-2.875-7.046-12.863-28.767-33.238-50.205v206.144l222.376 91.519c6.232 2.559 10.287 8.641 10.287 15.372v16.618c0 9.175-7.428 16.62-16.618 16.62zM498.562 680.665c-20.291 0-33.238 9.839-33.238 16.618 0 6.781 12.945 16.618 33.238 16.618s33.238-9.839 33.238-16.618c0-6.781-12.947-16.618-33.238-16.618zM747.843 115.627c-9.173 0-16.618 7.461-16.618 16.618s7.445 16.618 16.618 16.618c9.173 0 16.618-7.461 16.618-16.618 0-9.155-7.445-16.618-16.618-16.618zM813.819 69.809c-2.226 8.89-11.268 14.326-20.141 12.082-8.908-2.226-14.326-11.251-12.098-20.159l16.618-66.474c1.895-7.545 8.659-12.581 16.104-12.581 1.33 0 2.691 0.15 4.039 0.499 8.908 2.226 14.326 11.235 12.098 20.159l-16.62 66.474z" />
|
28 |
+
<glyph unicode="" glyph-name="offer" d="M932.274 434.786c-4.104 8.397-4.104 18.028 0 26.423l38.043 77.826c21.181 43.333 4.399 94.981-38.207 117.587l-76.521 40.601c-8.256 4.379-13.916 12.172-15.531 21.375l-14.966 85.325c-8.333 47.506-52.278 79.43-100.025 72.674l-85.771-12.133c-9.258-1.307-18.412 1.669-25.128 8.166l-62.259 60.229c-34.667 33.537-88.974 33.539-123.639 0l-62.261-60.235c-6.718-6.499-15.872-9.469-25.128-8.166l-85.771 12.133c-47.763 6.76-91.692-25.168-100.025-72.674l-14.966-85.321c-1.616-9.204-7.276-16.996-15.529-21.376l-76.521-40.601c-42.606-22.604-59.388-74.256-38.207-117.589l38.041-77.824c4.104-8.397 4.104-18.028 0-26.423l-38.043-77.824c-21.181-43.333-4.399-94.981 38.207-117.587l76.521-40.601c8.256-4.379 13.916-12.172 15.531-21.375l14.966-85.325c7.586-43.247 44.67-73.577 87.289-73.573 4.198 0 8.457 0.295 12.738 0.9l85.771 12.133c9.25 1.313 18.41-1.669 25.128-8.166l62.259-60.229c17.336-16.77 39.573-25.154 61.819-25.152 22.239 0.002 44.49 8.385 61.819 25.152l62.261 60.229c6.718 6.497 15.874 9.465 25.128 8.166l85.771-12.133c47.769-6.758 91.692 25.168 100.025 72.674l14.968 85.321c1.616 9.204 7.276 16.996 15.529 21.376l76.521 40.601c42.606 22.604 59.388 74.256 38.207 117.589l-38.043 77.826zM904.537 291.342l-76.521-40.601c-24.397-12.947-41.129-35.973-45.901-63.179l-14.966-85.323c-2.819-16.073-17.679-26.869-33.842-24.588l-85.771 12.133c-27.353 3.875-54.419-4.929-74.272-24.132l-62.261-60.227c-11.726-11.344-30.1-11.344-41.831 0l-62.259 60.229c-16.778 16.231-38.713 25.026-61.611 25.026-4.196 0-8.425-0.295-12.661-0.895l-85.771-12.133c-16.149-2.283-31.021 8.515-33.842 24.588l-14.968 85.325c-4.773 27.206-21.504 50.234-45.903 63.177l-76.521 40.601c-14.416 7.648-20.094 25.122-12.928 39.783l38.043 77.826c12.129 24.815 12.129 53.276 0 78.091l-38.043 77.826c-7.166 14.661-1.488 32.134 12.928 39.783l76.521 40.601c24.397 12.947 41.129 35.973 45.901 63.179l14.966 85.323c2.821 16.073 17.679 26.871 33.842 24.588l85.771-12.133c27.343-3.871 54.419 4.929 74.272 24.132l62.261 60.229c11.726 11.344 30.1 11.344 41.831 0l62.259-60.229c19.852-19.205 46.925-28.003 74.272-24.132l85.771 12.133c16.151 2.285 31.023-8.515 33.842-24.588l14.966-85.325c4.773-27.206 21.504-50.234 45.903-63.177l76.521-40.601c14.416-7.648 20.094-25.122 12.928-39.783l-38.043-77.824c-12.129-24.813-12.129-53.278 0-78.091l38.043-77.824c7.168-14.665 1.49-32.14-12.926-39.789zM705.018 662.928c-11.485 11.487-30.112 11.487-41.6 0l-388.261-388.263c-11.487-11.487-11.487-30.112 0-41.6 5.744-5.744 13.272-8.616 20.799-8.616s15.057 2.871 20.799 8.616l388.261 388.261c11.491 11.489 11.491 30.112 0.002 41.601zM372.427 712.734c-59.472 0-107.857-48.385-107.857-107.857s48.385-107.857 107.857-107.857c59.472 0 107.857 48.385 107.857 107.857s-48.385 107.857-107.857 107.857zM372.427 555.853c-27.032 0-49.024 21.992-49.024 49.026 0 27.032 21.992 49.024 49.024 49.024s49.026-21.992 49.026-49.024c-0.002-27.034-21.994-49.026-49.026-49.026zM607.748 398.972c-59.472 0-107.857-48.385-107.857-107.857s48.385-107.857 107.857-107.857c59.472 0 107.857 48.385 107.857 107.857s-48.385 107.857-107.857 107.857zM607.748 242.090c-27.032 0-49.026 21.992-49.026 49.024s21.992 49.024 49.026 49.024c27.032 0 49.024-21.992 49.024-49.024s-21.992-49.024-49.024-49.024z" />
|
29 |
+
<glyph unicode="" glyph-name="play" d="M483.043 356.403l110.517 63.003c7.559 4.309 10.193 13.93 5.884 21.488-1.346 2.361-3.28 4.334-5.615 5.727l-110.517 65.934c-7.472 4.458-17.143 2.014-21.6-5.458-1.456-2.441-2.225-5.229-2.225-8.071v-128.937c0-8.701 7.053-15.754 15.754-15.754 2.736 0 5.425 0.713 7.802 2.068zM1013.996 663.246c-0.016 0.086-0.034 0.189-0.034 0.275-0.426 3.219-10.754 79.539-43.493 115.38-38.492 43.495-81.149 47.877-104.073 50.223l-6.537 0.718c-137.563 10.806-345.469 11.986-348.2 12.004-2.082-0.018-209.989-1.198-348.304-12.090l-5.753-0.634c-22.924-2.346-65.565-6.73-103.901-50.035-32.893-36.028-43.237-112.332-43.697-115.842-0.104-0.875-10.004-88.547-10.004-175.073v-81.132c0-86.578 9.9-174.2 10.038-175.364 0.426-3.219 10.736-79.505 43.493-115.294 35.522-40.104 79.817-45.875 106.292-49.334 4.677-0.6 8.825-1.114 13.86-2.055 79.049-8.203 327.598-10.736 338.352-10.84 2.082 0 210.227 0.496 348.678 11.268l5.957 0.668c22.874 2.414 65.461 6.935 103.595 50.069 32.909 35.978 43.253 112.246 43.731 115.755 0.086 0.891 10.004 88.547 10.004 175.089v81.15c0 86.546-9.918 174.218-10.004 175.093zM725.248 415.928l-324.32-182.008c-2.594-1.455-5.463-2.191-8.329-2.191-2.986 0-5.975 0.789-8.637 2.346-5.223 3.082-8.431 8.699-8.431 14.777v372.492c0 6.13 3.277 11.815 8.569 14.863 5.343 3.048 11.846 2.996 17.121-0.086l324.32-190.484c5.291-3.098 8.501-8.801 8.449-14.932-0.070-6.146-3.399-11.781-8.741-14.777z" />
|
30 |
+
<glyph unicode="" glyph-name="plus" d="M426.667 512v362.667c0 35.346 28.654 64 64 64s64-28.654 64-64v-362.667h362.667c35.346 0 64-28.654 64-64s-28.654-64-64-64h-362.667v-362.667c0-35.346-28.654-64-64-64s-64 28.654-64 64v362.667h-362.667c-35.346 0-64 28.654-64 64s28.654 64 64 64h362.667z" />
|
31 |
+
<glyph unicode="" glyph-name="shopping-cart" d="M296.989 286.37h563.726c63.921 0 116.067 52.146 116.067 116.067v237.181c0 0.21 0 0.631 0 0.841 0 0.631 0 1.051 0 1.682 0 0.421 0 0.841-0.21 1.262 0 0.421-0.21 1.051-0.21 1.472s-0.21 0.841-0.21 1.262c-0.21 0.421-0.21 0.841-0.421 1.472-0.21 0.421-0.21 0.841-0.421 1.262s-0.21 0.841-0.421 1.262c-0.21 0.421-0.421 0.841-0.631 1.472-0.21 0.421-0.421 0.841-0.631 1.051-0.21 0.421-0.421 0.841-0.631 1.262s-0.421 0.631-0.631 1.051c-0.21 0.421-0.631 0.841-0.841 1.262s-0.421 0.631-0.841 1.051c-0.21 0.421-0.631 0.631-0.841 1.051s-0.631 0.631-0.841 1.051c-0.21 0.421-0.631 0.631-0.841 0.841-0.421 0.421-0.631 0.631-1.051 1.051-0.421 0.21-0.631 0.631-1.051 0.841s-0.841 0.631-1.262 0.841c-0.421 0.21-0.631 0.421-1.051 0.631s-0.841 0.421-1.262 0.841c-0.421 0.21-0.841 0.421-1.262 0.631s-0.841 0.421-1.262 0.631c-0.421 0.21-0.841 0.421-1.262 0.631s-0.841 0.21-1.262 0.421c-0.421 0.21-1.051 0.421-1.472 0.421s-0.841 0.21-1.051 0.21-1.051 0.21-1.682 0.21c-0.21 0-0.421 0.21-0.841 0.21l-714.487 98.615v99.667c0 1.051 0 2.103-0.21 2.944 0 0.21 0 0.421-0.21 0.841 0 0.631-0.21 1.262-0.21 1.892-0.21 0.631-0.21 1.051-0.421 1.682 0 0.421-0.21 0.631-0.21 1.051-0.21 0.631-0.421 1.262-0.631 1.892 0 0.21-0.21 0.631-0.21 0.841-0.21 0.631-0.421 1.051-0.841 1.682-0.21 0.21-0.21 0.631-0.421 0.841-0.21 0.421-0.421 0.841-0.841 1.262-0.21 0.421-0.421 0.631-0.631 1.051s-0.421 0.631-0.631 1.051c-0.21 0.421-0.631 0.841-0.841 1.262-0.21 0.21-0.421 0.421-0.631 0.631-0.421 0.421-0.841 0.841-1.262 1.262-0.21 0.21-0.421 0.421-0.631 0.631-0.421 0.421-0.841 0.841-1.472 1.262-0.21 0.21-0.631 0.421-0.841 0.631-0.421 0.421-0.841 0.631-1.262 1.051-0.631 0.421-1.262 0.841-1.682 1.051-0.21 0.21-0.421 0.21-0.631 0.421-0.841 0.421-1.892 0.841-2.733 1.262l-154.967 65.183c-14.508 6.098-31.12-0.631-37.217-15.139s0.631-31.12 15.139-37.217l137.515-58.034v-621.97c0-58.875 44.156-107.657 101.138-115.016-10.303-17.242-16.401-37.428-16.401-58.875 0-63.29 51.515-114.595 114.595-114.595s114.595 51.515 114.595 114.595c0 21.027-5.677 41.002-15.77 57.823h255.264c-10.093-17.032-15.77-36.797-15.77-57.823 0-63.29 51.515-114.595 114.595-114.595s114.595 51.515 114.595 114.595c0 63.080-51.515 114.595-114.595 114.595h-536.181c-32.802 0-59.295 26.704-59.295 59.295v76.958c17.242-10.093 37.638-15.98 59.295-15.98zM438.289 51.712c0-31.961-26.073-57.823-57.823-57.823s-57.823 26.073-57.823 57.823c0 31.75 26.073 57.823 57.823 57.823s57.823-25.863 57.823-57.823zM891.204 51.712c0-31.961-26.073-57.823-57.823-57.823s-57.823 26.073-57.823 57.823c0 31.75 26.073 57.823 57.823 57.823s57.823-25.863 57.823-57.823zM860.715 343.142h-563.726c-32.802 0-59.295 26.704-59.295 59.295v306.779l682.316-93.989v-212.58c0-33.012-26.704-59.506-59.295-59.506z" />
|
32 |
+
<glyph unicode="" glyph-name="star-full" d="M489.984 934.093c14.643 5.12 29.286 5.12 44.032 0 14.643-5.12 25.805-15.36 33.485-30.618l124.416-252.621 279.45-40.141c16.589-2.56 29.696-10.24 39.219-22.938 9.523-12.8 14.029-26.829 13.414-42.086-0.614-15.36-6.656-28.672-18.227-40.141l-202.854-197.222 47.821-279.45c2.56-15.36-0.307-29.696-8.602-43.11s-20.070-22.016-35.43-25.805c-15.36-3.789-30.003-1.946-44.032 5.734l-250.675 130.15-250.675-130.15c-14.029-7.68-28.672-9.523-44.032-5.734s-27.136 12.39-35.43 25.805c-8.294 13.414-11.162 27.75-8.602 43.11l47.821 279.45-202.854 197.12c-11.469 11.469-17.51 24.883-18.125 40.141-0.614 15.36 3.789 29.286 13.414 42.086 9.523 12.698 22.63 20.378 39.219 22.938l279.45 40.141 124.314 252.723c7.68 15.36 18.842 25.498 33.485 30.618z" />
|
33 |
+
<glyph unicode="" glyph-name="star-half" d="M1009.664 587.469c9.523-12.698 14.336-26.726 14.336-41.984s-6.349-28.672-19.149-40.141l-202.445-196.813 47.718-278.938c3.789-19.149-0.614-35.635-13.414-49.664-12.698-14.029-28.058-20.992-45.875-20.992-10.24 0-19.763 2.56-28.672 7.68l-250.163 129.843-250.266-129.843c-8.909-5.12-18.432-7.68-28.672-7.68-17.818 0-33.178 7.066-45.875 20.992-12.698 14.029-17.203 30.618-13.414 49.664l47.718 278.938-202.342 196.813c-12.8 11.469-19.149 24.781-19.149 40.038s4.813 29.286 14.336 41.984c9.523 12.698 22.016 20.378 37.274 22.938l280.883 40.141 124.109 252.211c6.349 11.469 14.336 20.070 23.859 25.805s20.070 8.602 31.539 8.602 22.016-2.867 31.539-8.602 17.51-14.336 23.859-25.805l124.211-252.211 280.883-41.984c15.258-1.229 27.648-8.294 37.171-20.992zM896 528.282l-265.523 38.195-118.477 240.64v-605.594l236.851-126.054-43.93 265.523 34.406 32.461 156.672 154.829z" />
|
34 |
+
<glyph unicode="" glyph-name="star-line" d="M1010.586 587.674c9.523-12.8 14.029-26.829 13.414-42.086-0.614-15.36-6.656-28.672-18.227-40.141l-202.854-197.12 47.821-279.45c2.56-15.36-0.307-29.696-8.602-43.11s-20.070-22.016-35.43-25.805c-15.36-3.789-30.003-1.946-44.032 5.734l-250.675 130.15-250.675-130.15c-14.029-7.68-28.672-9.523-44.032-5.734s-27.136 12.39-35.43 25.805c-8.294 13.414-11.162 27.75-8.602 43.11l47.821 279.45-202.854 197.12c-11.469 11.469-17.51 24.883-18.125 40.141-0.614 15.36 3.789 29.286 13.414 42.086 9.523 12.698 22.63 20.378 39.219 22.938l279.45 40.141 124.314 252.723c7.68 15.36 18.842 25.498 33.485 30.618s29.286 5.12 44.032 0c14.643-5.12 25.805-15.36 33.485-30.618l124.416-252.621 279.45-40.141c16.486-2.56 29.594-10.24 39.219-23.040zM896.717 528.384l-266.035 38.298-118.682 241.152-118.682-241.152-266.035-38.298 191.386-187.597-44.032-266.035 237.363 126.362 237.261-126.259-44.032 266.035 191.488 187.494z" />
|
35 |
+
<glyph unicode="" glyph-name="tumblr" d="M812.032 27.955c5.325-13.312 5.325-22.63 0-27.955-15.974-17.306-40.038-31.949-71.987-44.032-38.707-13.312-79.974-19.968-124.006-19.968-73.318 0-134.042 16.691-181.965 49.971-40.038 26.726-69.325 64-87.962 112.026-15.974 37.274-23.962 77.312-23.962 120.013v287.949h-94.003c-5.325 0-10.035 1.638-14.029 5.018-3.994 3.277-6.042 8.294-6.042 14.95v136.090c0 6.656 2.048 13.005 6.042 19.046s9.318 10.342 15.974 13.005c56.013 18.637 99.328 52.634 130.048 101.99 22.63 38.707 36.045 82.637 40.038 131.994 1.126 21.299 11.878 31.949 31.846 31.949h142.029c5.325 0 10.035-2.048 14.029-6.042s6.042-8.704 6.042-14.029v-229.99h165.99c5.325 0 10.035-2.048 14.029-6.042s6.042-8.704 6.042-14.029v-164.045c0-5.325-2.048-10.035-6.042-14.029s-8.704-6.042-14.029-6.042h-168.141v-266.035c0-36.045 11.981-61.338 36.045-75.981 23.962-14.643 57.344-13.312 100.045 3.994 11.981 5.325 20.992 6.963 27.034 5.018s10.342-6.963 13.005-14.95l43.93-129.843z" />
|
36 |
+
<glyph unicode="" glyph-name="twitter" d="M1024 765.952c-29.389-42.701-64.717-79.36-105.984-109.978 1.331-5.325 2.048-14.029 2.048-26.010 0-96.051-23.347-188.723-70.042-278.016-48.026-94.72-115.302-169.984-202.035-225.997-94.72-62.669-203.366-94.003-326.042-94.003-117.248 0.102-224.666 31.437-321.946 94.003 14.643-1.331 31.334-2.048 49.971-2.048 97.28 0 184.627 30.003 262.042 90.010-46.694 0-87.654 13.619-122.982 40.96s-59.699 61.645-73.011 103.014c13.312-1.331 26.010-2.048 37.99-2.048 18.637 0 37.274 2.048 56.013 6.042-48.026 10.65-87.962 35.328-120.013 74.035s-48.026 82.739-48.026 132.096v3.994c29.286-17.306 60.621-26.726 94.003-27.955-27.955 19.968-50.688 45.261-67.994 75.981-17.306 30.618-26.010 64.307-26.010 100.966s10.035 71.68 30.003 104.96c52.019-65.331 115.61-117.35 190.976-155.955 75.264-38.707 155.648-60.006 241.050-64-2.662 15.974-3.994 31.949-3.994 48.026 0 37.274 9.318 72.294 27.955 104.96s44.032 58.266 75.981 77.005c31.949 18.637 66.662 27.955 104.038 27.955 30.618 0 58.982-6.042 84.992-18.022s49.050-27.955 69.018-48.026c48.026 9.318 92.672 26.010 134.042 49.971-15.974-49.357-46.694-87.962-91.955-116.019 39.936 5.427 79.872 16.794 119.91 34.099v0z" />
|
37 |
+
<glyph unicode="" glyph-name="user" d="M511.109 485.445c64.001 0 119.413 22.946 164.702 68.218 45.274 45.265 68.236 100.649 68.236 164.634 0 63.962-22.954 119.354-68.243 164.634-45.289 45.258-100.701 68.203-164.695 68.203-64.008 0-119.413-22.946-164.695-68.211s-68.243-100.657-68.243-164.626c0-63.984 22.962-119.376 68.243-164.641 45.296-45.258 100.709-68.211 164.695-68.211zM386.494 842.866c34.745 34.732 75.504 51.615 124.615 51.615 49.104 0 89.87-16.883 124.622-51.615 34.745-34.74 51.642-75.491 51.642-124.569 0-49.093-16.897-89.836-51.642-124.576-34.753-34.74-75.519-51.623-124.622-51.623-49.096 0-89.855 16.89-124.615 51.623-34.753 34.732-51.649 75.483-51.649 124.576 0 49.078 16.897 89.829 51.649 124.569zM918.688 207.749c-1.306 18.838-3.947 39.386-7.836 61.086-3.925 21.862-8.98 42.528-15.030 61.418-6.257 19.524-14.75 38.804-25.264 57.28-10.898 19.177-23.707 35.876-38.080 49.617-15.030 14.375-33.432 25.933-54.711 34.364-21.206 8.386-44.706 12.635-69.845 12.635-9.872 0-19.42-4.049-37.859-16.050-11.348-7.398-24.622-15.954-39.438-25.417-12.669-8.069-29.831-15.629-51.030-22.474-20.682-6.69-41.681-10.083-62.414-10.083-20.719 0-41.718 3.393-62.414 10.083-21.176 6.837-38.346 14.397-50.993 22.466-14.676 9.375-27.957 17.93-39.475 25.432-18.424 12-27.972 16.050-37.844 16.050-25.146 0-48.639-4.256-69.837-12.649-21.265-8.416-39.674-19.973-54.719-34.364-14.373-13.748-27.182-30.44-38.073-49.609-10.5-18.476-19-37.749-25.257-57.287-6.043-18.889-11.097-39.549-15.023-61.41-3.896-21.67-6.53-42.226-7.836-61.108-1.284-18.461-1.933-37.675-1.933-57.088 0-50.465 16.048-91.319 47.694-121.449 31.255-29.732 72.604-44.808 122.903-44.808h465.67c50.284 0 91.633 15.076 122.896 44.808 31.654 30.108 47.702 70.977 47.702 121.456-0.007 19.479-0.664 38.693-1.955 57.103zM833.865 70.235c-20.652-19.649-48.071-29.201-83.827-29.201h-465.663c-35.763 0-63.182 9.552-83.827 29.193-20.254 19.273-30.097 45.582-30.097 80.41 0 18.115 0.598 36.001 1.793 53.172 1.166 16.846 3.549 35.352 7.083 55.016 3.49 19.42 7.932 37.646 13.215 54.145 5.069 15.821 11.983 31.487 20.556 46.578 8.183 14.383 17.598 26.722 27.987 36.665 9.717 9.301 21.966 16.913 36.398 22.621 13.348 5.281 28.348 8.172 44.632 8.607 1.985-1.055 5.519-3.068 11.245-6.8 11.651-7.59 25.079-16.249 39.925-25.727 16.734-10.665 38.294-20.298 64.053-28.61 26.334-8.512 53.191-12.834 79.85-12.834s53.523 4.322 79.842 12.826c25.78 8.327 47.333 17.953 64.089 28.633 15.192 9.706 28.245 18.115 39.895 25.712 5.726 3.725 9.26 5.746 11.245 6.8 16.292-0.435 31.292-3.326 44.647-8.607 14.425-5.709 26.673-13.328 36.391-22.621 10.389-9.935 19.804-22.275 27.987-36.672 8.581-15.083 15.502-30.757 20.564-46.563 5.29-16.522 9.74-34.74 13.222-54.145 3.527-19.701 5.918-38.214 7.083-55.030v-0.015c1.203-17.104 1.808-34.983 1.815-53.15-0.007-34.836-9.85-61.137-30.104-80.403z" />
|
38 |
+
<glyph unicode="" glyph-name="youtube" d="M1013.828 684.614c-0.016 0.086-0.034 0.188-0.034 0.274-0.426 3.208-10.752 79.274-43.486 114.996-38.486 43.35-81.136 47.718-104.056 50.056l-6.536 0.716c-137.54 10.77-345.412 11.946-348.142 11.964-2.082-0.018-209.954-1.194-348.246-12.050l-5.752-0.632c-22.92-2.338-65.554-6.708-103.884-49.868-32.888-35.908-43.23-111.958-43.69-115.456-0.104-0.872-10.002-88.252-10.002-174.49v-80.862c0-86.29 9.898-173.62 10.036-174.78 0.426-3.208 10.734-79.24 43.486-114.91 35.516-39.97 79.804-45.722 106.274-49.17 4.676-0.598 8.824-1.11 13.858-2.048 79.036-8.176 327.544-10.7 338.296-10.804 2.082 0 210.192 0.494 348.62 11.23l5.956 0.666c22.87 2.406 65.45 6.912 103.578 49.902 32.904 35.858 43.246 111.872 43.724 115.37 0.086 0.888 10.002 88.252 10.002 174.506v80.88c0 86.258-9.916 173.638-10.002 174.51zM725.128 438.12l-324.266-181.402c-2.594-1.45-5.462-2.184-8.328-2.184-2.986 0-5.974 0.786-8.636 2.338-5.222 3.072-8.43 8.67-8.43 14.728v371.252c0 6.11 3.276 11.776 8.568 14.814 5.342 3.038 11.844 2.986 17.118-0.086l324.266-189.85c5.29-3.088 8.5-8.772 8.448-14.882-0.070-6.126-3.398-11.742-8.74-14.728z" />
|
39 |
+
<glyph unicode="" glyph-name="spinner" d="M669.491 810.803c0-76.288-61.952-138.24-138.24-138.24-76.39 0-138.24 61.952-138.24 138.24 0 76.39 61.952 138.342 138.24 138.342s138.24-62.054 138.24-138.342zM531.354 100.352c-42.496 0.102-77.005-34.304-77.21-76.902-0.102-42.598 34.202-77.21 76.8-77.312s77.21 34.202 77.21 76.8c0.205 42.803-34.202 77.312-76.8 77.414zM924.979 467.354c-27.853 0-50.381-22.426-50.381-50.278 0-27.75 22.426-50.381 50.381-50.381 27.75 0 50.278 22.528 50.278 50.381 0 27.75-22.528 50.278-50.278 50.278zM225.382 417.075c0 48.64-39.322 87.962-87.962 87.962s-87.962-39.424-87.962-87.962 39.322-87.962 87.962-87.962 87.962 39.322 87.962 87.962zM837.632 667.341c15.462 15.565 15.462 40.755 0 56.218-15.462 15.565-40.448 15.462-55.91 0-15.462-15.565-15.462-40.755 0-56.218 15.565-15.565 40.55-15.565 55.91 0zM188.826 202.445c-35.328-35.123-35.328-92.365 0-127.59s92.57-35.226 127.795 0c35.43 35.123 35.43 92.262 0.102 127.488-35.328 35.123-92.57 35.123-127.898 0.102zM773.222 175.206c-20.173-20.275-20.173-53.146 0-73.421 20.378-20.173 53.043-20.173 73.216 0.102s20.173 53.146-0.102 73.421c-20.173 20.173-52.941 20.173-73.114-0.102zM186.982 761.549c-36.454-36.454-36.454-95.642 0-132.198s95.539-36.454 131.994 0c36.454 36.454 36.454 95.642 0 132.198-36.454 36.454-95.539 36.454-131.994 0z" />
|
40 |
+
<glyph unicode="" glyph-name="file" d="M659.821 954.086c-4.695 4.945-11.133 7.914-17.805 7.914h-399.462c-73.711 0-134.555-60.602-134.555-134.305v-755.384c0-73.711 60.844-134.313 134.555-134.313h542.173c73.711 0 134.555 60.602 134.555 134.313v599.806c0 6.43-2.969 12.609-7.172 17.313zM666.992 874.687l168.938-177.344h-109.821c-32.648 0-59.117 26.219-59.117 58.867zM784.727-12.533h-542.173c-46.25 0-85.086 38.336-85.086 84.844v755.384c0 46.25 38.586 84.836 85.086 84.836h374.969v-156.321c0-60.102 48.484-108.336 108.586-108.336h143.703v-575.564c0-46.508-38.586-84.844-85.086-84.844zM717.204 158.131h-407.126c-13.602 0-24.734-11.125-24.734-24.734 0-13.602 11.133-24.734 24.734-24.734h407.376c13.602 0 24.734 11.133 24.734 24.734 0 13.609-11.133 24.734-24.984 24.734zM495.586 246.928c4.703-4.945 11.133-7.914 18.055-7.914 6.93 0 13.359 2.969 18.055 7.914l144.946 155.578c9.398 9.898 8.656 25.727-1.234 34.875-9.898 9.398-25.727 8.664-34.875-1.234l-102.156-109.571v270.094c0 13.609-11.133 24.734-24.734 24.734s-24.734-11.125-24.734-24.734v-270.094l-101.906 109.571c-9.398 9.891-24.984 10.633-34.875 1.234s-10.633-24.984-1.234-34.875z" />
|
41 |
+
<glyph unicode="" glyph-name="doubt" d="M916.676 896.179h-809.352c-59.298 0-107.324-48.048-107.324-107.324v-530.376c0-59.298 48.048-107.28 107.324-107.28h614.912l118.111-119.523c20.582-20.781 48.246-31.855 76.373-31.855 13.677 0 27.576 2.603 40.768 8.030 40.238 16.545 66.534 55.747 66.534 99.272v681.733c-0.022 59.298-48.070 107.324-107.346 107.324zM560.334 306.902c0-36.841-28.392-65.277-66.733-65.277-38.385 0-66.777 28.436-66.777 65.277v1.522c0 36.797 28.414 65.233 66.777 65.233 38.341 0 66.733-28.436 66.733-65.233v-1.522zM694.638 629.91c0-97.397-67.549-137.37-151.202-154.202l-2.294-13.81c-3.111-19.921-19.17-37.613-41.429-37.613h-6.111c-22.259 0-38.385 16.964-41.474 37.613l-7.655 52.173c-3.839 25.347 10.743 42.974 35.319 46.062 66.733 8.427 97.441 29.186 97.441 66.799v1.456c0 34.502-26.097 54.511-70.615 54.511-33.002 0-61.394-9.993-89.014-30.708-9.221-6.905-21.509-12.31-34.525-12.31-29.164 0-53.761 24.597-53.761 53.739 0 14.648 6.155 29.936 19.965 41.452 40.679 33.797 92.102 55.328 159.629 55.328 110.501 0 185.705-56.872 185.705-158.945v-1.544h0.022z" />
|
42 |
+
<glyph unicode="" glyph-name="angle-down" d="M472.064 154.931l-455.68 455.68c-10.854 10.957-16.384 24.269-16.384 39.936s5.53 28.979 16.486 39.936l51.712 51.712c10.957 10.957 24.269 16.794 39.936 17.613s28.979-4.301 39.936-15.258l363.93-364.134 364.032 364.032c10.957 10.957 24.269 16.077 39.936 15.258s28.979-6.656 39.936-17.613l51.712-51.712c10.957-10.957 16.486-24.269 16.486-39.936s-5.53-28.979-16.486-39.936l-455.68-455.68c-10.957-12.595-24.269-18.739-39.936-18.739-15.667 0.102-28.979 6.349-39.936 18.842z" />
|
43 |
+
<glyph unicode="" glyph-name="angle-left" d="M218.931 487.936l455.68 455.68c10.957 10.854 24.269 16.384 39.936 16.384s28.979-5.53 39.936-16.486l51.712-51.712c10.957-10.957 16.794-24.269 17.613-39.936s-4.301-28.979-15.258-39.936l-364.134-363.93 364.032-364.032c10.957-10.957 16.077-24.269 15.258-39.936s-6.656-28.979-17.613-39.936l-51.712-51.712c-10.957-10.957-24.269-16.486-39.936-16.486s-28.979 5.53-39.936 16.486l-455.68 455.68c-12.595 10.957-18.739 24.269-18.739 39.936 0.102 15.667 6.349 28.979 18.842 39.936z" />
|
44 |
+
<glyph unicode="" glyph-name="default" d="M938.6 721h-170.6c-28.2 0-51.2 23-51.2 51.2v85.4c0 9.4-7.6 17-17 17s-17-7.6-17-17v-85.4c0-47 38.2-85.4 85.4-85.4h153.6v-665.6c0-28.2-23-51.2-51.2-51.2h-717c-28.2 0-51.2 23-51.2 51.2v853.4c0 28.2 23 51.2 51.2 51.2h539l165.6-165.6c6.6-6.6 17.4-6.6 24.2 0 6.6 6.6 6.6 17.4 0 24.2l-170.6 170.6c-3.2 3.2-7.6 5-12 5h-546.2c-47 0-85.4-38.2-85.4-85.4v-853.4c0-47 38.2-85.4 85.4-85.4h716.8c47 0 85.4 38.2 85.4 85.4v682.8c0 9.4-7.8 17-17.2 17z" />
|
45 |
+
<glyph unicode="" glyph-name="artboard" d="M426.666 379.734h136.534c9.438 0 17.066 7.646 17.066 17.066s-7.628 17.066-17.066 17.066h-136.534c-9.438 0-17.066-7.646-17.066-17.066s7.628-17.066 17.066-17.066zM938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.628 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.526 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.63 17.066-17.068 17.066zM426.666 311.466h170.666c9.438 0 17.066 7.646 17.066 17.066s-7.628 17.066-17.066 17.066h-170.666c-9.438 0-17.066-7.646-17.066-17.066s7.628-17.066 17.066-17.066zM512 550.4c-9.438 0-17.066-7.646-17.066-17.066v-17.066h-170.666c-9.438 0-17.066-7.646-17.066-17.066v-273.066c0-9.42 7.628-17.066 17.066-17.066h125.986l-38.86-77.704c-4.216-8.43-0.786-18.67 7.646-22.904 2.44-1.212 5.052-1.792 7.612-1.792 6.264 0 12.288 3.448 15.292 9.438l46.472 92.962h47.172l46.472-92.962c3.004-5.99 9.028-9.438 15.292-9.438 2.56 0 5.172 0.58 7.612 1.792 8.43 4.232 11.862 14.472 7.646 22.904l-38.86 77.704h125.986c9.438 0 17.066 7.646 17.066 17.066v273.064c0 9.42-7.628 17.066-17.066 17.066h-170.666v17.066c-0.004 9.422-7.632 17.068-17.070 17.068zM682.666 482.134v-238.934h-341.332v238.934h341.332z" />
|
46 |
+
<glyph unicode="" glyph-name="clipboard" d="M512.484 905.508c-35.109 0-63.672-28.563-63.672-63.672 0-35.117 28.563-63.688 63.672-63.688 35.117 0 63.688 28.57 63.688 63.688 0 35.109-28.57 63.672-63.688 63.672zM512.484 875.094c12.859 0 24.023-7.344 29.555-18.047h-59.094c5.531 10.703 16.68 18.047 29.539 18.047zM512.484 808.562c-12.859 0-24.016 7.359-29.547 18.070h59.109c-5.539-10.711-16.695-18.070-29.563-18.070zM897.743 555.905c8.398 0 15.211 6.813 15.211 15.211v193.321c0 51.070-41.547 92.61-92.61 92.61h-86.75c-4.313 21.359-23.234 37.492-45.844 37.492h-67.281c-19.969 40.75-62.102 67.461-107.985 67.461-45.875 0-88.008-26.711-107.977-67.461h-67.281c-22.617 0-41.531-16.133-45.844-37.492h-86.781c-51.063 0-92.602-41.539-92.602-92.602v-733.837c0-51.063 41.539-92.61 92.602-92.61h615.743c51.063 0 92.61 41.547 92.61 92.61v479.673c0 8.398-6.813 15.211-15.211 15.211s-15.203-6.813-15.203-15.211v-479.673c0-34.297-27.898-62.195-62.195-62.195h-615.743c-34.289 0-62.188 27.898-62.188 62.195v733.83c0 34.297 27.898 62.195 62.188 62.195h85.852v-65.922h-57.797c-8.398 0-15.211-6.813-15.211-15.211v-669.15c0-8.398 6.813-15.211 15.211-15.211h50.484c8.398 0 15.203 6.813 15.203 15.211s-6.805 15.203-15.203 15.203h-35.274v638.736h42.586v-45.625c0-8.398 6.805-15.203 15.203-15.203h413.657c8.398 0 15.211 6.805 15.211 15.203v45.625h42.578v-638.736h-433.134c-8.398 0-15.203-6.805-15.203-15.203s6.805-15.211 15.203-15.211h448.345c8.398 0 15.203 6.813 15.203 15.211v669.15c0 8.398-6.805 15.211-15.203 15.211h-57.789v65.922h85.82c34.297 0 62.195-27.898 62.195-62.188v-193.328c0-8.398 6.805-15.211 15.203-15.211zM320.867 699.874v147.891c0 9.023 7.336 16.359 16.359 16.359h77.227c6.305 0 11.953 3.883 14.203 9.773 13.211 34.5 46.899 57.688 83.828 57.688 36.938 0 70.625-23.188 83.836-57.688 2.25-5.891 7.898-9.773 14.203-9.773h77.227c9.016 0 16.359-7.336 16.359-16.359v-147.891zM315.789 539.687h393.384c8.398 0 15.203 6.813 15.203 15.211s-6.805 15.203-15.203 15.203h-393.384c-8.398 0-15.211-6.805-15.211-15.203s6.813-15.211 15.211-15.211zM315.789 422.077h393.384c8.398 0 15.203 6.813 15.203 15.211s-6.805 15.203-15.203 15.203h-393.384c-8.398 0-15.211-6.805-15.211-15.203s6.813-15.211 15.211-15.211zM315.789 304.467h393.384c8.398 0 15.203 6.813 15.203 15.211s-6.805 15.211-15.203 15.211h-393.384c-8.398 0-15.211-6.813-15.211-15.211s6.813-15.211 15.211-15.211zM315.789 186.858h393.384c8.398 0 15.203 6.813 15.203 15.211s-6.805 15.211-15.203 15.211h-393.384c-8.398 0-15.211-6.813-15.211-15.211s6.813-15.211 15.211-15.211z" />
|
47 |
+
<glyph unicode="" glyph-name="audio" d="M938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.544 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066zM631.466 311.466c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066c-47.052 0-85.334-38.28-85.334-85.334 0-47.052 38.28-85.334 85.334-85.334 47.052 0 85.334 38.28 85.334 85.334v307.2c0 5.256-2.424 10.222-6.57 13.448-4.13 3.242-9.574 4.404-14.644 3.106l-273.066-68.264c-7.594-1.894-12.92-8.722-12.92-16.554v-307.2c0-28.228-22.972-51.2-51.2-51.2s-51.2 22.972-51.2 51.2 22.972 51.2 51.2 51.2c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066c-47.052 0-85.334-38.28-85.334-85.334 0-47.052 38.28-85.334 85.334-85.334 47.052 0 85.334 38.28 85.334 85.334v293.872l238.934 59.734v-285.338c0-28.228-22.972-51.2-51.2-51.2s-51.2 22.972-51.2 51.2 22.97 51.2 51.198 51.2z" />
|
48 |
+
<glyph unicode="" glyph-name="professor" d="M689.875 269.445c16.836 16.836 30.945 35.664 42.148 55.938 4.539-1.313 9.32-2.016 14.336-2.016 46.242 0 87.391 57.938 87.391 103.609 0 25.305-8.977 46.938-23.977 61.75v121.711c0 8.406-6.813 15.219-15.227 15.219-8.406 0-15.219-6.813-15.219-15.219v-103.789c-5.25 1.547-10.781 2.547-16.539 2.945v100.047c0 8.406-6.813 15.227-15.227 15.227-8.406 0-15.227-6.82-15.227-15.227v-16.469c-59.438 3.914-274.242 26.172-384.321 146.047-1.258 1.359-2.758 2.492-4.414 3.32-6.234 3.117-13.789 1.602-18.344-3.68-38.875-45.094-60.289-102.774-60.289-162.414v-66.844c-4.43-0.313-8.727-0.969-12.859-1.969v250.039c0 16.305 7.523 31.195 20.641 40.875 13.109 9.68 29.57 12.469 45.141 7.664 8-2.469 16.5 1.984 19.008 9.977 13.594 43.203 43.578 77.766 84.422 97.328s86.57 21.258 128.75 4.758l102.477-40.070c37.516-14.664 69.344-40 92.063-73.273 22.711-33.266 34.719-72.141 34.719-112.422v-35.383c0-8.406 6.813-15.227 15.219-15.227 8.414 0 15.227 6.82 15.227 15.227v35.383c0 46.438-13.836 91.242-40.016 129.594-26.18 38.344-62.883 67.555-106.125 84.461l-102.477 40.070c-50.117 19.602-104.453 17.594-152.992-5.656-44.344-21.234-77.914-57.359-95.695-102.586-20.383 2.492-40.836-2.828-57.805-15.344-20.977-15.477-33.008-39.305-33.008-65.375v-265.555c-17.195-14.797-27.656-37.836-27.656-65.141 0-45.672 41.148-103.609 87.391-103.609 5.016 0 9.797 0.695 14.336 2.016 11.203-20.281 25.313-39.117 42.148-55.945 5.945-5.945 15.586-5.945 21.523 0 5.953 5.945 5.953 15.586 0 21.523-41.258 41.266-63.984 96.117-63.984 154.469v40.313h11.422c7.313-45.43 46.781-80.25 94.242-80.25 49.781 0 90.758 38.305 95.070 86.984 11.078 5.875 24.383 5.875 35.461 0 4.313-48.68 45.289-86.977 95.070-86.977 47.453 0 86.922 34.813 94.234 80.242h11.422v-40.313c0-58.336-22.727-113.188-63.992-154.453-41.25-41.266-96.109-63.992-154.477-63.992-43.773 0-86.008 12.898-122.125 37.297-6.969 4.711-16.43 2.875-21.133-4.086-4.711-6.969-2.883-16.438 4.086-21.141 17.828-12.047 36.969-21.617 56.977-28.617v-56.102l-153.477-88.977c-3.508-2.039-6.063-5.398-7.094-9.328l-26.391-100.953c-2.125-8.133 2.75-16.453 10.883-18.578 1.289-0.336 2.586-0.5 3.859-0.5 6.758 0 12.93 4.539 14.719 11.375l24.781 94.82 88.516 51.313 17.414-86.945c1.023-5.102 4.578-9.32 9.422-11.203 4.852-1.883 10.32-1.156 14.516 1.922l39.625 29.078 32.844-48.367c2.828-4.172 7.547-6.672 12.594-6.672s9.766 2.5 12.594 6.672l32.836 48.344 39.594-29.055c2.648-1.945 5.813-2.953 9.008-2.953 1.852 0 3.719 0.336 5.5 1.031 4.852 1.883 8.406 6.109 9.422 11.203l17.422 86.953 88.516-51.32 24.781-94.813c1.789-6.844 7.961-11.383 14.719-11.383 1.281 0 2.57 0.164 3.859 0.5 8.141 2.133 13.008 10.445 10.883 18.586l-26.391 100.953c-1.031 3.922-3.578 7.281-7.094 9.32l-153.43 88.953v56.078c34.898 12.172 66.883 32.141 93.774 59.055zM803.297 426.976c0-30.219-29.445-73.164-56.938-73.164-0.313 0-0.609 0.023-0.914 0.031 4.406 11.148 8 22.617 10.742 34.344 3.406 12.195 12.453 31.641 22.266 31.641 8.406 0 15.227 6.82 15.227 15.227s-6.82 15.227-15.227 15.227c-5.789 0-10.984-1.211-15.664-3.25v31.961c20.477-2.609 40.508-19.133 40.508-52.016zM281.39 353.812c-27.492 0-56.938 42.945-56.938 73.164 0 32.891 20.039 49.406 40.516 52.016v-31.969c-4.68 2.047-9.883 3.258-15.672 3.258-8.406 0-15.227-6.82-15.227-15.227s6.82-15.227 15.227-15.227c9.844 0 18.914-19.563 22.297-31.75 2.742-11.688 6.32-23.125 10.711-34.234-0.305-0.008-0.602-0.031-0.914-0.031zM401.078 435.945c-35.852 0-65.016 29.172-65.016 65.023 0 23.484 10.633 37.078 65.016 37.078s65.016-13.594 65.016-37.078c0-35.852-29.164-65.023-65.016-65.023zM626.68 435.945c-35.852 0-65.016 29.172-65.016 65.023 0 23.484 10.641 37.078 65.016 37.078s65.016-13.594 65.016-37.078c0-35.852-29.164-65.023-65.016-65.023zM720.774 516.187c-9.734 52.266-70.117 52.313-94.094 52.313-22.695 0-78.055-0.031-92.141-44.391-13.438 4.266-27.883 4.266-41.32 0-14.086 44.367-69.438 44.391-92.141 44.391-23.969 0-84.359-0.047-94.094-52.313h-11.563v60.258c0 46.742 14.984 92.117 42.492 129.477 57.594-56.188 141.93-97.313 251.024-122.352 63.914-14.672 118.234-19.438 143.399-20.953v-46.43zM415.297 109.64l20.047 11.625c6.805-21.961 22.586-40.016 43.039-49.844l-48.328-35.469zM513.891 13.648l-20.875 30.734 20.852 15.305 20.883-15.32zM597.68 35.952l-48.313 35.453c20.461 9.828 36.25 27.875 43.063 49.836l20.016-11.602zM565.656 146.499c-0.031-0.523-0.039-1.055-0.016-1.578-0.352-28.25-23.422-51.125-51.773-51.125-28.531 0-51.742 23.227-51.742 51.766v56.398c16.883-3.57 34.203-5.43 51.742-5.43 17.617 0 34.945 1.836 51.789 5.383zM366.703 325.218c0-8.406 6.82-15.227 15.227-15.227h73.078c23.977 0 45.32 11.461 58.875 29.172 13.547-17.711 34.891-29.172 58.867-29.172h73.078c8.414 0 15.227 6.82 15.227 15.227 0 40.859-33.242 74.094-74.094 74.094h-36.766c4.68 5.977 4.281 14.641-1.219 20.141-5.945 5.945-15.586 5.945-21.531 0-3.625-3.625-8.445-5.617-13.57-5.617s-9.945 1.992-13.57 5.617c-5.945 5.945-15.586 5.945-21.531 0-5.5-5.5-5.898-14.164-1.219-20.141h-36.758c-40.852 0-74.094-33.234-74.094-74.094zM455.008 340.445h-55.109c6.188 16.578 22.188 28.422 40.898 28.422h55.117c-6.195-16.586-22.195-28.422-40.906-28.422zM627.867 340.445h-55.117c-18.711 0-34.711 11.836-40.906 28.422h55.117c18.711 0 34.711-11.844 40.906-28.422z" />
|
49 |
+
<glyph unicode="" glyph-name="interactive" d="M593.442 382.924c-6.656-6.674-6.656-17.476 0-24.15 3.344-3.328 7.714-5 12.066-5 4.37 0 8.738 1.672 12.084 5l77.142 77.158c18.568 18.568 33.894 58.504 0 92.398-33.622 33.622-73.626 18.484-92.398 0l-77.158-77.142c-6.656-6.674-6.656-17.476 0-24.15 6.674-6.656 17.476-6.656 24.15 0l76.954 76.97c5.342 5.102 24.354 20.156 44.322 0.188 20.122-20.138 5.018-38.946 0-44.134l-77.162-77.138zM938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.544 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066zM443.734 345.6c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066c18.824 0 34.134-15.308 34.134-34.134 0-9.42 7.646-17.066 17.066-17.066s17.066 7.646 17.066 17.066c0 37.648-30.618 68.266-68.266 68.266zM443.734 413.866c-75.282 0-136.534-61.252-136.534-136.534v-119.466c0-9.42 7.646-17.066 17.066-17.066h119.466c75.282 0 136.534 61.252 136.534 136.534 0 75.28-61.252 136.532-136.532 136.532zM443.734 174.934h-102.4v102.4c0 56.474 45.926 102.4 102.4 102.4s102.4-45.926 102.4-102.4c0-56.474-45.928-102.4-102.4-102.4z" />
|
50 |
+
<glyph unicode="" glyph-name="graduate" d="M432.86 267.812v16.883c0 8.391-6.805 15.195-15.195 15.195-8.398 0-15.195-6.805-15.195-15.195v-16.883c0-8.391 6.797-15.195 15.195-15.195 8.391 0 15.195 6.805 15.195 15.195zM598.65 299.89c-8.391 0-15.195-6.805-15.195-15.195v-16.883c0-8.391 6.805-15.195 15.195-15.195 8.398 0 15.195 6.805 15.195 15.195v16.883c0 8.391-6.805 15.195-15.195 15.195zM508.157 201.414c12.688 0 25.375 4.828 35.031 14.484 5.938 5.93 5.938 15.555 0 21.484-5.938 5.938-15.555 5.938-21.484 0-7.477-7.461-19.617-7.469-27.094 0-5.93 5.938-15.547 5.938-21.484 0-5.938-5.93-5.938-15.555 0-21.484 9.656-9.656 22.344-14.484 35.031-14.484zM591.228 183.406h-166.133c-8.398 0-15.195-6.805-15.195-15.195 0-54.18 44.078-98.258 98.258-98.258s98.266 44.078 98.266 98.258c0 8.391-6.805 15.195-15.195 15.195zM508.157 100.335c-32.203 0-59.234 22.547-66.156 52.68h132.313c-6.914-30.133-33.953-52.68-66.156-52.68zM434.134 334.062c2.969-2.969 6.859-4.453 10.75-4.453 3.883 0 7.773 1.484 10.742 4.453 5.938 5.938 5.938 15.555 0 21.484-20.93 20.938-54.992 20.938-75.93 0-5.93-5.93-5.93-15.555 0-21.484 5.938-5.938 15.555-5.938 21.492 0 9.078 9.086 23.859 9.086 32.945 0zM598.65 371.273c-14.336 0-27.82-5.578-37.961-15.727-5.938-5.93-5.938-15.555 0-21.484 5.938-5.938 15.555-5.938 21.492 0 4.398 4.398 10.25 6.82 16.469 6.82 6.227 0 12.078-2.422 16.477-6.82 2.969-2.969 6.859-4.453 10.742-4.453 3.891 0 7.781 1.484 10.75 4.453 5.938 5.938 5.938 15.555 0 21.484-10.148 10.148-23.625 15.727-37.969 15.727zM1012.221 709.594l-133.086 50.742c-7.836 2.984-16.617-0.945-19.609-8.789-2.992-7.836 0.945-16.617 8.781-19.609l95.844-36.539-160.68-61.258v41.469c0 6.938-4.695 12.992-11.414 14.719-184.524 47.375-379.595 47.375-564.118 0-6.719-1.727-11.422-7.781-11.422-14.719v-41.461l-160.664 61.25 454.142 173.149 299.813-114.305c7.828-2.992 16.617 0.938 19.609 8.781s-0.945 16.625-8.781 19.609l-305.227 116.375c-3.492 1.328-7.344 1.328-10.828 0l-496.798-189.414c-5.891-2.25-9.781-7.898-9.781-14.195 0-6.305 3.891-11.953 9.781-14.203l208.735-79.578 0.008-216.196c0-8.391 6.797-15.195 15.195-15.195 8.391 0 15.195 6.805 15.195 15.195v85.367c12.367 3.031 24.781 5.867 37.242 8.469-16.031-33.344-24.422-69.93-24.422-107.477v-66.711c-4.414-0.313-8.695-0.969-12.82-1.961v21.531c0 8.398-6.805 15.195-15.195 15.195-8.398 0-15.195-6.797-15.195-15.195v-37.008c-17.172-14.766-27.609-37.766-27.609-65.024 0-45.578 41.063-103.406 87.219-103.406 5.055 0 9.867 0.719 14.445 2.055 42.352-76.633 123.992-128.641 217.563-128.641 66.383 0 128.766 25.844 175.664 72.766 16.805 16.805 30.883 35.594 42.063 55.836 4.531-1.313 9.305-2.008 14.305-2.008 46.156 0 87.227 57.82 87.227 103.406 0 25.242-8.961 46.836-23.93 61.625v317.383l59.727 22.766v-216.977c-20.594-6.469-35.57-25.734-35.57-48.43 0-27.992 22.773-50.766 50.766-50.766 27.984 0 50.758 22.773 50.758 50.766 0 22.695-14.977 41.961-35.563 48.43v228.555l118.633 45.227c5.891 2.25 9.781 7.898 9.781 14.203 0 6.297-3.891 11.953-9.781 14.195zM756.572 305.062v67.391c0 0.008 0.008 0.023 0.008 0.039v32.414c0 8.391-6.805 15.195-15.195 15.195-8.398 0-15.195-6.805-15.195-15.195v-16.438c-52.242 3.43-224.907 21.055-340.376 107.071 129.196 14.563 260.657 6.305 387.274-24.758v-168.664c-5.242 1.547-10.766 2.547-16.516 2.945zM246.907 663.758c172.383 42.281 353.79 42.281 526.173 0v-161.68c-86.281 20.563-174.672 30.836-263.086 30.836-88.406 0-176.805-10.273-263.079-30.836zM276.133 149.585c-27.438 0-56.828 42.859-56.828 73.024 0 32.82 20 49.305 40.43 51.914v-31.906c-4.664 2.039-9.859 3.25-15.633 3.25-8.398 0-15.195-6.805-15.195-15.195s6.797-15.195 15.195-15.195c10.445 0 20.016-22.078 22.82-33.899 0.023-0.094 0.063-0.18 0.086-0.273 2.688-10.852 6.086-21.438 10.148-31.68-0.336-0.016-0.672-0.039-1.023-0.039zM662.314 86.859c-41.156-41.18-95.914-63.86-154.164-63.86-120.219 0-218.024 97.805-218.024 218.016v130.758c0 40.859 11.289 80.406 32.672 114.821 7.188 1.234 14.383 2.375 21.586 3.469 73.836-65.188 176.078-97.75 249.711-113.633 59-12.719 108.446-17.031 132.094-18.453v-116.961c0-58.219-22.688-112.961-63.875-154.157zM740.181 149.585c-0.313 0-0.609 0.023-0.914 0.031 4.406 11.133 7.992 22.594 10.734 34.305 3.406 12.172 12.422 31.555 22.211 31.555 8.391 0 15.195 6.805 15.195 15.195s-6.805 15.195-15.195 15.195c-5.781 0-10.969-1.211-15.641-3.25v31.906c20.438-2.609 40.438-19.094 40.438-51.914 0-30.164-29.391-73.024-56.828-73.024zM878.392 338.601c-11.234 0-20.375 9.141-20.375 20.367 0 11.234 9.141 20.375 20.375 20.375s20.367-9.141 20.367-20.375c0-11.227-9.133-20.367-20.367-20.367z" />
|
51 |
+
<glyph unicode="" glyph-name="student" d="M461.883 559.266c-2.070 8.148-10.359 13.062-18.508 10.992l-69.023-17.594c-8.148-2.078-13.070-10.367-10.992-18.516 1.758-6.891 7.945-11.469 14.742-11.469 1.242 0 2.508 0.156 3.773 0.477l69.016 17.594c8.148 2.078 13.070 10.367 10.992 18.516zM572.851 540.751l69.023-17.594c1.258-0.328 2.523-0.477 3.773-0.477 6.789 0 12.984 4.578 14.742 11.469 2.070 8.148-2.844 16.43-10.992 18.508l-69.023 17.594c-8.156 2.078-16.437-2.844-18.516-10.992s2.844-16.43 10.992-18.508zM405.977 489.188v-16.914c0-8.406 6.812-15.227 15.227-15.227 8.406 0 15.219 6.82 15.219 15.227v16.914c0 8.406-6.812 15.227-15.219 15.227-8.414 0-15.227-6.82-15.227-15.227zM602.547 504.415c-8.406 0-15.227-6.82-15.227-15.227v-16.914c0-8.406 6.82-15.227 15.227-15.227s15.227 6.82 15.227 15.227v16.914c0 8.406-6.82 15.227-15.227 15.227zM511.875 395.587c12.711 0 25.422 4.836 35.102 14.516 5.945 5.945 5.945 15.586 0 21.531-5.953 5.945-15.594 5.945-21.531 0-7.484-7.484-19.664-7.484-27.141 0-5.945 5.945-15.586 5.945-21.531 0s-5.945-15.586 0-21.531c9.68-9.68 22.391-14.516 35.102-14.516zM496.953 332.563c-51.937 5.711-64.008 40.266-64.601 42.055-2.477 7.969-10.922 12.461-18.922 10.055-8.055-2.422-12.617-10.914-10.195-18.961 0.68-2.266 17.484-55.406 90.391-63.414 0.562-0.062 1.125-0.094 1.68-0.094 7.664 0 14.258 5.773 15.117 13.57 0.922 8.359-5.109 15.875-13.469 16.789zM687.875 269.438c16.836 16.836 30.945 35.664 42.141 55.937 4.547-1.312 9.32-2.008 14.344-2.008 46.242 0 87.391 57.937 87.391 103.609 0 25.297-8.977 46.937-23.977 61.75v203.781c0 46.43-13.836 91.242-40.016 129.594-4.742 6.945-14.211 8.727-21.164 3.984-6.937-4.742-8.727-14.211-3.984-21.156 22.711-33.266 34.719-72.141 34.719-112.422v-185.859c-5.25 1.547-10.781 2.539-16.539 2.945v100.039c0 8.414-6.82 15.227-15.227 15.227s-15.227-6.812-15.227-15.227v-16.453c-59.461 3.945-274.367 26.297-384.32 146.031-1.258 1.367-2.758 2.492-4.414 3.328-6.234 3.117-13.789 1.602-18.344-3.68-38.875-45.094-60.289-102.781-60.289-162.414v-66.851c-4.43-0.305-8.719-0.969-12.859-1.961v250.039c0 16.297 7.523 31.195 20.641 40.875 13.109 9.68 29.57 12.469 45.141 7.664 8-2.477 16.5 1.984 19.016 9.977 13.586 43.203 43.57 77.766 84.414 97.328 40.852 19.562 86.57 21.258 128.75 4.758l102.476-40.070c18.828-7.359 36.344-17.477 52.062-30.078 6.562-5.258 16.141-4.203 21.398 2.359s4.203 16.141-2.359 21.398c-18.125 14.531-38.312 26.195-60.016 34.68l-102.476 40.070c-50.117 19.602-104.453 17.594-152.992-5.656-44.344-21.234-77.906-57.359-95.695-102.586-20.375 2.484-40.836-2.828-57.805-15.344-20.977-15.477-33.008-39.305-33.008-65.375v-265.554c-17.195-14.797-27.656-37.836-27.656-65.141 0-45.672 41.148-103.609 87.391-103.609 5.070 0 9.898 0.711 14.484 2.055 29.398-53.195 77.711-94.547 135.797-114.93v-56.156l-74.844-43.391c-7.273-4.219-9.75-13.531-5.531-20.812 2.82-4.867 7.93-7.586 13.18-7.586 2.594 0 5.227 0.656 7.625 2.055l15.367 8.906 17.422-86.945c1.016-5.102 4.57-9.32 9.422-11.203 1.781-0.695 3.648-1.031 5.5-1.031 3.195 0 6.359 1.008 9.008 2.953l69.82 51.234v-97.289c0-8.406 6.82-15.219 15.227-15.219s15.227 6.812 15.227 15.219v97.289l69.812-51.234c4.195-3.078 9.672-3.805 14.516-1.922 4.852 1.875 8.398 6.102 9.422 11.203l17.422 86.945 88.508-51.312 24.781-94.82c1.789-6.844 7.961-11.375 14.719-11.375 1.273 0 2.57 0.164 3.867 0.5 8.133 2.125 13 10.445 10.875 18.578l-26.391 100.953c-1.023 3.93-3.578 7.281-7.094 9.32l-153.437 88.961v56.070c34.906 12.18 66.883 32.148 93.781 59.055zM801.297 426.977c0-30.219-29.453-73.164-56.945-73.164-0.305 0-0.609 0.023-0.906 0.031 4.43 11.203 8.031 22.742 10.789 34.531 3.352 11.937 12.469 31.453 22.211 31.453 8.414 0 15.227 6.82 15.227 15.227s-6.812 15.227-15.227 15.227c-5.781 0-10.984-1.211-15.664-3.258v31.969c20.477-2.617 40.516-19.133 40.516-52.016zM279.391 353.813c-27.492 0-56.945 42.945-56.945 73.164 0 32.883 20.047 49.406 40.523 52.016v-31.961c-4.68 2.047-9.883 3.25-15.672 3.25-8.406 0-15.227-6.82-15.227-15.227s6.82-15.227 15.227-15.227c10.461 0 20.055-22.117 22.859-33.961 0.031-0.125 0.086-0.234 0.117-0.352 2.695-10.852 6.086-21.422 10.148-31.664-0.336-0.016-0.68-0.039-1.031-0.039zM293.414 445.43v131.015c0 46.742 14.992 92.117 42.492 129.469 57.601-56.187 141.937-97.305 251.031-122.344 63.914-14.672 118.234-19.437 143.398-20.953v-117.195c0-58.336-22.727-113.187-64-154.453-41.242-41.266-96.101-63.992-154.469-63.992-120.453 0-218.453 98-218.453 218.453zM413.297 109.642l20.039 11.625c6.805-21.969 22.594-40.016 43.047-49.851l-48.328-35.461zM595.68 35.954l-48.312 35.453c20.453 9.828 36.25 27.875 43.062 49.836l20.008-11.602zM563.648 146.485c-0.031-0.516-0.031-1.023-0.016-1.539-0.328-28.258-23.406-51.148-51.766-51.148-28.531 0-51.742 23.219-51.742 51.766v56.391c16.695-3.539 34-5.422 51.742-5.422 17.609 0 34.945 1.836 51.781 5.383zM309.953 84.923l-33.758-19.57c-3.508-2.031-6.062-5.391-7.094-9.32l-26.391-100.953c-2.125-8.133 2.75-16.453 10.883-18.578 1.289-0.336 2.586-0.5 3.859-0.5 6.758 0 12.93 4.531 14.719 11.375l24.789 94.82 28.266 16.391c7.273 4.211 9.75 13.531 5.531 20.805-4.211 7.273-13.531 9.75-20.805 5.531z" />
|
52 |
+
<glyph unicode="" glyph-name="magnifying-glass-1" d="M1015.031-11.778l-248.848 248.848c66.753 76.743 107.168 176.873 107.168 286.311 0 240.901-195.945 436.619-436.619 436.619-240.901 0-436.619-195.945-436.619-436.619s195.945-436.619 436.619-436.619c109.439 0 209.568 40.415 286.311 107.168l248.848-248.848c5.903-5.903 13.85-9.082 21.57-9.082s15.667 2.952 21.57 9.082c11.807 11.807 11.807 31.333 0 43.14zM61.19 523.381c0 207.071 168.472 375.315 375.315 375.315 207.071 0 375.315-168.472 375.315-375.315s-168.245-375.542-375.315-375.542c-206.843 0-375.315 168.472-375.315 375.542z" />
|
53 |
+
<glyph unicode="" glyph-name="code" d="M623.82 176.726c2.458-1.228 5.068-1.792 7.628-1.792 6.264 0 12.288 3.448 15.274 9.42l68.266 136.534c2.406 4.812 2.406 10.462 0 15.274l-68.266 136.534c-4.216 8.43-14.456 11.862-22.904 7.628-8.432-4.216-11.844-14.456-7.628-22.904l64.444-128.888-64.444-128.904c-4.214-8.43-0.8-18.688 7.63-22.902zM938.666 721.066h-170.666c-28.246 0-51.2 22.954-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066-9.438 0-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.246-22.972-51.2-51.2-51.2h-716.802c-28.246 0-51.2 22.954-51.2 51.2v853.334c0 28.228 22.954 51.2 51.2 51.2h539.050l165.666-165.666c6.674-6.674 17.476-6.674 24.15 0 6.656 6.656 6.656 17.46 0 24.132l-170.666 170.668c-3.208 3.192-7.544 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.036 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066zM547.926 438.562l-102.4-204.8c-4.216-8.43-0.802-18.688 7.628-22.904 2.458-1.228 5.068-1.792 7.628-1.792 6.264 0 12.288 3.448 15.274 9.42l102.4 204.8c4.216 8.448 0.802 18.688-7.628 22.904-8.464 4.216-18.688 0.804-22.902-7.628zM400.162 480.324c-8.466 4.232-18.688 0.802-22.904-7.628l-68.266-136.534c-2.406-4.812-2.406-10.462 0-15.274l68.266-136.534c2.986-5.974 9.012-9.42 15.292-9.42 2.542 0 5.154 0.564 7.612 1.792 8.43 4.216 11.844 14.472 7.628 22.904l-64.444 128.904 64.444 128.888c4.216 8.446 0.804 18.686-7.628 22.902z" />
|
54 |
+
<glyph unicode="" glyph-name="review" d="M1020.334 253.047c-6.741 21.383-26.679 35.841-49.096 35.597h-22.552v550.857c0 9.507-7.708 17.214-17.214 17.214h-241v86.071c0 9.507-7.708 17.214-17.214 17.214h-654.142c-9.507 0-17.214-7.708-17.214-17.214v-895.142c0-9.507 7.708-17.214 17.214-17.214h568.76l-8.607-26.544c-6.976-21.299 0.58-44.658 18.71-57.838 18.122-13.18 42.674-13.163 60.788 0.034l90.232 65.722c6.094 4.455 14.373 4.455 20.467 0l90.4-65.755c18.021-13.398 42.699-13.398 60.729 0 18.332 13.012 25.964 36.513 18.761 57.821l-34.563 106.488c-2.269 7.052 0.286 14.768 6.312 19.072l90.568 65.755c18.29 13.070 25.863 36.572 18.66 57.863zM914.257 822.286v-533.642h-54.913c-1.807 0.008-3.606 0.303-5.321 0.874-5.186 1.748-9.254 5.808-11.011 10.986l-34.605 106.404c-6.968 21.19-26.754 35.513-49.062 35.513s-42.094-14.323-49.062-35.513l-19.812-60.822v166.343h137.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-137.714v68.857h137.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-137.714v68.857h137.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-137.714v68.857zM36.33 64.858v860.713h619.714v-636.928h-108.623c-22.4 0.059-42.288-14.348-49.23-35.647-6.934-21.308 0.656-44.658 18.794-57.812l90.535-65.739c6.069-4.32 8.632-12.070 6.338-19.156l-14.777-45.431zM981.391 223.023l-90.543-65.755c-18.139-13.070-25.746-36.37-18.803-57.619l34.605-106.387c2.362-7.103-0.143-14.928-6.203-19.341-6.052-4.413-14.264-4.396-20.307 0.034l-90.459 65.806c-18.164 13.070-42.657 13.070-60.822 0l-90.358-65.755c-6.035-4.438-14.256-4.455-20.316-0.050-6.060 4.413-8.574 12.23-6.212 19.341l34.588 106.337c6.968 21.282-0.647 44.624-18.82 57.703l-90.476 65.671c-6.102 4.371-8.666 12.188-6.346 19.324s9.002 11.944 16.5 11.885h111.893c7.17-0.059 14.264 1.479 20.761 4.514l0.328 0.185 0.311 0.101c0.244 0.109 0.412 0.311 0.656 0.437 12.827 5.959 22.611 16.971 27.023 30.411l34.605 106.37c2.32 7.061 8.918 11.843 16.349 11.843 7.439 0 14.037-4.783 16.357-11.843l34.613-106.454c6.951-21.198 26.721-35.538 49.029-35.563h111.893c7.498 0.059 14.172-4.749 16.491-11.877 2.328-7.128-0.227-14.936-6.321-19.316zM156.83 787.857h378.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-378.714c-9.507 0-17.214-7.708-17.214-17.214s7.708-17.214 17.214-17.214zM156.83 650.143h378.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-378.714c-9.507 0-17.214-7.708-17.214-17.214s7.708-17.214 17.214-17.214zM156.83 512.429h378.714c9.507 0 17.214 7.708 17.214 17.214s-7.708 17.214-17.214 17.214h-378.714c-9.507 0-17.214-7.708-17.214-17.214s7.708-17.214 17.214-17.214zM552.758 391.929c0 9.507-7.708 17.214-17.214 17.214h-378.714c-9.507 0-17.214-7.708-17.214-17.214s7.708-17.214 17.214-17.214h378.714c9.507 0 17.214 7.708 17.214 17.214z" />
|
55 |
+
<glyph unicode="" glyph-name="calendar" d="M970.104 872.78h-175.158v60.252c0 11.236-9.054 20.344-20.21 20.344s-20.21-9.108-20.21-20.344v-60.268h-485.214v60.268c0 11.236-9.054 20.344-20.21 20.344s-20.21-9.108-20.21-20.344v-60.268h-174.996c-29.656 0-53.896-24.428-53.896-54.258v-821.624c0-29.844 24.24-54.258 53.896-54.258h916.21c29.628 0 53.894 24.428 53.894 54.258v821.624c0 29.844-24.266 54.274-53.896 54.274zM983.578-3.118c0-7.344-6.186-13.568-13.474-13.568h-916.208c-7.316 0-13.474 6.224-13.474 13.568v632.816h943.156v-632.816zM983.58 670.392h-943.158v148.114c0 7.358 6.156 13.568 13.474 13.568h174.996v-75.426c0-11.236 9.054-20.344 20.21-20.344s20.21 9.108 20.21 20.344v75.426h485.214v-75.426c0-11.236 9.054-20.344 20.21-20.344s20.21 9.108 20.21 20.344v75.426h175.158c7.29 0 13.474-6.212 13.474-13.568v-148.114zM465.11 495.328h-94.288c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.288c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.358-20.21 20.358zM653.742 495.328h-94.316c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.358-20.21 20.358zM842.372 495.328h-94.316c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358s-9.052 20.358-20.21 20.358zM465.11 374.064h-94.288c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.288c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.358-20.21 20.358zM653.742 374.064h-94.316c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.358-20.21 20.358zM842.372 374.064h-94.316c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358s-9.052 20.358-20.21 20.358zM263.020 374.064h-94.316c-11.156 0-20.21-9.122-20.21-20.358s9.054-20.358 20.21-20.358h94.316c11.13 0 20.21 9.122 20.21 20.358-0.002 11.236-9.068 20.358-20.21 20.358zM465.11 252.788h-94.288c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.288c11.156 0 20.21 9.122 20.21 20.358 0.002 11.236-9.054 20.344-20.21 20.344zM653.742 252.788h-94.316c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.344-20.21 20.344zM842.372 252.788h-94.316c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358 0.002 11.236-9.052 20.344-20.21 20.344zM263.020 252.788h-94.316c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.316c11.13 0 20.21 9.122 20.21 20.358 0.002 11.236-9.068 20.344-20.21 20.344zM263.020 131.524h-94.316c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.316c11.13 0 20.21 9.122 20.21 20.358-0.002 11.236-9.068 20.344-20.21 20.344zM451.638 131.524h-94.288c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.288c11.156 0 20.21 9.122 20.21 20.358s-9.054 20.344-20.21 20.344zM640.268 131.524h-94.316c-11.156 0-20.21-9.108-20.21-20.344s9.054-20.358 20.21-20.358h94.316c11.156 0 20.21 9.122 20.21 20.358 0.002 11.236-9.054 20.344-20.21 20.344z" />
|
56 |
+
<glyph unicode="" glyph-name="open-book-1" d="M582.109 474.382c3.020-5.906 9.028-9.318 15.24-9.318 2.594 0 5.256 0.598 7.732 1.86 1.006 0.512 101.461 51.542 151.005 67.191 8.978 2.85 13.96 12.442 11.11 21.418-2.834 8.978-12.356 13.978-21.418 11.144-52.19-16.504-151.961-67.191-156.193-69.341-8.398-4.266-11.742-14.542-7.476-22.954zM597.349 669.86c2.594 0 5.256 0.598 7.732 1.86 1.006 0.512 101.461 51.542 151.005 67.191 8.978 2.85 13.96 12.442 11.11 21.418-2.834 8.978-12.356 13.978-21.418 11.144-52.19-16.504-151.961-67.191-156.193-69.341-8.396-4.266-11.742-14.54-7.476-22.954 3.020-5.904 9.028-9.318 15.24-9.318zM1006.93 703.994c-9.438 0-17.066-7.646-17.066-17.066v-665.595c0-28.228-22.972-51.2-51.2-51.2h-409.597v39.27c24.884 8.704 89.701 28.996 153.599 28.996 148.667 0 249.616-32.922 250.622-33.262 5.136-1.706 10.872-0.854 15.36 2.356 4.454 3.208 7.082 8.362 7.082 13.842v750.924c0 8.004-5.546 14.934-13.364 16.658 0 0-13.38 2.986-36.25 7.186-9.234 1.706-18.158-4.438-19.866-13.688-1.706-9.284 4.42-18.176 13.688-19.882 8.722-1.604 16.026-3.020 21.658-4.148v-714.37c-38.674 10.138-124.551 28.518-238.932 28.518-74.359 0-147.403-24.422-170.001-32.7-20.088 8.874-80.809 32.7-154.265 32.7-117.555 0-214.39-19.388-255.998-29.236v715.754c34.082 8.38 134.741 30.276 255.998 30.276 62.226 0 115.591-19.37 136.533-28.126v-671.603c0-6.144 3.31-11.828 8.652-14.848 5.342-3.038 11.93-2.952 17.204 0.222 1.69 1.006 170.785 102.007 320.867 152.029 6.98 2.338 11.674 8.84 11.674 16.196v699.729c0 5.598-2.748 10.838-7.356 14.028-4.574 3.192-10.444 3.926-15.718 1.962-136.549-51.216-274.718-137.197-276.102-138.051-7.988-5-10.428-15.53-5.428-23.518 4.984-7.988 15.514-10.428 23.518-5.428 1.262 0.802 121.463 75.587 246.952 126.053v-662.557c-116.497-40.482-238.13-106.581-290.132-136.173v653.017c0 6.468-3.652 12.374-9.438 15.274-2.936 1.45-72.873 35.926-161.227 35.926-154.213 0-272.774-33.366-277.758-34.798-7.322-2.082-12.374-8.79-12.374-16.402v-750.928c0-5.342 2.526-10.394 6.776-13.62 3.004-2.27 6.622-3.448 10.292-3.448 1.57 0 3.14 0.222 4.676 0.666 1.178 0.324 119.193 33.468 268.388 33.468 62.396 0 115.711-19.422 136.533-28.142v-40.124h-409.597c-28.228 0-51.2 22.972-51.2 51.2v665.595c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-665.595c0-47.052 38.28-85.333 85.333-85.333h853.327c47.052 0 85.333 38.28 85.333 85.333v665.595c-0.002 9.422-7.63 17.068-17.068 17.068zM582.109 576.781c3.020-5.906 9.028-9.318 15.24-9.318 2.594 0 5.256 0.598 7.732 1.86 1.006 0.512 101.461 51.542 151.005 67.191 8.978 2.85 13.96 12.442 11.11 21.418-2.834 8.978-12.356 13.978-21.418 11.144-52.19-16.504-151.961-67.191-156.193-69.341-8.398-4.266-11.742-14.542-7.476-22.954zM582.109 371.983c3.020-5.906 9.028-9.318 15.24-9.318 2.594 0 5.256 0.598 7.732 1.86 1.006 0.512 101.461 51.542 151.005 67.191 8.978 2.85 13.96 12.442 11.11 21.418-2.834 8.978-12.356 13.978-21.418 11.144-52.19-16.504-151.961-67.191-156.193-69.341-8.398-4.266-11.742-14.542-7.476-22.954zM413.493 643.27c-105.385 24.73-225.142-6.776-230.176-8.124-9.096-2.44-14.506-11.792-12.066-20.906 2.048-7.628 8.942-12.646 16.47-12.646 1.468 0 2.952 0.188 4.438 0.58 1.144 0.324 116.445 30.652 213.554 7.868 9.13-2.134 18.364 3.55 20.514 12.732 2.148 9.164-3.552 18.346-12.734 20.496zM413.493 540.871c-105.385 24.712-225.142-6.776-230.176-8.124-9.096-2.44-14.506-11.794-12.066-20.906 2.048-7.628 8.942-12.646 16.47-12.646 1.468 0 2.952 0.188 4.438 0.58 1.144 0.324 116.445 30.652 213.554 7.868 9.13-2.134 18.364 3.55 20.514 12.732 2.148 9.164-3.552 18.346-12.734 20.496zM582.109 269.583c3.020-5.906 9.028-9.318 15.24-9.318 2.594 0 5.256 0.598 7.732 1.86 1.006 0.512 101.461 51.542 151.005 67.191 8.978 2.85 13.96 12.442 11.11 21.418-2.834 8.976-12.356 13.978-21.418 11.144-52.19-16.504-151.961-67.191-156.193-69.341-8.398-4.266-11.742-14.542-7.476-22.954zM413.493 438.472c-105.385 24.712-225.142-6.758-230.176-8.124-9.096-2.44-14.506-11.794-12.066-20.906 2.048-7.628 8.942-12.664 16.47-12.664 1.468 0 2.952 0.204 4.438 0.598 1.144 0.324 116.445 30.652 213.554 7.868 9.13-2.134 18.364 3.55 20.514 12.732 2.148 9.164-3.552 18.346-12.734 20.496zM413.493 233.674c-105.385 24.73-225.142-6.776-230.176-8.124-9.096-2.44-14.506-11.794-12.066-20.906 2.048-7.628 8.942-12.664 16.47-12.664 1.468 0 2.952 0.204 4.438 0.598 1.144 0.324 116.445 30.652 213.554 7.868 9.13-2.116 18.364 3.55 20.514 12.732 2.148 9.164-3.552 18.346-12.734 20.496zM413.493 336.073c-105.385 24.73-225.142-6.758-230.176-8.124-9.096-2.44-14.506-11.794-12.066-20.906 2.048-7.628 8.942-12.664 16.47-12.664 1.468 0 2.952 0.204 4.438 0.598 1.144 0.324 116.445 30.652 213.554 7.868 9.13-2.134 18.364 3.55 20.514 12.732 2.148 9.164-3.552 18.346-12.734 20.496z" />
|
57 |
+
<glyph unicode="" glyph-name="image" d="M482.868 214.068c6.674-6.674 17.46-6.674 24.132 0l141.534 141.534 107.4-107.4c6.674-6.672 17.46-6.672 24.132 0 6.672 6.674 6.672 17.46 0 24.132l-119.466 119.466c-6.674 6.674-17.46 6.674-24.132 0l-141.534-141.534-73.268 73.268c-6.674 6.672-17.46 6.672-24.132 0l-187.734-187.734c-4.882-4.882-6.348-12.22-3.704-18.602 2.646-6.366 8.874-10.53 15.77-10.53h546.134c9.438 0 17.066 7.646 17.066 17.066s-7.628 17.066-17.066 17.066h-504.934l146.534 146.534 73.268-73.266zM938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.628 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.526 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.63 17.066-17.068 17.066zM254.942 439.466c3.158-5.478 8.892-8.534 14.796-8.534 2.884 0 5.82 0.734 8.516 2.286l31.522 18.194c8.534-8.688 19.438-14.9 31.574-18.040v-36.572c0-9.42 7.646-17.066 17.066-17.066s17.066 7.646 17.066 17.066v36.59c12.134 3.14 23.022 9.37 31.556 18.056l31.54-18.21c2.68-1.554 5.632-2.286 8.516-2.286 5.906 0 11.64 3.056 14.796 8.534 4.71 8.158 1.928 18.602-6.246 23.314l-31.726 18.312c1.622 5.802 2.748 11.792 2.748 18.108s-1.144 12.322-2.748 18.124l31.71 18.312c8.174 4.728 10.956 15.156 6.246 23.312-4.71 8.174-15.172 10.974-23.312 6.264l-31.54-18.21c-8.534 8.67-19.422 14.882-31.556 18.040v36.556c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-36.556c-12.134-3.158-23.040-9.37-31.574-18.056l-31.506 18.194c-8.208 4.71-18.62 1.912-23.312-6.246-4.71-8.174-1.912-18.602 6.246-23.33l31.692-18.296c-1.604-5.802-2.748-11.794-2.748-18.108s1.144-12.322 2.748-18.124l-31.692-18.312c-8.174-4.712-10.956-15.158-6.246-23.316zM358.4 533.35c18.824 0 34.134-15.308 34.134-34.134 0-18.808-15.292-34.116-34.1-34.134h-0.052c-18.824 0-34.116 15.308-34.116 34.134s15.31 34.134 34.134 34.134z" />
|
58 |
+
<glyph unicode="" glyph-name="spreadsheet" d="M938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.544 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066zM768 106.666c9.42 0 17.066 7.646 17.066 17.066v341.334c0 9.42-7.646 17.066-17.066 17.066h-512c-9.42 0-17.066-7.646-17.066-17.066v-341.334c0-9.42 7.646-17.066 17.066-17.066h443.734c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-119.466v68.266h170.666v-85.334c0-9.418 7.646-17.064 17.066-17.064zM341.334 140.8h-68.266v68.266h68.266v-68.266zM341.334 243.2h-68.266v68.266h68.266v-68.266zM341.334 345.6h-68.266v102.4h68.266v-102.4zM546.134 140.8h-170.666v68.266h170.666v-68.266zM546.134 243.2h-170.666v68.266h170.666v-68.266zM546.134 345.6h-170.666v102.4h170.666v-102.4zM580.266 448h170.666v-102.4h-170.666v102.4zM580.266 243.2v68.266h170.666v-68.266h-170.666z" />
|
59 |
+
<glyph unicode="" glyph-name="text" d="M460.8 311.466h273.066c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-273.066c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM699.734 448h-102.4c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h102.4c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066zM256 652.8h170.666c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-170.666c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM256 413.866h136.534c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-136.534c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.672 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.208-7.544 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066zM256 516.266h307.2c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-307.2c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM460.8 413.866h68.266c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-68.266c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM529.066 106.666h170.666c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-170.666c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM785.066 226.134c0 9.42-7.646 17.066-17.066 17.066h-102.4c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h102.4c9.42-0.002 17.066 7.644 17.066 17.066zM768 550.4h-136.534c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h136.534c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066zM256 106.666h204.8c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-204.8c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM256 209.066h102.4c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-102.4c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM614.4 226.134c0 9.42-7.646 17.066-17.066 17.066h-170.666c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h170.666c9.42-0.002 17.066 7.644 17.066 17.066zM256 311.466h136.534c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-136.534c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066z" />
|
60 |
+
<glyph unicode="" glyph-name="document" d="M256.004 209.062h102.399c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-102.399c-9.42 0-17.066-7.646-17.066-17.066s7.644-17.066 17.066-17.066zM950.727 716.055l-238.931 238.929c-4.898 4.898-12.236 6.366-18.602 3.704-6.366-2.646-10.53-8.874-10.53-15.77v-170.664c0-47.853 37.477-85.333 85.333-85.333h68.265c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-68.265c-29.184 0-51.199 22.016-51.199 51.199v129.468l204.797-204.797v-675.593c0-28.228-22.972-51.199-51.199-51.199h-716.79c-28.228 0-51.199 22.972-51.199 51.199v853.322c0 28.228 22.972 51.199 51.199 51.199h477.859c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-477.859c-47.051 0-85.333-38.279-85.333-85.333v-853.322c0-47.051 38.279-85.333 85.333-85.333h716.79c47.051 0 85.333 38.279 85.333 85.333v682.661c-0.002 4.522-1.81 8.874-5.002 12.066zM256.004 106.664h170.664c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-170.664c-9.42 0-17.066-7.646-17.066-17.066s7.644-17.066 17.066-17.066zM614.4 226.128c0 9.42-7.646 17.066-17.066 17.066h-170.664c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h170.664c9.42 0 17.066 7.646 17.066 17.066zM785.063 567.457c0 9.42-7.646 17.066-17.066 17.066h-511.993c-9.42 0-17.066-7.646-17.066-17.066v-238.931c0-9.42 7.646-17.066 17.066-17.066h102.399c4.522 0 8.858 1.792 12.066 5l107.399 107.399 39.133-39.133c6.674-6.672 17.46-6.672 24.132 0l73.267 73.267 73.267-73.267c6.672-6.672 17.46-6.672 24.132 0 6.674 6.674 6.674 17.46 0 24.132l-85.333 85.333c-6.674 6.674-17.46 6.674-24.132 0l-73.267-73.267-39.133 39.133c-6.672 6.672-17.46 6.672-24.132 0l-114.464-114.464h-78.267v204.797h477.859v-204.797h-290.128c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h307.196c9.42 0 17.066 7.646 17.066 17.066v238.931zM307.204 482.125c0-18.824 15.308-34.134 34.134-34.134 18.824 0 34.134 15.308 34.134 34.134s-15.308 34.134-34.134 34.134c-18.826 0-34.134-15.308-34.134-34.134zM494.933 106.664h238.931c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-238.931c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066zM256.004 652.79h170.664c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066h-170.664c-9.42 0-17.066-7.646-17.066-17.066-0.002-9.42 7.644-17.066 17.066-17.066zM785.063 226.128c0 9.42-7.646 17.066-17.066 17.066h-102.417c-9.42 0-17.066-7.646-17.066-17.066s7.646-17.066 17.066-17.066h102.417c9.42 0 17.066 7.646 17.066 17.066z" />
|
61 |
+
<glyph unicode="" glyph-name="video" d="M938.666 721.066h-170.666c-28.228 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.628 17.066-17.066 17.066s-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.228 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.972 51.2 51.2 51.2h539.068l165.666-165.666c6.674-6.674 17.46-6.674 24.132 0 6.672 6.656 6.672 17.46 0 24.132l-170.666 170.668c-3.192 3.192-7.526 5-12.066 5h-546.134c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.63 17.066-17.068 17.066zM273.066 345.6c0-131.754 107.178-238.934 238.934-238.934s238.934 107.18 238.934 238.934-107.18 238.934-238.934 238.934-238.934-107.18-238.934-238.934zM512 550.4c112.93 0 204.8-91.87 204.8-204.8s-91.87-204.8-204.8-204.8-204.8 91.87-204.8 204.8 91.87 204.8 204.8 204.8zM452.232 262.57c2.646-1.536 5.598-2.304 8.568-2.304 2.918 0 5.854 0.75 8.466 2.252l119.466 68.266c5.324 3.020 8.602 8.686 8.602 14.814s-3.276 11.776-8.602 14.814l-119.466 68.266c-5.274 3.038-11.776 3.004-17.032-0.052-5.274-3.054-8.5-8.686-8.5-14.762v-136.534c0-6.090 3.224-11.704 8.498-14.76zM477.866 384.46l67.994-38.86-67.994-38.86v77.72z" />
|
62 |
+
<glyph unicode="" glyph-name="conversation-1" d="M692 322c-11.044 0-20-8.954-20-20v-138c0-55.14-44.86-100-100-100h-215.936c-11.042 0-19.992-8.946-20-19.986l-0.028-39.764-47.736 47.734c-3.090 7.094-10.162 12.016-18.342 12.016h-129.958c-55.14 0-100 44.86-100 100v308c0 55.14 44.86 100 100 100h202c11.044 0 20 8.954 20 20s-8.956 20-20 20h-202c-77.196 0-140-62.804-140-140v-308c0-77.196 62.804-140 140-140h119.716l82.142-82.142c3.826-3.826 8.94-5.858 14.146-5.858 2.574 0 5.172 0.498 7.642 1.52 7.474 3.092 12.348 10.38 12.354 18.466l0.048 68.014h195.952c77.196 0 140 62.804 140 140v138c0 11.046-8.956 20-20 20zM733.31 960h-50.618c-160.288 0-290.692-130.404-290.692-290.692s130.404-290.69 290.69-290.69h50.618c25.018 0 49.78 3.178 73.78 9.458l74.774-74.732c3.826-3.822 8.938-5.854 14.142-5.854 2.578 0 5.178 0.498 7.652 1.524 7.472 3.096 12.344 10.388 12.344 18.476v115.712c31.658 25.638 57.956 58.024 76.412 94.204 20.962 41.092 31.588 85.47 31.588 131.902 0 160.288-130.404 290.692-290.69 290.692zM883.966 468.93c-5.014-3.778-7.966-9.694-7.966-15.976v-77.2l-48.942 48.916c-3.808 3.804-8.916 5.854-14.14 5.854-1.96 0-3.94-0.29-5.872-0.884-23.806-7.316-48.614-11.024-73.736-11.024h-50.618c-138.234 0-250.692 112.46-250.692 250.692s112.46 250.692 250.692 250.692h50.618c138.232 0 250.69-112.46 250.69-250.692 0-79.462-36.46-152.498-100.034-200.378zM798.066 741.158c-2.886 41.87-36.638 75.622-78.51 78.508-23.736 1.63-46.388-6.376-63.726-22.562-17.1-15.962-26.906-38.526-26.906-61.908 0-11.046 8.956-20 20-20s20 8.954 20 20c0 12.518 5.044 24.12 14.2 32.666 9.148 8.538 21.104 12.764 33.684 11.896 22.056-1.52 39.834-19.298 41.354-41.352 1.536-22.274-13.078-41.958-34.746-46.806-17.556-3.928-29.816-19.184-29.816-37.098v-48.050c0-11.046 8.956-20 20-20 11.046 0 20 8.954 19.998 20v46.452c40.3 9.736 67.338 46.612 64.468 88.254zM727.74 541.48c-3.72 3.72-8.88 5.86-14.14 5.86s-10.42-2.14-14.14-5.86c-3.72-3.72-5.86-8.88-5.86-14.14 0-5.28 2.142-10.44 5.86-14.16 3.72-3.72 8.88-5.84 14.14-5.84s10.42 2.12 14.14 5.84c3.72 3.74 5.86 8.88 5.86 14.16 0 5.26-2.142 10.42-5.86 14.14zM550 340h-422c-11.044 0-20-8.954-20-20s8.956-20 20-20h422c11.046 0 20 8.954 20 20s-8.956 20-20 20zM564.138 222.14c-3.718 3.72-8.878 5.86-14.138 5.86s-10.42-2.14-14.14-5.86c-3.722-3.72-5.86-8.88-5.86-14.14s2.14-10.42 5.86-14.14c3.72-3.72 8.88-5.86 14.14-5.86s10.42 2.14 14.138 5.86c3.722 3.72 5.862 8.86 5.862 14.14 0 5.26-2.142 10.42-5.862 14.14zM471.334 228h-343.334c-11.044 0-20-8.954-20-20s8.956-20 20-20h343.334c11.046 0 20 8.954 20 20s-8.956 20-20 20zM420 452h-292c-11.044 0-20-8.954-20-20s8.956-20 20-20h292c11.046 0 20 8.954 20 20s-8.956 20-20 20z" />
|
63 |
+
<glyph unicode="" glyph-name="archive" d="M443.734 465.066c-18.824 0-34.134-15.308-34.134-34.134v-170.666c0-18.824 15.308-34.134 34.134-34.134h102.4c18.808 0 34.134 15.308 34.134 34.134v170.666c0 18.824-15.326 34.134-34.134 34.134-9.438 0-17.066-7.646-17.066-17.066s7.628-17.066 17.066-17.066v-170.666h-102.4v170.666h51.2c9.42 0 17.066 7.646 17.066 17.066v68.266c0 9.42-7.646 17.066-17.066 17.066h-17.066v34.134h17.066c9.42 0 17.066 7.646 17.066 17.066v68.268c0 9.42-7.646 17.066-17.066 17.066h-17.066v34.134h17.066c9.42 0 17.066 7.646 17.066 17.066v68.268c0 9.42-7.646 17.066-17.066 17.066h-17.066v34.134h17.066c9.42 0 17.066 7.646 17.066 17.066v51.2h180.668l165.666-165.666c6.656-6.674 17.46-6.674 24.132 0 6.656 6.672 6.656 17.46 0 24.132l-170.666 170.666c-3.208 3.208-7.544 5-12.066 5h-204.8c-9.438 0-17.066-7.646-17.066-17.066v-51.2h-17.068c-9.438 0-17.066-7.646-17.066-17.066v-68.266c0-9.42 7.628-17.066 17.066-17.066h17.066v-34.134h-17.066c-9.438 0-17.066-7.646-17.066-17.066v-68.268c0-9.42 7.628-17.066 17.066-17.066h17.066v-34.134h-17.066c-9.438 0-17.066-7.646-17.066-17.066v-68.266c0-9.42 7.628-17.066 17.066-17.066h17.066v-34.134h-34.132zM495.446 328.534h-0.188c-9.404 0-16.964-7.646-16.964-17.066s7.714-17.066 17.152-17.066c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.066-17.066 17.066zM938.666 721.066h-170.666c-28.246 0-51.2 22.972-51.2 51.2v85.334c0 9.42-7.646 17.066-17.066 17.066-9.438 0-17.066-7.646-17.066-17.066v-85.334c0-47.052 38.28-85.334 85.334-85.334h153.6v-665.6c0-28.228-22.972-51.2-51.2-51.2h-716.802c-28.246 0-51.2 22.972-51.2 51.2v853.334c0 28.228 22.954 51.2 51.2 51.2h270.934c9.42 0 17.066 7.646 17.066 17.066s-7.646 17.068-17.066 17.068h-270.934c-47.052 0-85.334-38.28-85.334-85.334v-853.334c0-47.052 38.282-85.332 85.334-85.332h716.8c47.052 0 85.334 38.28 85.334 85.334v682.666c0 9.42-7.646 17.066-17.068 17.066z" />
|
64 |
+
<glyph unicode="" glyph-name="manual" horiz-adv-x="1158" d="M696.32 102.11c-26.89-27.65-63.83-43.24-102.4-43.23h-593.92v-40.96h593.92v-40.96h-593.92v-40.96h593.92c56.53 0.070 102.33 45.87 102.4 102.4v63.71zM0 714.24h389.12v-286.72h-389.12zM901.12 448c-0.070 67.84-55.040 122.81-122.88 122.88-13.96 0.030-27.82-2.37-40.96-7.090v-231.58c13.14-4.72 27-7.12 40.96-7.090 67.84 0.070 122.81 55.040 122.88 122.88zM737.28 79.36h46.122c22.123 0 40.891 16.245 44.062 38.14l4.716 32.56c3.080 22.22 18.16 40.93 39.22 48.66 6.15 2.29 12.15 4.83 18.010 7.37 20.27 9.17 43.95 6.49 61.66-6.98l26.069-19.552c17.725-13.294 42.528-11.531 58.195 4.136l7.277 7.277c15.678 15.678 17.431 40.502 4.111 58.228l-19.652 26.152c-13.48 17.84-16.080 41.63-6.76 61.96 2.38 5.46 4.92 11.48 7.25 17.75 7.78 21.040 26.52 36.070 48.75 39.080l32.442 4.707c21.89 3.176 38.128 21.941 38.128 44.060v10.254c0 22.123-16.245 40.891-38.14 44.062l-32.56 4.716c-22.22 3.080-40.93 18.16-48.66 39.22-2.29 6.15-4.83 12.15-7.37 18.010-9.17 20.27-6.49 43.95 6.98 61.66l19.552 26.069c13.294 17.725 11.531 42.528-4.136 58.195l-7.277 7.277c-15.678 15.678-40.502 17.431-58.228 4.111l-26.152-19.652c-17.84-13.46-41.63-16.060-61.96-6.76-5.46 2.38-11.48 4.92-17.75 7.25-21.040 7.78-36.070 26.52-39.080 48.75l-4.664 32.393c-3.155 21.912-21.93 38.177-44.067 38.177h-46.089v-210.17c66.42 17.43 136.67-8.41 175.96-64.73s39.29-131.16 0-187.48c-39.29-56.32-109.54-82.16-175.96-64.73v-210.17zM0 386.56h389.12v-286.72h-300.077c-49.177 0-89.043 39.866-89.043 89.043v197.677zM696.32 857.6c-0.070 56.53-45.87 102.33-102.4 102.4h-40.96v-204.8h143.36v102.4zM696.32 386.56h-143.36v-286.72h40.96c56.53 0.070 102.33 45.87 102.4 102.4v184.32zM552.96 714.24h143.36v-286.72h-143.36zM430.080 960h81.92v-860.16h-81.92zM89.043 960h300.077v-204.8h-389.12v115.757c0 49.177 39.866 89.043 89.043 89.043z" />
|
65 |
+
<glyph unicode="" glyph-name="light-up" d="M47.476 183.933c-15.56 15.5-15.56 40.6-0.002 56.096l434.377 472.356c8.296 8.261 19.294 11.801 30.168 11.252 10.837 0.549 21.872-2.991 30.168-11.252l434.338-472.314c15.56-15.499 15.56-40.638 0-56.138s-40.808-15.499-56.368 0l-408.179 443.835-408.137-443.835c-15.56-15.499-40.807-15.499-56.367 0z" />
|
66 |
+
<glyph unicode="" glyph-name="light-down" d="M976.524 712.067c15.56-15.5 15.56-40.6 0.002-56.096l-434.377-472.356c-8.296-8.261-19.294-11.801-30.168-11.252-10.837-0.549-21.872 2.991-30.168 11.252l-434.338 472.314c-15.56 15.499-15.56 40.638 0 56.138s40.808 15.499 56.368 0l408.179-443.835 408.137 443.835c15.56 15.499 40.807 15.499 56.367 0z" />
|
67 |
+
<glyph unicode="" glyph-name="light-right" horiz-adv-x="551" d="M11.625 948.33c15.5 15.56 40.6 15.56 56.096 0.002l472.356-434.377c8.261-8.296 11.801-19.294 11.252-30.168 0.549-10.837-2.991-21.872-11.252-30.168l-472.314-434.338c-15.499-15.56-40.638-15.56-56.138 0s-15.499 40.808 0 56.368l443.835 408.179-443.835 408.137c-15.499 15.56-15.499 40.807 0 56.367z" />
|
68 |
+
<glyph unicode="" glyph-name="light-left" horiz-adv-x="551" d="M539.375-52.33c-15.5-15.56-40.6-15.56-56.096-0.002l-472.356 434.377c-8.261 8.296-11.801 19.294-11.252 30.168-0.549 10.837 2.991 21.872 11.252 30.168l472.314 434.338c15.499 15.56 40.638 15.56 56.138 0s15.499-40.808 0-56.368l-443.835-408.179 443.835-408.137c15.499-15.56 15.499-40.807 0-56.367z" />
|
69 |
+
<glyph unicode="" glyph-name="pencil" horiz-adv-x="887" d="M55.507 29.265l10.263 3.759 0.221 0.283 10.042 3.476-18.199 14.218-2.328-21.736zM525.939 952.207l311.306-243.219c11.833-9.245 14.516-25.828 5.952-36.789l-446.22-571.136c-3.071-3.931-7.653-6.682-12.196-8.124l-173.987-63.23-123.347-45.304-0.221-0.283-33.555-12.254-18.079-6.236-0.221-0.283c-4.016-1.397-8.728-1.793-13.609-1.145-14.195 2.478-25.117 16.002-23.419 30.075l11.666 108.119c-0.169 1.045-0.111 2.34 0.247 3.429l7.829 74.444 19.547 183.891c0.162 3.951 1.346 7.988 3.396 11.833 0.443 0.567 0.872 1.116 1.093 1.399l446.663 571.703c8.583 10.946 25.322 12.355 37.155 3.11zM785.025 685.965l-268.811 210.018-415.258-531.506 268.811-210.018 415.258 531.506zM131.58 57.207l57.843 20.882 133.611 49.062-237.27 185.375-15.282-141.511-6.268-61.177 67.365-52.632z" />
|
70 |
+
<glyph unicode="" glyph-name="man-user" d="M512 459.197c113.851 0 206.155 112.108 206.155 250.4 0 138.296-30.305 250.403-206.155 250.403s-206.16-112.108-206.16-250.403c0-138.293 92.303-250.4 206.16-250.4zM122.614 76.864c-0.035 8.432-0.070 2.376 0 0v0zM901.369 70.279c0.111 2.308 0.038 16.015 0 0v0zM900.93 86.976c-3.818 240.909-35.281 309.555-276.047 353.008 0 0-33.891-43.186-112.886-43.186s-112.892 43.186-112.892 43.186c-238.139-42.979-271.515-110.607-275.904-345.182-0.36-19.155-0.527-20.161-0.591-17.938 0.015-4.166 0.032-11.873 0.032-25.31 0 0 57.321-115.554 389.354-115.554 332.028 0 389.354 115.554 389.354 115.554 0 8.634 0.006 14.637 0.015 18.722-0.064-1.375-0.193 1.29-0.436 16.7z" />
|
71 |
+
<glyph unicode="" glyph-name="move" d="M1010.365 480.911l-116.364 116.364c-13.309 13.315-33.339 17.29-50.725 10.091-17.392-7.205-28.734-24.176-28.734-43.002v-69.818h-255.997v256h69.818c18.826 0 35.797 11.342 43.002 28.734 7.202 17.392 3.221 37.413-10.091 50.725l-116.364 116.364c-18.174 18.178-47.647 18.178-65.825 0l-116.364-116.364c-13.312-13.312-17.293-33.333-10.091-50.725 7.205-17.392 24.179-28.734 43.002-28.734h69.821v-256h-256v69.818c0 18.826-11.342 35.8-28.734 43.002-17.396 7.202-37.416 3.221-50.725-10.091l-116.364-116.364c-18.178-18.178-18.178-47.647 0-65.825l116.364-116.364c8.906-8.906 20.806-13.635 32.923-13.635 5.995 0 12.043 1.161 17.802 3.544 17.392 7.205 28.734 24.179 28.734 43.002v69.821h256v-256h-69.818c-18.826 0-35.8-11.342-43.002-28.734s-3.221-37.413 10.091-50.725l116.364-116.364c9.086-9.089 20.998-13.632 32.911-13.632s23.825 4.543 32.911 13.635l116.364 116.364c13.312 13.312 17.293 33.333 10.091 50.725-7.205 17.392-24.176 28.734-43.002 28.734h-69.818v255.997h256v-69.818c0-18.826 11.338-35.8 28.734-43.002 5.756-2.386 11.807-3.544 17.802-3.544 12.111 0 24.017 4.729 32.92 13.635l116.364 116.364c18.181 18.174 18.181 47.644 0 65.821z" />
|
72 |
+
<glyph unicode="" glyph-name="list" d="M672 896h-69.504c-13.184 37.248-48.768 64-90.496 64s-77.312-26.752-90.56-64h-69.44c-17.664 0-32-14.336-32-32v-128c0-17.664 14.336-32 32-32h320c17.664 0 32 14.336 32 32v128c0 17.664-14.336 32-32 32zM832 832h-64v-96c0-52.928-43.072-96-96-96h-320c-52.928 0-96 43.072-96 96v96h-64c-35.264 0-64-28.736-64-64v-768c0-35.904 28.096-64 64-64h640c35.904 0 64 28.096 64 64v768c0 35.904-28.096 64-64 64zM502.656 265.344l-128-128c-6.272-6.208-14.464-9.344-22.656-9.344s-16.384 3.136-22.656 9.344l-64 64c-12.48 12.48-12.48 32.768 0 45.248s32.768 12.48 45.248 0l41.408-41.344 105.344 105.344c12.48 12.48 32.768 12.48 45.248 0s12.544-32.704 0.064-45.248zM502.656 521.344l-128-128c-6.272-6.208-14.464-9.344-22.656-9.344s-16.384 3.136-22.656 9.344l-64 64c-12.48 12.48-12.48 32.768 0 45.248s32.768 12.48 45.248 0l41.408-41.344 105.344 105.344c12.48 12.48 32.768 12.48 45.248 0s12.544-32.704 0.064-45.248zM736 192h-128c-17.664 0-32 14.336-32 32s14.336 32 32 32h128c17.664 0 32-14.336 32-32s-14.336-32-32-32zM736 448h-128c-17.664 0-32 14.336-32 32s14.336 32 32 32h128c17.664 0 32-14.336 32-32s-14.336-32-32-32z" />
|
73 |
+
<glyph unicode="" glyph-name="speaker" d="M814.546 960c-124.136 0-208.942-71.586-283.788-134.75-62.324-52.55-116.084-97.978-181.666-97.978h-256c-63.954 0-93.092-120.646-93.092-232.726 0-112.082 29.138-232.728 93.090-232.728h256c65.582 0 119.342-45.428 181.666-97.978 74.846-63.162 159.652-134.75 283.788-134.75 137.496 0 209.456 234.172 209.456 465.456s-71.96 465.454-209.454 465.454zM814.546 122.182c-39.518 0-116.364 131.444-116.364 372.364s76.846 372.364 116.364 372.364c39.516 0 116.364-131.444 116.364-372.364s-76.848-372.364-116.364-372.364zM779.916 629.248c-6.702 1.676-13.544 0.466-19.13-3.352-5.586-3.864-9.17-9.96-9.914-16.664-4.142-38.866-6.144-76.382-6.144-114.688s2.002-75.822 6.19-114.642c0.744-6.75 4.328-12.8 9.914-16.664 3.91-2.7 8.564-4.096 13.218-4.096 1.954 0 3.91 0.232 5.864 0.744 61.486 16.012 104.448 71.4 104.448 134.656 0.002 63.258-42.96 118.648-104.446 134.706zM434.642 98.91c-13.312 0-25.042 8.472-29.23 21.086l-26.206 78.522c-2.792 8.378-12.894 14.802-21.644 16.058-2.84 0.372-5.726 0.698-8.472 0.698h-159.604c-7.308 0-14.196-3.444-18.572-9.262s-5.818-13.406-3.816-20.386l52.038-182.086c11.358-39.752 48.174-67.54 89.506-67.54h125.998c42.638 0 77.36 34.722 77.36 77.358v8.192c0 42.636-34.722 77.36-77.358 77.36z" />
|
74 |
+
<glyph unicode="" glyph-name="video-camera" d="M1017.846 433.846c-11.077 19.692-36.923 27.077-57.845 14.769l-140.306-81.23-35.692-20.923v-194.459l33.23-19.692c1.231 0 1.231-1.231 2.462-1.231l137.844-79.999c6.154-4.923 14.769-7.385 23.384-7.385 23.384 0 41.846 18.461 41.846 41.846v164.921l1.231 162.46c0 7.385-1.231 14.769-6.154 20.923zM198.164 496.615c109.537 0 198.151 88.614 198.151 198.151s-88.614 198.151-198.151 198.151-198.151-88.614-198.151-198.151c-1.231-109.537 88.614-198.151 198.151-198.151zM198.164 775.996c45.538 0 81.23-36.923 81.23-81.23 0-45.538-36.923-81.23-81.23-81.23s-81.23 36.923-81.23 81.23c-1.231 45.538 35.692 81.23 81.23 81.23zM700.312 485.538c-32-16-67.691-25.846-105.845-25.846-46.769 0-91.076 13.538-127.998 38.153h-140.306c-36.923-24.615-81.23-38.153-127.998-38.153-38.153 0-73.845 8.615-105.845 25.846-28.307-16-47.999-47.999-47.999-82.461v-300.304c0-55.384 45.538-99.691 99.691-99.691h505.84c55.384 0 99.691 45.538 99.691 99.691v300.304c-1.231 34.461-20.923 66.461-49.23 82.461zM594.467 496.615c109.537 0 198.151 88.614 198.151 198.151s-88.614 198.151-198.151 198.151c-109.537 0-198.151-88.614-198.151-198.151s88.614-198.151 198.151-198.151zM594.467 775.996c45.538 0 81.23-36.923 81.23-81.23 0-45.538-36.923-81.23-81.23-81.23s-81.23 36.923-81.23 81.23c0 45.538 35.692 81.23 81.23 81.23z" />
|
75 |
+
<glyph unicode="" glyph-name="garbage" d="M901.8 813h-236.8v104.2c0 11.6-9.4 20.8-20.8 20.8h-264.4c-11.6 0-20.8-9.4-20.8-20.8v-104.2h-236.8c-11.6 0-20.8-9.4-20.8-20.8v-129.8c0-11.6 9.4-20.8 20.8-20.8h49.2v-529.4c0-85 69.2-154.2 154.2-154.2h372.8c85 0 154.2 69.2 154.2 154.2v529.2h49.2c11.6 0 20.8 9.4 20.8 20.8v130c0 11.4-9.4 20.8-20.8 20.8zM400.8 896.2h222.6v-83.4h-222.6v83.4zM810.8 112.2c0-62-50.4-112.4-112.4-112.4h-372.8c-62 0-112.4 50.4-112.4 112.4v529.2h597.6v-529.2zM880.8 683.2h-737.6v88h737.8v-88zM328.2 106c11.6 0 20.8 9.4 20.8 20.8v387.4c0 11.6-9.4 20.8-20.8 20.8-11.6 0-20.8-9.4-20.8-20.8v-387.4c0-11.4 9.4-20.8 20.8-20.8zM512 106c11.6 0 20.8 9.4 20.8 20.8v387.4c0 11.6-9.4 20.8-20.8 20.8s-20.8-9.4-20.8-20.8v-387.4c0-11.4 9.2-20.8 20.8-20.8zM695.8 106c11.6 0 20.8 9.4 20.8 20.8v387.4c0 11.6-9.4 20.8-20.8 20.8-11.6 0-20.8-9.4-20.8-20.8v-387.4c-0.2-11.4 9.2-20.8 20.8-20.8z" />
|
76 |
+
<glyph unicode="" glyph-name="add-line" d="M916.122 960h-808.245c-59.584 0-107.878-48.503-107.878-107.878v-808.245c0-59.584 48.503-107.878 107.878-107.878h808.245c59.584 0 107.878 48.503 107.878 107.878v808.245c0 59.374-48.503 107.878-107.878 107.878zM972.779 43.878c0-31.151-25.506-56.657-56.657-56.657h-808.245c-31.151 0-56.657 25.506-56.657 56.657v808.245c0 31.151 25.506 56.657 56.657 56.657h808.245c31.151 0 56.657-25.506 56.657-56.657v-808.245zM705.385 473.506h-167.879v167.879c0 14.216-11.499 25.715-25.715 25.715s-25.715-11.499-25.715-25.715v-167.879h-167.879c-14.216 0-25.715-11.499-25.715-25.506 0-14.216 11.499-25.715 25.715-25.715h167.879v-167.879c0-14.216 11.499-25.715 25.715-25.715s25.715 11.499 25.715 25.715v167.879h167.879c14.216 0 25.715 11.499 25.715 25.715s-11.499 25.506-25.715 25.506z" />
|
77 |
+
</font></defs></svg>
|
assets/icons/font/tutor.ttf
ADDED
Binary file
|
assets/icons/font/tutor.woff
ADDED
Binary file
|
assets/images/image.png
ADDED
Binary file
|
assets/images/placeholder.jpg
ADDED
Binary file
|
assets/images/play-button.png
ADDED
Binary file
|
assets/images/spinner.gif
ADDED
Binary file
|
assets/images/tutor-plugin.png
ADDED
Binary file
|
assets/js/gutenberg_blocks.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var el = wp.element.createElement,
|
2 |
+
registerBlockType = wp.blocks.registerBlockType,
|
3 |
+
withSelect = wp.data.withSelect;
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Block for student registration
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
registerBlockType( 'tutor-gutenberg/student-registration', {
|
13 |
+
title: 'Tutor Student Registration',
|
14 |
+
icon: 'welcome-learn-more',
|
15 |
+
category: 'tutor',
|
16 |
+
edit: function( props ) {
|
17 |
+
var dataHtml;
|
18 |
+
jQuery.ajax({
|
19 |
+
url : ajaxurl,
|
20 |
+
type : 'POST',
|
21 |
+
async: false,
|
22 |
+
data : {shortcode: 'tutor_student_registration_form', action : 'render_block_tutor'},
|
23 |
+
success: function (response) {
|
24 |
+
dataHtml = response.data;
|
25 |
+
},
|
26 |
+
});
|
27 |
+
|
28 |
+
return el('div', {
|
29 |
+
dangerouslySetInnerHTML: {
|
30 |
+
__html: dataHtml
|
31 |
+
}
|
32 |
+
})
|
33 |
+
},
|
34 |
+
|
35 |
+
save: function() {
|
36 |
+
return null;
|
37 |
+
//return el( 'div', { }, '[tutor_student_registration_form]' );
|
38 |
+
},
|
39 |
+
} );
|
40 |
+
|
41 |
+
registerBlockType( 'tutor-gutenberg/student-dashboard', {
|
42 |
+
title: 'Tutor Student Dashboard',
|
43 |
+
icon: 'welcome-learn-more',
|
44 |
+
category: 'tutor',
|
45 |
+
edit: function( props ) {
|
46 |
+
var dataHtml;
|
47 |
+
jQuery.ajax({
|
48 |
+
url : ajaxurl,
|
49 |
+
type : 'POST',
|
50 |
+
async: false,
|
51 |
+
data : {shortcode: 'tutor_student_dashboard', action : 'render_block_tutor'},
|
52 |
+
success: function (response) {
|
53 |
+
dataHtml = response.data;
|
54 |
+
},
|
55 |
+
});
|
56 |
+
return el('div', {
|
57 |
+
dangerouslySetInnerHTML: {
|
58 |
+
__html: dataHtml
|
59 |
+
}
|
60 |
+
})
|
61 |
+
},
|
62 |
+
save: function() {
|
63 |
+
return null;
|
64 |
+
},
|
65 |
+
} );
|
66 |
+
|
67 |
+
|
68 |
+
//tutor_instructor_registration_form
|
69 |
+
|
70 |
+
registerBlockType( 'tutor-gutenberg/instructor-registration', {
|
71 |
+
title: 'Instructor Registration Form',
|
72 |
+
icon: 'welcome-learn-more',
|
73 |
+
category: 'tutor',
|
74 |
+
edit: function( props ) {
|
75 |
+
var dataHtml;
|
76 |
+
jQuery.ajax({
|
77 |
+
url : ajaxurl,
|
78 |
+
type : 'POST',
|
79 |
+
async: false,
|
80 |
+
data : {shortcode: 'tutor_instructor_registration_form', action : 'render_block_tutor'},
|
81 |
+
success: function (response) {
|
82 |
+
dataHtml = response.data;
|
83 |
+
},
|
84 |
+
});
|
85 |
+
return el('div', {
|
86 |
+
dangerouslySetInnerHTML: {
|
87 |
+
__html: dataHtml
|
88 |
+
}
|
89 |
+
})
|
90 |
+
},
|
91 |
+
save: function() {
|
92 |
+
return null;
|
93 |
+
},
|
94 |
+
} );
|
assets/js/mce-button.js
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
/*========================================================================
|
5 |
+
* Tutor WP Editor Button
|
6 |
+
*======================================================================== */
|
7 |
+
|
8 |
+
tinymce.PluginManager.add('tutor_button', function( editor, url ) {
|
9 |
+
editor.addButton( 'tutor_button', {
|
10 |
+
text: 'Tutor ShortCode',
|
11 |
+
icon: false,
|
12 |
+
type: 'menubutton',
|
13 |
+
menu: [
|
14 |
+
{
|
15 |
+
text: 'Student Registration Form',
|
16 |
+
onclick: function() {
|
17 |
+
editor.insertContent('[tutor_student_registration_form]');
|
18 |
+
}
|
19 |
+
},
|
20 |
+
{
|
21 |
+
text: 'Student Dashboard',
|
22 |
+
onclick: function() {
|
23 |
+
editor.insertContent('[tutor_student_dashboard]');
|
24 |
+
}
|
25 |
+
},{
|
26 |
+
text: 'Instructor Registration Form',
|
27 |
+
onclick: function() {
|
28 |
+
editor.insertContent('[tutor_instructor_registration_form]');
|
29 |
+
}
|
30 |
+
},
|
31 |
+
]
|
32 |
+
});
|
33 |
+
});
|
34 |
+
|
35 |
+
});
|
assets/js/tutor-admin.js
ADDED
@@ -0,0 +1,1036 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
if (jQuery().select2){
|
5 |
+
$('.tutor_select2').select2();
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Option Settings Nav Tab
|
10 |
+
*/
|
11 |
+
$('.tutor-option-nav-tabs li a').click(function(e){
|
12 |
+
e.preventDefault();
|
13 |
+
var tab_page_id = $(this).attr('href');
|
14 |
+
$('.option-nav-item').removeClass('current');
|
15 |
+
$(this).closest('li').addClass('current');
|
16 |
+
$('.tutor-option-nav-page').hide();
|
17 |
+
$(tab_page_id).addClass('current-page').show();
|
18 |
+
});
|
19 |
+
|
20 |
+
$('#save_tutor_option').click(function (e) {
|
21 |
+
e.preventDefault();
|
22 |
+
$(this).closest('form').submit();
|
23 |
+
});
|
24 |
+
$('#tutor-option-form').submit(function(e){
|
25 |
+
e.preventDefault();
|
26 |
+
|
27 |
+
var $form = $(this);
|
28 |
+
var data = $form.serialize();
|
29 |
+
|
30 |
+
$.ajax({
|
31 |
+
url : ajaxurl,
|
32 |
+
type : 'POST',
|
33 |
+
data : data,
|
34 |
+
beforeSend: function () {
|
35 |
+
$form.find('.button').addClass('tutor-updating-message');
|
36 |
+
},
|
37 |
+
success: function (data) {
|
38 |
+
//
|
39 |
+
},
|
40 |
+
complete: function () {
|
41 |
+
$form.find('.button').removeClass('tutor-updating-message');
|
42 |
+
window.location.reload();
|
43 |
+
}
|
44 |
+
});
|
45 |
+
});
|
46 |
+
|
47 |
+
$('.tutor-field-slider').each(function(){
|
48 |
+
var $slider = $(this);
|
49 |
+
var $input = $slider.closest('.tutor-field-type-slider').find('input[type="hidden"]');
|
50 |
+
var $showVal = $slider.closest('.tutor-field-type-slider').find('.tutor-field-type-slider-value');
|
51 |
+
var min = parseFloat($slider.closest('.tutor-field-type-slider').attr('data-min'));
|
52 |
+
var max = parseFloat($slider.closest('.tutor-field-type-slider').attr('data-max'));
|
53 |
+
|
54 |
+
$slider.slider({
|
55 |
+
range: "max",
|
56 |
+
min: min,
|
57 |
+
max: max,
|
58 |
+
value: $input.val(),
|
59 |
+
slide: function( event, ui ) {
|
60 |
+
$showVal.text(ui.value);
|
61 |
+
$input.val(ui.value);
|
62 |
+
}
|
63 |
+
});
|
64 |
+
});
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Course and lesson sorting
|
68 |
+
*/
|
69 |
+
function enable_sorting_topic_lesson(){
|
70 |
+
if (jQuery().sortable) {
|
71 |
+
$(".course-contents").sortable({
|
72 |
+
handle: ".course-move-handle",
|
73 |
+
start: function (e, ui) {
|
74 |
+
ui.placeholder.css('visibility', 'visible');
|
75 |
+
},
|
76 |
+
stop: function (e, ui) {
|
77 |
+
tutor_sorting_topics_and_lesson();
|
78 |
+
},
|
79 |
+
});
|
80 |
+
$(".tutor-lessons:not(.drop-lessons)").sortable({
|
81 |
+
connectWith: ".tutor-lessons",
|
82 |
+
items: "div.tutor-lesson",
|
83 |
+
start: function (e, ui) {
|
84 |
+
ui.placeholder.css('visibility', 'visible');
|
85 |
+
},
|
86 |
+
stop: function (e, ui) {
|
87 |
+
tutor_sorting_topics_and_lesson();
|
88 |
+
},
|
89 |
+
});
|
90 |
+
}
|
91 |
+
}
|
92 |
+
enable_sorting_topic_lesson();
|
93 |
+
function tutor_sorting_topics_and_lesson(){
|
94 |
+
var topics = {};
|
95 |
+
$('.tutor-topics-wrap').each(function(index, item){
|
96 |
+
var $topic = $(this);
|
97 |
+
var topics_id = parseInt($topic.attr('id').match(/\d+/)[0], 10);
|
98 |
+
var lessons = {};
|
99 |
+
|
100 |
+
$topic.find('.tutor-lesson').each(function(lessonIndex, lessonItem){
|
101 |
+
var $lesson = $(this);
|
102 |
+
var lesson_id = parseInt($lesson.attr('id').match(/\d+/)[0], 10);
|
103 |
+
|
104 |
+
lessons[lessonIndex] = lesson_id;
|
105 |
+
});
|
106 |
+
topics[index] = { 'topic_id' : topics_id, 'lesson_ids' : lessons };
|
107 |
+
|
108 |
+
//Hide drop element
|
109 |
+
/*
|
110 |
+
if ($topic.find('.tutor-lesson').length){
|
111 |
+
$topic.find('.drop-lessons').hide();
|
112 |
+
}else{
|
113 |
+
$topic.find('.drop-lessons').show();
|
114 |
+
}
|
115 |
+
*/
|
116 |
+
|
117 |
+
});
|
118 |
+
$('#tutor_topics_lessons_sorting').val(JSON.stringify(topics));
|
119 |
+
}
|
120 |
+
|
121 |
+
$(document).on('click', '.create_new_topic_btn', function (e) {
|
122 |
+
e.preventDefault();
|
123 |
+
$('.tutor-metabox-add-topics').slideToggle();
|
124 |
+
});
|
125 |
+
|
126 |
+
$(document).on('click', '#tutor-add-topic-btn', function (e) {
|
127 |
+
e.preventDefault();
|
128 |
+
var $that = $(this);
|
129 |
+
var form_data = $that.closest('.tutor-metabox-add-topics').find('input, textarea').serialize()+'&action=tutor_add_course_topic';
|
130 |
+
|
131 |
+
$.ajax({
|
132 |
+
url : ajaxurl,
|
133 |
+
type : 'POST',
|
134 |
+
data : form_data,
|
135 |
+
beforeSend: function () {
|
136 |
+
$that.addClass('tutor-updating-message');
|
137 |
+
},
|
138 |
+
success: function (data) {
|
139 |
+
if (data.success){
|
140 |
+
$('#tutor-course-content-wrap').html(data.data.course_contents);
|
141 |
+
$that.closest('.tutor-metabox-add-topics').find('input[type!="hidden"], textarea').each(function () {
|
142 |
+
$(this).val('');
|
143 |
+
});
|
144 |
+
$that.closest('.tutor-metabox-add-topics').slideUp();
|
145 |
+
enable_sorting_topic_lesson();
|
146 |
+
}
|
147 |
+
},
|
148 |
+
complete: function () {
|
149 |
+
$that.removeClass('tutor-updating-message');
|
150 |
+
}
|
151 |
+
});
|
152 |
+
});
|
153 |
+
|
154 |
+
$(document).on('change keyup', '.course-edit-topic-title-input', function (e) {
|
155 |
+
e.preventDefault();
|
156 |
+
$(this).closest('.tutor-topics-top').find('.topic-inner-title').html($(this).val());
|
157 |
+
});
|
158 |
+
|
159 |
+
$(document).on('click', '.topic-edit-icon', function (e) {
|
160 |
+
e.preventDefault();
|
161 |
+
$(this).closest('.tutor-topics-top').find('.tutor-topics-edit-form').slideToggle();
|
162 |
+
});
|
163 |
+
|
164 |
+
$(document).on('click', '.tutor-topics-edit-button', function(e){
|
165 |
+
e.preventDefault();
|
166 |
+
var $button = $(this);
|
167 |
+
var $topic = $button.closest('.tutor-topics-wrap');
|
168 |
+
var topics_id = parseInt($topic.attr('id').match(/\d+/)[0], 10);
|
169 |
+
var topic_title = $button.closest('.tutor-topics-wrap').find('[name="topic_title"]').val();
|
170 |
+
var topic_summery = $button.closest('.tutor-topics-wrap').find('[name="topic_summery"]').val();
|
171 |
+
|
172 |
+
var data = {topic_title: topic_title, topic_summery : topic_summery, topic_id : topics_id, action: 'tutor_update_topic'};
|
173 |
+
$.ajax({
|
174 |
+
url : ajaxurl,
|
175 |
+
type : 'POST',
|
176 |
+
data : data,
|
177 |
+
beforeSend: function () {
|
178 |
+
$button.addClass('tutor-updating-message');
|
179 |
+
},
|
180 |
+
success: function (data) {
|
181 |
+
if (data.success){
|
182 |
+
$button.closest('.tutor-topics-wrap').find('span.topic-inner-title').text(topic_title);
|
183 |
+
$button.closest('.tutor-topics-wrap').find('.tutor-topics-edit-form').slideUp();
|
184 |
+
}
|
185 |
+
},
|
186 |
+
complete: function () {
|
187 |
+
$button.removeClass('tutor-updating-message');
|
188 |
+
}
|
189 |
+
});
|
190 |
+
});
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Confirmation for deleting Topic
|
194 |
+
*/
|
195 |
+
$(document).on('click', '.topic-delete-btn a', function(e){
|
196 |
+
var topic_id = $(this).attr('data-topic-id');
|
197 |
+
console.log(topic_id);
|
198 |
+
|
199 |
+
if ( ! confirm('Are you sure to delete?')){
|
200 |
+
e.preventDefault();
|
201 |
+
}
|
202 |
+
});
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Create Lesson Under Topic
|
206 |
+
*/
|
207 |
+
/*
|
208 |
+
$(document).on('click', '.create-lesson-in-topic-btn', function(e){
|
209 |
+
e.preventDefault();
|
210 |
+
$(this).closest('.tutor-lessons').find('.tutor-create-new-lesson-form').toggle();
|
211 |
+
});
|
212 |
+
$(document).on('click', '.tutor-create-lesson-btn', function(e){
|
213 |
+
e.preventDefault();
|
214 |
+
var $that = $(this);
|
215 |
+
|
216 |
+
var course_id = $('#post_ID').val();
|
217 |
+
var topic_id = $that.closest('.tutor-create-new-lesson-form').attr('data-topic-id');
|
218 |
+
|
219 |
+
var form_data = $that.closest('.tutor-create-new-lesson-form').find('input, textarea').serialize()+'&course_id='+course_id+'&topic_id='+topic_id+'&action=tutor_create_lesson';
|
220 |
+
|
221 |
+
$.ajax({
|
222 |
+
url : ajaxurl,
|
223 |
+
type : 'POST',
|
224 |
+
data : form_data,
|
225 |
+
beforeSend: function () {
|
226 |
+
$that.addClass('tutor-updating-message');
|
227 |
+
},
|
228 |
+
success: function (data) {
|
229 |
+
if (data.success){
|
230 |
+
$('#tutor-course-content-wrap').html(data.data.course_contents);
|
231 |
+
$that.closest('.tutor-create-new-lesson-form').find('input, textarea').each(function () {
|
232 |
+
$(this).val('');
|
233 |
+
});
|
234 |
+
enable_sorting_topic_lesson();
|
235 |
+
}
|
236 |
+
},
|
237 |
+
complete: function () {
|
238 |
+
$that.removeClass('tutor-updating-message');
|
239 |
+
}
|
240 |
+
});
|
241 |
+
});
|
242 |
+
|
243 |
+
$(document).on('click', '.open-inline-lesson-edit-btn', function(e){
|
244 |
+
e.preventDefault();
|
245 |
+
$(this).closest('.tutor-lesson').find('.tutor-edit-inline-lesson-form').toggle();
|
246 |
+
});
|
247 |
+
$(document).on('change keyup', '.inline-lesson-title-input', function (e) {
|
248 |
+
e.preventDefault();
|
249 |
+
$(this).closest('.tutor-lesson').find('.open-inline-lesson-edit-btn').html($(this).val());
|
250 |
+
});
|
251 |
+
|
252 |
+
$(document).on('click', '.edit-inline-lesson-btn', function(e){
|
253 |
+
e.preventDefault();
|
254 |
+
var $that = $(this);
|
255 |
+
|
256 |
+
var course_id = $('#post_ID').val();
|
257 |
+
var lesson_id = $that.closest('.tutor-edit-inline-lesson-form').attr('data-lesson-id');
|
258 |
+
var topic_id = $that.closest('.tutor-edit-inline-lesson-form').attr('data-topic-id');
|
259 |
+
|
260 |
+
var form_data = $that.closest('.tutor-edit-inline-lesson-form').find('input, textarea').serialize()+'&course_id='+course_id+'&lesson_id='+lesson_id+'&topic_id='+topic_id+'&action=tutor_update_inline_lesson';
|
261 |
+
|
262 |
+
$.ajax({
|
263 |
+
url : ajaxurl,
|
264 |
+
type : 'POST',
|
265 |
+
data : form_data,
|
266 |
+
beforeSend: function () {
|
267 |
+
$that.addClass('tutor-updating-message');
|
268 |
+
},
|
269 |
+
success: function (data) {
|
270 |
+
if (data.success){
|
271 |
+
$that.closest('.tutor-edit-inline-lesson-form').hide();
|
272 |
+
}
|
273 |
+
},
|
274 |
+
complete: function () {
|
275 |
+
$that.removeClass('tutor-updating-message');
|
276 |
+
}
|
277 |
+
});
|
278 |
+
});
|
279 |
+
*/
|
280 |
+
$(document).on('click', '.tutor-expand-all-topic', function (e) {
|
281 |
+
e.preventDefault();
|
282 |
+
$('.tutor-topics-body').slideDown();
|
283 |
+
});
|
284 |
+
$(document).on('click', '.tutor-collapse-all-topic', function (e) {
|
285 |
+
e.preventDefault();
|
286 |
+
$('.tutor-topics-body').slideUp();
|
287 |
+
});
|
288 |
+
$(document).on('click', '.expand-collapse-wrap', function (e) {
|
289 |
+
e.preventDefault();
|
290 |
+
var $that = $(this);
|
291 |
+
$that.closest('.tutor-topics-wrap').find('.tutor-topics-body').slideToggle();
|
292 |
+
$that.closest('.tutor-topics-wrap').find('.expand-collapse-wrap .dashicons').toggleClass('dashicons-arrow-down-alt2 dashicons-arrow-up-alt2 ');
|
293 |
+
});
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Update Lesson Modal
|
297 |
+
*/
|
298 |
+
$(document).on('click', '.open-tutor-lesson-modal', function(e){
|
299 |
+
e.preventDefault();
|
300 |
+
|
301 |
+
var $that = $(this);
|
302 |
+
var lesson_id = $that.attr('data-lesson-id');
|
303 |
+
var topic_id = $that.attr('data-topic-id');
|
304 |
+
var course_id = $('#post_ID').val();
|
305 |
+
|
306 |
+
$.ajax({
|
307 |
+
url : ajaxurl,
|
308 |
+
type : 'POST',
|
309 |
+
data : {lesson_id : lesson_id, topic_id : topic_id, course_id : course_id, action: 'tutor_load_edit_lesson_modal'},
|
310 |
+
beforeSend: function () {
|
311 |
+
$that.addClass('tutor-updating-message');
|
312 |
+
},
|
313 |
+
success: function (data) {
|
314 |
+
$('.tutor-lesson-modal-wrap .modal-container').html(data.data.output);
|
315 |
+
$('.tutor-lesson-modal-wrap').attr({'data-lesson-id' : lesson_id, 'data-topic-id':topic_id}).addClass('show');
|
316 |
+
|
317 |
+
tinymce.init(tinyMCEPreInit.mceInit.content);
|
318 |
+
tinymce.execCommand( 'mceRemoveEditor', false, 'tutor_lesson_modal_editor' );
|
319 |
+
tinyMCE.execCommand('mceAddEditor', false, "tutor_lesson_modal_editor");
|
320 |
+
},
|
321 |
+
complete: function () {
|
322 |
+
quicktags({id : "tutor_lesson_modal_editor"});
|
323 |
+
$that.removeClass('tutor-updating-message');
|
324 |
+
}
|
325 |
+
});
|
326 |
+
});
|
327 |
+
|
328 |
+
$(document).on( 'click', '.lesson_thumbnail_upload_btn', function( event ){
|
329 |
+
event.preventDefault();
|
330 |
+
var $that = $(this);
|
331 |
+
var frame;
|
332 |
+
if ( frame ) {
|
333 |
+
frame.open();
|
334 |
+
return;
|
335 |
+
}
|
336 |
+
frame = wp.media({
|
337 |
+
title: 'Select or Upload Media Of Your Chosen Persuasion',
|
338 |
+
button: {
|
339 |
+
text: 'Use this media'
|
340 |
+
},
|
341 |
+
multiple: false
|
342 |
+
});
|
343 |
+
frame.on( 'select', function() {
|
344 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
345 |
+
$that.closest('.tutor-thumbnail-wrap').find('.thumbnail-img').html('<img src="'+attachment.url+'" alt="" />');
|
346 |
+
$that.closest('.tutor-thumbnail-wrap').find('input').val(attachment.id);
|
347 |
+
});
|
348 |
+
frame.open();
|
349 |
+
});
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Delete Lesson from course builder
|
353 |
+
*/
|
354 |
+
$(document).on('click', '.tutor-delete-lesson-btn', function(e){
|
355 |
+
e.preventDefault();
|
356 |
+
|
357 |
+
if( ! confirm('Are you sure?')){
|
358 |
+
return;
|
359 |
+
}
|
360 |
+
|
361 |
+
var $that = $(this);
|
362 |
+
var lesson_id = $that.attr('data-lesson-id');
|
363 |
+
|
364 |
+
$.ajax({
|
365 |
+
url : ajaxurl,
|
366 |
+
type : 'POST',
|
367 |
+
data : {lesson_id : lesson_id, action: 'tutor_delete_lesson_by_id'},
|
368 |
+
beforeSend: function () {
|
369 |
+
$that.addClass('tutor-updating-message');
|
370 |
+
},
|
371 |
+
success: function (data) {
|
372 |
+
if (data.success){
|
373 |
+
$that.closest('.tutor-lesson').remove();
|
374 |
+
}
|
375 |
+
},
|
376 |
+
complete: function () {
|
377 |
+
$that.removeClass('tutor-updating-message');
|
378 |
+
}
|
379 |
+
});
|
380 |
+
});
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Lesson Update or Create Modal
|
384 |
+
*/
|
385 |
+
$(document).on( 'click', '.update_lesson_modal_btn', function( event ){
|
386 |
+
event.preventDefault();
|
387 |
+
|
388 |
+
var $that = $(this);
|
389 |
+
var content;
|
390 |
+
var editor = tinyMCE.get('tutor_lesson_modal_editor');
|
391 |
+
if (editor) {
|
392 |
+
content = editor.getContent();
|
393 |
+
} else {
|
394 |
+
content = $('#'+inputid).val();
|
395 |
+
}
|
396 |
+
|
397 |
+
var form_data = $(this).closest('form').serialize();
|
398 |
+
form_data += '&lesson_content='+content;
|
399 |
+
|
400 |
+
$.ajax({
|
401 |
+
url : ajaxurl,
|
402 |
+
type : 'POST',
|
403 |
+
data : form_data,
|
404 |
+
beforeSend: function () {
|
405 |
+
$that.addClass('tutor-updating-message');
|
406 |
+
},
|
407 |
+
success: function (data) {
|
408 |
+
if (data.success){
|
409 |
+
$('#tutor-course-content-wrap').html(data.data.course_contents);
|
410 |
+
enable_sorting_topic_lesson();
|
411 |
+
|
412 |
+
//Close the modal
|
413 |
+
$('.tutor-lesson-modal-wrap').removeClass('show');
|
414 |
+
}
|
415 |
+
},
|
416 |
+
complete: function () {
|
417 |
+
$that.removeClass('tutor-updating-message');
|
418 |
+
}
|
419 |
+
});
|
420 |
+
});
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Lesson Video
|
424 |
+
*/
|
425 |
+
$(document).on('change', '.tutor_lesson_video_source', function(e){
|
426 |
+
var selector = $(this).val();
|
427 |
+
$('[class^="video_source_wrap"]').hide();
|
428 |
+
$('.video_source_wrap_'+selector).show();
|
429 |
+
});
|
430 |
+
|
431 |
+
$(document).on( 'click', '.video_source_wrap_html5 .video_upload_btn', function( event ){
|
432 |
+
event.preventDefault();
|
433 |
+
|
434 |
+
var $that = $(this);
|
435 |
+
var frame;
|
436 |
+
// If the media frame already exists, reopen it.
|
437 |
+
if ( frame ) {
|
438 |
+
frame.open();
|
439 |
+
return;
|
440 |
+
}
|
441 |
+
|
442 |
+
// Create a new media frame
|
443 |
+
frame = wp.media({
|
444 |
+
title: 'Select or Upload Media Of Your Chosen Persuasion',
|
445 |
+
button: {
|
446 |
+
text: 'Use this media'
|
447 |
+
},
|
448 |
+
multiple: false // Set to true to allow multiple files to be selected
|
449 |
+
});
|
450 |
+
|
451 |
+
// When an image is selected in the media frame...
|
452 |
+
frame.on( 'select', function() {
|
453 |
+
// Get media attachment details from the frame state
|
454 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
455 |
+
$that.closest('.video_source_wrap_html5').find('span.video_media_id').text(attachment.id).closest('p').show();
|
456 |
+
$that.closest('.video_source_wrap_html5').find('input').val(attachment.id);
|
457 |
+
});
|
458 |
+
// Finally, open the modal on click
|
459 |
+
frame.open();
|
460 |
+
});
|
461 |
+
|
462 |
+
//tutor_video_poster_upload_btn
|
463 |
+
$(document).on( 'click', '.tutor_video_poster_upload_btn', function( event ){
|
464 |
+
event.preventDefault();
|
465 |
+
|
466 |
+
var $that = $(this);
|
467 |
+
var frame;
|
468 |
+
// If the media frame already exists, reopen it.
|
469 |
+
if ( frame ) {
|
470 |
+
frame.open();
|
471 |
+
return;
|
472 |
+
}
|
473 |
+
|
474 |
+
// Create a new media frame
|
475 |
+
frame = wp.media({
|
476 |
+
title: 'Select or Upload Media Of Your Chosen Persuasion',
|
477 |
+
button: {
|
478 |
+
text: 'Use this media'
|
479 |
+
},
|
480 |
+
multiple: false // Set to true to allow multiple files to be selected
|
481 |
+
});
|
482 |
+
|
483 |
+
// When an image is selected in the media frame...
|
484 |
+
frame.on( 'select', function() {
|
485 |
+
// Get media attachment details from the frame state
|
486 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
487 |
+
$that.closest('.tutor-video-poster-wrap').find('.video-poster-img').html('<img src="'+attachment.url+'" alt="" />');
|
488 |
+
$that.closest('.tutor-video-poster-wrap').find('input').val(attachment.id);
|
489 |
+
});
|
490 |
+
// Finally, open the modal on click
|
491 |
+
frame.open();
|
492 |
+
});
|
493 |
+
|
494 |
+
$(document).on('click', 'a.tutor-delete-attachment', function(e){
|
495 |
+
e.preventDefault();
|
496 |
+
$(this).closest('.tutor-added-attachment').remove();
|
497 |
+
});
|
498 |
+
|
499 |
+
$(document).on('click', '.tutorUploadAttachmentBtn', function(e){
|
500 |
+
e.preventDefault();
|
501 |
+
|
502 |
+
var $that = $(this);
|
503 |
+
var frame;
|
504 |
+
// If the media frame already exists, reopen it.
|
505 |
+
if ( frame ) {
|
506 |
+
frame.open();
|
507 |
+
return;
|
508 |
+
}
|
509 |
+
// Create a new media frame
|
510 |
+
frame = wp.media({
|
511 |
+
title: 'Select or Upload Media Of Your Chosen Persuasion',
|
512 |
+
button: {
|
513 |
+
text: 'Use this media'
|
514 |
+
},
|
515 |
+
multiple: true // Set to true to allow multiple files to be selected
|
516 |
+
});
|
517 |
+
// When an image is selected in the media frame...
|
518 |
+
frame.on( 'select', function() {
|
519 |
+
// Get media attachment details from the frame state
|
520 |
+
var attachments = frame.state().get('selection').toJSON();
|
521 |
+
if (attachments.length){
|
522 |
+
for (var i=0; i < attachments.length; i++){
|
523 |
+
var attachment = attachments[i];
|
524 |
+
|
525 |
+
var inputHtml = '<div class="tutor-added-attachment"><p> <a href="javascript:;" class="tutor-delete-attachment">×</a> <span> <a href="'+attachment.url+'">'+attachment.filename+'</a> </span> </p><input type="hidden" name="tutor_attachments[]" value="'+attachment.id+'"></div>';
|
526 |
+
$that.closest('.tutor-lesson-attachments-metabox').find('.tutor-added-attachments-wrap').append(inputHtml);
|
527 |
+
}
|
528 |
+
}
|
529 |
+
});
|
530 |
+
// Finally, open the modal on click
|
531 |
+
frame.open();
|
532 |
+
});
|
533 |
+
|
534 |
+
/**
|
535 |
+
* Open Sidebar Menu
|
536 |
+
*/
|
537 |
+
if (tutor_data.open_tutor_admin_menu){
|
538 |
+
var $adminMenu = $('#adminmenu');
|
539 |
+
$adminMenu.find('[href="admin.php?page=tutor"]').closest('li.wp-has-submenu').addClass('wp-has-current-submenu');
|
540 |
+
$adminMenu.find('[href="admin.php?page=tutor"]').closest('li.wp-has-submenu').find('a.wp-has-submenu').removeClass('wp-has-current-submenu').addClass('wp-has-current-submenu');
|
541 |
+
}
|
542 |
+
|
543 |
+
/**
|
544 |
+
* Add question answer for quiz
|
545 |
+
*/
|
546 |
+
|
547 |
+
$(document).on('change keyup paste', '.question_field_title', function(){
|
548 |
+
var $that = $(this);
|
549 |
+
$that.closest('.single-question-item').find('.tutor-question-item-head').find('.question-title').text($that.val());
|
550 |
+
});
|
551 |
+
|
552 |
+
$(document).on('change', '.question_type_field', function(){
|
553 |
+
var $that = $(this);
|
554 |
+
var question_type = $that.val();
|
555 |
+
|
556 |
+
var option_text = $that.find('option[value="'+question_type+'"]').text();
|
557 |
+
$that.closest('.single-question-item').find('.tutor-question-item-head').find('.question-type').text(option_text);
|
558 |
+
|
559 |
+
var question_id = $that.closest('.single-question-item').attr('data-question-id');
|
560 |
+
var data = {question_id: question_id, question_type : question_type, action: 'quiz_question_type_changed'};
|
561 |
+
|
562 |
+
$.ajax({
|
563 |
+
url : ajaxurl,
|
564 |
+
type : 'POST',
|
565 |
+
data : data,
|
566 |
+
beforeSend: function () {
|
567 |
+
$that.closest('.single-question-item').find('.tutor-loading-icon-wrap').addClass('tutor-updating-message');
|
568 |
+
},
|
569 |
+
success: function (data) {
|
570 |
+
if (data.success){
|
571 |
+
$that.closest('.quiz-question-form-wrap').find('.answer-entry-wrap').html(data.data.multi_answer_options);
|
572 |
+
|
573 |
+
if (question_type === 'true_false' && $('.answer-option-row').length >= 2){
|
574 |
+
$('.add_answer_option_wrap').hide();
|
575 |
+
}else{
|
576 |
+
$('.add_answer_option_wrap').show();
|
577 |
+
}
|
578 |
+
}
|
579 |
+
},
|
580 |
+
complete: function () {
|
581 |
+
$that.closest('.single-question-item').find('.tutor-loading-icon-wrap').removeClass('tutor-updating-message');
|
582 |
+
}
|
583 |
+
});
|
584 |
+
});
|
585 |
+
|
586 |
+
$(document).on('click', '.add_answer_option_btn', function(e){
|
587 |
+
e.preventDefault();
|
588 |
+
|
589 |
+
var $that = $(this);
|
590 |
+
var question_id = $that.closest('.single-question-item').attr('data-question-id');
|
591 |
+
var question_type = $that.closest('.quiz-question-form-wrap').find('select.question_type_field').val();
|
592 |
+
var data = {question_id: question_id, action: 'quiz_add_answer_to_question'};
|
593 |
+
|
594 |
+
$.ajax({
|
595 |
+
url : ajaxurl,
|
596 |
+
type : 'POST',
|
597 |
+
data : data,
|
598 |
+
beforeSend: function () {
|
599 |
+
$that.removeClass('updated-message').addClass('tutor-updating-message');
|
600 |
+
},
|
601 |
+
success: function (data) {
|
602 |
+
if (data.success){
|
603 |
+
$that.closest('.answer-entry-wrap').find('table.multi-answers-options').append(data.data.data_tr);
|
604 |
+
|
605 |
+
//Hide add answer button if true false and 2 option exists
|
606 |
+
if (question_type === 'true_false' && $that.closest('.answer-entry-wrap').find('tr.answer-option-row').length >= 2){
|
607 |
+
$that.closest('.add_answer_option_wrap').hide();
|
608 |
+
}else{
|
609 |
+
$that.closest('.add_answer_option_wrap').show();
|
610 |
+
}
|
611 |
+
}
|
612 |
+
},
|
613 |
+
complete: function () {
|
614 |
+
$that.removeClass('tutor-updating-message').addClass('updated-message');
|
615 |
+
}
|
616 |
+
});
|
617 |
+
});
|
618 |
+
|
619 |
+
$(document).on('click', '.add_question_btn', function(e){
|
620 |
+
e.preventDefault();
|
621 |
+
|
622 |
+
var $that = $(this);
|
623 |
+
var $title = $('[name="new_question_title"]');
|
624 |
+
var question_title = $title.val();
|
625 |
+
var question_type = $('[name="new_question_type"]').val();
|
626 |
+
var quiz_id = $('#post_ID').val();
|
627 |
+
|
628 |
+
//If no question title, stop here
|
629 |
+
if ( ! question_title.length){
|
630 |
+
$title.addClass('tutor-input-text-error');
|
631 |
+
return;
|
632 |
+
}else{
|
633 |
+
$title.removeClass('tutor-input-text-error');
|
634 |
+
}
|
635 |
+
|
636 |
+
var data = {question_title : question_title, question_type:question_type, quiz_id : quiz_id, action: 'quiz_page_add_new_question' };
|
637 |
+
$.ajax({
|
638 |
+
url : ajaxurl,
|
639 |
+
type : 'POST',
|
640 |
+
data : data,
|
641 |
+
beforeSend: function () {
|
642 |
+
$that.removeClass('updated-message').addClass('tutor-updating-message');
|
643 |
+
},
|
644 |
+
success: function (data) {
|
645 |
+
if (data.success){
|
646 |
+
$('.single-question-item .quiz-question-form-wrap').hide();
|
647 |
+
$('.tutor-quiz-questions-wrap').append(data.data.question_html);
|
648 |
+
$('.single-question-item:last-child .quiz-question-form-wrap').show();
|
649 |
+
$title.val('');
|
650 |
+
}
|
651 |
+
},
|
652 |
+
complete: function () {
|
653 |
+
$that.removeClass('tutor-updating-message').addClass('updated-message');
|
654 |
+
}
|
655 |
+
});
|
656 |
+
});
|
657 |
+
|
658 |
+
//Show hide question settings
|
659 |
+
$(document).on('click', '.question-action-btn.down', function(e){
|
660 |
+
e.preventDefault();
|
661 |
+
$(this).closest('.single-question-item').find('.quiz-question-form-wrap').toggle();
|
662 |
+
$(this).find('i.dashicons').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
|
663 |
+
});
|
664 |
+
|
665 |
+
$(document).on('change', '.single-question-item', function(e){
|
666 |
+
e.preventDefault();
|
667 |
+
|
668 |
+
var $that = $(this);
|
669 |
+
var data = $(this).find("select, textarea, input").serialize()+'&action=update_tutor_question';
|
670 |
+
$.ajax({
|
671 |
+
url : ajaxurl,
|
672 |
+
type : 'POST',
|
673 |
+
data : data,
|
674 |
+
beforeSend: function () {
|
675 |
+
$that.find('.tutor-loading-icon-wrap').addClass('tutor-updating-message');
|
676 |
+
},
|
677 |
+
success: function (data) {
|
678 |
+
if (data.success){
|
679 |
+
|
680 |
+
}
|
681 |
+
},
|
682 |
+
complete: function () {
|
683 |
+
$that.find('.tutor-loading-icon-wrap').removeClass('tutor-updating-message');
|
684 |
+
}
|
685 |
+
});
|
686 |
+
});
|
687 |
+
|
688 |
+
$(document).on('click', '.quiz-answer-option-delete-btn', function(e){
|
689 |
+
e.preventDefault();
|
690 |
+
var $that = $(this);
|
691 |
+
var $closestTable = $that.closest('table');
|
692 |
+
var $loadingIcon = $that.closest('.single-question-item').find('.tutor-loading-icon-wrap');
|
693 |
+
|
694 |
+
var question_type = $that.closest('.quiz-question-form-wrap').find('select.question_type_field').val();
|
695 |
+
var answer_option_id = $that.closest('tr').attr('data-answer-option-id');
|
696 |
+
|
697 |
+
$.ajax({
|
698 |
+
url : ajaxurl,
|
699 |
+
type : 'POST',
|
700 |
+
data : {answer_option_id:answer_option_id, action: 'quiz_delete_answer_option'},
|
701 |
+
beforeSend: function () {
|
702 |
+
$loadingIcon.addClass('tutor-updating-message');
|
703 |
+
},
|
704 |
+
success: function (data) {
|
705 |
+
if (data.success){
|
706 |
+
$that.closest('tr').remove();
|
707 |
+
//Hide add answer button if true false and 2 option exists
|
708 |
+
if (question_type === 'true_false' && $closestTable.find('tr.answer-option-row').length >= 2){
|
709 |
+
$closestTable.closest('.answer-entry-wrap').find('.add_answer_option_wrap').hide();
|
710 |
+
}else{
|
711 |
+
$closestTable.closest('.answer-entry-wrap').find('.add_answer_option_wrap').show();
|
712 |
+
}
|
713 |
+
}
|
714 |
+
},
|
715 |
+
complete: function () {
|
716 |
+
$loadingIcon.removeClass('tutor-updating-message');
|
717 |
+
}
|
718 |
+
});
|
719 |
+
});
|
720 |
+
|
721 |
+
$(document).on('click', '.question-action-btn.trash', function(e){
|
722 |
+
e.preventDefault();
|
723 |
+
|
724 |
+
var $that = $(this);
|
725 |
+
var question_id = $that.closest('.single-question-item').attr('data-question-id');
|
726 |
+
var $loadingIcon = $that.closest('.single-question-item').find('.tutor-loading-icon-wrap');
|
727 |
+
|
728 |
+
$.ajax({
|
729 |
+
url : ajaxurl,
|
730 |
+
type : 'POST',
|
731 |
+
data : {question_id:question_id, action: 'quiz_question_delete'},
|
732 |
+
beforeSend: function () {
|
733 |
+
$loadingIcon.addClass('tutor-updating-message');
|
734 |
+
},
|
735 |
+
success: function (data) {
|
736 |
+
if (data.success){
|
737 |
+
$that.closest('.single-question-item').remove();
|
738 |
+
}
|
739 |
+
},
|
740 |
+
complete: function () {
|
741 |
+
$loadingIcon.removeClass('tutor-updating-message');
|
742 |
+
}
|
743 |
+
});
|
744 |
+
});
|
745 |
+
|
746 |
+
/**
|
747 |
+
* Sort quiz questions
|
748 |
+
*/
|
749 |
+
|
750 |
+
if (jQuery().sortable) {
|
751 |
+
$(".tutor-quiz-questions-wrap").sortable({
|
752 |
+
handle: ".question-short",
|
753 |
+
start: function (e, ui) {
|
754 |
+
ui.placeholder.css('visibility', 'visible');
|
755 |
+
},
|
756 |
+
stop: function (e, ui) {
|
757 |
+
var questions = {};
|
758 |
+
$('.single-question-item').each(function(index, item){
|
759 |
+
var $question = $(this);
|
760 |
+
var question_id = parseInt($question.attr('data-question-id').match(/\d+/)[0], 10);
|
761 |
+
questions[index] = { 'question_id' : question_id };
|
762 |
+
});
|
763 |
+
|
764 |
+
$.post(ajaxurl, {questions : questions, action: 'sorting_quiz_questions'});
|
765 |
+
},
|
766 |
+
});
|
767 |
+
}
|
768 |
+
|
769 |
+
/**
|
770 |
+
* Quiz Modal
|
771 |
+
*/
|
772 |
+
|
773 |
+
$(document).on('click', '.modal-close-btn', function(e){
|
774 |
+
e.preventDefault();
|
775 |
+
$('.tutor-modal-wrap').removeClass('show');
|
776 |
+
});
|
777 |
+
$(document).on('keyup', function(e){
|
778 |
+
if (e.keyCode === 27){
|
779 |
+
$('.tutor-modal-wrap').removeClass('show');
|
780 |
+
}
|
781 |
+
});
|
782 |
+
$(document).on('click', '.tutor-add-quiz-btn', function(e){
|
783 |
+
e.preventDefault();
|
784 |
+
|
785 |
+
var $that = $(this);
|
786 |
+
var quiz_for_post_id = $(this).closest('.tutor_add_quiz_wrap').attr('data-add-quiz-under');
|
787 |
+
|
788 |
+
$.ajax({
|
789 |
+
url : ajaxurl,
|
790 |
+
type : 'POST',
|
791 |
+
data : {quiz_for_post_id : quiz_for_post_id, action: 'tutor_load_quiz_modal'},
|
792 |
+
beforeSend: function () {
|
793 |
+
$that.addClass('tutor-updating-message');
|
794 |
+
},
|
795 |
+
success: function (data) {
|
796 |
+
$('.tutor-quiz-modal-wrap .modal-container').html(data.data.output);
|
797 |
+
$('.tutor-quiz-modal-wrap').attr('quiz-for-post-id', quiz_for_post_id).addClass('show');
|
798 |
+
},
|
799 |
+
complete: function () {
|
800 |
+
$that.removeClass('tutor-updating-message');
|
801 |
+
}
|
802 |
+
});
|
803 |
+
});
|
804 |
+
|
805 |
+
$(document).on('click', '.add_quiz_to_post_btn', function(e){
|
806 |
+
e.preventDefault();
|
807 |
+
|
808 |
+
var $that = $(this);
|
809 |
+
var $modal = $('.tutor-modal-wrap');
|
810 |
+
|
811 |
+
var quiz_for_post_id = $modal.attr('quiz-for-post-id');
|
812 |
+
var data = $modal.find('input').serialize()+'&action=tutor_add_quiz_to_post&parent_post_id='+quiz_for_post_id;
|
813 |
+
|
814 |
+
$.ajax({
|
815 |
+
url : ajaxurl,
|
816 |
+
type : 'POST',
|
817 |
+
data : data,
|
818 |
+
beforeSend: function () {
|
819 |
+
$that.addClass('tutor-updating-message');
|
820 |
+
},
|
821 |
+
success: function (data) {
|
822 |
+
if (data.success){
|
823 |
+
$('[data-add-quiz-under="'+quiz_for_post_id+'"] .tutor-available-quizzes').html(data.data.output);
|
824 |
+
$('.tutor-modal-wrap').removeClass('show');
|
825 |
+
}
|
826 |
+
},
|
827 |
+
complete: function () {
|
828 |
+
$that.removeClass('tutor-updating-message');
|
829 |
+
}
|
830 |
+
});
|
831 |
+
});
|
832 |
+
|
833 |
+
$(document).on('change keyup', '.tutor-quiz-modal-wrap .tutor-modal-search-input', function(e){
|
834 |
+
e.preventDefault();
|
835 |
+
|
836 |
+
var $that = $(this);
|
837 |
+
var $modal = $('.tutor-modal-wrap');
|
838 |
+
|
839 |
+
tutor_delay(function(){
|
840 |
+
var search_terms = $that.val();
|
841 |
+
var quiz_for_post_id = $modal.attr('quiz-for-post-id');
|
842 |
+
|
843 |
+
$.ajax({
|
844 |
+
url : ajaxurl,
|
845 |
+
type : 'POST',
|
846 |
+
data : {quiz_for_post_id : quiz_for_post_id, search_terms : search_terms, action: 'tutor_load_quiz_modal'},
|
847 |
+
beforeSend: function () {
|
848 |
+
$modal.addClass('loading');
|
849 |
+
},
|
850 |
+
success: function (data) {
|
851 |
+
if (data.success){
|
852 |
+
$('.tutor-modal-wrap .modal-container').html(data.data.output);
|
853 |
+
}
|
854 |
+
},
|
855 |
+
complete: function () {
|
856 |
+
$modal.removeClass('loading');
|
857 |
+
}
|
858 |
+
});
|
859 |
+
|
860 |
+
}, 1000)
|
861 |
+
});
|
862 |
+
|
863 |
+
var tutor_delay = (function(){
|
864 |
+
var timer = 0;
|
865 |
+
return function(callback, ms){
|
866 |
+
clearTimeout (timer);
|
867 |
+
timer = setTimeout(callback, ms);
|
868 |
+
};
|
869 |
+
})();
|
870 |
+
|
871 |
+
$(document).on('click', '.tutor-quiz-delete-btn', function(e){
|
872 |
+
e.preventDefault();
|
873 |
+
|
874 |
+
var $that = $(this);
|
875 |
+
var quiz_id = $that.closest('.added-quiz-item').attr('data-quiz-id');
|
876 |
+
|
877 |
+
$.ajax({
|
878 |
+
url : ajaxurl,
|
879 |
+
type : 'POST',
|
880 |
+
data : {quiz_id:quiz_id, action: 'remove_quiz_from_post'},
|
881 |
+
success: function (data) {
|
882 |
+
if (data.success){
|
883 |
+
$that.closest('.added-quiz-item').remove();
|
884 |
+
}
|
885 |
+
}
|
886 |
+
});
|
887 |
+
});
|
888 |
+
|
889 |
+
/**
|
890 |
+
* Add instructor modal
|
891 |
+
*/
|
892 |
+
$(document).on('click', '.tutor-add-instructor-btn', function(e){
|
893 |
+
e.preventDefault();
|
894 |
+
|
895 |
+
var $that = $(this);
|
896 |
+
var course_id = $('#post_ID').val();
|
897 |
+
|
898 |
+
$.ajax({
|
899 |
+
url : ajaxurl,
|
900 |
+
type : 'POST',
|
901 |
+
data : {course_id : course_id, action: 'tutor_load_instructors_modal'},
|
902 |
+
beforeSend: function () {
|
903 |
+
$that.addClass('tutor-updating-message');
|
904 |
+
},
|
905 |
+
success: function (data) {
|
906 |
+
if (data.success){
|
907 |
+
$('.tutor-instructors-modal-wrap .modal-container').html(data.data.output);
|
908 |
+
$('.tutor-instructors-modal-wrap').addClass('show');
|
909 |
+
}
|
910 |
+
},
|
911 |
+
complete: function () {
|
912 |
+
$that.removeClass('tutor-updating-message');
|
913 |
+
}
|
914 |
+
});
|
915 |
+
});
|
916 |
+
|
917 |
+
$(document).on('change keyup', '.tutor-instructors-modal-wrap .tutor-modal-search-input', function(e){
|
918 |
+
e.preventDefault();
|
919 |
+
|
920 |
+
var $that = $(this);
|
921 |
+
var $modal = $('.tutor-modal-wrap');
|
922 |
+
|
923 |
+
tutor_delay(function(){
|
924 |
+
var search_terms = $that.val();
|
925 |
+
var course_id = $('#post_ID').val();
|
926 |
+
|
927 |
+
$.ajax({
|
928 |
+
url : ajaxurl,
|
929 |
+
type : 'POST',
|
930 |
+
data : {course_id : course_id, search_terms : search_terms, action: 'tutor_load_instructors_modal'},
|
931 |
+
beforeSend: function () {
|
932 |
+
$modal.addClass('loading');
|
933 |
+
},
|
934 |
+
success: function (data) {
|
935 |
+
if (data.success){
|
936 |
+
$('.tutor-instructors-modal-wrap .modal-container').html(data.data.output);
|
937 |
+
$('.tutor-instructors-modal-wrap').addClass('show');
|
938 |
+
}
|
939 |
+
},
|
940 |
+
complete: function () {
|
941 |
+
$modal.removeClass('loading');
|
942 |
+
}
|
943 |
+
});
|
944 |
+
|
945 |
+
}, 1000)
|
946 |
+
});
|
947 |
+
$(document).on('click', '.add_instructor_to_course_btn', function(e){
|
948 |
+
e.preventDefault();
|
949 |
+
|
950 |
+
var $that = $(this);
|
951 |
+
var $modal = $('.tutor-modal-wrap');
|
952 |
+
var course_id = $('#post_ID').val();
|
953 |
+
var data = $modal.find('input').serialize()+'&course_id='+course_id+'&action=tutor_add_instructors_to_course';
|
954 |
+
|
955 |
+
$.ajax({
|
956 |
+
url : ajaxurl,
|
957 |
+
type : 'POST',
|
958 |
+
data : data,
|
959 |
+
beforeSend: function () {
|
960 |
+
$that.addClass('tutor-updating-message');
|
961 |
+
},
|
962 |
+
success: function (data) {
|
963 |
+
if (data.success){
|
964 |
+
$('.tutor-course-available-instructors').html(data.data.output);
|
965 |
+
$('.tutor-modal-wrap').removeClass('show');
|
966 |
+
}
|
967 |
+
},
|
968 |
+
complete: function () {
|
969 |
+
$that.removeClass('tutor-updating-message');
|
970 |
+
}
|
971 |
+
});
|
972 |
+
});
|
973 |
+
|
974 |
+
$(document).on('click', '.tutor-instructor-delete-btn', function(e){
|
975 |
+
e.preventDefault();
|
976 |
+
|
977 |
+
var $that = $(this);
|
978 |
+
var course_id = $('#post_ID').val();
|
979 |
+
var instructor_id = $that.closest('.added-instructor-item').attr('data-instructor-id');
|
980 |
+
|
981 |
+
$.ajax({
|
982 |
+
url : ajaxurl,
|
983 |
+
type : 'POST',
|
984 |
+
data : {course_id:course_id, instructor_id:instructor_id, action : 'detach_instructor_from_course'},
|
985 |
+
success: function (data) {
|
986 |
+
if (data.success){
|
987 |
+
$that.closest('.added-instructor-item').remove();
|
988 |
+
}
|
989 |
+
}
|
990 |
+
});
|
991 |
+
});
|
992 |
+
|
993 |
+
$(document).on('click', '.tutor-option-media-upload-btn', function(e){
|
994 |
+
e.preventDefault();
|
995 |
+
|
996 |
+
var $that = $(this);
|
997 |
+
var frame;
|
998 |
+
if ( frame ) {
|
999 |
+
frame.open();
|
1000 |
+
return;
|
1001 |
+
}
|
1002 |
+
frame = wp.media({
|
1003 |
+
title: 'Select or Upload Media Of Your Chosen Persuasion',
|
1004 |
+
button: {
|
1005 |
+
text: 'Use this media'
|
1006 |
+
},
|
1007 |
+
multiple: false
|
1008 |
+
});
|
1009 |
+
frame.on( 'select', function() {
|
1010 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
1011 |
+
$that.closest('.option-media-wrap').find('.option-media-preview').html('<img src="'+attachment.url+'" alt="" />');
|
1012 |
+
$that.closest('.option-media-wrap').find('input').val(attachment.id);
|
1013 |
+
});
|
1014 |
+
frame.open();
|
1015 |
+
});
|
1016 |
+
|
1017 |
+
$(document).on('change', '.tutor_addons_list_item', function(e) {
|
1018 |
+
var $that = $(this);
|
1019 |
+
|
1020 |
+
var isEnable = $that.prop('checked') ? 1 : 0;
|
1021 |
+
var addonFieldName = $that.attr('name');
|
1022 |
+
|
1023 |
+
$.ajax({
|
1024 |
+
url : ajaxurl,
|
1025 |
+
type : 'POST',
|
1026 |
+
data : {isEnable:isEnable, addonFieldName:addonFieldName, action : 'addon_enable_disable'},
|
1027 |
+
success: function (data) {
|
1028 |
+
if (data.success){
|
1029 |
+
//Success
|
1030 |
+
}
|
1031 |
+
}
|
1032 |
+
});
|
1033 |
+
|
1034 |
+
});
|
1035 |
+
|
1036 |
+
});
|
assets/js/tutor-front.js
ADDED
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
$(document).on('change', '.tutor-course-filter-form', function(e){
|
5 |
+
e.preventDefault();
|
6 |
+
$(this).closest('form').submit();
|
7 |
+
});
|
8 |
+
|
9 |
+
const videoPlayer = {
|
10 |
+
nonce_key : _tutorobject.nonce_key,
|
11 |
+
video_track_data : $('#tutor_video_tracking_information').val(),
|
12 |
+
track_player : function(){
|
13 |
+
var that = this;
|
14 |
+
|
15 |
+
var video_data = this.video_track_data ? JSON.parse(this.video_track_data) : {};
|
16 |
+
|
17 |
+
if (typeof Plyr !== 'undefined') {
|
18 |
+
const player = new Plyr('#tutorPlayer');
|
19 |
+
|
20 |
+
player.on('ready', function(event){
|
21 |
+
const instance = event.detail.plyr;
|
22 |
+
if (video_data.best_watch_time > 0) {
|
23 |
+
instance.media.currentTime = video_data.best_watch_time;
|
24 |
+
}
|
25 |
+
that.sync_time(instance);
|
26 |
+
});
|
27 |
+
|
28 |
+
var tempTimeNow = 0;
|
29 |
+
var intervalSeconds = 60; //Send to tutor backend about video playing time in this interval
|
30 |
+
player.on('timeupdate', function(event){
|
31 |
+
const instance = event.detail.plyr;
|
32 |
+
|
33 |
+
var tempTimeNowInSec = (tempTimeNow / 4); //timeupdate firing 250ms interval
|
34 |
+
if (tempTimeNowInSec >= intervalSeconds){
|
35 |
+
that.sync_time(instance);
|
36 |
+
tempTimeNow = 0;
|
37 |
+
}
|
38 |
+
tempTimeNow++;
|
39 |
+
});
|
40 |
+
|
41 |
+
player.on('ended', function(event){
|
42 |
+
const instance = event.detail.plyr;
|
43 |
+
|
44 |
+
var data = {is_ended:true};
|
45 |
+
that.sync_time(instance, data)
|
46 |
+
});
|
47 |
+
}
|
48 |
+
},
|
49 |
+
sync_time: function(instance, options){
|
50 |
+
/**
|
51 |
+
* TUTOR is sending about video playback information to server.
|
52 |
+
*/
|
53 |
+
var video_data = this.video_track_data ? JSON.parse(this.video_track_data) : {};
|
54 |
+
var data = {action: 'sync_video_playback', currentTime : instance.currentTime, duration:instance.duration, post_id : video_data.post_id};
|
55 |
+
data[this.nonce_key] = _tutorobject[this.nonce_key];
|
56 |
+
|
57 |
+
var data_send = data;
|
58 |
+
if(options){
|
59 |
+
data_send = Object.assign(data, options);
|
60 |
+
}
|
61 |
+
$.post(_tutorobject.ajaxurl, data_send);
|
62 |
+
},
|
63 |
+
init: function(){
|
64 |
+
this.track_player();
|
65 |
+
}
|
66 |
+
};
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Fire TUTOR video
|
70 |
+
* @since v.1.0.0
|
71 |
+
*/
|
72 |
+
if ($('#tutorPlayer').length){
|
73 |
+
videoPlayer.init();
|
74 |
+
}
|
75 |
+
|
76 |
+
$(document).on('change keyup paste', '.tutor_user_name', function(){
|
77 |
+
$(this).val(tutor_slugify($(this).val()));
|
78 |
+
});
|
79 |
+
|
80 |
+
function tutor_slugify(text) {
|
81 |
+
return text.toString().toLowerCase()
|
82 |
+
.replace(/\s+/g, '-') // Replace spaces with -
|
83 |
+
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
84 |
+
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
85 |
+
.replace(/^-+/, '') // Trim - from start of text
|
86 |
+
.replace(/-+$/, ''); // Trim - from end of text
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Hover tutor rating and set value
|
91 |
+
*/
|
92 |
+
$(document).on('hover', '.tutor-ratings-wrap i', function(){
|
93 |
+
$(this).closest('.tutor-ratings-wrap').find('i').removeClass('tutor-icon-star-full').addClass('tutor-icon-star-line');
|
94 |
+
var currentRateValue = $(this).attr('data-rating-value');
|
95 |
+
for (var i = 1; i<= currentRateValue; i++){
|
96 |
+
$(this).closest('.tutor-ratings-wrap').find('i[data-rating-value="'+i+'"]').removeClass('tutor-icon-star-line').addClass('tutor-icon-star-full');
|
97 |
+
}
|
98 |
+
});
|
99 |
+
|
100 |
+
$(document).on('click', '.tutor-ratings-wrap i', function(){
|
101 |
+
var rating = $(this).attr('data-rating-value');
|
102 |
+
var course_id = $('input[name="tutor_course_id"]').val();
|
103 |
+
var data = {course_id : course_id, rating:rating, action: 'tutor_place_rating' };
|
104 |
+
|
105 |
+
$.post(_tutorobject.ajaxurl, data);
|
106 |
+
});
|
107 |
+
|
108 |
+
$(document).on('click', '.tutor_submit_review_btn', function (e) {
|
109 |
+
e.preventDefault();
|
110 |
+
var $that = $(this);
|
111 |
+
var review = $(this).closest('form').find('textarea[name="review"]').val();
|
112 |
+
review = review.trim();
|
113 |
+
|
114 |
+
var course_id = $('input[name="tutor_course_id"]').val();
|
115 |
+
var data = {course_id : course_id, review:review, action: 'tutor_place_rating' };
|
116 |
+
|
117 |
+
if (review) {
|
118 |
+
$.ajax({
|
119 |
+
url: _tutorobject.ajaxurl,
|
120 |
+
type: 'POST',
|
121 |
+
data: data,
|
122 |
+
beforeSend: function () {
|
123 |
+
$that.addClass('updating-icon');
|
124 |
+
},
|
125 |
+
success: function (data) {
|
126 |
+
var review_id = data.data.review_id;
|
127 |
+
var review = data.data.review;
|
128 |
+
$('.tutor-review-'+review_id+' .review-content').html(review);
|
129 |
+
},
|
130 |
+
complete: function () {
|
131 |
+
$('.tutor-write-review-form').slideUp();
|
132 |
+
$that.removeClass('updating-icon');
|
133 |
+
}
|
134 |
+
});
|
135 |
+
}
|
136 |
+
});
|
137 |
+
|
138 |
+
$(document).on('click', '.write-course-review-link-btn', function(e){
|
139 |
+
e.preventDefault();
|
140 |
+
$(this).siblings('.tutor-write-review-form').slideToggle();
|
141 |
+
});
|
142 |
+
|
143 |
+
$(document).on('click', '.tutor-ask-question-btn', function(e){
|
144 |
+
e.preventDefault();
|
145 |
+
$('.tutor-add-question-wrap').slideToggle();
|
146 |
+
});
|
147 |
+
$(document).on('click', '.tutor_question_cancel', function(e){
|
148 |
+
e.preventDefault();
|
149 |
+
$('.tutor-add-question-wrap').toggle();
|
150 |
+
});
|
151 |
+
|
152 |
+
$(document).on('submit', '#tutor-ask-question-form', function(e){
|
153 |
+
e.preventDefault();
|
154 |
+
|
155 |
+
var $form = $(this);
|
156 |
+
var data = $(this).serialize()+'&action=tutor_ask_question';
|
157 |
+
|
158 |
+
$.ajax({
|
159 |
+
url: _tutorobject.ajaxurl,
|
160 |
+
type: 'POST',
|
161 |
+
data: data,
|
162 |
+
beforeSend: function () {
|
163 |
+
$form.find('.tutor_ask_question_btn').addClass('updating-icon');
|
164 |
+
},
|
165 |
+
success: function (data) {
|
166 |
+
if (data.success){
|
167 |
+
$('.tutor-add-question-wrap').hide();
|
168 |
+
window.location.reload();
|
169 |
+
}
|
170 |
+
},
|
171 |
+
complete: function () {
|
172 |
+
$form.find('.tutor_ask_question_btn').removeClass('updating-icon');
|
173 |
+
}
|
174 |
+
});
|
175 |
+
});
|
176 |
+
|
177 |
+
$(document).on('submit', '.tutor-add-answer-form', function(e){
|
178 |
+
e.preventDefault();
|
179 |
+
|
180 |
+
var $form = $(this);
|
181 |
+
var data = $(this).serialize()+'&action=tutor_add_answer';
|
182 |
+
|
183 |
+
$.ajax({
|
184 |
+
url: _tutorobject.ajaxurl,
|
185 |
+
type: 'POST',
|
186 |
+
data: data,
|
187 |
+
beforeSend: function () {
|
188 |
+
$form.find('.tutor_add_answer_btn').addClass('updating-icon');
|
189 |
+
},
|
190 |
+
success: function (data) {
|
191 |
+
if (data.success){
|
192 |
+
window.location.reload();
|
193 |
+
}
|
194 |
+
},
|
195 |
+
complete: function () {
|
196 |
+
$form.find('.tutor_add_answer_btn').removeClass('updating-icon');
|
197 |
+
}
|
198 |
+
});
|
199 |
+
});
|
200 |
+
|
201 |
+
$(document).on('focus', '.tutor_add_answer_textarea', function(e){
|
202 |
+
e.preventDefault();
|
203 |
+
|
204 |
+
var question_id = $(this).closest('.tutor_add_answer_wrap').attr('data-question-id');
|
205 |
+
var conf = {
|
206 |
+
tinymce: {
|
207 |
+
wpautop:true,
|
208 |
+
//plugins : 'charmap colorpicker compat3x directionality fullscreen hr image lists media paste tabfocus textcolor wordpress wpautoresize wpdialogs wpeditimage wpemoji wpgallery wplink wptextpattern wpview',
|
209 |
+
toolbar1: 'bold italic underline bullist strikethrough numlist blockquote alignleft aligncenter alignright undo redo link unlink spellchecker fullscreen'
|
210 |
+
},
|
211 |
+
};
|
212 |
+
wp.editor.initialize('tutor_answer_'+question_id, conf);
|
213 |
+
});
|
214 |
+
|
215 |
+
$(document).on('click', '.tutor_cancel_wp_editor', function(e){
|
216 |
+
e.preventDefault();
|
217 |
+
$(this).closest('.tutor_wp_editor_wrap').toggle();
|
218 |
+
$(this).closest('.tutor_add_answer_wrap').find('.tutor_wp_editor_show_btn_wrap').toggle();
|
219 |
+
var question_id = $(this).closest('.tutor_add_answer_wrap').attr('data-question-id');
|
220 |
+
wp.editor.remove('tutor_answer_'+question_id);
|
221 |
+
});
|
222 |
+
|
223 |
+
$(document).on('click', '.tutor_wp_editor_show_btn', function(e){
|
224 |
+
e.preventDefault();
|
225 |
+
$(this).closest('.tutor_add_answer_wrap').find('.tutor_wp_editor_wrap').toggle();
|
226 |
+
$(this).closest('.tutor_wp_editor_show_btn_wrap').toggle();
|
227 |
+
});
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Quiz attempt
|
231 |
+
*/
|
232 |
+
var $tutor_quiz_time_update = $('#tutor-quiz-time-update');
|
233 |
+
var attempt_settings = null;
|
234 |
+
if ($tutor_quiz_time_update.length){
|
235 |
+
attempt_settings = JSON.parse($tutor_quiz_time_update.attr('data-attempt-settings'));
|
236 |
+
var attempt_meta = JSON.parse($tutor_quiz_time_update.attr('data-attempt-meta'));
|
237 |
+
|
238 |
+
var countDownDate = new Date(attempt_settings.quiz_started_at).getTime() + (attempt_meta.time_limit_seconds * 1000);
|
239 |
+
var time_now = new Date(attempt_meta.date_time_now).getTime();
|
240 |
+
|
241 |
+
var tutor_quiz_interval = setInterval(function() {
|
242 |
+
var distance = countDownDate - time_now;
|
243 |
+
|
244 |
+
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
245 |
+
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
246 |
+
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
247 |
+
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
248 |
+
|
249 |
+
var countdown_human = '';
|
250 |
+
|
251 |
+
if (days){
|
252 |
+
countdown_human += days + "d ";
|
253 |
+
}
|
254 |
+
if (hours){
|
255 |
+
countdown_human += hours + "h ";
|
256 |
+
}
|
257 |
+
if (minutes){
|
258 |
+
countdown_human += minutes + "m ";
|
259 |
+
}
|
260 |
+
if (seconds){
|
261 |
+
countdown_human += seconds + "s ";
|
262 |
+
}
|
263 |
+
|
264 |
+
if (distance < 0) {
|
265 |
+
clearInterval(tutor_quiz_interval);
|
266 |
+
countdown_human = "EXPIRED";
|
267 |
+
//Set the quiz attempt to timeout in ajax
|
268 |
+
|
269 |
+
var quiz_id = $('#tutor_quiz_id').val();
|
270 |
+
var tutor_quiz_remaining_time_secs = $('#tutor_quiz_remaining_time_secs').val();
|
271 |
+
var quiz_timeout_data = { quiz_id : quiz_id, action : 'tutor_quiz_timeout' };
|
272 |
+
|
273 |
+
$.ajax({
|
274 |
+
url: _tutorobject.ajaxurl,
|
275 |
+
type: 'POST',
|
276 |
+
data: quiz_timeout_data,
|
277 |
+
success: function (data) {
|
278 |
+
if (data.success){
|
279 |
+
window.location.reload(true);
|
280 |
+
}
|
281 |
+
},
|
282 |
+
complete: function () {
|
283 |
+
$('#tutor-quiz-body').html('');
|
284 |
+
window.location.reload(true);
|
285 |
+
}
|
286 |
+
});
|
287 |
+
}
|
288 |
+
time_now = time_now + 1000;
|
289 |
+
$tutor_quiz_time_update.html(countdown_human);
|
290 |
+
}, 1000);
|
291 |
+
}
|
292 |
+
|
293 |
+
// tutor course content accordion
|
294 |
+
$('.tutor-course-topic.tutor-active').find('.tutor-course-lessons').slideDown();
|
295 |
+
$('.tutor-course-title').on('click', function () {
|
296 |
+
var lesson = $(this).siblings('.tutor-course-lessons');
|
297 |
+
$(this).closest('.tutor-course-topic').toggleClass('tutor-active');
|
298 |
+
lesson.slideToggle();
|
299 |
+
});
|
300 |
+
|
301 |
+
$('.tutor-topics-title').on('click', function () {
|
302 |
+
$(this).siblings('.tutor-topics-summery').slideToggle();
|
303 |
+
});
|
304 |
+
|
305 |
+
$(document).on('click', '.tutor-course-wishlist-btn', function (e) {
|
306 |
+
e.preventDefault();
|
307 |
+
|
308 |
+
var $that = $(this);
|
309 |
+
var course_id = $that.attr('data-course-id');
|
310 |
+
|
311 |
+
$.ajax({
|
312 |
+
url: _tutorobject.ajaxurl,
|
313 |
+
type: 'POST',
|
314 |
+
data: {course_id : course_id, 'action': 'tutor_course_add_to_wishlist'},
|
315 |
+
beforeSend: function () {
|
316 |
+
$that.addClass('updating-icon');
|
317 |
+
},
|
318 |
+
success: function (data) {
|
319 |
+
if (data.success){
|
320 |
+
if (data.data.status === 'added'){
|
321 |
+
$that.addClass('has-wish-listed');
|
322 |
+
}else{
|
323 |
+
$that.removeClass('has-wish-listed');
|
324 |
+
}
|
325 |
+
}else{
|
326 |
+
window.location = data.data.redirect_to;
|
327 |
+
}
|
328 |
+
},
|
329 |
+
complete: function () {
|
330 |
+
$that.removeClass('updating-icon');
|
331 |
+
}
|
332 |
+
});
|
333 |
+
});
|
334 |
+
|
335 |
+
$(document).on('click', '.tutor-single-lesson-a', function (e) {
|
336 |
+
e.preventDefault();
|
337 |
+
|
338 |
+
var $that = $(this);
|
339 |
+
var lesson_id = $that.attr('data-lesson-id');
|
340 |
+
var $wrap = $('#tutor-single-lesson-entry-content');
|
341 |
+
|
342 |
+
$.ajax({
|
343 |
+
url: _tutorobject.ajaxurl,
|
344 |
+
type: 'POST',
|
345 |
+
data: {lesson_id : lesson_id, 'action': 'tutor_render_lesson_content'},
|
346 |
+
beforeSend: function () {
|
347 |
+
var page_title = $that.find('.lesson_title').text();
|
348 |
+
$('head title').text(page_title);
|
349 |
+
window.history.pushState('obj', page_title, $that.attr('href'));
|
350 |
+
$wrap.addClass('loading-lesson');
|
351 |
+
$('.tutor-single-lesson-items').removeClass('active');
|
352 |
+
$that.closest('.tutor-single-lesson-items').addClass('active');
|
353 |
+
},
|
354 |
+
success: function (data) {
|
355 |
+
$wrap.html(data.data.html);
|
356 |
+
videoPlayer.init();
|
357 |
+
},
|
358 |
+
complete: function () {
|
359 |
+
$wrap.removeClass('loading-lesson');
|
360 |
+
}
|
361 |
+
});
|
362 |
+
});
|
363 |
+
|
364 |
+
/**
|
365 |
+
* @date 05 Feb, 2019
|
366 |
+
*/
|
367 |
+
|
368 |
+
$(document).on('click', '.tutor-lesson-sidebar-hide-bar', function(e){
|
369 |
+
e.preventDefault();
|
370 |
+
$('.tutor-lesson-sidebar').toggle();
|
371 |
+
});
|
372 |
+
|
373 |
+
$(document).on('click', '.tutor-tabs-btn-group a', function (e) {
|
374 |
+
e.preventDefault();
|
375 |
+
var $that = $(this);
|
376 |
+
|
377 |
+
|
378 |
+
var tabSelector = $that.attr('href');
|
379 |
+
$('.tutor-lesson-sidebar-tab-item').hide();
|
380 |
+
$(tabSelector).show();
|
381 |
+
|
382 |
+
$('.tutor-tabs-btn-group a').removeClass('active');
|
383 |
+
$that.addClass('active');
|
384 |
+
});
|
385 |
+
|
386 |
+
|
387 |
+
});
|
assets/packages/plyr/plyr.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@keyframes plyr-progress{to{background-position:25px 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{from{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;direction:ltr;font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;font-variant-numeric:tabular-nums;font-weight:500;line-height:1.7;max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease}.plyr audio,.plyr video{border-radius:inherit;height:auto;vertical-align:middle;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui ::after,.plyr--full-ui ::before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4f5b5f;border-radius:2px;color:#fff;font-size:9px;line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;color:#fff;display:none;font-size:14px;left:0;padding:10px;position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions .plyr__caption{background:rgba(0,0,0,.8);border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__captions .plyr__caption div{display:inline}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:16px;padding:20px}}@media (min-width:768px){.plyr__captions{font-size:18px}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-40px)}.plyr__control{background:0 0;border:0;border-radius:3px;color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;position:relative;transition:all .3s ease}.plyr__control svg{display:block;fill:currentColor;height:18px;pointer-events:none;width:18px}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{box-shadow:0 0 0 5px rgba(26,175,255,.5);outline:0}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed{display:none}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#1aafff;color:#fff}.plyr--video .plyr__control svg{filter:drop-shadow(0 1px 1px rgba(0, 0, 0, .15))}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#1aafff;color:#fff}.plyr__control--overlaid{background:rgba(26,175,255,.8);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15);color:#fff;display:none;left:50%;padding:15px;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:2}.plyr__control--overlaid svg{height:20px;left:2px;position:relative;width:20px}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{background:#1aafff}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__menu,.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls .plyr__volume,.plyr__controls>.plyr__control{margin-left:5px}.plyr__controls .plyr__menu+.plyr__control,.plyr__controls .plyr__progress+.plyr__control,.plyr__controls>.plyr__control+.plyr__control,.plyr__controls>.plyr__control+.plyr__menu{margin-left:2px}.plyr__controls>.plyr__control:first-child,.plyr__controls>.plyr__control:first-child+[data-plyr=pause]{margin-left:0;margin-right:auto}.plyr__controls:empty{display:none}@media (min-width:480px){.plyr__controls .plyr__menu,.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls .plyr__volume,.plyr__controls>.plyr__control{margin-left:10px}}.plyr--audio .plyr__controls{background:#fff;border-radius:inherit;color:#4f5b5f;padding:10px}.plyr--video .plyr__controls{background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.7));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;left:0;padding:20px 5px 5px;position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:35px 10px 10px}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip]{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__video-embed{height:0;padding-bottom:56.25%;position:relative}.plyr__video-embed iframe{border:0;height:100%;left:0;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:rgba(255,255,255,.9);border-radius:4px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);color:#4f5b5f;font-size:16px;margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container::after{border:4px solid transparent;border-top-color:rgba(255,255,255,.9);content:'';height:0;position:absolute;right:15px;top:100%;width:0}.plyr__menu__container [role=menu]{padding:7px}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4f5b5f;display:flex;font-size:14px;padding:4px 11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control::after{border:4px solid transparent;content:'';position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:28px}.plyr__menu__container .plyr__control--forward::after{border-left-color:rgba(79,91,95,.8);right:5px}.plyr__menu__container .plyr__control--forward.plyr__tab-focus::after,.plyr__menu__container .plyr__control--forward:hover::after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:500;margin:7px;margin-bottom:3px;padding-left:28px;position:relative;width:calc(100% - 14px)}.plyr__menu__container .plyr__control--back::after{border-right-color:rgba(79,91,95,.8);left:7px}.plyr__menu__container .plyr__control--back::before{background:#b7c5cd;box-shadow:0 1px 0 #fff;content:'';height:1px;left:0;margin-top:4px;overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus::after,.plyr__menu__container .plyr__control--back:hover::after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:7px}.plyr__menu__container .plyr__control[role=menuitemradio]::after,.plyr__menu__container .plyr__control[role=menuitemradio]::before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0,0,0,.1);content:'';display:block;flex-shrink:0;height:16px;margin-right:10px;transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{background:#1aafff}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus::before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover::before{background:rgba(0,0,0,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:-5px;overflow:hidden;padding-left:25px;pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;background:0 0;border:0;border-radius:28px;color:#1aafff;display:block;height:20px;margin:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:0 0;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none;background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2);height:14px;position:relative;transition:all .2s ease;width:14px;-webkit-appearance:none;margin-top:-4px}.plyr--full-ui input[type=range]::-moz-range-track{background:0 0;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;-moz-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2);height:14px;position:relative;transition:all .2s ease;width:14px}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:3px;height:6px}.plyr--full-ui input[type=range]::-ms-track{background:0 0;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:0 0;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:0 0;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2);height:14px;position:relative;transition:all .2s ease;width:14px;margin-top:0}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{box-shadow:0 0 0 5px rgba(26,175,255,.5);outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{box-shadow:0 0 0 5px rgba(26,175,255,.5);outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{box-shadow:0 0 0 5px rgba(26,175,255,.5);outline:0}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:rgba(255,255,255,.25)}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:rgba(255,255,255,.25)}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:rgba(255,255,255,.25)}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(255,255,255,.5)}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(255,255,255,.5)}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(255,255,255,.5)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:rgba(183,197,205,.66)}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:rgba(183,197,205,.66)}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:rgba(183,197,205,.66)}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(0,0,0,.1)}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(0,0,0,.1)}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(47,52,61,.2),0 0 0 3px rgba(0,0,0,.1)}.plyr__poster{background-color:#000;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr__time{font-size:14px}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr--video .plyr__time{text-shadow:0 1px 1px rgba(0,0,0,.15)}.plyr__tooltip{background:rgba(255,255,255,.9);border-radius:3px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);color:#4f5b5f;font-size:14px;font-weight:500;left:50%;line-height:1.3;margin-bottom:10px;opacity:0;padding:5px 7.5px;pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.9);bottom:-4px;content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%,0) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translate(0,10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip::before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip::before{left:16px}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0,10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:16px;transform:translateX(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0,0) scale(1)}.plyr--video{background:#000;overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;border-radius:inherit;overflow:hidden;position:relative;z-index:0}.plyr__progress{flex:1;left:7px;margin-right:14px;position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-7px;margin-right:-7px;width:calc(100% + 14px)}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{font-size:14px;left:0}.plyr__progress__buffer{-webkit-appearance:none;background:0 0;border:0;border-radius:100px;height:6px;left:0;margin-top:-3px;padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:0 0;transition:width .2s ease}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:6px}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:6px;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;transition:width .2s ease}.plyr--video .plyr__progress__buffer{box-shadow:0 1px 1px rgba(0,0,0,.15);color:rgba(255,255,255,.25)}.plyr--audio .plyr__progress__buffer{color:rgba(183,197,205,.66)}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(47,52,61,.6) 25%,transparent 25%,transparent 50%,rgba(47,52,61,.6) 50%,rgba(47,52,61,.6) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:25px 25px;color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:rgba(255,255,255,.25)}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:rgba(183,197,205,.66)}.plyr__volume{align-items:center;display:flex;flex:1;position:relative}.plyr__volume input[type=range]{margin-left:5px;position:relative;z-index:2}@media (min-width:480px){.plyr__volume{max-width:90px}}@media (min-width:768px){.plyr__volume{max-width:110px}}.plyr--is-ios .plyr__volume{display:none!important}.plyr--is-ios.plyr--vimeo [data-plyr=mute]{display:none!important}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-moz-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-moz-full-screen video{height:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:fullscreen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;width:100%}.plyr:-moz-full-screen .plyr__video-wrapper{height:100%;width:100%}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;width:100%}.plyr:fullscreen .plyr__video-wrapper{height:100%;width:100%}.plyr:-webkit-full-screen .plyr__video-embed{overflow:visible}.plyr:-moz-full-screen .plyr__video-embed{overflow:visible}.plyr:-ms-fullscreen .plyr__video-embed{overflow:visible}.plyr:fullscreen .plyr__video-embed{overflow:visible}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-moz-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}.plyr:-moz-full-screen.plyr--hide-controls{cursor:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px}.plyr:-moz-full-screen .plyr__captions{font-size:21px}.plyr:-ms-fullscreen .plyr__captions{font-size:21px}.plyr:fullscreen .plyr__captions{font-size:21px}}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;width:100%}.plyr:-webkit-full-screen .plyr__video-embed{overflow:visible}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px}}.plyr:-moz-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-moz-full-screen video{height:100%}.plyr:-moz-full-screen .plyr__video-wrapper{height:100%;width:100%}.plyr:-moz-full-screen .plyr__video-embed{overflow:visible}.plyr:-moz-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-moz-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-moz-full-screen .plyr__captions{font-size:21px}}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;width:100%}.plyr:-ms-fullscreen .plyr__video-embed{overflow:visible}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-ms-fullscreen .plyr__captions{font-size:21px}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;height:100%;margin:0;width:100%;bottom:0;left:0;position:fixed;right:0;top:0;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen-fallback .plyr__video-embed{overflow:visible}.plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads::after{background:rgba(47,52,61,.8);border-radius:2px;bottom:10px;color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;z-index:3}.plyr__ads::after:empty{display:none}.plyr__cues{background:currentColor;display:block;height:6px;left:0;margin:-3px 0 0;opacity:.8;position:absolute;top:50%;width:3px;z-index:3}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);overflow:hidden;border:0!important;height:1px!important;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}
|
assets/packages/plyr/plyr.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):e.Plyr=t()}(this,function(){"use strict";var e=function(e){return null!=e?e.constructor:null},t=function(e,t){return Boolean(e&&t&&e instanceof t)},i=function(e){return null==e},n=function(t){return e(t)===Object},s=function(t){return e(t)===String},a=function(e){return Array.isArray(e)},o=function(e){return t(e,NodeList)},r=function(e){return i(e)||(s(e)||a(e)||o(e))&&!e.length||n(e)&&!Object.keys(e).length},l={nullOrUndefined:i,object:n,number:function(t){return e(t)===Number&&!Number.isNaN(t)},string:s,boolean:function(t){return e(t)===Boolean},function:function(t){return e(t)===Function},array:a,weakMap:function(e){return t(e,WeakMap)},nodeList:o,element:function(e){return t(e,Element)},textNode:function(t){return e(t)===Text},event:function(e){return t(e,Event)},keyboardEvent:function(e){return t(e,KeyboardEvent)},cue:function(e){return t(e,window.TextTrackCue)||t(e,window.VTTCue)},track:function(e){return t(e,TextTrack)||!i(e)&&s(e.kind)},url:function(e){if(t(e,window.URL))return!0;var i=e;e.startsWith("http://")&&e.startsWith("https://")||(i="http://"+e);try{return!r(new URL(i).hostname)}catch(e){return!1}},empty:r},c=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function u(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!l.empty(t)&&l.function(i)){var r=t.split(" "),u=o;c&&(u={passive:a,capture:o}),r.forEach(function(t){s&&s.eventListeners&&n&&s.eventListeners.push({element:e,type:t,callback:i,options:u}),e[n?"addEventListener":"removeEventListener"](t,i,u)})}}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];u.call(this,e,t,i,!0,n,s)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];u.call(this,e,t,i,!1,n,s)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];u.call(this,e,t,function a(){h(e,t,a,n,s);for(var o=arguments.length,r=Array(o),l=0;l<o;l++)r[l]=arguments[l];i.apply(this,r)},!0,n,s)}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(l.element(e)&&!l.empty(t)){var s=new CustomEvent(t,{bubbles:i,detail:Object.assign({},n,{plyr:this})});e.dispatchEvent(s)}}var m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),y=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},v=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,s=!1,a=void 0;try{for(var o,r=e[Symbol.iterator]();!(n=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){s=!0,a=e}finally{try{!n&&r.return&&r.return()}finally{if(s)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function b(e,t){var i=e.length?e:[e];Array.from(i).reverse().forEach(function(e,i){var n=i>0?t.cloneNode(!0):t,s=e.parentNode,a=e.nextSibling;n.appendChild(e),a?s.insertBefore(n,a):s.appendChild(n)})}function k(e,t){l.element(e)&&!l.empty(t)&&Object.entries(t).filter(function(e){var t=v(e,2)[1];return!l.nullOrUndefined(t)}).forEach(function(t){var i=v(t,2),n=i[0],s=i[1];return e.setAttribute(n,s)})}function w(e,t,i){var n=document.createElement(e);return l.object(t)&&k(n,t),l.string(i)&&(n.innerText=i),n}function T(e,t,i,n){l.element(t)&&t.appendChild(w(e,i,n))}function A(e){l.nodeList(e)||l.array(e)?Array.from(e).forEach(A):l.element(e)&&l.element(e.parentNode)&&e.parentNode.removeChild(e)}function E(e){if(l.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function C(e,t){return l.element(t)&&l.element(t.parentNode)&&l.element(e)?(t.parentNode.replaceChild(e,t),e):null}function P(e,t){if(!l.string(e)||l.empty(e))return{};var i={},n=t;return e.split(",").forEach(function(e){var t=e.trim(),s=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=a[0],r=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":l.object(n)&&l.string(n.class)&&(n.class+=" "+s),i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[o]=r}}),i}function S(e,t){if(l.element(e)){var i=t;l.boolean(i)||(i=!e.hidden),i?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function M(e,t,i){if(l.nodeList(e))return Array.from(e).map(function(e){return M(e,t,i)});if(l.element(e)){var n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function N(e,t){return l.element(e)&&e.classList.contains(t)}function L(e,t){var i={Element:Element};return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function x(e){return this.elements.container.querySelectorAll(e)}function _(e){return this.elements.container.querySelector(e)}function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l.element(e)&&(e.focus(),t&&M(e,this.config.classNames.tabFocus))}var O,j,q,R=(O=document.createElement("span"),j={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},q=Object.keys(j).find(function(e){return void 0!==O.style[e]}),!!l.string(q)&&j[q]);function B(e){setTimeout(function(){try{S(e,!0),e.offsetHeight,S(e,!1)}catch(e){}},0)}var H,V={isIE:!!document.documentMode,isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},D={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},F={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,i){var n=V.isIPhone&&i&&F.playsinline,s=F[e]||"html5"!==t;return{api:s,ui:s&&F.rangeInput&&("video"!==e||!V.isIPhone||n)}},pip:!V.isIPhone&&l.function(w("video").webkitSetPresentationMode),airplay:l.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){var t=e.split("/"),i=v(t,1)[0];if(!this.isHTML5||i!==this.type)return!1;var n=void 0;e&&e.includes("codecs=")?n=e:"audio/mpeg"===e?n="audio/mpeg;":e in D&&(n=e+'; codecs="'+D[e]+'"');try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(H=document.createElement("input"),H.type="range","range"===H.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==R,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},U={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){return F.mime.call(e,t.getAttribute("type"))}):[]},getQualityOptions:function(){return U.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;Object.defineProperty(e.media,"quality",{get:function(){var t=U.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var i=U.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(i){var n=e.media,s=n.currentTime,a=n.paused,o=n.preload,r=n.readyState;e.media.src=i.getAttribute("src"),("none"!==o||r)&&(e.once("loadedmetadata",function(){e.currentTime=s,a||e.play()}),e.media.load()),f.call(e,e.media,"qualitychange",!1,{quality:t}),e.storage.set({quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(A(U.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function z(e){return l.array(e)?e.filter(function(t,i){return e.indexOf(t)===i}):e}function W(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function K(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(!i.length)return e;var s=i.shift();return l.object(s)?(Object.keys(s).forEach(function(t){l.object(s[t])?(Object.keys(e).includes(t)||Object.assign(e,y({},t,{})),K(e[t],s[t])):Object.assign(e,y({},t,s[t]))}),K.apply(void 0,[e].concat(i))):e}function Y(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return l.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return i[t].toString()})}function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),i.toString())}function Q(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function $(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=J(e,"-"," "),e=J(e,"_"," "),J(e=Q(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function G(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l.empty(e)||l.empty(t))return"";var i=W(t.i18n,e);if(l.empty(i))return"";var n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach(function(e){var t=v(e,2),n=t[0],s=t[1];i=J(i,n,s)}),i},Z=function(){function e(t){m(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return g(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var i=window.localStorage.getItem(this.key);if(l.empty(i))return null;var n=JSON.parse(i);return l.string(t)&&t.length?n[t]:n}},{key:"set",value:function(t){if(e.supported&&this.enabled&&l.object(t)){var i=this.get();l.empty(i)&&(i={}),K(i,t),window.localStorage.setItem(this.key,JSON.stringify(i))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise(function(i,n){try{var s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",function(){if("text"===t)try{i(JSON.parse(s.responseText))}catch(e){i(s.responseText)}else i(s.response)}),s.addEventListener("error",function(){throw new Error(s.status)}),s.open("GET",e,!0),s.responseType=t,s.send()}catch(e){n(e)}})}function te(e,t){if(l.string(e)){var i=l.string(t),n=function(){return null!==document.getElementById(t)},s=function(e,t){e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){var a=Z.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),i&&o.setAttribute("id",t),a){var r=window.localStorage.getItem("cache-"+t);if(null!==r){var c=JSON.parse(r);s(o,c.content)}}ee(e).then(function(e){l.empty(e)||(a&&window.localStorage.setItem("cache-"+t,JSON.stringify({content:e})),s(o,e))}).catch(function(){})}}}var ie=function(e){return parseInt(e/60/60%60,10)},ne=function(e){return parseInt(e/60%60,10)},se=function(e){return parseInt(e%60,10)};function ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!l.number(e))return ae(null,t,i);var n=function(e){return("0"+e).slice(-2)},s=ie(e),a=ne(e),o=se(e);return t||s>0?s+=":":s="",(i&&e>0?"-":"")+s+n(a)+":"+n(o)}var oe={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||V.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=_.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:x.call(this,this.config.selectors.buttons.play),pause:_.call(this,this.config.selectors.buttons.pause),restart:_.call(this,this.config.selectors.buttons.restart),rewind:_.call(this,this.config.selectors.buttons.rewind),fastForward:_.call(this,this.config.selectors.buttons.fastForward),mute:_.call(this,this.config.selectors.buttons.mute),pip:_.call(this,this.config.selectors.buttons.pip),airplay:_.call(this,this.config.selectors.buttons.airplay),settings:_.call(this,this.config.selectors.buttons.settings),captions:_.call(this,this.config.selectors.buttons.captions),fullscreen:_.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=_.call(this,this.config.selectors.progress),this.elements.inputs={seek:_.call(this,this.config.selectors.inputs.seek),volume:_.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:_.call(this,this.config.selectors.display.buffer),currentTime:_.call(this,this.config.selectors.display.currentTime),duration:_.call(this,this.config.selectors.display.duration)},l.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector("."+this.config.classNames.tooltip)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var i=oe.getIconUrl.call(this),n=(i.cors?"":i.url)+"#"+this.config.iconPrefix,s=document.createElementNS("http://www.w3.org/2000/svg","svg");k(s,K(t,{role:"presentation",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o=n+"-"+e;return"href"in a?a.setAttributeNS("http://www.w3.org/1999/xlink","href",o):a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),s.appendChild(a),s},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={pip:"PIP",airplay:"AirPlay"}[e]||X(e,this.config);return w("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),i)},createBadge:function(e){if(l.empty(e))return null;var t=w("span",{class:this.config.classNames.menu.value});return t.appendChild(w("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var i=w("button"),n=Object.assign({},t),s=$(e),a=!1,o=void 0,r=void 0,c=void 0,u=void 0;switch("type"in n||(n.type="button"),"class"in n?n.class.includes(this.config.classNames.control)||(n.class+=" "+this.config.classNames.control):n.class=this.config.classNames.control,e){case"play":a=!0,o="play",c="pause",r="play",u="pause";break;case"mute":a=!0,o="mute",c="unmute",r="volume",u="muted";break;case"captions":a=!0,o="enableCaptions",c="disableCaptions",r="captions-off",u="captions-on";break;case"fullscreen":a=!0,o="enterFullscreen",c="exitFullscreen",r="enter-fullscreen",u="exit-fullscreen";break;case"play-large":n.class+=" "+this.config.classNames.control+"--overlaid",s="play",o="play",r="play";break;default:o=s,r=e}return a?(i.appendChild(oe.createIcon.call(this,u,{class:"icon--pressed"})),i.appendChild(oe.createIcon.call(this,r,{class:"icon--not-pressed"})),i.appendChild(oe.createLabel.call(this,c,{class:"label--pressed"})),i.appendChild(oe.createLabel.call(this,o,{class:"label--not-pressed"}))):(i.appendChild(oe.createIcon.call(this,r)),i.appendChild(oe.createLabel.call(this,o))),K(n,P(this.config.selectors.buttons[s],n)),k(i,n),"play"===s?(l.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(i)):this.elements.buttons[s]=i,i},createRange:function(e,t){var i=w("input",K(P(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":X(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,oe.updateRangeFill.call(this,i),i},createProgress:function(e,t){var i=w("progress",K(P(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"presentation","aria-hidden":!0},t));if("volume"!==e){i.appendChild(w("span",null,"0"));var n={played:"played",buffer:"buffered"}[e],s=n?X(n,this.config):"";i.innerText="% "+s.toLowerCase()}return this.elements.display[e]=i,i},createTime:function(e){var t=P(this.config.selectors.display[e]),i=w("div",K(t,{class:(this.config.classNames.display.time+" "+(t.class?t.class:"")).trim(),"aria-label":X(e,this.config)}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts:function(e,t){var i=this;d(e,"keydown keyup",function(n){if([32,38,39,40].includes(n.which)&&(n.preventDefault(),n.stopPropagation(),"keydown"!==n.type)){var s=L(e,'[role="menuitemradio"]');if(!s&&[32,39].includes(n.which))oe.showMenuPanel.call(i,t,!0);else{var a=void 0;32!==n.which&&(40===n.which||s&&39===n.which?(a=e.nextElementSibling,l.element(a)||(a=e.parentNode.firstElementChild)):(a=e.previousElementSibling,l.element(a)||(a=e.parentNode.lastElementChild)),I.call(i,a,!0))}}},!1),d(e,"keyup",function(e){13===e.which&&oe.focusFirstMenuItem.call(i,null,!0)})},createMenuItem:function(e){var t=this,i=e.value,n=e.list,s=e.type,a=e.title,o=e.badge,r=void 0===o?null:o,c=e.checked,u=void 0!==c&&c,d=P(this.config.selectors.inputs[s]),h=w("button",K(d,{type:"button",role:"menuitemradio",class:(this.config.classNames.control+" "+(d.class?d.class:"")).trim(),"aria-checked":u,value:i})),p=w("span");p.innerHTML=a,l.element(r)&&p.appendChild(r),h.appendChild(p),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter(function(e){return L(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",function(e){if(!l.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,s){case"language":t.currentTrack=Number(i);break;case"quality":t.quality=i;break;case"speed":t.speed=parseFloat(i)}oe.showMenuPanel.call(t,"home",l.keyboardEvent(e))}},s,!1),oe.bindMenuItemShortcuts.call(this,h,s),n.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l.number(e)?ae(e,ie(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];l.element(e)&&l.number(t)&&(e.innerText=oe.formatTime(t,i))},updateVolume:function(){this.supported.ui&&(l.element(this.elements.inputs.volume)&&oe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),l.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;l.element(e)&&(e.value=t,oe.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&l.event(e)){var i,n,s=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=this.currentTime,n=this.duration,s=0===i||0===n||Number.isNaN(i)||Number.isNaN(n)?0:(i/n*100).toFixed(2),"timeupdate"===e.type&&oe.setRange.call(this,this.elements.inputs.seek,s);break;case"playing":case"progress":!function(e,i){var n=l.number(i)?i:0,s=l.element(e)?e:t.elements.display.buffer;if(l.element(s)){s.value=n;var a=s.getElementsByTagName("span")[0];l.element(a)&&(a.childNodes[0].nodeValue=n)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=l.event(e)?e.target:e;if(l.element(t)&&"range"===t.getAttribute("type")){if(L(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var i=oe.formatTime(this.currentTime),n=oe.formatTime(this.duration),s=X("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",i).replace("{duration}",n))}else if(L(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext",a.toFixed(1)+"%")}else t.setAttribute("aria-valuenow",t.value);V.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&l.element(this.elements.inputs.seek)&&l.element(this.elements.display.seekTooltip)&&0!==this.duration){var i=0,n=this.elements.progress.getBoundingClientRect(),s=this.config.classNames.tooltip+"--visible",a=function(e){M(t.elements.display.seekTooltip,s,e)};if(this.touch)a(!1);else{if(l.event(e))i=100/n.width*(e.pageX-n.left);else{if(!N(this.elements.display.seekTooltip,s))return;i=parseFloat(this.elements.display.seekTooltip.style.left,10)}i<0?i=0:i>100&&(i=100),oe.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*i),this.elements.display.seekTooltip.style.left=i+"%",l.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!l.element(this.elements.display.duration)&&this.config.invertTime;oe.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||oe.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return S(this.elements.display.currentTime,!0),void S(this.elements.progress,!0);l.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=l.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&oe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&oe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),oe.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){S(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,i){var n=this.elements.settings.panels[e],s=null,a=t;if("captions"===e)s=this.currentTrack;else{if(s=l.empty(i)?this[e]:i,l.empty(s)&&(s=this.config[e].default),!l.empty(this.options[e])&&!this.options[e].includes(s))return void this.debug.warn("Unsupported value of '"+s+"' for "+e);if(!this.config[e].options.includes(s))return void this.debug.warn("Disabled value of '"+s+"' for "+e)}if(l.element(a)||(a=n&&n.querySelector('[role="menu"]')),l.element(a)){this.elements.settings.buttons[e].querySelector("."+this.config.classNames.menu.value).innerHTML=oe.getLabel.call(this,e,s);var o=a&&a.querySelector('[value="'+s+'"]');l.element(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?X("normal",this.config):t+"×";case"quality":if(l.number(t)){var i=X("qualityLabel."+t,this.config);return i.length?i:t+"p"}return Q(t);case"captions":return ce.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(l.element(this.elements.settings.panels.quality)){var i=this.elements.settings.panels.quality.querySelector('[role="menu"]');l.array(e)&&(this.options.quality=z(e).filter(function(e){return t.config.quality.options.includes(e)}));var n=!l.empty(this.options.quality)&&this.options.quality.length>1;if(oe.toggleMenuButton.call(this,"quality",n),E(i),oe.checkMenu.call(this),n){this.options.quality.sort(function(e,i){var n=t.config.quality.options;return n.indexOf(e)>n.indexOf(i)?1:-1}).forEach(function(e){oe.createMenuItem.call(t,{value:e,list:i,type:"quality",title:oe.getLabel.call(t,"quality",e),badge:function(e){var i=X("qualityBadge."+e,t.config);return i.length?oe.createBadge.call(t,i):null}(e)})}),oe.updateSetting.call(this,"quality",i)}}},setCaptionsMenu:function(){var e=this;if(l.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=ce.getTracks.call(this),n=Boolean(i.length);if(oe.toggleMenuButton.call(this,"captions",n),E(t),oe.checkMenu.call(this),n){var s=i.map(function(i,n){return{value:n,checked:e.captions.toggled&&e.currentTrack===n,title:ce.getLabel.call(e,i),badge:i.language&&oe.createBadge.call(e,i.language.toUpperCase()),list:t,type:"language"}});s.unshift({value:-1,checked:!this.captions.toggled,title:X("disabled",this.config),list:t,type:"language"}),s.forEach(oe.createMenuItem.bind(this)),oe.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(l.element(this.elements.settings.panels.speed)){var i=this.elements.settings.panels.speed.querySelector('[role="menu"]');l.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var n=!l.empty(this.options.speed)&&this.options.speed.length>1;oe.toggleMenuButton.call(this,"speed",n),E(i),oe.checkMenu.call(this),n&&(this.options.speed.forEach(function(e){oe.createMenuItem.call(t,{value:e,list:i,type:"speed",title:oe.getLabel.call(t,"speed",e)})}),oe.updateSetting.call(this,"speed",i))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!l.empty(e)&&Object.values(e).some(function(e){return!e.hidden});S(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var i=e;l.element(i)||(i=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var n=i.querySelector('[role^="menuitem"]');I.call(this,n,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,i=this.elements.buttons.settings;if(l.element(t)&&l.element(i)){var n=t.hidden,s=n;if(l.boolean(e))s=e;else if(l.keyboardEvent(e)&&27===e.which)s=!1;else if(l.event(e)){var a=t.contains(e.target);if(a||!a&&e.target!==i&&s)return}i.setAttribute("aria-expanded",s),S(t,!s),M(this.elements.container,this.config.classNames.menu.open,s),s&&l.keyboardEvent(e)?oe.focusFirstMenuItem.call(this,null,!0):s||n||I.call(this,i,l.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var i=t.scrollWidth,n=t.scrollHeight;return A(t),{width:i,height:n}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById("plyr-settings-"+this.id+"-"+t);if(l.element(n)){var s=n.parentNode,a=Array.from(s.children).find(function(e){return!e.hidden});if(F.transitions&&!F.reducedMotion){s.style.width=a.scrollWidth+"px",s.style.height=a.scrollHeight+"px";var o=oe.getMenuSize.call(this,n);d.call(this,s,R,function t(i){i.target===s&&["width","height"].includes(i.propertyName)&&(s.style.width="",s.style.height="",h.call(e,s,R,t))}),s.style.width=o.width+"px",s.style.height=o.height+"px"}S(a,!0),S(n,!1),oe.focusFirstMenuItem.call(this,n,i)}},create:function(e){var t=this,i=w("div",P(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&i.appendChild(oe.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&i.appendChild(oe.createButton.call(this,"rewind")),this.config.controls.includes("play")&&i.appendChild(oe.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&i.appendChild(oe.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var n=w("div",P(this.config.selectors.progress));if(n.appendChild(oe.createRange.call(this,"seek",{id:"plyr-seek-"+e.id})),n.appendChild(oe.createProgress.call(this,"buffer")),this.config.tooltips.seek){var s=w("span",{class:this.config.classNames.tooltip},"00:00");n.appendChild(s),this.elements.display.seekTooltip=s}this.elements.progress=n,i.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&i.appendChild(oe.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&i.appendChild(oe.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var a=w("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&a.appendChild(oe.createButton.call(this,"mute")),this.config.controls.includes("volume")){var o={max:1,step:.05,value:this.config.volume};a.appendChild(oe.createRange.call(this,"volume",K(o,{id:"plyr-volume-"+e.id}))),this.elements.volume=a}i.appendChild(a)}if(this.config.controls.includes("captions")&&i.appendChild(oe.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!l.empty(this.config.settings)){var r=w("div",{class:"plyr__menu",hidden:""});r.appendChild(oe.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-"+e.id,"aria-expanded":!1}));var c=w("div",{class:"plyr__menu__container",id:"plyr-settings-"+e.id,hidden:""}),u=w("div"),h=w("div",{id:"plyr-settings-"+e.id+"-home"}),p=w("div",{role:"menu"});h.appendChild(p),u.appendChild(h),this.elements.settings.panels.home=h,this.config.settings.forEach(function(i){var n=w("button",K(P(t.config.selectors.buttons.settings),{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--forward",role:"menuitem","aria-haspopup":!0,hidden:""}));oe.bindMenuItemShortcuts.call(t,n,i),d(n,"click",function(){oe.showMenuPanel.call(t,i,!1)});var s=w("span",null,X(i,t.config)),a=w("span",{class:t.config.classNames.menu.value});a.innerHTML=e[i],s.appendChild(a),n.appendChild(s),p.appendChild(n);var o=w("div",{id:"plyr-settings-"+e.id+"-"+i,hidden:""}),r=w("button",{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--back"});r.appendChild(w("span",{"aria-hidden":!0},X(i,t.config))),r.appendChild(w("span",{class:t.config.classNames.hidden},X("menuBack",t.config))),d(o,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),oe.showMenuPanel.call(t,"home",!0))},!1),d(r,"click",function(){oe.showMenuPanel.call(t,"home",!1)}),o.appendChild(r),o.appendChild(w("div",{role:"menu"})),u.appendChild(o),t.elements.settings.buttons[i]=n,t.elements.settings.panels[i]=o}),c.appendChild(u),r.appendChild(c),i.appendChild(r),this.elements.settings.popup=c,this.elements.settings.menu=r}return this.config.controls.includes("pip")&&F.pip&&i.appendChild(oe.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&F.airplay&&i.appendChild(oe.createButton.call(this,"airplay")),this.config.controls.includes("fullscreen")&&i.appendChild(oe.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(oe.createButton.call(this,"play-large")),this.elements.controls=i,this.isHTML5&&oe.setQualityMenu.call(this,U.getQualityOptions.call(this)),oe.setSpeedMenu.call(this),i},inject:function(){var e=this;if(this.config.loadSprite){var t=oe.getIconUrl.call(this);t.cors&&te(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var i=null;this.elements.controls=null;var n={id:this.id,seektime:this.config.seekTime,title:this.config.title},s=!0;l.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this.props)),this.config.controls||(this.config.controls=[]),l.element(this.config.controls)||l.string(this.config.controls)?i=this.config.controls:(i=oe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:ce.getLabel.call(this)}),s=!1);var a=function(e){var t=e;return Object.entries(n).forEach(function(e){var i=v(e,2),n=i[0],s=i[1];t=J(t,"{"+n+"}",s)}),t};s&&(l.string(this.config.controls)?i=a(i):l.element(i)&&(i.innerHTML=a(i.innerHTML)));var o=void 0;if(l.string(this.config.selectors.controls.container)&&(o=document.querySelector(this.config.selectors.controls.container)),l.element(o)||(o=this.elements.container),o[l.element(i)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",i),l.element(this.elements.controls)||oe.findElements.call(this),!l.empty(this.elements.buttons)){var r=function(t){var i=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return N(t,i)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];M(t,i,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){l.array(e)||l.nodeList(e)?Array.from(e).filter(Boolean).forEach(r):r(e)})}if(window.navigator.userAgent.includes("Edge")&&B(o),this.config.tooltips.controls){var c=this.config,u=c.classNames,d=c.selectors,h=d.controls.wrapper+" "+d.labels+" ."+u.hidden,p=x.call(this,h);Array.from(p).forEach(function(t){M(t,e.config.classNames.hidden,!1),M(t,e.config.classNames.tooltip,!0)})}}};function re(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var i=document.createElement("a");i.href=t,t=i.href}try{return new URL(t)}catch(e){return null}}function le(e){var t=new URLSearchParams;return l.object(e)&&Object.entries(e).forEach(function(e){var i=v(e,2),n=i[0],s=i[1];t.set(n,s)}),t}var ce={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!F.textTracks)l.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&oe.setCaptionsMenu.call(this);else{var e,t;if(l.element(this.elements.captions)||(this.elements.captions=w("div",P(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,l.element(e)&&l.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),V.isIE&&window.URL){var i=this.media.querySelectorAll("track");Array.from(i).forEach(function(e){var t=e.getAttribute("src"),i=re(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&ee(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){A(e)})})}var n=z((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),s=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===s)s=v(n,1)[0];var a=this.storage.get("captions");if(l.boolean(a)||(a=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:a,language:s,languages:n}),this.isHTML5){var o=this.config.captions.update?"addtrack removetrack":"removetrack";d.call(this,this.media.textTracks,o,ce.update.bind(this))}setTimeout(ce.update.bind(this),0)}},update:function(){var e=this,t=ce.getTracks.call(this,!0),i=this.captions,n=i.active,s=i.language,a=i.meta,o=i.currentTrackNode,r=Boolean(t.find(function(e){return e.language===s}));this.isHTML5&&this.isVideo&&t.filter(function(e){return!a.get(e)}).forEach(function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),t.mode="hidden",d.call(e,t,"cuechange",function(){return ce.updateCues.call(e)})}),(r&&this.language!==s||!t.includes(o))&&(ce.setLanguage.call(this,s),ce.toggle.call(this,n&&r)),M(this.elements.container,this.config.classNames.captions.enabled,!l.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&oe.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,n=this.config.classNames.captions.active,s=l.nullOrUndefined(e)?!i:e;if(s!==i){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){var a=ce.getTracks.call(this),o=ce.findTrack.call(this,[this.captions.language].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(this.captions.languages)),!0);return this.captions.language=o.language,void ce.set.call(this,a.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),M(this.elements.container,n,s),this.captions.toggled=s,oe.updateSetting.call(this,"captions"),f.call(this,this.media,s?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=ce.getTracks.call(this);if(-1!==e)if(l.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var n=i[e],s=(n||{}).language;this.captions.currentTrackNode=n,oe.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),f.call(this,this.media,"languagechange")}ce.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&ce.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else ce.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(l.string(e)){var i=e.toLowerCase();this.captions.language=i;var n=ce.getTracks.call(this),s=ce.findTrack.call(this,[i]);ce.set.call(this,n.indexOf(s),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter(function(i){return!e.isHTML5||t||e.captions.meta.has(i)}).filter(function(e){return["captions","subtitles"].includes(e.kind)})},findTrack:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ce.getTracks.call(this),s=function(e){return Number((t.captions.meta.get(e)||{}).default)},a=Array.from(n).sort(function(e,t){return s(t)-s(e)}),o=void 0;return e.every(function(e){return!(o=a.find(function(t){return t.language===e}))}),o||(i?a[0]:void 0)},getCurrentTrack:function(){return ce.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!l.track(t)&&F.textTracks&&this.captions.toggled&&(t=ce.getCurrentTrack.call(this)),l.track(t)?l.empty(t.label)?l.empty(t.language)?X("enabled",this.config):e.language.toUpperCase():t.label:X("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(l.element(this.elements.captions))if(l.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var i=ce.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(G)}var n=t.map(function(e){return e.trim()}).join("\n");if(n!==this.elements.captions.innerHTML){E(this.elements.captions);var s=w("span",P(this.config.selectors.caption));s.innerHTML=n,this.elements.captions.appendChild(s),f.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},ue={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:"16:9",clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.3.12/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus"},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},keys:{google:null},ads:{enabled:!1,publisherId:""}},de={html5:"html5",youtube:"youtube",vimeo:"vimeo"},he={audio:"audio",video:"video"};var pe=function(){},fe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return g(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):pe}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):pe}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):pe}}]),e}();function me(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;l.element(e)&&(e.pressed=this.active),f.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),V.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l.element(e)){var i=x.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),n=i[0],s=i[i.length-1];u.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==s||e.shiftKey?t===n&&e.shiftKey&&(s.focus(),e.preventDefault()):(n.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function ge(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",M(this.target,this.player.config.classNames.fullscreen.fallback,e),me.call(this)}var ye=function(){function e(t){var i=this;m(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},d.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":this.prefix+"fullscreenchange",function(){me.call(i)}),d.call(this.player,this.player.elements.container,"dblclick",function(e){l.element(i.player.elements.controls)&&i.player.elements.controls.contains(e.target)||i.toggle()}),this.update()}return g(e,[{key:"update",value:function(){this.enabled?this.player.debug.log((e.native?"Native":"Fallback")+" fullscreen enabled"):this.player.debug.log("Fullscreen not supported and fallback disabled"),M(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(V.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():e.native?this.prefix?l.empty(this.prefix)||this.target[this.prefix+"Request"+this.property]():this.target.requestFullscreen():ge.call(this,!0))}},{key:"exit",value:function(){if(this.enabled)if(V.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(e.native)if(this.prefix){if(!l.empty(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document[""+this.prefix+t+this.property]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document);else ge.call(this,!1)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(e.native?(this.prefix?document[""+this.prefix+this.property+"Element"]:document.fullscreenElement)===this.target:N(this.target,this.player.config.classNames.fullscreen.fallback))}},{key:"target",get:function(){return V.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(l.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!l.function(document[t+"ExitFullscreen"])&&!l.function(document[t+"CancelFullScreen"]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}();function ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise(function(i,n){var s=new Image,a=function(){delete s.onload,delete s.onerror,(s.naturalWidth>=t?i:n)(s)};Object.assign(s,{onload:a,onerror:a,src:e})})}var be={addStyleHook:function(){M(this.elements.container,this.config.selectors.container.replace(".",""),!0),M(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for "+this.provider+" "+this.type),void be.toggleNativeControls.call(this,!0);l.element(this.elements.controls)||(oe.inject.call(this),this.listeners.controls()),be.toggleNativeControls.call(this),this.isHTML5&&ce.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,oe.updateVolume.call(this),oe.timeUpdate.call(this),be.checkPlaying.call(this),M(this.elements.container,this.config.classNames.pip.supported,F.pip&&this.isHTML5&&this.isVideo),M(this.elements.container,this.config.classNames.airplay.supported,F.airplay&&this.isHTML5),M(this.elements.container,this.config.classNames.isIos,V.isIos),M(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){f.call(e,e.media,"ready")},0),be.setTitle.call(this),this.poster&&be.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&oe.durationUpdate.call(this)},setTitle:function(){var e=X("play",this.config);if(l.string(this.config.title)&&!l.empty(this.config.title)&&(e+=", "+this.config.title),Array.from(this.elements.buttons.play||[]).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=_.call(this,"iframe");if(!l.element(t))return;var i=l.empty(this.config.title)?"video":this.config.title,n=X("frameTitle",this.config);t.setAttribute("title",n.replace("{title}",i))}},togglePoster:function(e){M(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):d.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return ve(e)}).catch(function(i){throw e===t.poster&&be.togglePoster.call(t,!1),i}).then(function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('"+e+"')",backgroundSize:""}),be.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;M(this.elements.container,this.config.classNames.playing,this.playing),M(this.elements.container,this.config.classNames.paused,this.paused),M(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),l.event(e)&&"timeupdate"===e.type||be.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){M(t.elements.container,t.config.classNames.loading,t.loading),be.toggleControls.call(t)},this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;t&&this.config.hideControls&&this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover))}},ke=function(){function e(t){m(this,e),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return g(e,[{key:"handleKey",value:function(e){var t=this.player,i=t.elements,n=e.keyCode?e.keyCode:e.which,s="keydown"===e.type,a=s&&n===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&l.number(n)){if(s){var o=document.activeElement;if(l.element(o)){var r=t.config.selectors.editable;if(o!==i.inputs.seek&&L(o,r))return;if(32===e.which&&L(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(n-48));break;case 32:case 75:a||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}!t.fullscreen.enabled&&t.fullscreen.active&&27===n&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){oe.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,M(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,i=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var n,s=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||s)n=t.config.classNames.tabFocus,M(x.call(t,"."+n),n,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;i.container.contains(e)&&M(document.activeElement,t.config.classNames.tabFocus,!0)},10)}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&u.call(t,window,"keydown keyup",this.handleKey,e,!1),u.call(t,document.body,"click",this.toggleMenu,e),p.call(t,document.body,"touchstart",this.firstTouch),u.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.elements;!e.config.keyboard.global&&e.config.keyboard.focused&&d.call(e,t.container,"keydown keyup",this.handleKey,!1),d.call(e,t.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",function(i){var n=t.controls;n&&"enterfullscreen"===i.type&&(n.pressed=!1,n.hover=!1);var s=0;["touchstart","touchmove","mousemove"].includes(i.type)&&(be.toggleControls.call(e,!0),s=e.touch?3e3:2e3),clearTimeout(e.timers.controls),e.timers.controls=setTimeout(function(){return be.toggleControls.call(e,!1)},s)})}},{key:"media",value:function(){var e=this.player,t=e.elements;if(d.call(e,e.media,"timeupdate seeking seeked",function(t){return oe.timeUpdate.call(e,t)}),d.call(e,e.media,"durationchange loadeddata loadedmetadata",function(t){return oe.durationUpdate.call(e,t)}),d.call(e,e.media,"canplay",function(){S(t.volume,!e.hasAudio),S(t.buttons.mute,!e.hasAudio)}),d.call(e,e.media,"ended",function(){e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&e.restart()}),d.call(e,e.media,"progress playing seeking seeked",function(t){return oe.updateProgress.call(e,t)}),d.call(e,e.media,"volumechange",function(t){return oe.updateVolume.call(e,t)}),d.call(e,e.media,"playing play pause ended emptied timeupdate",function(t){return be.checkPlaying.call(e,t)}),d.call(e,e.media,"waiting canplay seeked playing",function(t){return be.checkLoading.call(e,t)}),d.call(e,e.media,"playing",function(){e.ads&&e.ads.enabled&&!e.ads.initialized&&e.ads.managerPromise.then(function(){return e.ads.play()}).catch(function(){return e.play()})}),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){var i=_.call(e,"."+e.config.classNames.video);if(!l.element(i))return;d.call(e,t.container,"click touchstart",function(n){([t.container,i].includes(n.target)||i.contains(n.target))&&(e.config.hideControls&&e.touch&&N(t.container,e.config.classNames.hideControls)||(e.ended?(e.restart(),e.play()):e.togglePlay()))})}e.supported.ui&&e.config.disableContextMenu&&d.call(e,t.wrapper,"contextmenu",function(e){e.preventDefault()},!1),d.call(e,e.media,"volumechange",function(){e.storage.set({volume:e.volume,muted:e.muted})}),d.call(e,e.media,"ratechange",function(){oe.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),d.call(e,e.media,"qualitychange",function(t){oe.updateSetting.call(e,"quality",null,t.detail.quality)});var n=e.config.events.concat(["keyup","keydown"]).join(" ");d.call(e,e.media,n,function(i){var n=i.detail,s=void 0===n?{}:n;"error"===i.type&&(s=e.media.error),f.call(e,t.container,i.type,!0,s)})}},{key:"proxy",value:function(e,t,i){var n=this.player,s=n.config.listeners[i],a=!0;l.function(s)&&(a=s.call(n,e)),a&&l.function(t)&&t.call(n,e)}},{key:"bind",value:function(e,t,i,n){var s=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,r=o.config.listeners[n],c=l.function(r);d.call(o,e,t,function(e){return s.proxy(e,i,n)},a&&!c)}},{key:"controls",value:function(){var e=this,t=this.player,i=t.elements,n=V.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach(function(i){e.bind(i,"click",t.togglePlay,"play")}),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",t.rewind,"rewind"),this.bind(i.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(i.buttons.mute,"click",function(){t.muted=!t.muted},"mute"),this.bind(i.buttons.captions,"click",function(){return t.toggleCaptions()}),this.bind(i.buttons.fullscreen,"click",function(){t.fullscreen.toggle()},"fullscreen"),this.bind(i.buttons.pip,"click",function(){t.pip="toggle"},"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",function(e){e.stopPropagation(),oe.toggleMenu.call(t,e)}),this.bind(i.buttons.settings,"keyup",function(e){var i=e.which;[13,32].includes(i)&&(13!==i?(e.preventDefault(),e.stopPropagation(),oe.toggleMenu.call(t,e)):oe.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(i.settings.menu,"keydown",function(e){27===e.which&&oe.toggleMenu.call(t,e)}),this.bind(i.inputs.seek,"mousedown mousemove",function(e){var t=i.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",n)}),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",function(e){var i=e.currentTarget,n=e.keyCode?e.keyCode:e.which;if(!l.keyboardEvent(e)||39===n||37===n){var s=i.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);s&&a?(i.removeAttribute("play-on-seeked"),t.play()):!a&&t.playing&&(i.setAttribute("play-on-seeked",""),t.pause())}}),V.isIos){var s=x.call(t,'input[type="range"]');Array.from(s).forEach(function(t){return e.bind(t,n,function(e){return B(e.target)})})}this.bind(i.inputs.seek,n,function(e){var i=e.currentTarget,n=i.getAttribute("seek-value");l.empty(n)&&(n=i.value),i.removeAttribute("seek-value"),t.currentTime=n/i.max*t.duration},"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",function(e){return oe.updateSeekTooltip.call(t,e)}),V.isWebkit&&Array.from(x.call(t,'input[type="range"]')).forEach(function(i){e.bind(i,"input",function(e){return oe.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!l.element(i.display.duration)&&this.bind(i.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,oe.timeUpdate.call(t))}),this.bind(i.inputs.volume,n,function(e){t.volume=e.target.value},"volume"),this.bind(i.controls,"mouseenter mouseleave",function(e){i.controls.hover=!t.touch&&"mouseenter"===e.type}),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){i.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(i.controls,"focusin focusout",function(i){var n=t.config,s=t.elements,a=t.timers,o="focusin"===i.type;if(M(s.controls,n.classNames.noTransition,o),be.toggleControls.call(t,o),o){setTimeout(function(){M(s.controls,n.classNames.noTransition,!1)},0);var r=e.touch?3e3:4e3;clearTimeout(a.controls),a.controls=setTimeout(function(){return be.toggleControls.call(t,!1)},r)}}),this.bind(i.inputs.volume,"wheel",function(e){var i=e.webkitDirectionInvertedFromDevice,n=[e.deltaX,-e.deltaY].map(function(e){return i?-e:e}),s=v(n,2),a=s[0],o=s[1],r=Math.sign(Math.abs(a)>Math.abs(o)?a:o);t.increaseVolume(r/50);var l=t.media.volume;(1===r&&l<1||-1===r&&l>0)&&e.preventDefault()},"volume",!1)}}]),e}();"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var we,Te=(function(e,t){var i;i=function(){var e=function(){},t={},i={},n={};function s(e,t){if(e){var s=n[e];if(i[e]=t,s)for(;s.length;)s[0](e,t),s.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,n,s){var a,r,l=document,c=n.async,u=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/^(css|img)!/,"");s=s||0,/(^css!|\.css$)/.test(t)?(a=!0,(r=l.createElement("link")).rel="stylesheet",r.href=h):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(r=l.createElement("img")).src=h:((r=l.createElement("script")).src=t,r.async=void 0===c||c),r.onload=r.onerror=r.onbeforeload=function(e){var l=e.type[0];if(a&&"hideFocus"in r)try{r.sheet.cssText.length||(l="e")}catch(e){l="e"}if("e"==l&&(s+=1)<u)return o(t,i,n,s);i(t,l,e.defaultPrevented)},!1!==d(t,r)&&l.head.appendChild(r)}function r(e,i,n){var r,l;if(i&&i.trim&&(r=i),l=(r?n:i)||{},r){if(r in t)throw"LoadJS";t[r]=!0}!function(e,t,i){var n,s,a=(e=e.push?e:[e]).length,r=a,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--a||t(l)},s=0;s<r;s++)o(e[s],n,i)}(e,function(e){a(l,e),s(r,e)},l)}return r.ready=function(e,t){return function(e,t){e=e.push?e:[e];var s,a,o,r=[],l=e.length,c=l;for(s=function(e,i){i.length&&r.push(e),--c||t(r)};l--;)a=e[l],(o=i[a])?s(a,o):(n[a]=n[a]||[]).push(s)}(e,function(e){a(t,e)}),r},r.done=function(e){s(e,[])},r.reset=function(){t={},i={},n={}},r.isDefined=function(e){return e in t},r},e.exports=i()}(we={exports:{}},we.exports),we.exports);function Ae(e){return new Promise(function(t,i){Te(e,{success:t,error:i})})}function Ee(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,f.call(this,this.media,e?"play":"pause"))}var Ce={setup:function(){var e=this;M(this.elements.wrapper,this.config.classNames.embed,!0),Ce.setAspectRatio.call(this),l.object(window.Vimeo)?Ce.ready.call(this):Ae(this.config.urls.vimeo.sdk).then(function(){Ce.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},setAspectRatio:function(e){var t=(l.string(e)?e:this.config.ratio).split(":"),i=v(t,2),n=100/i[0]*i[1];if(this.elements.wrapper.style.paddingBottom=n+"%",this.supported.ui){var s=(240-n)/4.8;this.media.style.transform="translateY(-"+s+"%)"}},ready:function(){var e=this,t=this,i=le({loop:t.config.loop.active,autoplay:t.autoplay,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0,gesture:"media",playsinline:!this.config.fullscreen.iosNative}),n=t.media.getAttribute("src");l.empty(n)&&(n=t.media.getAttribute(t.config.attributes.embed.id));var s,a=(s=n,l.empty(s)?null:l.number(Number(s))?s:s.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:s),o=w("iframe"),r=Y(t.config.urls.vimeo.iframe,a,i);o.setAttribute("src",r),o.setAttribute("allowfullscreen",""),o.setAttribute("allowtransparency",""),o.setAttribute("allow","autoplay");var c=w("div",{poster:t.poster,class:t.config.classNames.embedContainer});c.appendChild(o),t.media=C(c,t.media),ee(Y(t.config.urls.vimeo.api,a),"json").then(function(e){if(!l.empty(e)){var i=new URL(e[0].thumbnail_large);i.pathname=i.pathname.split("_")[0]+".jpg",be.setPoster.call(t,i.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(o,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return Ee.call(t,!0),t.embed.play()},t.media.pause=function(){return Ee.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var u=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return u},set:function(e){var i=t.embed,n=t.media,s=t.paused,a=t.volume,o=s&&!i.hasPlayed;n.seeking=!0,f.call(t,n,"seeking"),Promise.resolve(o&&i.setVolume(0)).then(function(){return i.setCurrentTime(e)}).then(function(){return o&&i.pause()}).then(function(){return o&&i.setVolume(a)}).catch(function(){})}});var d=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return d},set:function(e){t.embed.setPlaybackRate(e).then(function(){d=e,f.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&oe.setSpeedMenu.call(t,[])})}});var h=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return h},set:function(e){t.embed.setVolume(e).then(function(){h=e,f.call(t,t.media,"volumechange")})}});var p=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return p},set:function(e){var i=!!l.boolean(e)&&e;t.embed.setVolume(i?0:t.config.volume).then(function(){p=i,f.call(t,t.media,"volumechange")})}});var m=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return m},set:function(e){var i=l.boolean(e)?e:t.config.loop.active;t.embed.setLoop(i).then(function(){m=i})}});var g=void 0;t.embed.getVideoUrl().then(function(e){g=e}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return g}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(t){var i=function(e,t){var i=function e(t,i){return 0===i?t:e(i,t%i)}(e,t);return e/i+":"+t/i}(t[0],t[1]);Ce.setAspectRatio.call(e,i)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(i){t.config.title=i,be.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){u=e,f.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,f.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,ce.setup.call(t)}),t.embed.on("cuechange",function(e){var i=e.cues,n=(void 0===i?[]:i).map(function(e){return t=e.text,i=document.createDocumentFragment(),n=document.createElement("div"),i.appendChild(n),n.innerHTML=t,i.firstChild.innerText;var t,i,n});ce.updateCues.call(t,n)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){Ee.call(t,!e),e||f.call(t,t.media,"playing")}),l.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){Ee.call(t,!0),f.call(t,t.media,"playing")}),t.embed.on("pause",function(){Ee.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,u=e.seconds,f.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,f.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&f.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,f.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,f.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,f.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,f.call(t,t.media,"error")}),setTimeout(function(){return be.build.call(t)},0)}};function Pe(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,f.call(this,this.media,e?"play":"pause"))}var Se,Me={setup:function(){var e=this;M(this.elements.wrapper,this.config.classNames.embed,!0),Me.setAspectRatio.call(this),l.object(window.YT)&&l.function(window.YT.Player)?Me.ready.call(this):(Ae(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){Me.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(l.function(this.embed.getVideoData)){var i=this.embed.getVideoData().title;if(l.empty(i))return this.config.title=i,void be.setTitle.call(this)}var n=this.config.keys.google;l.string(n)&&!l.empty(n)&&ee(Y(this.config.urls.youtube.api,e,n)).then(function(e){l.object(e)&&(t.config.title=e.items[0].snippet.title,be.setTitle.call(t))}).catch(function(){})},setAspectRatio:function(){var e=this.config.ratio.split(":");this.elements.wrapper.style.paddingBottom=100/e[0]*e[1]+"%"},ready:function(){var e=this,t=e.media.getAttribute("id");if(l.empty(t)||!t.startsWith("youtube-")){var i=e.media.getAttribute("src");l.empty(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));var n,s=(n=i,l.empty(n)?null:n.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:n),a=e.provider+"-"+Math.floor(1e4*Math.random()),o=w("div",{id:a,poster:e.poster});e.media=C(o,e.media);var r=function(e){return"https://img.youtube.com/vi/"+s+"/"+e+"default.jpg"};ve(r("maxres"),121).catch(function(){return ve(r("sd"),121)}).catch(function(){return ve(r("hq"))}).then(function(t){return be.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){}),e.embed=new window.YT.Player(a,{videoId:s,playerVars:{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,disablekb:1,playsinline:1,widget_referrer:window?window.location.href:null,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language},events:{onError:function(t){if(!e.media.error){var i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},f.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var i=t.target;e.media.playbackRate=i.getPlaybackRate(),f.call(e,e.media,"ratechange")},onReady:function(t){if(!l.function(e.media.play)){var i=t.target;Me.getTitle.call(e,s),e.media.play=function(){Pe.call(e,!0),i.playVideo()},e.media.pause=function(){Pe.call(e,!1),i.pauseVideo()},e.media.stop=function(){i.stopVideo()},e.media.duration=i.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,f.call(e,e.media,"seeking"),i.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}});var n=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return n},set:function(t){n=t,i.setVolume(100*n),f.call(e,e.media,"volumechange")}});var a=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return a},set:function(t){var n=l.boolean(t)?t:a;a=n,i[n?"mute":"unMute"](),f.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=i.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),f.call(e,e.media,"timeupdate"),f.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=i.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&f.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),f.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return be.build.call(e)},50)}},onStateChange:function(t){var i=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,f.call(e,e.media,"seeked")),t.data){case-1:f.call(e,e.media,"timeupdate"),e.media.buffered=i.getVideoLoadedFraction(),f.call(e,e.media,"progress");break;case 0:Pe.call(e,!1),e.media.loop?(i.stopVideo(),i.playVideo()):f.call(e,e.media,"ended");break;case 1:e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Pe.call(e,!0),f.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){f.call(e,e.media,"timeupdate")},50),e.media.duration!==i.getDuration()&&(e.media.duration=i.getDuration(),f.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Pe.call(e,!1)}f.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},Ne={setup:function(){this.media?(M(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),M(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&M(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=w("div",{class:this.config.classNames.video}),b(this.media,this.elements.wrapper),this.elements.poster=w("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?U.extend.call(this):this.isYouTube?Me.setup.call(this):this.isVimeo&&Ce.setup.call(this)):this.debug.warn("No media element found!")}},Le=function(){function e(t){var i=this;m(this,e),this.player=t,this.publisherId=t.config.ads.publisherId,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){i.on("loaded",e),i.on("error",t)}),this.load()}return g(e,[{key:"load",value:function(){var e=this;this.enabled&&(l.object(window.google)&&l.object(window.google.ima)?this.ready():Ae(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=w("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=t.offsetWidth,i.linearAdSlotHeight=t.offsetHeight,i.nonLinearAdSlotWidth=t.offsetWidth,i.nonLinearAdSlotHeight=t.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=ae(Math.max(e.manager.getRemainingTime(),0)),i=X("advertisement",e.player.config)+" - "+t;e.elements.container.setAttribute("data-badge-text",i)},100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=e.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),l.empty(this.cuePoints)||this.cuePoints.forEach(function(e){if(0!==e&&-1!==e&&e<t.player.duration){var i=t.player.elements.progress;if(l.element(i)){var n=100/t.player.duration*e,s=w("span",{class:t.player.config.classNames.cues});s.style.left=n.toString()+"%",i.appendChild(s)}}}),this.manager.setVolume(this.player.volume),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){return t.onAdError(e)}),Object.keys(google.ima.AdEvent.Type).forEach(function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],function(e){return t.onAdEvent(e)})}),this.trigger("loaded")}}},{key:"onAdEvent",value:function(e){var t=this,i=this.player.elements.container,n=e.getAd(),s=function(e){var i="ads"+e.replace(/_/g,"").toLowerCase();f.call(t.player,t.player.media,i)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),s(e.type),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:s(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:s(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:s(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:s(e.type)}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e=this,t=this.player.elements.container,i=void 0;this.player.on("ended",function(){e.loader.contentComplete()}),this.player.on("seeking",function(){return i=e.player.currentTime}),this.player.on("seeked",function(){var t=e.player.currentTime;l.empty(e.cuePoints)||e.cuePoints.forEach(function(n,s){i<n&&n<t&&(e.manager.discardAdBreak(),e.cuePoints.splice(s,1))})}),window.addEventListener("resize",function(){e.manager&&e.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.currentTime<this.player.duration&&this.player.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];var a=this.events[e];l.array(a)&&a.forEach(function(e){l.function(e)&&e.apply(t,n)})}},{key:"on",value:function(e,t){return l.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var i=this;this.player.debug.log("Safety timer invoked from: "+t),this.safetyTimer=setTimeout(function(){i.cancel(),i.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){l.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: "+e),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.ads.enabled&&!l.empty(this.publisherId)}},{key:"tagUrl",get:function(){return"https://go.aniview.com/api/adserver6/vast/?"+le({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId})}}]),e}(),xe={insertElements:function(e,t){var i=this;l.string(t)?T(e,this.media,{src:t}):l.array(t)&&t.forEach(function(t){T(e,i.media,t)})},change:function(e){var t=this;W(e,"sources.length")?(U.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],A(t.media),t.media=null,l.element(t.elements.container)&&t.elements.container.removeAttribute("class");var i=e.sources,n=e.type,s=v(i,1)[0],a=s.provider,o=void 0===a?de.html5:a,r=s.src,c="html5"===o?n:"div",u="html5"===o?{}:{src:r};Object.assign(t,{provider:o,type:n,supported:F.check(n,o,t.config.playsinline),media:w(c,u)}),t.elements.container.appendChild(t.media),l.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),l.empty(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),be.addStyleHook.call(t),t.isHTML5&&xe.insertElements.call(t,"source",i),t.config.title=e.title,Ne.setup.call(t),t.isHTML5&&("tracks"in e&&xe.insertElements.call(t,"track",e.tracks),t.media.load()),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&be.build.call(t),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},_e=function(){function e(t,i){var n=this;if(m(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=F.touch,this.media=t,l.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||l.nodeList(this.media)||l.array(this.media))&&(this.media=this.media[0]),this.config=K({},ue,e.defaults,i||{},function(){try{return JSON.parse(n.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new fe(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",F),!l.nullOrUndefined(this.media)&&l.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(F.check().api){var s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;var a=this.media.tagName.toLowerCase(),o=null,r=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),l.element(o)){if(r=re(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(e)?de.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?de.vimeo:null}(r.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",r.search.length){var c=["1","true"];c.includes(r.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(r.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(r.searchParams.get("playsinline")),this.config.hl=r.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(l.empty(this.provider)||!Object.keys(de).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=he.video;break;case"video":case"audio":this.type=a,this.provider=de.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=F.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new ke(this),this.storage=new Z(this),this.media.plyr=this,l.element(this.elements.container)||(this.elements.container=w("div"),b(this.media,this.elements.container)),be.addStyleHook.call(this),Ne.setup.call(this),this.config.debug&&d.call(this,this.elements.container,this.config.events.join(" "),function(e){n.debug.log("event: "+e.type)}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&be.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new ye(this),this.config.ads.enabled&&(this.ads=new Le(this)),this.config.autoplay&&this.play()):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return g(e,[{key:"play",value:function(){return l.function(this.media.play)?this.media.play():null}},{key:"pause",value:function(){this.playing&&l.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(l.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):l.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(l.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(l.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(l.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){ce.toggle.call(this,e,!1)}},{key:"airplay",value:function(){F.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=N(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=M(this.elements.container,this.config.classNames.hideControls,i);if(n&&this.config.controls.includes("settings")&&!l.empty(this.config.settings)&&oe.toggleMenu.call(this,!1),n!==t){var s=n?"controlshidden":"controlsshown";f.call(this,this.media,s)}return!n}return!1}},{key:"on",value:function(e,t){d.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){p.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){h(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var n=function(){document.body.style.overflow="",t.embed=null,i?(Object.keys(t.elements).length&&(A(t.elements.buttons.play),A(t.elements.captions),A(t.elements.controls),A(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),l.function(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach(function(e){var t=e.element,i=e.type,n=e.callback,s=e.options;t.removeEventListener(i,n,s)}),this.eventListeners=[])}.call(t),C(t.elements.original,t.elements.container),f.call(t,t.elements.original,"destroyed",!0),l.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),this.isHTML5?(clearTimeout(this.timers.loading),be.toggleNativeControls.call(this,!0),n()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&l.function(this.embed.destroy)&&this.embed.destroy(),n()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(n),setTimeout(n,200))}}},{key:"supports",value:function(e){return F.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===de.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===de.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===de.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===he.video)}},{key:"isAudio",get:function(){return Boolean(this.type===he.audio)}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=l.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to "+this.currentTime+" seconds")}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return l.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=l.number(t)&&t!==1/0?t:0;return e||i}},{key:"volume",set:function(e){var t=e;l.string(t)&&(t=Number(t)),l.number(t)||(t=this.storage.get("volume")),l.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!l.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;l.boolean(t)||(t=this.storage.get("muted")),l.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=null;l.number(e)&&(t=e),l.number(t)||(t=this.storage.get("speed")),l.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed ("+t+")")},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,i=this.options.quality;if(i.length){var n=[!l.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(l.number);if(!i.includes(n)){var s=function(e,t){return l.array(e)&&e.length?e.reduce(function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e}):null}(i,n);this.debug.warn("Unsupported quality option: "+n+", using "+s+" instead"),n=s}t.selected=n,this.media.quality=n}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=l.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){xe.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"poster",set:function(e){this.isVideo?be.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=l.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){ce.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,i=e.currentTrack;return t?i:-1}},{key:"language",set:function(e){ce.setLanguage.call(this,e,!1)},get:function(){return(ce.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){var t="picture-in-picture",i="inline";if(F.pip){var n=l.boolean(e)?e:this.pip===i;this.media.webkitSetPresentationMode(n?t:i)}},get:function(){return F.pip?this.media.webkitPresentationMode:null}}],[{key:"supported",value:function(e,t,i){return F.check(e,t,i)}},{key:"loadSprite",value:function(e,t){return te(e,t)}},{key:"setup",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;return l.string(t)?n=Array.from(document.querySelectorAll(t)):l.nodeList(t)?n=Array.from(t):l.array(t)&&(n=t.filter(l.element)),l.empty(n)?null:n.map(function(t){return new e(t,i)})}}]),e}();return _e.defaults=(Se=ue,JSON.parse(JSON.stringify(Se))),_e});
|
2 |
+
//# sourceMappingURL=plyr.min.js.map
|
assets/packages/plyr/plyr.polyfilled.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):e.Plyr=t()}(this,function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=t(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),i=t(function(e){var t=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=t)}),r=(i.version,function(e){return"object"==typeof e?null!==e:"function"==typeof e}),o=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e},a=function(e){try{return!!e()}catch(e){return!0}},s=!a(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),l=n.document,c=r(l)&&r(l.createElement),u=function(e){return c?l.createElement(e):{}},f=!s&&!a(function(){return 7!=Object.defineProperty(u("div"),"a",{get:function(){return 7}}).a}),h=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},d=Object.defineProperty,p={f:s?Object.defineProperty:function(e,t,n){if(o(e),t=h(t,!0),o(n),f)try{return d(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},g=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},m=s?function(e,t,n){return p.f(e,t,g(1,n))}:function(e,t,n){return e[t]=n,e},v={}.hasOwnProperty,y=function(e,t){return v.call(e,t)},b=0,w=Math.random(),k=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++b+w).toString(36))},T=t(function(e){var t=k("src"),r=Function.toString,o=(""+r).split("toString");i.inspectSource=function(e){return r.call(e)},(e.exports=function(e,i,r,a){var s="function"==typeof r;s&&(y(r,"name")||m(r,"name",i)),e[i]!==r&&(s&&(y(r,t)||m(r,t,e[i]?""+e[i]:o.join(String(i)))),e===n?e[i]=r:a?e[i]?e[i]=r:m(e,i,r):(delete e[i],m(e,i,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||r.call(this)})}),E=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},S=function(e,t,n){if(E(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},_=function(e,t,r){var o,a,s,l,c=e&_.F,u=e&_.G,f=e&_.S,h=e&_.P,d=e&_.B,p=u?n:f?n[t]||(n[t]={}):(n[t]||{}).prototype,g=u?i:i[t]||(i[t]={}),v=g.prototype||(g.prototype={});for(o in u&&(r=t),r)s=((a=!c&&p&&void 0!==p[o])?p:r)[o],l=d&&a?S(s,n):h&&"function"==typeof s?S(Function.call,s):s,p&&T(p,o,s,e&_.U),g[o]!=s&&m(g,o,l),h&&v[o]!=s&&(v[o]=s)};n.core=i,_.F=1,_.G=2,_.S=4,_.P=8,_.B=16,_.W=32,_.U=64,_.R=128;for(var A,P=_,M=k("typed_array"),L=k("view"),x=!(!n.ArrayBuffer||!n.DataView),C=x,O=0,N="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");O<9;)(A=n[N[O++]])?(m(A.prototype,M,!0),m(A.prototype,L,!0)):C=!1;var j={ABV:x,CONSTR:C,TYPED:M,VIEW:L},I=function(e,t,n){for(var i in t)T(e,i,t[i],n);return e},F=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e},R=Math.ceil,B=Math.floor,D=function(e){return isNaN(e=+e)?0:(e>0?B:R)(e)},V=Math.min,U=function(e){return e>0?V(D(e),9007199254740991):0},q=function(e){if(void 0===e)return 0;var t=D(e),n=U(t);if(t!==n)throw RangeError("Wrong length!");return n},H={}.toString,W=function(e){return H.call(e).slice(8,-1)},z=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==W(e)?e.split(""):Object(e)},K=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},G=function(e){return z(K(e))},Y=Math.max,J=Math.min,Q=function(e,t){return(e=D(e))<0?Y(e+t,0):J(e,t)},$=function(e){return function(t,n,i){var r,o=G(t),a=U(o.length),s=Q(i,a);if(e&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},X=t(function(e){var t=n["__core-js_shared__"]||(n["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),Z=X("keys"),ee=function(e){return Z[e]||(Z[e]=k(e))},te=$(!1),ne=ee("IE_PROTO"),ie=function(e,t){var n,i=G(e),r=0,o=[];for(n in i)n!=ne&&y(i,n)&&o.push(n);for(;t.length>r;)y(i,n=t[r++])&&(~te(o,n)||o.push(n));return o},re="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),oe=re.concat("length","prototype"),ae={f:Object.getOwnPropertyNames||function(e){return ie(e,oe)}},se=function(e){return Object(K(e))},le=function(e){for(var t=se(this),n=U(t.length),i=arguments.length,r=Q(i>1?arguments[1]:void 0,n),o=i>2?arguments[2]:void 0,a=void 0===o?n:Q(o,n);a>r;)t[r++]=e;return t},ce=t(function(e){var t=X("wks"),i=n.Symbol,r="function"==typeof i;(e.exports=function(e){return t[e]||(t[e]=r&&i[e]||(r?i:k)("Symbol."+e))}).store=t}),ue=p.f,fe=ce("toStringTag"),he=function(e,t,n){e&&!y(e=n?e:e.prototype,fe)&&ue(e,fe,{configurable:!0,value:t})},de=t(function(e,t){var i=ae.f,r=p.f,o="prototype",l="Wrong index!",c=n.ArrayBuffer,u=n.DataView,f=n.Math,h=n.RangeError,d=n.Infinity,g=c,v=f.abs,y=f.pow,b=f.floor,w=f.log,k=f.LN2,T=s?"_b":"buffer",E=s?"_l":"byteLength",S=s?"_o":"byteOffset";function _(e,t,n){var i,r,o,a=new Array(n),s=8*n-t-1,l=(1<<s)-1,c=l>>1,u=23===t?y(2,-24)-y(2,-77):0,f=0,h=e<0||0===e&&1/e<0?1:0;for((e=v(e))!=e||e===d?(r=e!=e?1:0,i=l):(i=b(w(e)/k),e*(o=y(2,-i))<1&&(i--,o*=2),(e+=i+c>=1?u/o:u*y(2,1-c))*o>=2&&(i++,o/=2),i+c>=l?(r=0,i=l):i+c>=1?(r=(e*o-1)*y(2,t),i+=c):(r=e*y(2,c-1)*y(2,t),i=0));t>=8;a[f++]=255&r,r/=256,t-=8);for(i=i<<t|r,s+=t;s>0;a[f++]=255&i,i/=256,s-=8);return a[--f]|=128*h,a}function A(e,t,n){var i,r=8*n-t-1,o=(1<<r)-1,a=o>>1,s=r-7,l=n-1,c=e[l--],u=127&c;for(c>>=7;s>0;u=256*u+e[l],l--,s-=8);for(i=u&(1<<-s)-1,u>>=-s,s+=t;s>0;i=256*i+e[l],l--,s-=8);if(0===u)u=1-a;else{if(u===o)return i?NaN:c?-d:d;i+=y(2,t),u-=a}return(c?-1:1)*i*y(2,u-t)}function P(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function M(e){return[255&e]}function L(e){return[255&e,e>>8&255]}function x(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function C(e){return _(e,52,8)}function O(e){return _(e,23,4)}function N(e,t,n){r(e[o],t,{get:function(){return this[n]}})}function R(e,t,n,i){var r=q(+n);if(r+t>e[E])throw h(l);var o=e[T]._b,a=r+e[S],s=o.slice(a,a+t);return i?s:s.reverse()}function B(e,t,n,i,r,o){var a=q(+n);if(a+t>e[E])throw h(l);for(var s=e[T]._b,c=a+e[S],u=i(+r),f=0;f<t;f++)s[c+f]=u[o?f:t-f-1]}if(j.ABV){if(!a(function(){c(1)})||!a(function(){new c(-1)})||a(function(){return new c,new c(1.5),new c(NaN),"ArrayBuffer"!=c.name})){for(var V,H=(c=function(e){return F(this,c),new g(q(e))})[o]=g[o],W=i(g),z=0;W.length>z;)(V=W[z++])in c||m(c,V,g[V]);H.constructor=c}var K=new u(new c(2)),G=u[o].setInt8;K.setInt8(0,2147483648),K.setInt8(1,2147483649),!K.getInt8(0)&&K.getInt8(1)||I(u[o],{setInt8:function(e,t){G.call(this,e,t<<24>>24)},setUint8:function(e,t){G.call(this,e,t<<24>>24)}},!0)}else c=function(e){F(this,c,"ArrayBuffer");var t=q(e);this._b=le.call(new Array(t),0),this[E]=t},u=function(e,t,n){F(this,u,"DataView"),F(e,c,"DataView");var i=e[E],r=D(t);if(r<0||r>i)throw h("Wrong offset!");if(r+(n=void 0===n?i-r:U(n))>i)throw h("Wrong length!");this[T]=e,this[S]=r,this[E]=n},s&&(N(c,"byteLength","_l"),N(u,"buffer","_b"),N(u,"byteLength","_l"),N(u,"byteOffset","_o")),I(u[o],{getInt8:function(e){return R(this,1,e)[0]<<24>>24},getUint8:function(e){return R(this,1,e)[0]},getInt16:function(e){var t=R(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=R(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return P(R(this,4,e,arguments[1]))},getUint32:function(e){return P(R(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return A(R(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return A(R(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){B(this,1,e,M,t)},setUint8:function(e,t){B(this,1,e,M,t)},setInt16:function(e,t){B(this,2,e,L,t,arguments[2])},setUint16:function(e,t){B(this,2,e,L,t,arguments[2])},setInt32:function(e,t){B(this,4,e,x,t,arguments[2])},setUint32:function(e,t){B(this,4,e,x,t,arguments[2])},setFloat32:function(e,t){B(this,4,e,O,t,arguments[2])},setFloat64:function(e,t){B(this,8,e,C,t,arguments[2])}});he(c,"ArrayBuffer"),he(u,"DataView"),m(u[o],j.VIEW,!0),t.ArrayBuffer=c,t.DataView=u}),pe=ce("species"),ge=function(e,t){var n,i=o(e).constructor;return void 0===i||null==(n=o(i)[pe])?t:E(n)},me=ce("species"),ve=function(e){var t=n[e];s&&t&&!t[me]&&p.f(t,me,{configurable:!0,get:function(){return this}})},ye=n.ArrayBuffer,be=de.ArrayBuffer,we=de.DataView,ke=j.ABV&&ye.isView,Te=be.prototype.slice,Ee=j.VIEW;P(P.G+P.W+P.F*(ye!==be),{ArrayBuffer:be}),P(P.S+P.F*!j.CONSTR,"ArrayBuffer",{isView:function(e){return ke&&ke(e)||r(e)&&Ee in e}}),P(P.P+P.U+P.F*a(function(){return!new be(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==Te&&void 0===t)return Te.call(o(this),e);for(var n=o(this).byteLength,i=Q(e,n),r=Q(void 0===t?n:t,n),a=new(ge(this,be))(U(r-i)),s=new we(this),l=new we(a),c=0;i<r;)l.setUint8(c++,s.getUint8(i++));return a}}),ve("ArrayBuffer");var Se=ce("toStringTag"),_e="Arguments"==W(function(){return arguments}()),Ae=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Se))?n:_e?W(t):"Object"==(i=W(t))&&"function"==typeof t.callee?"Arguments":i},Pe={},Me=ce("iterator"),Le=Array.prototype,xe=function(e){return void 0!==e&&(Pe.Array===e||Le[Me]===e)},Ce=Object.keys||function(e){return ie(e,re)},Oe=s?Object.defineProperties:function(e,t){o(e);for(var n,i=Ce(t),r=i.length,a=0;r>a;)p.f(e,n=i[a++],t[n]);return e},Ne=n.document,je=Ne&&Ne.documentElement,Ie=ee("IE_PROTO"),Fe=function(){},Re=function(){var e,t=u("iframe"),n=re.length;for(t.style.display="none",je.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),Re=e.F;n--;)delete Re.prototype[re[n]];return Re()},Be=Object.create||function(e,t){var n;return null!==e?(Fe.prototype=o(e),n=new Fe,Fe.prototype=null,n[Ie]=e):n=Re(),void 0===t?n:Oe(n,t)},De=ee("IE_PROTO"),Ve=Object.prototype,Ue=Object.getPrototypeOf||function(e){return e=se(e),y(e,De)?e[De]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ve:null},qe=ce("iterator"),He=i.getIteratorMethod=function(e){if(null!=e)return e[qe]||e["@@iterator"]||Pe[Ae(e)]},We=Array.isArray||function(e){return"Array"==W(e)},ze=ce("species"),Ke=function(e,t){return new(function(e){var t;return We(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!We(t.prototype)||(t=void 0),r(t)&&null===(t=t[ze])&&(t=void 0)),void 0===t?Array:t}(e))(t)},Ge=function(e,t){var n=1==e,i=2==e,r=3==e,o=4==e,a=6==e,s=5==e||a,l=t||Ke;return function(t,c,u){for(var f,h,d=se(t),p=z(d),g=S(c,u,3),m=U(p.length),v=0,y=n?l(t,m):i?l(t,0):void 0;m>v;v++)if((s||v in p)&&(h=g(f=p[v],v,d),e))if(n)y[v]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:y.push(f)}else if(o)return!1;return a?-1:r||o?o:y}},Ye=ce("unscopables"),Je=Array.prototype;null==Je[Ye]&&m(Je,Ye,{});var Qe=function(e){Je[Ye][e]=!0},$e=function(e,t){return{value:t,done:!!e}},Xe={};m(Xe,ce("iterator"),function(){return this});var Ze=function(e,t,n){e.prototype=Be(Xe,{next:g(1,n)}),he(e,t+" Iterator")},et=ce("iterator"),tt=!([].keys&&"next"in[].keys()),nt=function(){return this},it=function(e,t,n,i,r,o,a){Ze(n,t,i);var s,l,c,u=function(e){if(!tt&&e in p)return p[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},f=t+" Iterator",h="values"==r,d=!1,p=e.prototype,g=p[et]||p["@@iterator"]||r&&p[r],v=g||u(r),y=r?h?u("entries"):v:void 0,b="Array"==t&&p.entries||g;if(b&&(c=Ue(b.call(new e)))!==Object.prototype&&c.next&&(he(c,f,!0),"function"!=typeof c[et]&&m(c,et,nt)),h&&g&&"values"!==g.name&&(d=!0,v=function(){return g.call(this)}),(tt||d||!p[et])&&m(p,et,v),Pe[t]=v,Pe[f]=nt,r)if(s={values:h?v:u("values"),keys:o?v:u("keys"),entries:y},a)for(l in s)l in p||T(p,l,s[l]);else P(P.P+P.F*(tt||d),t,s);return s},rt=it(Array,"Array",function(e,t){this._t=G(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,$e(1)):$e(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values");Pe.Arguments=Pe.Array,Qe("keys"),Qe("values"),Qe("entries");var ot=ce("iterator"),at=!1;try{[7][ot]().return=function(){at=!0}}catch(e){}var st=function(e,t){if(!t&&!at)return!1;var n=!1;try{var i=[7],r=i[ot]();r.next=function(){return{done:n=!0}},i[ot]=function(){return r},e(i)}catch(e){}return n},lt=[].copyWithin||function(e,t){var n=se(this),i=U(n.length),r=Q(e,i),o=Q(t,i),a=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===a?i:Q(a,i))-o,i-r),l=1;for(o<r&&r<o+s&&(l=-1,o+=s-1,r+=s-1);s-- >0;)o in n?n[r]=n[o]:delete n[r],r+=l,o+=l;return n},ct={f:{}.propertyIsEnumerable},ut=Object.getOwnPropertyDescriptor,ft={f:s?ut:function(e,t){if(e=G(e),t=h(t,!0),f)try{return ut(e,t)}catch(e){}if(y(e,t))return g(!ct.f.call(e,t),e[t])}},ht=t(function(e){if(s){var t=n,i=a,o=P,l=j,c=de,u=S,f=F,d=g,v=m,b=I,w=D,T=U,E=q,_=Q,A=h,M=y,L=Ae,x=r,C=se,O=xe,N=Be,R=Ue,B=ae.f,V=He,H=k,W=ce,z=Ge,K=$,G=ge,Y=rt,J=Pe,X=st,Z=ve,ee=le,te=lt,ne=p,ie=ft,re=ne.f,oe=ie.f,ue=t.RangeError,fe=t.TypeError,he=t.Uint8Array,pe=Array.prototype,me=c.ArrayBuffer,ye=c.DataView,be=z(0),we=z(2),ke=z(3),Te=z(4),Ee=z(5),Se=z(6),_e=K(!0),Me=K(!1),Le=Y.values,Ce=Y.keys,Oe=Y.entries,Ne=pe.lastIndexOf,je=pe.reduce,Ie=pe.reduceRight,Fe=pe.join,Re=pe.sort,De=pe.slice,Ve=pe.toString,qe=pe.toLocaleString,We=W("iterator"),ze=W("toStringTag"),Ke=H("typed_constructor"),Ye=H("def_constructor"),Je=l.CONSTR,Qe=l.TYPED,$e=l.VIEW,Xe=z(1,function(e,t){return it(G(e,e[Ye]),t)}),Ze=i(function(){return 1===new he(new Uint16Array([1]).buffer)[0]}),et=!!he&&!!he.prototype.set&&i(function(){new he(1).set({})}),tt=function(e,t){var n=w(e);if(n<0||n%t)throw ue("Wrong offset!");return n},nt=function(e){if(x(e)&&Qe in e)return e;throw fe(e+" is not a typed array!")},it=function(e,t){if(!(x(e)&&Ke in e))throw fe("It is not a typed array constructor!");return new e(t)},ot=function(e,t){return at(G(e,e[Ye]),t)},at=function(e,t){for(var n=0,i=t.length,r=it(e,i);i>n;)r[n]=t[n++];return r},ct=function(e,t,n){re(e,t,{get:function(){return this._d[n]}})},ut=function(e){var t,n,i,r,o,a,s=C(e),l=arguments.length,c=l>1?arguments[1]:void 0,f=void 0!==c,h=V(s);if(null!=h&&!O(h)){for(a=h.call(s),i=[],t=0;!(o=a.next()).done;t++)i.push(o.value);s=i}for(f&&l>2&&(c=u(c,arguments[2],2)),t=0,n=T(s.length),r=it(this,n);n>t;t++)r[t]=f?c(s[t],t):s[t];return r},ht=function(){for(var e=0,t=arguments.length,n=it(this,t);t>e;)n[e]=arguments[e++];return n},dt=!!he&&i(function(){qe.call(new he(1))}),pt=function(){return qe.apply(dt?De.call(nt(this)):nt(this),arguments)},gt={copyWithin:function(e,t){return te.call(nt(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Te(nt(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return ee.apply(nt(this),arguments)},filter:function(e){return ot(this,we(nt(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Ee(nt(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return Se(nt(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){be(nt(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return Me(nt(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return _e(nt(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return Fe.apply(nt(this),arguments)},lastIndexOf:function(e){return Ne.apply(nt(this),arguments)},map:function(e){return Xe(nt(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return je.apply(nt(this),arguments)},reduceRight:function(e){return Ie.apply(nt(this),arguments)},reverse:function(){for(var e,t=nt(this).length,n=Math.floor(t/2),i=0;i<n;)e=this[i],this[i++]=this[--t],this[t]=e;return this},some:function(e){return ke(nt(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return Re.call(nt(this),e)},subarray:function(e,t){var n=nt(this),i=n.length,r=_(e,i);return new(G(n,n[Ye]))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,T((void 0===t?i:_(t,i))-r))}},mt=function(e,t){return ot(this,De.call(nt(this),e,t))},vt=function(e){nt(this);var t=tt(arguments[1],1),n=this.length,i=C(e),r=T(i.length),o=0;if(r+t>n)throw ue("Wrong length!");for(;o<r;)this[t+o]=i[o++]},yt={entries:function(){return Oe.call(nt(this))},keys:function(){return Ce.call(nt(this))},values:function(){return Le.call(nt(this))}},bt=function(e,t){return x(e)&&e[Qe]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},wt=function(e,t){return bt(e,t=A(t,!0))?d(2,e[t]):oe(e,t)},kt=function(e,t,n){return!(bt(e,t=A(t,!0))&&x(n)&&M(n,"value"))||M(n,"get")||M(n,"set")||n.configurable||M(n,"writable")&&!n.writable||M(n,"enumerable")&&!n.enumerable?re(e,t,n):(e[t]=n.value,e)};Je||(ie.f=wt,ne.f=kt),o(o.S+o.F*!Je,"Object",{getOwnPropertyDescriptor:wt,defineProperty:kt}),i(function(){Ve.call({})})&&(Ve=qe=function(){return Fe.call(this)});var Tt=b({},gt);b(Tt,yt),v(Tt,We,yt.values),b(Tt,{slice:mt,set:vt,constructor:function(){},toString:Ve,toLocaleString:pt}),ct(Tt,"buffer","b"),ct(Tt,"byteOffset","o"),ct(Tt,"byteLength","l"),ct(Tt,"length","e"),re(Tt,ze,{get:function(){return this[Qe]}}),e.exports=function(e,n,r,a){var s=e+((a=!!a)?"Clamped":"")+"Array",c="get"+e,u="set"+e,h=t[s],d=h||{},p=h&&R(h),g=!h||!l.ABV,m={},y=h&&h.prototype,b=function(e,t){re(e,t,{get:function(){return function(e,t){var i=e._d;return i.v[c](t*n+i.o,Ze)}(this,t)},set:function(e){return function(e,t,i){var r=e._d;a&&(i=(i=Math.round(i))<0?0:i>255?255:255&i),r.v[u](t*n+r.o,i,Ze)}(this,t,e)},enumerable:!0})};g?(h=r(function(e,t,i,r){f(e,h,s,"_d");var o,a,l,c,u=0,d=0;if(x(t)){if(!(t instanceof me||"ArrayBuffer"==(c=L(t))||"SharedArrayBuffer"==c))return Qe in t?at(h,t):ut.call(h,t);o=t,d=tt(i,n);var p=t.byteLength;if(void 0===r){if(p%n)throw ue("Wrong length!");if((a=p-d)<0)throw ue("Wrong length!")}else if((a=T(r)*n)+d>p)throw ue("Wrong length!");l=a/n}else l=E(t),o=new me(a=l*n);for(v(e,"_d",{b:o,o:d,l:a,e:l,v:new ye(o)});u<l;)b(e,u++)}),y=h.prototype=N(Tt),v(y,"constructor",h)):i(function(){h(1)})&&i(function(){new h(-1)})&&X(function(e){new h,new h(null),new h(1.5),new h(e)},!0)||(h=r(function(e,t,i,r){var o;return f(e,h,s),x(t)?t instanceof me||"ArrayBuffer"==(o=L(t))||"SharedArrayBuffer"==o?void 0!==r?new d(t,tt(i,n),r):void 0!==i?new d(t,tt(i,n)):new d(t):Qe in t?at(h,t):ut.call(h,t):new d(E(t))}),be(p!==Function.prototype?B(d).concat(B(p)):B(d),function(e){e in h||v(h,e,d[e])}),h.prototype=y,y.constructor=h);var w=y[We],k=!!w&&("values"==w.name||null==w.name),S=yt.values;v(h,Ke,!0),v(y,Qe,s),v(y,$e,!0),v(y,Ye,h),(a?new h(1)[ze]==s:ze in y)||re(y,ze,{get:function(){return s}}),m[s]=h,o(o.G+o.W+o.F*(h!=d),m),o(o.S,s,{BYTES_PER_ELEMENT:n}),o(o.S+o.F*i(function(){d.of.call(h,1)}),s,{from:ut,of:ht}),"BYTES_PER_ELEMENT"in y||v(y,"BYTES_PER_ELEMENT",n),o(o.P,s,gt),Z(s),o(o.P+o.F*et,s,{set:vt}),o(o.P+o.F*!k,s,yt),y.toString!=Ve&&(y.toString=Ve),o(o.P+o.F*i(function(){new h(1).slice()}),s,{slice:mt}),o(o.P+o.F*(i(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!i(function(){y.toLocaleString.call([1,2])})),s,{toLocaleString:pt}),J[s]=k?w:S,k||v(y,We,S)}}else e.exports=function(){}});ht("Int8",1,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Uint8",1,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Uint8",1,function(e){return function(t,n,i){return e(this,t,n,i)}},!0),ht("Int16",2,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Uint16",2,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Int32",4,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Uint32",4,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Float32",4,function(e){return function(t,n,i){return e(this,t,n,i)}}),ht("Float64",8,function(e){return function(t,n,i){return e(this,t,n,i)}});var dt=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&o(r.call(e)),t}},pt=t(function(e){var t={},n={},i=e.exports=function(e,i,r,a,s){var l,c,u,f,h=s?function(){return e}:He(e),d=S(r,a,i?2:1),p=0;if("function"!=typeof h)throw TypeError(e+" is not iterable!");if(xe(h)){for(l=U(e.length);l>p;p++)if((f=i?d(o(c=e[p])[0],c[1]):d(e[p]))===t||f===n)return f}else for(u=h.call(e);!(c=u.next()).done;)if((f=dt(u,d,c.value,i))===t||f===n)return f};i.BREAK=t,i.RETURN=n}),gt=t(function(e){var t=k("meta"),n=p.f,i=0,o=Object.isExtensible||function(){return!0},s=!a(function(){return o(Object.preventExtensions({}))}),l=function(e){n(e,t,{value:{i:"O"+ ++i,w:{}}})},c=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!y(e,t)){if(!o(e))return"F";if(!n)return"E";l(e)}return e[t].i},getWeak:function(e,n){if(!y(e,t)){if(!o(e))return!0;if(!n)return!1;l(e)}return e[t].w},onFreeze:function(e){return s&&c.NEED&&o(e)&&!y(e,t)&&l(e),e}}}),mt=(gt.KEY,gt.NEED,gt.fastKey,gt.getWeak,gt.onFreeze,function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}),vt=p.f,yt=gt.fastKey,bt=s?"_s":"size",wt=function(e,t){var n,i=yt(t);if("F"!==i)return e._i[i];for(n=e._f;n;n=n.n)if(n.k==t)return n},kt={getConstructor:function(e,t,n,i){var r=e(function(e,o){F(e,r,t,"_i"),e._t=t,e._i=Be(null),e._f=void 0,e._l=void 0,e[bt]=0,null!=o&&pt(o,n,e[i],e)});return I(r.prototype,{clear:function(){for(var e=mt(this,t),n=e._i,i=e._f;i;i=i.n)i.r=!0,i.p&&(i.p=i.p.n=void 0),delete n[i.i];e._f=e._l=void 0,e[bt]=0},delete:function(e){var n=mt(this,t),i=wt(n,e);if(i){var r=i.n,o=i.p;delete n._i[i.i],i.r=!0,o&&(o.n=r),r&&(r.p=o),n._f==i&&(n._f=r),n._l==i&&(n._l=o),n[bt]--}return!!i},forEach:function(e){mt(this,t);for(var n,i=S(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!wt(mt(this,t),e)}}),s&&vt(r.prototype,"size",{get:function(){return mt(this,t)[bt]}}),r},def:function(e,t,n){var i,r,o=wt(e,t);return o?o.v=n:(e._l=o={i:r=yt(t,!0),k:t,v:n,p:i=e._l,n:void 0,r:!1},e._f||(e._f=o),i&&(i.n=o),e[bt]++,"F"!==r&&(e._i[r]=o)),e},getEntry:wt,setStrong:function(e,t,n){it(e,t,function(e,n){this._t=mt(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?$e(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,$e(1))},n?"entries":"values",!n,!0),ve(t)}},Tt=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Et={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=S(Function.call,ft.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return Tt(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:Tt},St=Et.set,_t=function(e,t,i,o,s,l){var c=n[e],u=c,f=s?"set":"add",h=u&&u.prototype,d={},p=function(e){var t=h[e];T(h,e,"delete"==e?function(e){return!(l&&!r(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(l&&!r(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return l&&!r(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof u&&(l||h.forEach&&!a(function(){(new u).entries().next()}))){var g=new u,m=g[f](l?{}:-0,1)!=g,v=a(function(){g.has(1)}),y=st(function(e){new u(e)}),b=!l&&a(function(){for(var e=new u,t=5;t--;)e[f](t,t);return!e.has(-0)});y||((u=t(function(t,n){F(t,u,e);var i=function(e,t,n){var i,o=t.constructor;return o!==n&&"function"==typeof o&&(i=o.prototype)!==n.prototype&&r(i)&&St&&St(e,i),e}(new c,t,u);return null!=n&&pt(n,s,i[f],i),i})).prototype=h,h.constructor=u),(v||b)&&(p("delete"),p("has"),s&&p("get")),(b||m)&&p(f),l&&h.clear&&delete h.clear}else u=o.getConstructor(t,e,s,f),I(u.prototype,i),gt.NEED=!0;return he(u,e),d[e]=u,P(P.G+P.W+P.F*(u!=c),d),l||o.setStrong(u,e,s),u},At=(_t("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=kt.getEntry(mt(this,"Map"),e);return t&&t.v},set:function(e,t){return kt.def(mt(this,"Map"),0===e?0:e,t)}},kt,!0),_t("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return kt.def(mt(this,"Set"),e=0===e?0:e,e)}},kt),{f:Object.getOwnPropertySymbols}),Pt=Object.assign,Mt=!Pt||a(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=Pt({},e)[n]||Object.keys(Pt({},t)).join("")!=i})?function(e,t){for(var n=se(e),i=arguments.length,r=1,o=At.f,a=ct.f;i>r;)for(var s,l=z(arguments[r++]),c=o?Ce(l).concat(o(l)):Ce(l),u=c.length,f=0;u>f;)a.call(l,s=c[f++])&&(n[s]=l[s]);return n}:Pt,Lt=gt.getWeak,xt=Ge(5),Ct=Ge(6),Ot=0,Nt=function(e){return e._l||(e._l=new jt)},jt=function(){this.a=[]},It=function(e,t){return xt(e.a,function(e){return e[0]===t})};jt.prototype={get:function(e){var t=It(this,e);if(t)return t[1]},has:function(e){return!!It(this,e)},set:function(e,t){var n=It(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=Ct(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}};var Ft={getConstructor:function(e,t,n,i){var o=e(function(e,r){F(e,o,t,"_i"),e._t=t,e._i=Ot++,e._l=void 0,null!=r&&pt(r,n,e[i],e)});return I(o.prototype,{delete:function(e){if(!r(e))return!1;var n=Lt(e);return!0===n?Nt(mt(this,t)).delete(e):n&&y(n,this._i)&&delete n[this._i]},has:function(e){if(!r(e))return!1;var n=Lt(e);return!0===n?Nt(mt(this,t)).has(e):n&&y(n,this._i)}}),o},def:function(e,t,n){var i=Lt(o(t),!0);return!0===i?Nt(e).set(t,n):i[e._i]=n,e},ufstore:Nt};t(function(e){var t,n=Ge(0),i=gt.getWeak,o=Object.isExtensible,s=Ft.ufstore,l={},c=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},u={get:function(e){if(r(e)){var t=i(e);return!0===t?s(mt(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return Ft.def(mt(this,"WeakMap"),e,t)}},f=e.exports=_t("WeakMap",c,u,Ft,!0,!0);a(function(){return 7!=(new f).set((Object.freeze||Object)(l),7).get(l)})&&(t=Ft.getConstructor(c,"WeakMap"),Mt(t.prototype,u),gt.NEED=!0,n(["delete","has","get","set"],function(e){var n=f.prototype,i=n[e];T(n,e,function(n,a){if(r(n)&&!o(n)){this._f||(this._f=new t);var s=this._f[e](n,a);return"set"==e?this:s}return i.call(this,n,a)})}))});_t("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return Ft.def(mt(this,"WeakSet"),e,!0)}},Ft,!1,!0);var Rt=(n.Reflect||{}).apply,Bt=Function.apply;P(P.S+P.F*!a(function(){Rt(function(){})}),"Reflect",{apply:function(e,t,n){var i=E(e),r=o(n);return Rt?Rt(i,t,r):Bt.call(i,t,r)}});var Dt=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)},Vt=[].slice,Ut={},qt=Function.bind||function(e){var t=E(this),n=Vt.call(arguments,1),i=function(){var r=n.concat(Vt.call(arguments));return this instanceof i?function(e,t,n){if(!(t in Ut)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Ut[t]=Function("F,a","return new F("+i.join(",")+")")}return Ut[t](e,n)}(t,r.length,r):Dt(t,r,e)};return r(t.prototype)&&(i.prototype=t.prototype),i},Ht=(n.Reflect||{}).construct,Wt=a(function(){function e(){}return!(Ht(function(){},[],e)instanceof e)}),zt=!a(function(){Ht(function(){})});P(P.S+P.F*(Wt||zt),"Reflect",{construct:function(e,t){E(e),o(t);var n=arguments.length<3?e:E(arguments[2]);if(zt&&!Wt)return Ht(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return i.push.apply(i,t),new(qt.apply(e,i))}var a=n.prototype,s=Be(r(a)?a:Object.prototype),l=Function.apply.call(e,s,t);return r(l)?l:s}}),P(P.S+P.F*a(function(){Reflect.defineProperty(p.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){o(e),t=h(t,!0),o(n);try{return p.f(e,t,n),!0}catch(e){return!1}}});var Kt=ft.f;P(P.S,"Reflect",{deleteProperty:function(e,t){var n=Kt(o(e),t);return!(n&&!n.configurable)&&delete e[t]}}),P(P.S,"Reflect",{get:function e(t,n){var i,a,s=arguments.length<3?t:arguments[2];return o(t)===s?t[n]:(i=ft.f(t,n))?y(i,"value")?i.value:void 0!==i.get?i.get.call(s):void 0:r(a=Ue(t))?e(a,n,s):void 0}}),P(P.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return ft.f(o(e),t)}}),P(P.S,"Reflect",{getPrototypeOf:function(e){return Ue(o(e))}}),P(P.S,"Reflect",{has:function(e,t){return t in e}});var Gt=Object.isExtensible;P(P.S,"Reflect",{isExtensible:function(e){return o(e),!Gt||Gt(e)}});var Yt=n.Reflect,Jt=Yt&&Yt.ownKeys||function(e){var t=ae.f(o(e)),n=At.f;return n?t.concat(n(e)):t};P(P.S,"Reflect",{ownKeys:Jt});var Qt=Object.preventExtensions;P(P.S,"Reflect",{preventExtensions:function(e){o(e);try{return Qt&&Qt(e),!0}catch(e){return!1}}}),P(P.S,"Reflect",{set:function e(t,n,i){var a,s,l=arguments.length<4?t:arguments[3],c=ft.f(o(t),n);if(!c){if(r(s=Ue(t)))return e(s,n,i,l);c=g(0)}if(y(c,"value")){if(!1===c.writable||!r(l))return!1;if(a=ft.f(l,n)){if(a.get||a.set||!1===a.writable)return!1;a.value=i,p.f(l,n,a)}else p.f(l,n,g(0,i));return!0}return void 0!==c.set&&(c.set.call(l,i),!0)}}),Et&&P(P.S,"Reflect",{setPrototypeOf:function(e,t){Et.check(e,t);try{return Et.set(e,t),!0}catch(e){return!1}}});var $t,Xt,Zt,en=n.process,tn=n.setImmediate,nn=n.clearImmediate,rn=n.MessageChannel,on=n.Dispatch,an=0,sn={},ln=function(){var e=+this;if(sn.hasOwnProperty(e)){var t=sn[e];delete sn[e],t()}},cn=function(e){ln.call(e.data)};tn&&nn||(tn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return sn[++an]=function(){Dt("function"==typeof e?e:Function(e),t)},$t(an),an},nn=function(e){delete sn[e]},"process"==W(en)?$t=function(e){en.nextTick(S(ln,e,1))}:on&&on.now?$t=function(e){on.now(S(ln,e,1))}:rn?(Zt=(Xt=new rn).port2,Xt.port1.onmessage=cn,$t=S(Zt.postMessage,Zt,1)):n.addEventListener&&"function"==typeof postMessage&&!n.importScripts?($t=function(e){n.postMessage(e+"","*")},n.addEventListener("message",cn,!1)):$t="onreadystatechange"in u("script")?function(e){je.appendChild(u("script")).onreadystatechange=function(){je.removeChild(this),ln.call(e)}}:function(e){setTimeout(S(ln,e,1),0)});var un={set:tn,clear:nn},fn=un.set,hn=n.MutationObserver||n.WebKitMutationObserver,dn=n.process,pn=n.Promise,gn="process"==W(dn);function mn(e){var t,n;this.promise=new e(function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i}),this.resolve=E(t),this.reject=E(n)}var vn,yn,bn,wn,kn={f:function(e){return new mn(e)}},Tn=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},En=n.navigator,Sn=En&&En.userAgent||"",_n=un.set,An=function(){var e,t,i,r=function(){var n,r;for(gn&&(n=dn.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(n){throw e?i():t=void 0,n}}t=void 0,n&&n.enter()};if(gn)i=function(){dn.nextTick(r)};else if(!hn||n.navigator&&n.navigator.standalone)if(pn&&pn.resolve){var o=pn.resolve(void 0);i=function(){o.then(r)}}else i=function(){fn.call(n,r)};else{var a=!0,s=document.createTextNode("");new hn(r).observe(s,{characterData:!0}),i=function(){s.data=a=!a}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}(),Pn=n.TypeError,Mn=n.process,Ln=Mn&&Mn.versions,xn=Ln&&Ln.v8||"",Cn=n.Promise,On="process"==Ae(Mn),Nn=function(){},jn=yn=kn.f,In=!!function(){try{var e=Cn.resolve(1),t=(e.constructor={})[ce("species")]=function(e){e(Nn,Nn)};return(On||"function"==typeof PromiseRejectionEvent)&&e.then(Nn)instanceof t&&0!==xn.indexOf("6.6")&&-1===Sn.indexOf("Chrome/66")}catch(e){}}(),Fn=function(e){var t;return!(!r(e)||"function"!=typeof(t=e.then))&&t},Rn=function(e,t){if(!e._n){e._n=!0;var n=e._c;An(function(){for(var i=e._v,r=1==e._s,o=0,a=function(t){var n,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&Vn(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),a=!0)),n===t.promise?c(Pn("Promise-chain cycle")):(o=Fn(n))?o.call(n,l,c):l(n)):c(i)}catch(e){u&&!a&&u.exit(),c(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&Bn(e)})}},Bn=function(e){_n.call(n,function(){var t,i,r,o=e._v,a=Dn(e);if(a&&(t=Tn(function(){On?Mn.emit("unhandledRejection",o,e):(i=n.onunhandledrejection)?i({promise:e,reason:o}):(r=n.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=On||Dn(e)?2:1),e._a=void 0,a&&t.e)throw t.v})},Dn=function(e){return 1!==e._h&&0===(e._a||e._c).length},Vn=function(e){_n.call(n,function(){var t;On?Mn.emit("rejectionHandled",e):(t=n.onrejectionhandled)&&t({promise:e,reason:e._v})})},Un=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),Rn(t,!0))},qn=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw Pn("Promise can't be resolved itself");(t=Fn(e))?An(function(){var i={_w:n,_d:!1};try{t.call(e,S(qn,i,1),S(Un,i,1))}catch(e){Un.call(i,e)}}):(n._v=e,n._s=1,Rn(n,!1))}catch(e){Un.call({_w:n,_d:!1},e)}}};In||(Cn=function(e){F(this,Cn,"Promise","_h"),E(e),vn.call(this);try{e(S(qn,this,1),S(Un,this,1))}catch(e){Un.call(this,e)}},(vn=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=I(Cn.prototype,{then:function(e,t){var n=jn(ge(this,Cn));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=On?Mn.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Rn(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),bn=function(){var e=new vn;this.promise=e,this.resolve=S(qn,e,1),this.reject=S(Un,e,1)},kn.f=jn=function(e){return e===Cn||e===wn?new bn(e):yn(e)}),P(P.G+P.W+P.F*!In,{Promise:Cn}),he(Cn,"Promise"),ve("Promise"),wn=i.Promise,P(P.S+P.F*!In,"Promise",{reject:function(e){var t=jn(this);return(0,t.reject)(e),t.promise}}),P(P.S+P.F*!In,"Promise",{resolve:function(e){return function(e,t){if(o(e),r(t)&&t.constructor===e)return t;var n=kn.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),P(P.S+P.F*!(In&&st(function(e){Cn.all(e).catch(Nn)})),"Promise",{all:function(e){var t=this,n=jn(t),i=n.resolve,r=n.reject,o=Tn(function(){var n=[],o=0,a=1;pt(e,!1,function(e){var s=o++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--a||i(n))},r)}),--a||i(n)});return o.e&&r(o.v),n.promise},race:function(e){var t=this,n=jn(t),i=n.reject,r=Tn(function(){pt(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}});var Hn={f:ce},Wn=p.f,zn=function(e){var t=i.Symbol||(i.Symbol=n.Symbol||{});"_"==e.charAt(0)||e in t||Wn(t,e,{value:Hn.f(e)})},Kn=ae.f,Gn={}.toString,Yn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Jn={f:function(e){return Yn&&"[object Window]"==Gn.call(e)?function(e){try{return Kn(e)}catch(e){return Yn.slice()}}(e):Kn(G(e))}},Qn=gt.KEY,$n=ft.f,Xn=p.f,Zn=Jn.f,ei=n.Symbol,ti=n.JSON,ni=ti&&ti.stringify,ii=ce("_hidden"),ri=ce("toPrimitive"),oi={}.propertyIsEnumerable,ai=X("symbol-registry"),si=X("symbols"),li=X("op-symbols"),ci=Object.prototype,ui="function"==typeof ei,fi=n.QObject,hi=!fi||!fi.prototype||!fi.prototype.findChild,di=s&&a(function(){return 7!=Be(Xn({},"a",{get:function(){return Xn(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=$n(ci,t);i&&delete ci[t],Xn(e,t,n),i&&e!==ci&&Xn(ci,t,i)}:Xn,pi=function(e){var t=si[e]=Be(ei.prototype);return t._k=e,t},gi=ui&&"symbol"==typeof ei.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof ei},mi=function(e,t,n){return e===ci&&mi(li,t,n),o(e),t=h(t,!0),o(n),y(si,t)?(n.enumerable?(y(e,ii)&&e[ii][t]&&(e[ii][t]=!1),n=Be(n,{enumerable:g(0,!1)})):(y(e,ii)||Xn(e,ii,g(1,{})),e[ii][t]=!0),di(e,t,n)):Xn(e,t,n)},vi=function(e,t){o(e);for(var n,i=function(e){var t=Ce(e),n=At.f;if(n)for(var i,r=n(e),o=ct.f,a=0;r.length>a;)o.call(e,i=r[a++])&&t.push(i);return t}(t=G(t)),r=0,a=i.length;a>r;)mi(e,n=i[r++],t[n]);return e},yi=function(e){var t=oi.call(this,e=h(e,!0));return!(this===ci&&y(si,e)&&!y(li,e))&&(!(t||!y(this,e)||!y(si,e)||y(this,ii)&&this[ii][e])||t)},bi=function(e,t){if(e=G(e),t=h(t,!0),e!==ci||!y(si,t)||y(li,t)){var n=$n(e,t);return!n||!y(si,t)||y(e,ii)&&e[ii][t]||(n.enumerable=!0),n}},wi=function(e){for(var t,n=Zn(G(e)),i=[],r=0;n.length>r;)y(si,t=n[r++])||t==ii||t==Qn||i.push(t);return i},ki=function(e){for(var t,n=e===ci,i=Zn(n?li:G(e)),r=[],o=0;i.length>o;)!y(si,t=i[o++])||n&&!y(ci,t)||r.push(si[t]);return r};ui||(T((ei=function(){if(this instanceof ei)throw TypeError("Symbol is not a constructor!");var e=k(arguments.length>0?arguments[0]:void 0),t=function(n){this===ci&&t.call(li,n),y(this,ii)&&y(this[ii],e)&&(this[ii][e]=!1),di(this,e,g(1,n))};return s&&hi&&di(ci,e,{configurable:!0,set:t}),pi(e)}).prototype,"toString",function(){return this._k}),ft.f=bi,p.f=mi,ae.f=Jn.f=wi,ct.f=yi,At.f=ki,s&&T(ci,"propertyIsEnumerable",yi,!0),Hn.f=function(e){return pi(ce(e))}),P(P.G+P.W+P.F*!ui,{Symbol:ei});for(var Ti="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ei=0;Ti.length>Ei;)ce(Ti[Ei++]);for(var Si=Ce(ce.store),_i=0;Si.length>_i;)zn(Si[_i++]);P(P.S+P.F*!ui,"Symbol",{for:function(e){return y(ai,e+="")?ai[e]:ai[e]=ei(e)},keyFor:function(e){if(!gi(e))throw TypeError(e+" is not a symbol!");for(var t in ai)if(ai[t]===e)return t},useSetter:function(){hi=!0},useSimple:function(){hi=!1}}),P(P.S+P.F*!ui,"Object",{create:function(e,t){return void 0===t?Be(e):vi(Be(e),t)},defineProperty:mi,defineProperties:vi,getOwnPropertyDescriptor:bi,getOwnPropertyNames:wi,getOwnPropertySymbols:ki}),ti&&P(P.S+P.F*(!ui||a(function(){var e=ei();return"[null]"!=ni([e])||"{}"!=ni({a:e})||"{}"!=ni(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t=i[1],(r(t)||void 0!==e)&&!gi(e))return We(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!gi(t))return t}),i[1]=t,ni.apply(ti,i)}}),ei.prototype[ri]||m(ei.prototype,ri,ei.prototype.valueOf),he(ei,"Symbol"),he(Math,"Math",!0),he(n.JSON,"JSON",!0);var Ai=function(e,t){var n=(i.Object||{})[e]||Object[e],r={};r[e]=t(n),P(P.S+P.F*a(function(){n(1)}),"Object",r)},Pi=gt.onFreeze;Ai("freeze",function(e){return function(t){return e&&r(t)?e(Pi(t)):t}});var Mi=gt.onFreeze;Ai("seal",function(e){return function(t){return e&&r(t)?e(Mi(t)):t}});var Li=gt.onFreeze;Ai("preventExtensions",function(e){return function(t){return e&&r(t)?e(Li(t)):t}}),Ai("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}}),Ai("isSealed",function(e){return function(t){return!r(t)||!!e&&e(t)}}),Ai("isExtensible",function(e){return function(t){return!!r(t)&&(!e||e(t))}});var xi=ft.f;Ai("getOwnPropertyDescriptor",function(){return function(e,t){return xi(G(e),t)}}),Ai("getPrototypeOf",function(){return function(e){return Ue(se(e))}}),Ai("keys",function(){return function(e){return Ce(se(e))}}),Ai("getOwnPropertyNames",function(){return Jn.f}),P(P.S+P.F,"Object",{assign:Mt});var Ci=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};P(P.S,"Object",{is:Ci});var Oi=p.f,Ni=Function.prototype,ji=/^\s*function ([^ (]*)/;"name"in Ni||s&&Oi(Ni,"name",{configurable:!0,get:function(){try{return(""+this).match(ji)[1]}catch(e){return""}}}),P(P.S,"String",{raw:function(e){for(var t=G(e.raw),n=U(t.length),i=arguments.length,r=[],o=0;n>o;)r.push(String(t[o++])),o<i&&r.push(String(arguments[o]));return r.join("")}});var Ii=String.fromCharCode,Fi=String.fromCodePoint;P(P.S+P.F*(!!Fi&&1!=Fi.length),"String",{fromCodePoint:function(e){for(var t,n=[],i=arguments.length,r=0;i>r;){if(t=+arguments[r++],Q(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?Ii(t):Ii(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}});var Ri,Bi=(Ri=!1,function(e,t){var n,i,r=String(K(e)),o=D(t),a=r.length;return o<0||o>=a?Ri?"":void 0:(n=r.charCodeAt(o))<55296||n>56319||o+1===a||(i=r.charCodeAt(o+1))<56320||i>57343?Ri?r.charAt(o):n:Ri?r.slice(o,o+2):i-56320+(n-55296<<10)+65536});P(P.P,"String",{codePointAt:function(e){return Bi(this,e)}});var Di=function(e){var t=String(K(this)),n="",i=D(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n};P(P.P,"String",{repeat:Di});var Vi=ce("match"),Ui=function(e){var t;return r(e)&&(void 0!==(t=e[Vi])?!!t:"RegExp"==W(e))},qi=function(e,t,n){if(Ui(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(K(e))},Hi=ce("match"),Wi=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Hi]=!1,!"/./"[e](t)}catch(e){}}return!0},zi="".startsWith;P(P.P+P.F*Wi("startsWith"),"String",{startsWith:function(e){var t=qi(this,e,"startsWith"),n=U(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return zi?zi.call(t,i,n):t.slice(n,n+i.length)===i}});var Ki="".endsWith;P(P.P+P.F*Wi("endsWith"),"String",{endsWith:function(e){var t=qi(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,i=U(t.length),r=void 0===n?i:Math.min(U(n),i),o=String(e);return Ki?Ki.call(t,o,r):t.slice(r-o.length,r)===o}});P(P.P+P.F*Wi("includes"),"String",{includes:function(e){return!!~qi(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}});s&&"g"!=/./g.flags&&p.f(RegExp.prototype,"flags",{configurable:!0,get:function(){var e=o(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}});var Gi=function(e,t,n){var i=ce(e),r=n(K,i,""[e]),o=r[0],s=r[1];a(function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})&&(T(String.prototype,e,o),m(RegExp.prototype,i,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)}))};Gi("match",1,function(e,t,n){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},n]}),Gi("replace",2,function(e,t,n){return[function(i,r){var o=e(this),a=null==i?void 0:i[t];return void 0!==a?a.call(i,o,r):n.call(String(o),i,r)},n]}),Gi("split",2,function(e,t,n){var i=Ui,r=n,o=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var a=void 0===/()??/.exec("")[1];n=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return r.call(n,e,t);var s,l,c,u,f,h=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,g=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,d+"g");for(a||(s=new RegExp("^"+m.source+"$(?!\\s)",d));(l=m.exec(n))&&!((c=l.index+l[0].length)>p&&(h.push(n.slice(p,l.index)),!a&&l.length>1&&l[0].replace(s,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(l[f]=void 0)}),l.length>1&&l.index<n.length&&o.apply(h,l.slice(1)),u=l[0].length,p=c,h.length>=g));)m.lastIndex===l.index&&m.lastIndex++;return p===n.length?!u&&m.test("")||h.push(""):h.push(n.slice(p)),h.length>g?h.slice(0,g):h}}else"0".split(void 0,0).length&&(n=function(e,t){return void 0===e&&0===t?[]:r.call(this,e,t)});return[function(i,r){var o=e(this),a=null==i?void 0:i[t];return void 0!==a?a.call(i,o,r):n.call(String(o),i,r)},n]}),Gi("search",1,function(e,t,n){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},n]});var Yi=function(e,t,n){t in e?p.f(e,t,g(0,n)):e[t]=n};P(P.S+P.F*!st(function(e){}),"Array",{from:function(e){var t,n,i,r,o=se(e),a="function"==typeof this?this:Array,s=arguments.length,l=s>1?arguments[1]:void 0,c=void 0!==l,u=0,f=He(o);if(c&&(l=S(l,s>2?arguments[2]:void 0,2)),null==f||a==Array&&xe(f))for(n=new a(t=U(o.length));t>u;u++)Yi(n,u,c?l(o[u],u):o[u]);else for(r=f.call(o),n=new a;!(i=r.next()).done;u++)Yi(n,u,c?dt(r,l,[i.value,u],!0):i.value);return n.length=u,n}}),P(P.S+P.F*a(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)Yi(n,e,arguments[e++]);return n.length=t,n}}),P(P.P,"Array",{copyWithin:lt}),Qe("copyWithin");var Ji=Ge(5),Qi=!0;"find"in[]&&Array(1).find(function(){Qi=!1}),P(P.P+P.F*Qi,"Array",{find:function(e){return Ji(this,e,arguments.length>1?arguments[1]:void 0)}}),Qe("find");var $i=Ge(6),Xi=!0;"findIndex"in[]&&Array(1).findIndex(function(){Xi=!1}),P(P.P+P.F*Xi,"Array",{findIndex:function(e){return $i(this,e,arguments.length>1?arguments[1]:void 0)}}),Qe("findIndex"),P(P.P,"Array",{fill:le}),Qe("fill");var Zi=n.isFinite;P(P.S,"Number",{isFinite:function(e){return"number"==typeof e&&Zi(e)}});var er=Math.floor,tr=function(e){return!r(e)&&isFinite(e)&&er(e)===e};P(P.S,"Number",{isInteger:tr});var nr=Math.abs;P(P.S,"Number",{isSafeInteger:function(e){return tr(e)&&nr(e)<=9007199254740991}}),P(P.S,"Number",{isNaN:function(e){return e!=e}}),P(P.S,"Number",{EPSILON:Math.pow(2,-52)}),P(P.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991}),P(P.S,"Number",{MAX_SAFE_INTEGER:9007199254740991});var ir=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)},rr=Math.sqrt,or=Math.acosh;P(P.S+P.F*!(or&&710==Math.floor(or(Number.MAX_VALUE))&&or(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:ir(e-1+rr(e-1)*rr(e+1))}});var ar=Math.asinh;P(P.S+P.F*!(ar&&1/ar(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}});var sr=Math.atanh;P(P.S+P.F*!(sr&&1/sr(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}});var lr=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};P(P.S,"Math",{cbrt:function(e){return lr(e=+e)*Math.pow(Math.abs(e),1/3)}}),P(P.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}});var cr=Math.exp;P(P.S,"Math",{cosh:function(e){return(cr(e=+e)+cr(-e))/2}});var ur=Math.expm1,fr=!ur||ur(10)>22025.465794806718||ur(10)<22025.465794806718||-2e-17!=ur(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:ur;P(P.S+P.F*(fr!=Math.expm1),"Math",{expm1:fr});var hr=Math.pow,dr=hr(2,-52),pr=hr(2,-23),gr=hr(2,127)*(2-pr),mr=hr(2,-126),vr=Math.fround||function(e){var t,n,i=Math.abs(e),r=lr(e);return i<mr?r*(i/mr/pr+1/dr-1/dr)*mr*pr:(n=(t=(1+pr/dr)*i)-(t-i))>gr||n!=n?r*(1/0):r*n};P(P.S,"Math",{fround:vr});var yr=Math.abs;P(P.S,"Math",{hypot:function(e,t){for(var n,i,r=0,o=0,a=arguments.length,s=0;o<a;)s<(n=yr(arguments[o++]))?(r=r*(i=s/n)*i+1,s=n):r+=n>0?(i=n/s)*i:n;return s===1/0?1/0:s*Math.sqrt(r)}});var br=Math.imul;P(P.S+P.F*a(function(){return-5!=br(4294967295,5)||2!=br.length}),"Math",{imul:function(e,t){var n=+e,i=+t,r=65535&n,o=65535&i;return 0|r*o+((65535&n>>>16)*o+r*(65535&i>>>16)<<16>>>0)}}),P(P.S,"Math",{log1p:ir}),P(P.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}}),P(P.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}}),P(P.S,"Math",{sign:lr});var wr=Math.exp;P(P.S+P.F*a(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(fr(e)-fr(-e))/2:(wr(e-1)-wr(-e-1))*(Math.E/2)}});var kr=Math.exp;P(P.S,"Math",{tanh:function(e){var t=fr(e=+e),n=fr(-e);return t==1/0?1:n==1/0?-1:(t-n)/(kr(e)+kr(-e))}}),P(P.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}});var Tr=$(!0);P(P.P,"Array",{includes:function(e){return Tr(this,e,arguments.length>1?arguments[1]:void 0)}}),Qe("includes");var Er=ct.f,Sr=function(e){return function(t){for(var n,i=G(t),r=Ce(i),o=r.length,a=0,s=[];o>a;)Er.call(i,n=r[a++])&&s.push(e?[n,i[n]]:i[n]);return s}},_r=Sr(!1);P(P.S,"Object",{values:function(e){return _r(e)}});var Ar=Sr(!0);P(P.S,"Object",{entries:function(e){return Ar(e)}}),P(P.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,i=G(e),r=ft.f,o=Jt(i),a={},s=0;o.length>s;)void 0!==(n=r(i,t=o[s++]))&&Yi(a,t,n);return a}});var Pr=function(e,t,n,i){var r=String(K(e)),o=r.length,a=void 0===n?" ":String(n),s=U(t);if(s<=o||""==a)return r;var l=s-o,c=Di.call(a,Math.ceil(l/a.length));return c.length>l&&(c=c.slice(0,l)),i?c+r:r+c};P(P.P+P.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(Sn),"String",{padStart:function(e){return Pr(this,e,arguments.length>1?arguments[1]:void 0,!0)}}),P(P.P+P.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(Sn),"String",{padEnd:function(e){return Pr(this,e,arguments.length>1?arguments[1]:void 0,!1)}});var Mr=[].slice,Lr=/MSIE .\./.test(Sn),xr=function(e){return function(t,n){var i=arguments.length>2,r=!!i&&Mr.call(arguments,2);return e(i?function(){("function"==typeof t?t:Function(t)).apply(this,r)}:t,n)}};P(P.G+P.B+P.F*Lr,{setTimeout:xr(n.setTimeout),setInterval:xr(n.setInterval)}),P(P.G+P.B,{setImmediate:un.set,clearImmediate:un.clear});for(var Cr=ce("iterator"),Or=ce("toStringTag"),Nr=Pe.Array,jr={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Ir=Ce(jr),Fr=0;Fr<Ir.length;Fr++){var Rr,Br=Ir[Fr],Dr=jr[Br],Vr=n[Br],Ur=Vr&&Vr.prototype;if(Ur&&(Ur[Cr]||m(Ur,Cr,Nr),Ur[Or]||m(Ur,Or,Br),Pe[Br]=Nr,Dr))for(Rr in rt)Ur[Rr]||T(Ur,Rr,rt[Rr],!0)}t(function(t){!function(e){var n,i=Object.prototype,r=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag",c=e.regeneratorRuntime;if(c)t.exports=c;else{(c=e.regeneratorRuntime=t.exports).wrap=b;var u="suspendedStart",f="suspendedYield",h="executing",d="completed",p={},g={};g[a]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(x([])));v&&v!==i&&r.call(v,a)&&(g=v);var y=E.prototype=k.prototype=Object.create(g);T.prototype=y.constructor=E,E.constructor=T,E[l]=T.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===T||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,l in e||(e[l]="GeneratorFunction")),e.prototype=Object.create(y),e},c.awrap=function(e){return{__await:e}},S(_.prototype),_.prototype[s]=function(){return this},c.AsyncIterator=_,c.async=function(e,t,n,i){var r=new _(b(e,t,n,i));return c.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(y),y[l]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},c.values=x,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;M(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:x(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),p}}}function b(e,t,n,i){var r=t&&t.prototype instanceof k?t:k,o=Object.create(r.prototype),a=new L(i||[]);return o._invoke=function(e,t,n){var i=u;return function(r,o){if(i===h)throw new Error("Generator is already running");if(i===d){if("throw"===r)throw o;return C()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=A(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===u)throw i=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var l=w(e,t,n);if("normal"===l.type){if(i=n.done?d:f,l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=d,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function w(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function k(){}function T(){}function E(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function _(t){function n(e,i,o,a){var s=w(t[e],t,i);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):Promise.resolve(c).then(function(e){l.value=e,o(l)},a)}a(s.arg)}var i;"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n)),this._invoke=function(e,t){function r(){return new Promise(function(i,r){n(e,t,i,r)})}return i=i?i.then(r,r):r()}}function A(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,A(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=w(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=n,t.done=!0,t};return o.next=o}}return{next:C}}function C(){return{value:n,done:!0}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:e)});!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}(),function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(e).replace(/\+/g," ")};"URLSearchParams"in e&&"a=1"===new URLSearchParams("?a=1").toString()||function(){var o=function(e){if(Object.defineProperty(this,"_entries",{value:{}}),"string"==typeof e){if(""!==e)for(var t,n=(e=e.replace(/^\?/,"")).split("&"),i=0;i<n.length;i++)t=n[i].split("="),this.append(r(t[0]),t.length>1?r(t[1]):"")}else if(e instanceof o){var a=this;e.forEach(function(e,t){a.append(e,t)})}},a=o.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(t.toString()):this._entries[e]=[t.toString()]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[t.toString()]},a.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},a.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),n(e)},a.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},a.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),n(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach(function(t,n){e.push(i(n)+"="+i(t))}),e.join("&")},e.URLSearchParams=o}()}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e),function(e){if(function(){try{var e=new URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(e){return!1}}()||function(){var t=e.URL,n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var o=r.createElement("a");if(o.href=t,i&&(r.body.appendChild(o),o.href=o.href),":"===o.protocol||!/:/.test(o.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o})},i=n.prototype;["hash","host","hostname","port","protocol","search"].forEach(function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0},searchParams:{get:function(){var e=new URLSearchParams(this.search),t=this;return["append","delete","set"].forEach(function(n){var i=e[n];e[n]=function(){i.apply(e,arguments),t.search=e.toString()}}),e},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(n){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e);var qr=function(e){return null!=e?e.constructor:null},Hr=function(e,t){return Boolean(e&&t&&e instanceof t)},Wr=function(e){return null==e},zr=function(e){return qr(e)===Object},Kr=function(e){return qr(e)===String},Gr=function(e){return Array.isArray(e)},Yr=function(e){return Hr(e,NodeList)},Jr=function(e){return Wr(e)||(Kr(e)||Gr(e)||Yr(e))&&!e.length||zr(e)&&!Object.keys(e).length},Qr={nullOrUndefined:Wr,object:zr,number:function(e){return qr(e)===Number&&!Number.isNaN(e)},string:Kr,boolean:function(e){return qr(e)===Boolean},function:function(e){return qr(e)===Function},array:Gr,weakMap:function(e){return Hr(e,WeakMap)},nodeList:Yr,element:function(e){return Hr(e,Element)},textNode:function(e){return qr(e)===Text},event:function(e){return Hr(e,Event)},keyboardEvent:function(e){return Hr(e,KeyboardEvent)},cue:function(e){return Hr(e,window.TextTrackCue)||Hr(e,window.VTTCue)},track:function(e){return Hr(e,TextTrack)||!Wr(e)&&Kr(e.kind)},url:function(e){if(Hr(e,window.URL))return!0;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://"+e);try{return!Jr(new URL(t).hostname)}catch(e){return!1}},empty:Jr},$r=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Xr(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!Qr.empty(t)&&Qr.function(n)){var s=t.split(" "),l=a;$r&&(l={passive:o,capture:a}),s.forEach(function(t){r&&r.eventListeners&&i&&r.eventListeners.push({element:e,type:t,callback:n,options:l}),e[i?"addEventListener":"removeEventListener"](t,n,l)})}}function Zr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Xr.call(this,e,t,n,!0,i,r)}function eo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Xr.call(this,e,t,n,!1,i,r)}function to(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Xr.call(this,e,t,function o(){eo(e,t,o,i,r);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];n.apply(this,s)},!0,i,r)}function no(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Qr.element(e)&&!Qr.empty(t)){var r=new CustomEvent(t,{bubbles:n,detail:Object.assign({},i,{plyr:this})});e.dispatchEvent(r)}}var io=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ro=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),oo=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ao=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function so(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach(function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,o=e.nextSibling;i.appendChild(e),o?r.insertBefore(i,o):r.appendChild(i)})}function lo(e,t){Qr.element(e)&&!Qr.empty(t)&&Object.entries(t).filter(function(e){var t=ao(e,2)[1];return!Qr.nullOrUndefined(t)}).forEach(function(t){var n=ao(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)})}function co(e,t,n){var i=document.createElement(e);return Qr.object(t)&&lo(i,t),Qr.string(n)&&(i.innerText=n),i}function uo(e,t,n,i){Qr.element(t)&&t.appendChild(co(e,n,i))}function fo(e){Qr.nodeList(e)||Qr.array(e)?Array.from(e).forEach(fo):Qr.element(e)&&Qr.element(e.parentNode)&&e.parentNode.removeChild(e)}function ho(e){if(Qr.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function po(e,t){return Qr.element(t)&&Qr.element(t.parentNode)&&Qr.element(e)?(t.parentNode.replaceChild(e,t),e):null}function go(e,t){if(!Qr.string(e)||Qr.empty(e))return{};var n={},i=t;return e.split(",").forEach(function(e){var t=e.trim(),r=t.replace(".",""),o=t.replace(/[[\]]/g,"").split("="),a=o[0],s=o.length>1?o[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Qr.object(i)&&Qr.string(i.class)&&(i.class+=" "+r),n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[a]=s}}),n}function mo(e,t){if(Qr.element(e)){var n=t;Qr.boolean(n)||(n=!e.hidden),n?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function vo(e,t,n){if(Qr.nodeList(e))return Array.from(e).map(function(e){return vo(e,t,n)});if(Qr.element(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function yo(e,t){return Qr.element(e)&&e.classList.contains(t)}function bo(e,t){var n={Element:Element};return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function wo(e){return this.elements.container.querySelectorAll(e)}function ko(e){return this.elements.container.querySelector(e)}function To(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Qr.element(e)&&(e.focus(),t&&vo(e,this.config.classNames.tabFocus))}var Eo,So,_o,Ao=(Eo=document.createElement("span"),So={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},_o=Object.keys(So).find(function(e){return void 0!==Eo.style[e]}),!!Qr.string(_o)&&So[_o]);function Po(e){setTimeout(function(){try{mo(e,!0),e.offsetHeight,mo(e,!1)}catch(e){}},0)}var Mo,Lo={isIE:!!document.documentMode,isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},xo={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Co={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=Lo.isIPhone&&n&&Co.playsinline,r=Co[e]||"html5"!==t;return{api:r,ui:r&&Co.rangeInput&&("video"!==e||!Lo.isIPhone||i)}},pip:!Lo.isIPhone&&Qr.function(co("video").webkitSetPresentationMode),airplay:Qr.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){var t=e.split("/"),n=ao(t,1)[0];if(!this.isHTML5||n!==this.type)return!1;var i=void 0;e&&e.includes("codecs=")?i=e:"audio/mpeg"===e?i="audio/mpeg;":e in xo&&(i=e+'; codecs="'+xo[e]+'"');try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(Mo=document.createElement("input"),Mo.type="range","range"===Mo.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==Ao,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Oo={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){return Co.mime.call(e,t.getAttribute("type"))}):[]},getQualityOptions:function(){return Oo.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;Object.defineProperty(e.media,"quality",{get:function(){var t=Oo.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var n=Oo.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(n){var i=e.media,r=i.currentTime,o=i.paused,a=i.preload,s=i.readyState;e.media.src=n.getAttribute("src"),("none"!==a||s)&&(e.once("loadedmetadata",function(){e.currentTime=r,o||e.play()}),e.media.load()),no.call(e,e.media,"qualitychange",!1,{quality:t}),e.storage.set({quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(fo(Oo.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function No(e){return Qr.array(e)?e.filter(function(t,n){return e.indexOf(t)===n}):e}function jo(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function Io(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return Qr.object(r)?(Object.keys(r).forEach(function(t){Qr.object(r[t])?(Object.keys(e).includes(t)||Object.assign(e,oo({},t,{})),Io(e[t],r[t])):Object.assign(e,oo({},t,r[t]))}),Io.apply(void 0,[e].concat(n))):e}function Fo(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Qr.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return n[t].toString()})}function Ro(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),n.toString())}function Bo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function Do(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=Ro(e,"-"," "),e=Ro(e,"_"," "),Ro(e=Bo(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function Vo(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var Uo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Qr.empty(e)||Qr.empty(t))return"";var n=jo(t.i18n,e);if(Qr.empty(n))return"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach(function(e){var t=ao(e,2),i=t[0],r=t[1];n=Ro(n,i,r)}),n},qo=function(){function e(t){io(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return ro(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(Qr.empty(n))return null;var i=JSON.parse(n);return Qr.string(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&Qr.object(t)){var n=this.get();Qr.empty(n)&&(n={}),Io(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Ho(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise(function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)}),r.addEventListener("error",function(){throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}})}function Wo(e,t){if(Qr.string(e)){var n=Qr.string(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var o=qo.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),n&&a.setAttribute("id",t),o){var s=window.localStorage.getItem("cache-"+t);if(null!==s){var l=JSON.parse(s);r(a,l.content)}}Ho(e).then(function(e){Qr.empty(e)||(o&&window.localStorage.setItem("cache-"+t,JSON.stringify({content:e})),r(a,e))}).catch(function(){})}}}var zo=function(e){return parseInt(e/60/60%60,10)},Ko=function(e){return parseInt(e/60%60,10)},Go=function(e){return parseInt(e%60,10)};function Yo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Qr.number(e))return Yo(null,t,n);var i=function(e){return("0"+e).slice(-2)},r=zo(e),o=Ko(e),a=Go(e);return t||r>0?r+=":":r="",(n&&e>0?"-":"")+r+i(o)+":"+i(a)}var Jo={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||Lo.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=ko.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:wo.call(this,this.config.selectors.buttons.play),pause:ko.call(this,this.config.selectors.buttons.pause),restart:ko.call(this,this.config.selectors.buttons.restart),rewind:ko.call(this,this.config.selectors.buttons.rewind),fastForward:ko.call(this,this.config.selectors.buttons.fastForward),mute:ko.call(this,this.config.selectors.buttons.mute),pip:ko.call(this,this.config.selectors.buttons.pip),airplay:ko.call(this,this.config.selectors.buttons.airplay),settings:ko.call(this,this.config.selectors.buttons.settings),captions:ko.call(this,this.config.selectors.buttons.captions),fullscreen:ko.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ko.call(this,this.config.selectors.progress),this.elements.inputs={seek:ko.call(this,this.config.selectors.inputs.seek),volume:ko.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ko.call(this,this.config.selectors.display.buffer),currentTime:ko.call(this,this.config.selectors.display.currentTime),duration:ko.call(this,this.config.selectors.display.duration)},Qr.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector("."+this.config.classNames.tooltip)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n=Jo.getIconUrl.call(this),i=(n.cors?"":n.url)+"#"+this.config.iconPrefix,r=document.createElementNS("http://www.w3.org/2000/svg","svg");lo(r,Io(t,{role:"presentation",focusable:"false"}));var o=document.createElementNS("http://www.w3.org/2000/svg","use"),a=i+"-"+e;return"href"in o?o.setAttributeNS("http://www.w3.org/1999/xlink","href",a):o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.appendChild(o),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={pip:"PIP",airplay:"AirPlay"}[e]||Uo(e,this.config);return co("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(Qr.empty(e))return null;var t=co("span",{class:this.config.classNames.menu.value});return t.appendChild(co("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=co("button"),i=Object.assign({},t),r=Do(e),o=!1,a=void 0,s=void 0,l=void 0,c=void 0;switch("type"in i||(i.type="button"),"class"in i?i.class.includes(this.config.classNames.control)||(i.class+=" "+this.config.classNames.control):i.class=this.config.classNames.control,e){case"play":o=!0,a="play",l="pause",s="play",c="pause";break;case"mute":o=!0,a="mute",l="unmute",s="volume",c="muted";break;case"captions":o=!0,a="enableCaptions",l="disableCaptions",s="captions-off",c="captions-on";break;case"fullscreen":o=!0,a="enterFullscreen",l="exitFullscreen",s="enter-fullscreen",c="exit-fullscreen";break;case"play-large":i.class+=" "+this.config.classNames.control+"--overlaid",r="play",a="play",s="play";break;default:a=r,s=e}return o?(n.appendChild(Jo.createIcon.call(this,c,{class:"icon--pressed"})),n.appendChild(Jo.createIcon.call(this,s,{class:"icon--not-pressed"})),n.appendChild(Jo.createLabel.call(this,l,{class:"label--pressed"})),n.appendChild(Jo.createLabel.call(this,a,{class:"label--not-pressed"}))):(n.appendChild(Jo.createIcon.call(this,s)),n.appendChild(Jo.createLabel.call(this,a))),Io(i,go(this.config.selectors.buttons[r],i)),lo(n,i),"play"===r?(Qr.array(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(n)):this.elements.buttons[r]=n,n},createRange:function(e,t){var n=co("input",Io(go(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Uo(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Jo.updateRangeFill.call(this,n),n},createProgress:function(e,t){var n=co("progress",Io(go(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"presentation","aria-hidden":!0},t));if("volume"!==e){n.appendChild(co("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Uo(i,this.config):"";n.innerText="% "+r.toLowerCase()}return this.elements.display[e]=n,n},createTime:function(e){var t=go(this.config.selectors.display[e]),n=co("div",Io(t,{class:(this.config.classNames.display.time+" "+(t.class?t.class:"")).trim(),"aria-label":Uo(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var n=this;Zr(e,"keydown keyup",function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r=bo(e,'[role="menuitemradio"]');if(!r&&[32,39].includes(i.which))Jo.showMenuPanel.call(n,t,!0);else{var o=void 0;32!==i.which&&(40===i.which||r&&39===i.which?(o=e.nextElementSibling,Qr.element(o)||(o=e.parentNode.firstElementChild)):(o=e.previousElementSibling,Qr.element(o)||(o=e.parentNode.lastElementChild)),To.call(n,o,!0))}}},!1),Zr(e,"keyup",function(e){13===e.which&&Jo.focusFirstMenuItem.call(n,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,o=e.title,a=e.badge,s=void 0===a?null:a,l=e.checked,c=void 0!==l&&l,u=go(this.config.selectors.inputs[r]),f=co("button",Io(u,{type:"button",role:"menuitemradio",class:(this.config.classNames.control+" "+(u.class?u.class:"")).trim(),"aria-checked":c,value:n})),h=co("span");h.innerHTML=o,Qr.element(s)&&h.appendChild(s),f.appendChild(h),Object.defineProperty(f,"checked",{enumerable:!0,get:function(){return"true"===f.getAttribute("aria-checked")},set:function(e){e&&Array.from(f.parentNode.children).filter(function(e){return bo(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),f.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(f,"click keyup",function(e){if(!Qr.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),f.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}Jo.showMenuPanel.call(t,"home",Qr.keyboardEvent(e))}},r,!1),Jo.bindMenuItemShortcuts.call(this,f,r),i.appendChild(f)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Qr.number(e)?Yo(e,zo(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Qr.element(e)&&Qr.number(t)&&(e.innerText=Jo.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(Qr.element(this.elements.inputs.volume)&&Jo.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Qr.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Qr.element(e)&&(e.value=t,Jo.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Qr.event(e)){var n,i,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,i=this.duration,r=0===n||0===i||Number.isNaN(n)||Number.isNaN(i)?0:(n/i*100).toFixed(2),"timeupdate"===e.type&&Jo.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=Qr.number(n)?n:0,r=Qr.element(e)?e:t.elements.display.buffer;if(Qr.element(r)){r.value=i;var o=r.getElementsByTagName("span")[0];Qr.element(o)&&(o.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Qr.event(e)?e.target:e;if(Qr.element(t)&&"range"===t.getAttribute("type")){if(bo(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=Jo.formatTime(this.currentTime),i=Jo.formatTime(this.duration),r=Uo("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(bo(t,this.config.selectors.inputs.volume)){var o=100*t.value;t.setAttribute("aria-valuenow",o),t.setAttribute("aria-valuetext",o.toFixed(1)+"%")}else t.setAttribute("aria-valuenow",t.value);Lo.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&Qr.element(this.elements.inputs.seek)&&Qr.element(this.elements.display.seekTooltip)&&0!==this.duration){var n=0,i=this.elements.progress.getBoundingClientRect(),r=this.config.classNames.tooltip+"--visible",o=function(e){vo(t.elements.display.seekTooltip,r,e)};if(this.touch)o(!1);else{if(Qr.event(e))n=100/i.width*(e.pageX-i.left);else{if(!yo(this.elements.display.seekTooltip,r))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),Jo.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left=n+"%",Qr.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&o("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!Qr.element(this.elements.display.duration)&&this.config.invertTime;Jo.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Jo.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return mo(this.elements.display.currentTime,!0),void mo(this.elements.progress,!0);Qr.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=Qr.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Jo.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Jo.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Jo.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){mo(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,o=t;if("captions"===e)r=this.currentTrack;else{if(r=Qr.empty(n)?this[e]:n,Qr.empty(r)&&(r=this.config[e].default),!Qr.empty(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '"+r+"' for "+e);if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '"+r+"' for "+e)}if(Qr.element(o)||(o=i&&i.querySelector('[role="menu"]')),Qr.element(o)){this.elements.settings.buttons[e].querySelector("."+this.config.classNames.menu.value).innerHTML=Jo.getLabel.call(this,e,r);var a=o&&o.querySelector('[value="'+r+'"]');Qr.element(a)&&(a.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Uo("normal",this.config):t+"×";case"quality":if(Qr.number(t)){var n=Uo("qualityLabel."+t,this.config);return n.length?n:t+"p"}return Bo(t);case"captions":return Xo.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(Qr.element(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');Qr.array(e)&&(this.options.quality=No(e).filter(function(e){return t.config.quality.options.includes(e)}));var i=!Qr.empty(this.options.quality)&&this.options.quality.length>1;if(Jo.toggleMenuButton.call(this,"quality",i),ho(n),Jo.checkMenu.call(this),i){this.options.quality.sort(function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1}).forEach(function(e){Jo.createMenuItem.call(t,{value:e,list:n,type:"quality",title:Jo.getLabel.call(t,"quality",e),badge:function(e){var n=Uo("qualityBadge."+e,t.config);return n.length?Jo.createBadge.call(t,n):null}(e)})}),Jo.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(Qr.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Xo.getTracks.call(this),i=Boolean(n.length);if(Jo.toggleMenuButton.call(this,"captions",i),ho(t),Jo.checkMenu.call(this),i){var r=n.map(function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:Xo.getLabel.call(e,n),badge:n.language&&Jo.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}});r.unshift({value:-1,checked:!this.captions.toggled,title:Uo("disabled",this.config),list:t,type:"language"}),r.forEach(Jo.createMenuItem.bind(this)),Jo.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(Qr.element(this.elements.settings.panels.speed)){var n=this.elements.settings.panels.speed.querySelector('[role="menu"]');Qr.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var i=!Qr.empty(this.options.speed)&&this.options.speed.length>1;Jo.toggleMenuButton.call(this,"speed",i),ho(n),Jo.checkMenu.call(this),i&&(this.options.speed.forEach(function(e){Jo.createMenuItem.call(t,{value:e,list:n,type:"speed",title:Jo.getLabel.call(t,"speed",e)})}),Jo.updateSetting.call(this,"speed",n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!Qr.empty(e)&&Object.values(e).some(function(e){return!e.hidden});mo(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;Qr.element(n)||(n=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var i=n.querySelector('[role^="menuitem"]');To.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(Qr.element(t)&&Qr.element(n)){var i=t.hidden,r=i;if(Qr.boolean(e))r=e;else if(Qr.keyboardEvent(e)&&27===e.which)r=!1;else if(Qr.event(e)){var o=t.contains(e.target);if(o||!o&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),mo(t,!r),vo(this.elements.container,this.config.classNames.menu.open,r),r&&Qr.keyboardEvent(e)?Jo.focusFirstMenuItem.call(this,null,!0):r||i||To.call(this,n,Qr.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return fo(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.getElementById("plyr-settings-"+this.id+"-"+t);if(Qr.element(i)){var r=i.parentNode,o=Array.from(r.children).find(function(e){return!e.hidden});if(Co.transitions&&!Co.reducedMotion){r.style.width=o.scrollWidth+"px",r.style.height=o.scrollHeight+"px";var a=Jo.getMenuSize.call(this,i);Zr.call(this,r,Ao,function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",eo.call(e,r,Ao,t))}),r.style.width=a.width+"px",r.style.height=a.height+"px"}mo(o,!0),mo(i,!1),Jo.focusFirstMenuItem.call(this,i,n)}},create:function(e){var t=this,n=co("div",go(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&n.appendChild(Jo.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&n.appendChild(Jo.createButton.call(this,"rewind")),this.config.controls.includes("play")&&n.appendChild(Jo.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&n.appendChild(Jo.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var i=co("div",go(this.config.selectors.progress));if(i.appendChild(Jo.createRange.call(this,"seek",{id:"plyr-seek-"+e.id})),i.appendChild(Jo.createProgress.call(this,"buffer")),this.config.tooltips.seek){var r=co("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(r),this.elements.display.seekTooltip=r}this.elements.progress=i,n.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&n.appendChild(Jo.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&n.appendChild(Jo.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var o=co("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&o.appendChild(Jo.createButton.call(this,"mute")),this.config.controls.includes("volume")){var a={max:1,step:.05,value:this.config.volume};o.appendChild(Jo.createRange.call(this,"volume",Io(a,{id:"plyr-volume-"+e.id}))),this.elements.volume=o}n.appendChild(o)}if(this.config.controls.includes("captions")&&n.appendChild(Jo.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!Qr.empty(this.config.settings)){var s=co("div",{class:"plyr__menu",hidden:""});s.appendChild(Jo.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-"+e.id,"aria-expanded":!1}));var l=co("div",{class:"plyr__menu__container",id:"plyr-settings-"+e.id,hidden:""}),c=co("div"),u=co("div",{id:"plyr-settings-"+e.id+"-home"}),f=co("div",{role:"menu"});u.appendChild(f),c.appendChild(u),this.elements.settings.panels.home=u,this.config.settings.forEach(function(n){var i=co("button",Io(go(t.config.selectors.buttons.settings),{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--forward",role:"menuitem","aria-haspopup":!0,hidden:""}));Jo.bindMenuItemShortcuts.call(t,i,n),Zr(i,"click",function(){Jo.showMenuPanel.call(t,n,!1)});var r=co("span",null,Uo(n,t.config)),o=co("span",{class:t.config.classNames.menu.value});o.innerHTML=e[n],r.appendChild(o),i.appendChild(r),f.appendChild(i);var a=co("div",{id:"plyr-settings-"+e.id+"-"+n,hidden:""}),s=co("button",{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--back"});s.appendChild(co("span",{"aria-hidden":!0},Uo(n,t.config))),s.appendChild(co("span",{class:t.config.classNames.hidden},Uo("menuBack",t.config))),Zr(a,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),Jo.showMenuPanel.call(t,"home",!0))},!1),Zr(s,"click",function(){Jo.showMenuPanel.call(t,"home",!1)}),a.appendChild(s),a.appendChild(co("div",{role:"menu"})),c.appendChild(a),t.elements.settings.buttons[n]=i,t.elements.settings.panels[n]=a}),l.appendChild(c),s.appendChild(l),n.appendChild(s),this.elements.settings.popup=l,this.elements.settings.menu=s}return this.config.controls.includes("pip")&&Co.pip&&n.appendChild(Jo.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&Co.airplay&&n.appendChild(Jo.createButton.call(this,"airplay")),this.config.controls.includes("fullscreen")&&n.appendChild(Jo.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(Jo.createButton.call(this,"play-large")),this.elements.controls=n,this.isHTML5&&Jo.setQualityMenu.call(this,Oo.getQualityOptions.call(this)),Jo.setSpeedMenu.call(this),n},inject:function(){var e=this;if(this.config.loadSprite){var t=Jo.getIconUrl.call(this);t.cors&&Wo(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;Qr.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this.props)),this.config.controls||(this.config.controls=[]),Qr.element(this.config.controls)||Qr.string(this.config.controls)?n=this.config.controls:(n=Jo.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Xo.getLabel.call(this)}),r=!1);var o=function(e){var t=e;return Object.entries(i).forEach(function(e){var n=ao(e,2),i=n[0],r=n[1];t=Ro(t,"{"+i+"}",r)}),t};r&&(Qr.string(this.config.controls)?n=o(n):Qr.element(n)&&(n.innerHTML=o(n.innerHTML)));var a=void 0;if(Qr.string(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),Qr.element(a)||(a=this.elements.container),a[Qr.element(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),Qr.element(this.elements.controls)||Jo.findElements.call(this),!Qr.empty(this.elements.buttons)){var s=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return yo(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];vo(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){Qr.array(e)||Qr.nodeList(e)?Array.from(e).filter(Boolean).forEach(s):s(e)})}if(window.navigator.userAgent.includes("Edge")&&Po(a),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,f=u.controls.wrapper+" "+u.labels+" ."+c.hidden,h=wo.call(this,f);Array.from(h).forEach(function(t){vo(t,e.config.classNames.hidden,!1),vo(t,e.config.classNames.tooltip,!0)})}}};function Qo(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=document.createElement("a");n.href=t,t=n.href}try{return new URL(t)}catch(e){return null}}function $o(e){var t=new URLSearchParams;return Qr.object(e)&&Object.entries(e).forEach(function(e){var n=ao(e,2),i=n[0],r=n[1];t.set(i,r)}),t}var Xo={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Co.textTracks)Qr.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Jo.setCaptionsMenu.call(this);else{var e,t;if(Qr.element(this.elements.captions)||(this.elements.captions=co("div",go(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,Qr.element(e)&&Qr.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Lo.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach(function(e){var t=e.getAttribute("src"),n=Qo(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Ho(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){fo(e)})})}var i=No((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===r)r=ao(i,1)[0];var o=this.storage.get("captions");if(Qr.boolean(o)||(o=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:o,language:r,languages:i}),this.isHTML5){var a=this.config.captions.update?"addtrack removetrack":"removetrack";Zr.call(this,this.media.textTracks,a,Xo.update.bind(this))}setTimeout(Xo.update.bind(this),0)}},update:function(){var e=this,t=Xo.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,o=n.meta,a=n.currentTrackNode,s=Boolean(t.find(function(e){return e.language===r}));this.isHTML5&&this.isVideo&&t.filter(function(e){return!o.get(e)}).forEach(function(t){e.debug.log("Track added",t),o.set(t,{default:"showing"===t.mode}),t.mode="hidden",Zr.call(e,t,"cuechange",function(){return Xo.updateCues.call(e)})}),(s&&this.language!==r||!t.includes(a))&&(Xo.setLanguage.call(this,r),Xo.toggle.call(this,i&&s)),vo(this.elements.container,this.config.classNames.captions.enabled,!Qr.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&Jo.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,i=this.config.classNames.captions.active,r=Qr.nullOrUndefined(e)?!n:e;if(r!==n){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){var o=Xo.getTracks.call(this),a=Xo.findTrack.call(this,[this.captions.language].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this.captions.languages)),!0);return this.captions.language=a.language,void Xo.set.call(this,o.indexOf(a))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),vo(this.elements.container,i,r),this.captions.toggled=r,Jo.updateSetting.call(this,"captions"),no.call(this,this.media,r?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Xo.getTracks.call(this);if(-1!==e)if(Qr.number(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=(i||{}).language;this.captions.currentTrackNode=i,Jo.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),no.call(this,this.media,"languagechange")}Xo.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Xo.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Xo.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Qr.string(e)){var n=e.toLowerCase();this.captions.language=n;var i=Xo.getTracks.call(this),r=Xo.findTrack.call(this,[n]);Xo.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter(function(n){return!e.isHTML5||t||e.captions.meta.has(n)}).filter(function(e){return["captions","subtitles"].includes(e.kind)})},findTrack:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Xo.getTracks.call(this),r=function(e){return Number((t.captions.meta.get(e)||{}).default)},o=Array.from(i).sort(function(e,t){return r(t)-r(e)}),a=void 0;return e.every(function(e){return!(a=o.find(function(t){return t.language===e}))}),a||(n?o[0]:void 0)},getCurrentTrack:function(){return Xo.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!Qr.track(t)&&Co.textTracks&&this.captions.toggled&&(t=Xo.getCurrentTrack.call(this)),Qr.track(t)?Qr.empty(t.label)?Qr.empty(t.language)?Uo("enabled",this.config):e.language.toUpperCase():t.label:Uo("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(Qr.element(this.elements.captions))if(Qr.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var n=Xo.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(Vo)}var i=t.map(function(e){return e.trim()}).join("\n");if(i!==this.elements.captions.innerHTML){ho(this.elements.captions);var r=co("span",go(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),no.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},Zo={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:"16:9",clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.3.12/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus"},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},keys:{google:null},ads:{enabled:!1,publisherId:""}},ea={html5:"html5",youtube:"youtube",vimeo:"vimeo"},ta={audio:"audio",video:"video"};var na=function(){},ia=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];io(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return ro(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):na}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):na}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):na}}]),e}();function ra(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;Qr.element(e)&&(e.pressed=this.active),no.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),Lo.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Qr.element(e)){var n=wo.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=n[0],r=n[n.length-1];Xr.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function oa(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",vo(this.target,this.player.config.classNames.fullscreen.fallback,e),ra.call(this)}var aa=function(){function e(t){var n=this;io(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},Zr.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":this.prefix+"fullscreenchange",function(){ra.call(n)}),Zr.call(this.player,this.player.elements.container,"dblclick",function(e){Qr.element(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()}),this.update()}return ro(e,[{key:"update",value:function(){this.enabled?this.player.debug.log((e.native?"Native":"Fallback")+" fullscreen enabled"):this.player.debug.log("Fullscreen not supported and fallback disabled"),vo(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(Lo.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():e.native?this.prefix?Qr.empty(this.prefix)||this.target[this.prefix+"Request"+this.property]():this.target.requestFullscreen():oa.call(this,!0))}},{key:"exit",value:function(){if(this.enabled)if(Lo.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(e.native)if(this.prefix){if(!Qr.empty(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document[""+this.prefix+t+this.property]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document);else oa.call(this,!1)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(e.native?(this.prefix?document[""+this.prefix+this.property+"Element"]:document.fullscreenElement)===this.target:yo(this.target,this.player.config.classNames.fullscreen.fallback))}},{key:"target",get:function(){return Lo.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(Qr.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!Qr.function(document[t+"ExitFullscreen"])&&!Qr.function(document[t+"CancelFullScreen"]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}();function sa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise(function(n,i){var r=new Image,o=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:o,onerror:o,src:e})})}var la={addStyleHook:function(){vo(this.elements.container,this.config.selectors.container.replace(".",""),!0),vo(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for "+this.provider+" "+this.type),void la.toggleNativeControls.call(this,!0);Qr.element(this.elements.controls)||(Jo.inject.call(this),this.listeners.controls()),la.toggleNativeControls.call(this),this.isHTML5&&Xo.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,Jo.updateVolume.call(this),Jo.timeUpdate.call(this),la.checkPlaying.call(this),vo(this.elements.container,this.config.classNames.pip.supported,Co.pip&&this.isHTML5&&this.isVideo),vo(this.elements.container,this.config.classNames.airplay.supported,Co.airplay&&this.isHTML5),vo(this.elements.container,this.config.classNames.isIos,Lo.isIos),vo(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){no.call(e,e.media,"ready")},0),la.setTitle.call(this),this.poster&&la.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&Jo.durationUpdate.call(this)},setTitle:function(){var e=Uo("play",this.config);if(Qr.string(this.config.title)&&!Qr.empty(this.config.title)&&(e+=", "+this.config.title),Array.from(this.elements.buttons.play||[]).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=ko.call(this,"iframe");if(!Qr.element(t))return;var n=Qr.empty(this.config.title)?"video":this.config.title,i=Uo("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){vo(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):Zr.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return sa(e)}).catch(function(n){throw e===t.poster&&la.togglePoster.call(t,!1),n}).then(function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('"+e+"')",backgroundSize:""}),la.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;vo(this.elements.container,this.config.classNames.playing,this.playing),vo(this.elements.container,this.config.classNames.paused,this.paused),vo(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),Qr.event(e)&&"timeupdate"===e.type||la.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){vo(t.elements.container,t.config.classNames.loading,t.loading),la.toggleControls.call(t)},this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;t&&this.config.hideControls&&this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover))}},ca=function(){function e(t){io(this,e),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return ro(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,o=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&Qr.number(i)){if(r){var a=document.activeElement;if(Qr.element(a)){var s=t.config.selectors.editable;if(a!==n.inputs.seek&&bo(a,s))return;if(32===e.which&&bo(a,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:o||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:o||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:o||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:o||t.toggleCaptions();break;case 76:t.loop=!t.loop}!t.fullscreen.enabled&&t.fullscreen.active&&27===i&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){Jo.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,vo(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,vo(wo.call(t,"."+i),i,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&vo(document.activeElement,t.config.classNames.tabFocus,!0)},10)}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Xr.call(t,window,"keydown keyup",this.handleKey,e,!1),Xr.call(t,document.body,"click",this.toggleMenu,e),to.call(t,document.body,"touchstart",this.firstTouch),Xr.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.elements;!e.config.keyboard.global&&e.config.keyboard.focused&&Zr.call(e,t.container,"keydown keyup",this.handleKey,!1),Zr.call(e,t.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",function(n){var i=t.controls;i&&"enterfullscreen"===n.type&&(i.pressed=!1,i.hover=!1);var r=0;["touchstart","touchmove","mousemove"].includes(n.type)&&(la.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(e.timers.controls),e.timers.controls=setTimeout(function(){return la.toggleControls.call(e,!1)},r)})}},{key:"media",value:function(){var e=this.player,t=e.elements;if(Zr.call(e,e.media,"timeupdate seeking seeked",function(t){return Jo.timeUpdate.call(e,t)}),Zr.call(e,e.media,"durationchange loadeddata loadedmetadata",function(t){return Jo.durationUpdate.call(e,t)}),Zr.call(e,e.media,"canplay",function(){mo(t.volume,!e.hasAudio),mo(t.buttons.mute,!e.hasAudio)}),Zr.call(e,e.media,"ended",function(){e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&e.restart()}),Zr.call(e,e.media,"progress playing seeking seeked",function(t){return Jo.updateProgress.call(e,t)}),Zr.call(e,e.media,"volumechange",function(t){return Jo.updateVolume.call(e,t)}),Zr.call(e,e.media,"playing play pause ended emptied timeupdate",function(t){return la.checkPlaying.call(e,t)}),Zr.call(e,e.media,"waiting canplay seeked playing",function(t){return la.checkLoading.call(e,t)}),Zr.call(e,e.media,"playing",function(){e.ads&&e.ads.enabled&&!e.ads.initialized&&e.ads.managerPromise.then(function(){return e.ads.play()}).catch(function(){return e.play()})}),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){var n=ko.call(e,"."+e.config.classNames.video);if(!Qr.element(n))return;Zr.call(e,t.container,"click touchstart",function(i){([t.container,n].includes(i.target)||n.contains(i.target))&&(e.config.hideControls&&e.touch&&yo(t.container,e.config.classNames.hideControls)||(e.ended?(e.restart(),e.play()):e.togglePlay()))})}e.supported.ui&&e.config.disableContextMenu&&Zr.call(e,t.wrapper,"contextmenu",function(e){e.preventDefault()},!1),Zr.call(e,e.media,"volumechange",function(){e.storage.set({volume:e.volume,muted:e.muted})}),Zr.call(e,e.media,"ratechange",function(){Jo.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),Zr.call(e,e.media,"qualitychange",function(t){Jo.updateSetting.call(e,"quality",null,t.detail.quality)});var i=e.config.events.concat(["keyup","keydown"]).join(" ");Zr.call(e,e.media,i,function(n){var i=n.detail,r=void 0===i?{}:i;"error"===n.type&&(r=e.media.error),no.call(e,t.container,n.type,!0,r)})}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],o=!0;Qr.function(r)&&(o=r.call(i,e)),o&&Qr.function(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=this.player,s=a.config.listeners[i],l=Qr.function(s);Zr.call(a,e,t,function(e){return r.proxy(e,n,i)},o&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=Lo.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach(function(n){e.bind(n,"click",t.togglePlay,"play")}),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",function(){t.muted=!t.muted},"mute"),this.bind(n.buttons.captions,"click",function(){return t.toggleCaptions()}),this.bind(n.buttons.fullscreen,"click",function(){t.fullscreen.toggle()},"fullscreen"),this.bind(n.buttons.pip,"click",function(){t.pip="toggle"},"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",function(e){e.stopPropagation(),Jo.toggleMenu.call(t,e)}),this.bind(n.buttons.settings,"keyup",function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),Jo.toggleMenu.call(t,e)):Jo.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(n.settings.menu,"keydown",function(e){27===e.which&&Jo.toggleMenu.call(t,e)}),this.bind(n.inputs.seek,"mousedown mousemove",function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)}),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!Qr.keyboardEvent(e)||39===i||37===i){var r=n.hasAttribute("play-on-seeked"),o=["mouseup","touchend","keyup"].includes(e.type);r&&o?(n.removeAttribute("play-on-seeked"),t.play()):!o&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}}),Lo.isIos){var r=wo.call(t,'input[type="range"]');Array.from(r).forEach(function(t){return e.bind(t,i,function(e){return Po(e.target)})})}this.bind(n.inputs.seek,i,function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");Qr.empty(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration},"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",function(e){return Jo.updateSeekTooltip.call(t,e)}),Lo.isWebkit&&Array.from(wo.call(t,'input[type="range"]')).forEach(function(n){e.bind(n,"input",function(e){return Jo.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!Qr.element(n.display.duration)&&this.bind(n.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Jo.timeUpdate.call(t))}),this.bind(n.inputs.volume,i,function(e){t.volume=e.target.value},"volume"),this.bind(n.controls,"mouseenter mouseleave",function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(n.controls,"focusin focusout",function(n){var i=t.config,r=t.elements,o=t.timers,a="focusin"===n.type;if(vo(r.controls,i.classNames.noTransition,a),la.toggleControls.call(t,a),a){setTimeout(function(){vo(r.controls,i.classNames.noTransition,!1)},0);var s=e.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(function(){return la.toggleControls.call(t,!1)},s)}}),this.bind(n.inputs.volume,"wheel",function(e){var n=e.webkitDirectionInvertedFromDevice,i=[e.deltaX,-e.deltaY].map(function(e){return n?-e:e}),r=ao(i,2),o=r[0],a=r[1],s=Math.sign(Math.abs(o)>Math.abs(a)?o:a);t.increaseVolume(s/50);var l=t.media.volume;(1===s&&l<1||-1===s&&l>0)&&e.preventDefault()},"volume",!1)}}]),e}(),ua=t(function(e,t){var n;n=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function o(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function a(t,n,i,r){var o,s,l=document,c=i.async,u=(i.numRetries||0)+1,f=i.before||e,h=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(t)?(o=!0,(s=l.createElement("link")).rel="stylesheet",s.href=h):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(s=l.createElement("img")).src=h:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(o&&"hideFocus"in s)try{s.sheet.cssText.length||(l="e")}catch(e){l="e"}if("e"==l&&(r+=1)<u)return a(t,n,i,r);n(t,l,e.defaultPrevented)},!1!==f(t,s)&&l.head.appendChild(s)}function s(e,n,i){var s,l;if(n&&n.trim&&(s=n),l=(s?i:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}!function(e,t,n){var i,r,o=(e=e.push?e:[e]).length,s=o,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--o||t(l)},r=0;r<s;r++)a(e[r],i,n)}(e,function(e){o(l,e),r(s,e)},l)}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,o,a,s=[],l=e.length,c=l;for(r=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)o=e[l],(a=n[o])?r(o,a):(i[o]=i[o]||[]).push(r)}(e,function(e){o(t,e)}),s},s.done=function(e){r(e,[])},s.reset=function(){t={},n={},i={}},s.isDefined=function(e){return e in t},s},e.exports=n()});function fa(e){return new Promise(function(t,n){ua(e,{success:t,error:n})})}function ha(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,no.call(this,this.media,e?"play":"pause"))}var da={setup:function(){var e=this;vo(this.elements.wrapper,this.config.classNames.embed,!0),da.setAspectRatio.call(this),Qr.object(window.Vimeo)?da.ready.call(this):fa(this.config.urls.vimeo.sdk).then(function(){da.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},setAspectRatio:function(e){var t=(Qr.string(e)?e:this.config.ratio).split(":"),n=ao(t,2),i=100/n[0]*n[1];if(this.elements.wrapper.style.paddingBottom=i+"%",this.supported.ui){var r=(240-i)/4.8;this.media.style.transform="translateY(-"+r+"%)"}},ready:function(){var e=this,t=this,n=$o({loop:t.config.loop.active,autoplay:t.autoplay,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0,gesture:"media",playsinline:!this.config.fullscreen.iosNative}),i=t.media.getAttribute("src");Qr.empty(i)&&(i=t.media.getAttribute(t.config.attributes.embed.id));var r,o=(r=i,Qr.empty(r)?null:Qr.number(Number(r))?r:r.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:r),a=co("iframe"),s=Fo(t.config.urls.vimeo.iframe,o,n);a.setAttribute("src",s),a.setAttribute("allowfullscreen",""),a.setAttribute("allowtransparency",""),a.setAttribute("allow","autoplay");var l=co("div",{poster:t.poster,class:t.config.classNames.embedContainer});l.appendChild(a),t.media=po(l,t.media),Ho(Fo(t.config.urls.vimeo.api,o),"json").then(function(e){if(!Qr.empty(e)){var n=new URL(e[0].thumbnail_large);n.pathname=n.pathname.split("_")[0]+".jpg",la.setPoster.call(t,n.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(a,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return ha.call(t,!0),t.embed.play()},t.media.pause=function(){return ha.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var c=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return c},set:function(e){var n=t.embed,i=t.media,r=t.paused,o=t.volume,a=r&&!n.hasPlayed;i.seeking=!0,no.call(t,i,"seeking"),Promise.resolve(a&&n.setVolume(0)).then(function(){return n.setCurrentTime(e)}).then(function(){return a&&n.pause()}).then(function(){return a&&n.setVolume(o)}).catch(function(){})}});var u=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return u},set:function(e){t.embed.setPlaybackRate(e).then(function(){u=e,no.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&Jo.setSpeedMenu.call(t,[])})}});var f=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return f},set:function(e){t.embed.setVolume(e).then(function(){f=e,no.call(t,t.media,"volumechange")})}});var h=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return h},set:function(e){var n=!!Qr.boolean(e)&&e;t.embed.setVolume(n?0:t.config.volume).then(function(){h=n,no.call(t,t.media,"volumechange")})}});var d=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return d},set:function(e){var n=Qr.boolean(e)?e:t.config.loop.active;t.embed.setLoop(n).then(function(){d=n})}});var p=void 0;t.embed.getVideoUrl().then(function(e){p=e}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return p}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(t){var n=function(e,t){var n=function e(t,n){return 0===n?t:e(n,t%n)}(e,t);return e/n+":"+t/n}(t[0],t[1]);da.setAspectRatio.call(e,n)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(n){t.config.title=n,la.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){c=e,no.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,no.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,Xo.setup.call(t)}),t.embed.on("cuechange",function(e){var n=e.cues,i=(void 0===n?[]:n).map(function(e){return t=e.text,n=document.createDocumentFragment(),i=document.createElement("div"),n.appendChild(i),i.innerHTML=t,n.firstChild.innerText;var t,n,i});Xo.updateCues.call(t,i)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){ha.call(t,!e),e||no.call(t,t.media,"playing")}),Qr.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){ha.call(t,!0),no.call(t,t.media,"playing")}),t.embed.on("pause",function(){ha.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,c=e.seconds,no.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,no.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&no.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,no.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,no.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,no.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,no.call(t,t.media,"error")}),setTimeout(function(){return la.build.call(t)},0)}};function pa(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,no.call(this,this.media,e?"play":"pause"))}var ga,ma={setup:function(){var e=this;vo(this.elements.wrapper,this.config.classNames.embed,!0),ma.setAspectRatio.call(this),Qr.object(window.YT)&&Qr.function(window.YT.Player)?ma.ready.call(this):(fa(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){ma.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(Qr.function(this.embed.getVideoData)){var n=this.embed.getVideoData().title;if(Qr.empty(n))return this.config.title=n,void la.setTitle.call(this)}var i=this.config.keys.google;Qr.string(i)&&!Qr.empty(i)&&Ho(Fo(this.config.urls.youtube.api,e,i)).then(function(e){Qr.object(e)&&(t.config.title=e.items[0].snippet.title,la.setTitle.call(t))}).catch(function(){})},setAspectRatio:function(){var e=this.config.ratio.split(":");this.elements.wrapper.style.paddingBottom=100/e[0]*e[1]+"%"},ready:function(){var e=this,t=e.media.getAttribute("id");if(Qr.empty(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");Qr.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r=(i=n,Qr.empty(i)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i),o=e.provider+"-"+Math.floor(1e4*Math.random()),a=co("div",{id:o,poster:e.poster});e.media=po(a,e.media);var s=function(e){return"https://img.youtube.com/vi/"+r+"/"+e+"default.jpg"};sa(s("maxres"),121).catch(function(){return sa(s("sd"),121)}).catch(function(){return sa(s("hq"))}).then(function(t){return la.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){}),e.embed=new window.YT.Player(o,{videoId:r,playerVars:{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,disablekb:1,playsinline:1,widget_referrer:window?window.location.href:null,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language},events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},no.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),no.call(e,e.media,"ratechange")},onReady:function(t){if(!Qr.function(e.media.play)){var n=t.target;ma.getTitle.call(e,r),e.media.play=function(){pa.call(e,!0),n.playVideo()},e.media.pause=function(){pa.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,no.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),no.call(e,e.media,"volumechange")}});var o=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return o},set:function(t){var i=Qr.boolean(t)?t:o;o=i,n[i?"mute":"unMute"](),no.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=n.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),no.call(e,e.media,"timeupdate"),no.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&no.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),no.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return la.build.call(e)},50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,no.call(e,e.media,"seeked")),t.data){case-1:no.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),no.call(e,e.media,"progress");break;case 0:pa.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):no.call(e,e.media,"ended");break;case 1:e.media.paused&&!e.embed.hasPlayed?e.media.pause():(pa.call(e,!0),no.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){no.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),no.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),pa.call(e,!1)}no.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},va={setup:function(){this.media?(vo(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),vo(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&vo(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=co("div",{class:this.config.classNames.video}),so(this.media,this.elements.wrapper),this.elements.poster=co("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Oo.extend.call(this):this.isYouTube?ma.setup.call(this):this.isVimeo&&da.setup.call(this)):this.debug.warn("No media element found!")}},ya=function(){function e(t){var n=this;io(this,e),this.player=t,this.publisherId=t.config.ads.publisherId,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){n.on("loaded",e),n.on("error",t)}),this.load()}return ro(e,[{key:"load",value:function(){var e=this;this.enabled&&(Qr.object(window.google)&&Qr.object(window.google.ima)?this.ready():fa(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=co("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var n=new google.ima.AdsRequest;n.adTagUrl=this.tagUrl,n.linearAdSlotWidth=t.offsetWidth,n.linearAdSlotHeight=t.offsetHeight,n.nonLinearAdSlotWidth=t.offsetWidth,n.nonLinearAdSlotHeight=t.offsetHeight,n.forceNonLinearFullSlot=!1,n.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(n)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=Yo(Math.max(e.manager.getRemainingTime(),0)),n=Uo("advertisement",e.player.config)+" - "+t;e.elements.container.setAttribute("data-badge-text",n)},100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),Qr.empty(this.cuePoints)||this.cuePoints.forEach(function(e){if(0!==e&&-1!==e&&e<t.player.duration){var n=t.player.elements.progress;if(Qr.element(n)){var i=100/t.player.duration*e,r=co("span",{class:t.player.config.classNames.cues});r.style.left=i.toString()+"%",n.appendChild(r)}}}),this.manager.setVolume(this.player.volume),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){return t.onAdError(e)}),Object.keys(google.ima.AdEvent.Type).forEach(function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],function(e){return t.onAdEvent(e)})}),this.trigger("loaded")}}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=function(e){var n="ads"+e.replace(/_/g,"").toLowerCase();no.call(t.player,t.player.media,n)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),r(e.type),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:r(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:r(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:r(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:r(e.type)}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e=this,t=this.player.elements.container,n=void 0;this.player.on("ended",function(){e.loader.contentComplete()}),this.player.on("seeking",function(){return n=e.player.currentTime}),this.player.on("seeked",function(){var t=e.player.currentTime;Qr.empty(e.cuePoints)||e.cuePoints.forEach(function(i,r){n<i&&i<t&&(e.manager.discardAdBreak(),e.cuePoints.splice(r,1))})}),window.addEventListener("resize",function(){e.manager&&e.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.currentTime<this.player.duration&&this.player.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=this.events[e];Qr.array(o)&&o.forEach(function(e){Qr.function(e)&&e.apply(t,i)})}},{key:"on",value:function(e,t){return Qr.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: "+t),this.safetyTimer=setTimeout(function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){Qr.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: "+e),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.ads.enabled&&!Qr.empty(this.publisherId)}},{key:"tagUrl",get:function(){return"https://go.aniview.com/api/adserver6/vast/?"+$o({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId})}}]),e}(),ba={insertElements:function(e,t){var n=this;Qr.string(t)?uo(e,this.media,{src:t}):Qr.array(t)&&t.forEach(function(t){uo(e,n.media,t)})},change:function(e){var t=this;jo(e,"sources.length")?(Oo.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],fo(t.media),t.media=null,Qr.element(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=ao(n,1)[0],o=r.provider,a=void 0===o?ea.html5:o,s=r.src,l="html5"===a?i:"div",c="html5"===a?{}:{src:s};Object.assign(t,{provider:a,type:i,supported:Co.check(i,a,t.config.playsinline),media:co(l,c)}),t.elements.container.appendChild(t.media),Qr.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),Qr.empty(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),la.addStyleHook.call(t),t.isHTML5&&ba.insertElements.call(t,"source",n),t.config.title=e.title,va.setup.call(t),t.isHTML5&&("tracks"in e&&ba.insertElements.call(t,"track",e.tracks),t.media.load()),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&la.build.call(t),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},wa=function(){function e(t,n){var i=this;if(io(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Co.touch,this.media=t,Qr.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Qr.nodeList(this.media)||Qr.array(this.media))&&(this.media=this.media[0]),this.config=Io({},Zo,e.defaults,n||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new ia(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Co),!Qr.nullOrUndefined(this.media)&&Qr.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Co.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var o=this.media.tagName.toLowerCase(),a=null,s=null;switch(o){case"div":if(a=this.media.querySelector("iframe"),Qr.element(a)){if(s=Qo(a.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(e)?ea.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?ea.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(Qr.empty(this.provider)||!Object.keys(ea).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=ta.video;break;case"video":case"audio":this.type=o,this.provider=ea.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Co.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new ca(this),this.storage=new qo(this),this.media.plyr=this,Qr.element(this.elements.container)||(this.elements.container=co("div"),so(this.media,this.elements.container)),la.addStyleHook.call(this),va.setup.call(this),this.config.debug&&Zr.call(this,this.elements.container,this.config.events.join(" "),function(e){i.debug.log("event: "+e.type)}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&la.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new aa(this),this.config.ads.enabled&&(this.ads=new ya(this)),this.config.autoplay&&this.play()):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return ro(e,[{key:"play",value:function(){return Qr.function(this.media.play)?this.media.play():null}},{key:"pause",value:function(){this.playing&&Qr.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(Qr.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):Qr.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(Qr.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(Qr.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(Qr.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){Xo.toggle.call(this,e,!1)}},{key:"airplay",value:function(){Co.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=yo(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=vo(this.elements.container,this.config.classNames.hideControls,n);if(i&&this.config.controls.includes("settings")&&!Qr.empty(this.config.settings)&&Jo.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";no.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){Zr.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){to.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){eo(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(fo(t.elements.buttons.play),fo(t.elements.captions),fo(t.elements.controls),fo(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),Qr.function(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach(function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)}),this.eventListeners=[])}.call(t),po(t.elements.original,t.elements.container),no.call(t,t.elements.original,"destroyed",!0),Qr.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),this.isHTML5?(clearTimeout(this.timers.loading),la.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&Qr.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return Co.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===ea.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===ea.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===ea.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===ta.video)}},{key:"isAudio",get:function(){return Boolean(this.type===ta.audio)}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=Qr.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to "+this.currentTime+" seconds")}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return Qr.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=Qr.number(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;Qr.string(t)&&(t=Number(t)),Qr.number(t)||(t=this.storage.get("volume")),Qr.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!Qr.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;Qr.boolean(t)||(t=this.storage.get("muted")),Qr.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=null;Qr.number(e)&&(t=e),Qr.number(t)||(t=this.storage.get("speed")),Qr.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed ("+t+")")},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!Qr.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(Qr.number);if(!n.includes(i)){var r=function(e,t){return Qr.array(e)&&e.length?e.reduce(function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}):null}(n,i);this.debug.warn("Unsupported quality option: "+i+", using "+r+" instead"),i=r}t.selected=i,this.media.quality=i}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=Qr.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){ba.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"poster",set:function(e){this.isVideo?la.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=Qr.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){Xo.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){Xo.setLanguage.call(this,e,!1)},get:function(){return(Xo.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){var t="picture-in-picture",n="inline";if(Co.pip){var i=Qr.boolean(e)?e:this.pip===n;this.media.webkitSetPresentationMode(i?t:n)}},get:function(){return Co.pip?this.media.webkitPresentationMode:null}}],[{key:"supported",value:function(e,t,n){return Co.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Wo(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return Qr.string(t)?i=Array.from(document.querySelectorAll(t)):Qr.nodeList(t)?i=Array.from(t):Qr.array(t)&&(i=t.filter(Qr.element)),Qr.empty(i)?null:i.map(function(t){return new e(t,n)})}}]),e}();return wa.defaults=(ga=Zo,JSON.parse(JSON.stringify(ga))),wa});
|
2 |
+
//# sourceMappingURL=plyr.polyfilled.min.js.map
|
assets/packages/select2/select2.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
|
assets/packages/select2/select2.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
classes/Addons.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Addons class
|
4 |
+
*
|
5 |
+
* @author: themeum
|
6 |
+
* @author_uri: https://themeum.com
|
7 |
+
* @package Tutor
|
8 |
+
* @since v.1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
namespace TUTOR;
|
13 |
+
|
14 |
+
|
15 |
+
if ( ! defined( 'ABSPATH' ) )
|
16 |
+
exit;
|
17 |
+
|
18 |
+
class Addons {
|
19 |
+
|
20 |
+
public function addons_page(){
|
21 |
+
|
22 |
+
if ( false === ( $addons_themes_data = get_transient( 'tutor_addons_themes_data' ) ) ) {
|
23 |
+
//Request New
|
24 |
+
$api_endpoint = 'https://www.themeum.com/wp-json/addon-serve/v2/get-products';
|
25 |
+
$response = wp_remote_post( $api_endpoint, array(
|
26 |
+
'method' => 'POST',
|
27 |
+
'timeout' => 45,
|
28 |
+
'user-agent' => 'Tutor/'.TUTOR_VERSION.'; '.home_url( '/' ),
|
29 |
+
'headers' => array(
|
30 |
+
'wp_blog' => home_url( '/' )
|
31 |
+
),
|
32 |
+
'body' => array('plugin_slug' => 'tutor', 'wp_blog' => home_url( '/' )),
|
33 |
+
)
|
34 |
+
);
|
35 |
+
|
36 |
+
if ( is_wp_error( $response ) ) {
|
37 |
+
$error_message = $response->get_error_message();
|
38 |
+
echo "Something went wrong: $error_message";
|
39 |
+
} else {
|
40 |
+
if (tutor_utils()->avalue_dot('body', $response) && tutor_utils()->avalue_dot('response.code', $response) == 200 ){
|
41 |
+
$api_data = tutor_utils()->avalue_dot('body', $response);
|
42 |
+
|
43 |
+
$addons_themes_data = array(
|
44 |
+
'last_checked_time' => time(),
|
45 |
+
'data' => $api_data,
|
46 |
+
);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
//Save the Final api call result on the database
|
51 |
+
set_transient( 'tutor_addons_themes_data', $addons_themes_data, 6 * HOUR_IN_SECONDS );
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
//Finally Show the View Page
|
56 |
+
include tutor()->path.'views/pages/addons.php';
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
classes/Admin.php
ADDED
@@ -0,0 +1,395 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class Admin
|
6 |
+
* @package TUTOR
|
7 |
+
*
|
8 |
+
* @since v.1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
class Admin{
|
15 |
+
public function __construct() {
|
16 |
+
add_action('admin_menu', array($this, 'register_menu'));
|
17 |
+
//Force activate menu for necessary
|
18 |
+
add_filter('parent_file', array($this, 'parent_menu_active'));
|
19 |
+
add_filter('submenu_file', array($this, 'submenu_file_active'), 10, 2);
|
20 |
+
|
21 |
+
add_action('admin_init', array($this, 'filter_posts_for_instructors'));
|
22 |
+
add_action('load-post.php', array($this, 'check_if_current_users_post') );
|
23 |
+
|
24 |
+
add_action('admin_action_uninstall_tutor_and_erase', array($this, 'erase_tutor_data'));
|
25 |
+
add_filter('plugin_action_links_' . plugin_basename(TUTOR_FILE), array( $this, 'plugin_action_links' ) );
|
26 |
+
}
|
27 |
+
|
28 |
+
public function register_menu(){
|
29 |
+
$hasPro = tutor()->has_pro;
|
30 |
+
|
31 |
+
$unanswered_questions = tutor_utils()->unanswered_question_count();
|
32 |
+
$unanswered_bubble = '';
|
33 |
+
if ($unanswered_questions){
|
34 |
+
$unanswered_bubble = '<span class="update-plugins count-'.$unanswered_questions.'"><span class="plugin-count">'.$unanswered_questions.'</span></span>';
|
35 |
+
}
|
36 |
+
|
37 |
+
$course_post_type = tutor()->course_post_type;
|
38 |
+
|
39 |
+
add_menu_page(__('Tutor LMS', 'tutor'), __('Tutor LMS', 'tutor'), 'manage_tutor_instructor', 'tutor', null, 'dashicons-welcome-learn-more', 2);
|
40 |
+
|
41 |
+
add_submenu_page('tutor', __('Categories', 'tutor'), __('Categories', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-category&post_type='.$course_post_type, null );
|
42 |
+
|
43 |
+
add_submenu_page('tutor', __('Tags', 'tutor'), __('Tags', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-tag&post_type='.$course_post_type, null );
|
44 |
+
|
45 |
+
add_submenu_page('tutor', __('Students', 'tutor'), __('Students', 'tutor'), 'manage_tutor', 'tutor-students', array($this, 'tutor_students') );
|
46 |
+
|
47 |
+
add_submenu_page('tutor', __('Instructors', 'tutor'), __('Instructors', 'tutor'), 'manage_tutor', 'tutor-instructors', array($this, 'tutor_instructors') );
|
48 |
+
|
49 |
+
add_submenu_page('tutor', __('Q & A', 'tutor'), __('Q & A '.$unanswered_bubble, 'tutor'), 'manage_tutor_instructor', 'question_answer', array($this, 'question_answer') );
|
50 |
+
|
51 |
+
//add_submenu_page('tutor', __('Quiz Attempts', 'tutor'), __('Quiz Attempts', 'tutor'), 'manage_tutor_instructor', 'tutor_quiz_attempts',array($this, 'quiz_attempts') );
|
52 |
+
|
53 |
+
//add_submenu_page('tutor', __('Add-ons', 'tutor'), __('Add-ons', 'tutor'), 'manage_tutor', 'tutor-addons', array(new Addons(),'addons_page') );
|
54 |
+
|
55 |
+
|
56 |
+
add_submenu_page('tutor', __('Add-ons', 'tutor'), __('Add-ons', 'tutor'), 'manage_tutor', 'tutor-addons', array($this, 'enable_disable_addons') );
|
57 |
+
|
58 |
+
add_submenu_page('tutor', __('Status', 'tutor'), __('Status', 'tutor'), 'manage_tutor', 'tutor-status', array($this, 'tutor_status') );
|
59 |
+
|
60 |
+
do_action('tutor_admin_register');
|
61 |
+
|
62 |
+
add_submenu_page('tutor', __('Settings', 'tutor'), __('Settings', 'tutor'), 'manage_tutor', 'tutor_settings', array($this, 'tutor_page') );
|
63 |
+
|
64 |
+
add_submenu_page('tutor',__('Uninstall Tutor LMS', 'tutor'), null, 'deactivate_plugin', 'tutor-uninstall', array($this, 'tutor_uninstall'));
|
65 |
+
/*
|
66 |
+
if ( ! $hasPro){
|
67 |
+
add_submenu_page( 'tutor', __( 'Get Pro', 'tutor' ), __( '<span class="dashicons dashicons-awards tutor-get-pro-text"></span> Get Pro', 'tutor' ), 'manage_options', 'tutor-get-pro', array($this, 'tutor_get_pro') );
|
68 |
+
}*/
|
69 |
+
|
70 |
+
}
|
71 |
+
|
72 |
+
public function tutor_page(){
|
73 |
+
$tutor_option = new Options();
|
74 |
+
echo apply_filters('tutor/options/generated-html', $tutor_option->generate());
|
75 |
+
}
|
76 |
+
|
77 |
+
public function tutor_students(){
|
78 |
+
include tutor()->path.'views/pages/students.php';
|
79 |
+
}
|
80 |
+
|
81 |
+
public function tutor_instructors(){
|
82 |
+
include tutor()->path.'views/pages/instructors.php';
|
83 |
+
}
|
84 |
+
|
85 |
+
public function question_answer(){
|
86 |
+
include tutor()->path.'views/pages/question_answer.php';
|
87 |
+
}
|
88 |
+
|
89 |
+
public function quiz_attempts(){
|
90 |
+
include tutor()->path.'views/pages/quiz_attempts.php';
|
91 |
+
}
|
92 |
+
|
93 |
+
public function enable_disable_addons(){
|
94 |
+
include tutor()->path.'views/pages/enable_disable_addons.php';
|
95 |
+
}
|
96 |
+
|
97 |
+
public function tutor_status(){
|
98 |
+
include tutor()->path.'views/pages/status.php';
|
99 |
+
}
|
100 |
+
|
101 |
+
public function tutor_uninstall(){
|
102 |
+
include tutor()->path.'views/pages/uninstall.php';
|
103 |
+
}
|
104 |
+
|
105 |
+
public function tutor_get_pro(){
|
106 |
+
include tutor()->path.'views/pages/get-pro.php';
|
107 |
+
}
|
108 |
+
|
109 |
+
public function parent_menu_active( $parent_file ){
|
110 |
+
$taxonomy = tutor_utils()->avalue_dot('taxonomy', $_GET);
|
111 |
+
if ($taxonomy === 'course-category' || $taxonomy === 'course-tag'){
|
112 |
+
return 'tutor';
|
113 |
+
}
|
114 |
+
|
115 |
+
return $parent_file;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function submenu_file_active($submenu_file, $parent_file){
|
119 |
+
$taxonomy = tutor_utils()->avalue_dot('taxonomy', $_GET);
|
120 |
+
$course_post_type = tutor()->course_post_type;
|
121 |
+
|
122 |
+
if ($taxonomy === 'course-category'){
|
123 |
+
return 'edit-tags.php?taxonomy=course-category&post_type='.$course_post_type;
|
124 |
+
}
|
125 |
+
if ($taxonomy === 'course-tag'){
|
126 |
+
return 'edit-tags.php?taxonomy=course-tag&post_type='.$course_post_type;
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
return $submenu_file;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Filter posts for instructor
|
135 |
+
*/
|
136 |
+
public function filter_posts_for_instructors(){
|
137 |
+
if (current_user_can(tutor()->instructor_role)){
|
138 |
+
remove_menu_page( 'edit-comments.php' ); //Comments
|
139 |
+
add_action( 'posts_clauses_request', array($this, 'posts_clauses_request') );
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function posts_clauses_request($clauses){
|
144 |
+
global $wpdb;
|
145 |
+
|
146 |
+
$user_id = get_current_user_id();
|
147 |
+
|
148 |
+
$get_assigned_courses_ids = $wpdb->get_col("SELECT meta_value from {$wpdb->usermeta} WHERE meta_key = '_tutor_instructor_course_id' AND user_id = {$user_id} ");
|
149 |
+
|
150 |
+
$custom_author_query = "AND {$wpdb->posts}.post_author = {$user_id}";
|
151 |
+
if (is_array($get_assigned_courses_ids) && count($get_assigned_courses_ids)){
|
152 |
+
$in_query_pre = implode($get_assigned_courses_ids, ',');
|
153 |
+
$custom_author_query = " AND ( {$wpdb->posts}.post_author = {$user_id} OR {$wpdb->posts}.ID IN({$in_query_pre}) ) ";
|
154 |
+
}
|
155 |
+
|
156 |
+
$clauses['where'] .= $custom_author_query;
|
157 |
+
|
158 |
+
return $clauses;
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Prevent unauthorised post edit page by direct URL
|
163 |
+
*
|
164 |
+
* @since v.1.0.0
|
165 |
+
*/
|
166 |
+
public function check_if_current_users_post(){
|
167 |
+
if (! current_user_can(tutor()->instructor_role)) {
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
if (! empty($_GET['post']) ) {
|
172 |
+
$get_post_id = (int) sanitize_text_field($_GET['post']);
|
173 |
+
$get_post = get_post($get_post_id);
|
174 |
+
$current_user = get_current_user_id();
|
175 |
+
|
176 |
+
if ($get_post->post_author != $current_user){
|
177 |
+
global $wpdb;
|
178 |
+
|
179 |
+
$get_assigned_courses_ids = (int) $wpdb->get_var("SELECT user_id from {$wpdb->usermeta} WHERE user_id = {$current_user} AND meta_key = '_tutor_instructor_course_id' AND meta_value = {$get_post_id} ");
|
180 |
+
|
181 |
+
if ( ! $get_assigned_courses_ids){
|
182 |
+
wp_die(__('Permission Denied', 'tutor'));
|
183 |
+
}
|
184 |
+
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Status
|
191 |
+
*/
|
192 |
+
|
193 |
+
public static function scan_template_files( $template_path = null ) {
|
194 |
+
if ( ! $template_path){
|
195 |
+
$template_path = tutor()->path.'templates/';
|
196 |
+
}
|
197 |
+
|
198 |
+
|
199 |
+
$files = @scandir( $template_path ); // @codingStandardsIgnoreLine.
|
200 |
+
$result = array();
|
201 |
+
|
202 |
+
if ( ! empty( $files ) ) {
|
203 |
+
foreach ( $files as $key => $value ) {
|
204 |
+
if ( ! in_array( $value, array( '.', '..', '.DS_Store' ), true ) ) {
|
205 |
+
if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
|
206 |
+
$sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
|
207 |
+
foreach ( $sub_files as $sub_file ) {
|
208 |
+
$result[] = $value . DIRECTORY_SEPARATOR . $sub_file;
|
209 |
+
}
|
210 |
+
} else {
|
211 |
+
$result[] = $value;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
return $result;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* @return array
|
221 |
+
*
|
222 |
+
*
|
223 |
+
*/
|
224 |
+
public static function template_overridden_files(){
|
225 |
+
$template_files = self::scan_template_files();
|
226 |
+
|
227 |
+
$override_files = array();
|
228 |
+
foreach ($template_files as $file){
|
229 |
+
$file_path = null;
|
230 |
+
if (file_exists(trailingslashit(get_stylesheet_directory()).tutor()->template_path.$file)){
|
231 |
+
$file_path = $file;
|
232 |
+
}elseif (file_exists(trailingslashit(get_template_directory()).tutor()->template_path.$file)){
|
233 |
+
$file_path = $file;
|
234 |
+
}
|
235 |
+
|
236 |
+
if ($file_path){
|
237 |
+
$override_files[] = str_replace( WP_CONTENT_DIR.'/themes/', '', $file_path );
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
return $override_files;
|
242 |
+
}
|
243 |
+
|
244 |
+
public static function get_environment_info(){
|
245 |
+
|
246 |
+
// Figure out cURL version, if installed.
|
247 |
+
$curl_version = '';
|
248 |
+
if ( function_exists( 'curl_version' ) ) {
|
249 |
+
$curl_version = curl_version();
|
250 |
+
$curl_version = $curl_version['version'] . ', ' . $curl_version['ssl_version'];
|
251 |
+
}
|
252 |
+
|
253 |
+
|
254 |
+
// WP memory limit.
|
255 |
+
$wp_memory_limit = tutor_utils()->let_to_num(WP_MEMORY_LIMIT);
|
256 |
+
if ( function_exists( 'memory_get_usage' ) ) {
|
257 |
+
$wp_memory_limit = max( $wp_memory_limit, tutor_utils()->let_to_num( @ini_get( 'memory_limit' ) ) );
|
258 |
+
}
|
259 |
+
|
260 |
+
$database_version = tutor_utils()->get_db_version();
|
261 |
+
|
262 |
+
return array(
|
263 |
+
'home_url' => get_option( 'home' ),
|
264 |
+
'site_url' => get_option( 'siteurl' ),
|
265 |
+
'version' => tutor()->version,
|
266 |
+
'wp_version' => get_bloginfo( 'version' ),
|
267 |
+
'wp_multisite' => is_multisite(),
|
268 |
+
'wp_memory_limit' => $wp_memory_limit,
|
269 |
+
'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
|
270 |
+
'wp_cron' => ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
|
271 |
+
'language' => get_locale(),
|
272 |
+
'external_object_cache' => wp_using_ext_object_cache(),
|
273 |
+
'server_info' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) : '',
|
274 |
+
'php_version' => phpversion(),
|
275 |
+
'php_post_max_size' => tutor_utils()->let_to_num( ini_get( 'post_max_size' ) ),
|
276 |
+
'php_max_execution_time' => ini_get( 'max_execution_time' ),
|
277 |
+
'php_max_input_vars' => ini_get( 'max_input_vars' ),
|
278 |
+
'curl_version' => $curl_version,
|
279 |
+
'suhosin_installed' => extension_loaded( 'suhosin' ),
|
280 |
+
'max_upload_size' => wp_max_upload_size(),
|
281 |
+
'mysql_version' => $database_version['number'],
|
282 |
+
'mysql_version_string' => $database_version['string'],
|
283 |
+
'default_timezone' => date_default_timezone_get(),
|
284 |
+
'fsockopen_or_curl_enabled' => ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ),
|
285 |
+
'soapclient_enabled' => class_exists( 'SoapClient' ),
|
286 |
+
'domdocument_enabled' => class_exists( 'DOMDocument' ),
|
287 |
+
'gzip_enabled' => is_callable( 'gzopen' ),
|
288 |
+
'mbstring_enabled' => extension_loaded( 'mbstring' ),
|
289 |
+
);
|
290 |
+
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
public function erase_tutor_data(){
|
295 |
+
global $wpdb;
|
296 |
+
|
297 |
+
$is_erase_data = tutor_utils()->get_option('delete_on_uninstall');
|
298 |
+
/**D*/ //=> Deleting Data
|
299 |
+
|
300 |
+
$plugin_file = tutor()->basename;
|
301 |
+
if ($is_erase_data && current_user_can( 'deactivate_plugin', $plugin_file )) {
|
302 |
+
/**
|
303 |
+
* Deleting Post Type, Meta Data, taxonomy
|
304 |
+
*/
|
305 |
+
$course_post_type = tutor()->course_post_type;
|
306 |
+
$lesson_post_type = tutor()->lesson_post_type;
|
307 |
+
|
308 |
+
$post_types = array(
|
309 |
+
$course_post_type,
|
310 |
+
$lesson_post_type,
|
311 |
+
'tutor_quiz',
|
312 |
+
'tutor_question',
|
313 |
+
'tutor_enrolled',
|
314 |
+
'topics',
|
315 |
+
'tutor_enrolled',
|
316 |
+
'tutor_announcements',
|
317 |
+
);
|
318 |
+
|
319 |
+
$post_type_strings = "'".implode("','", $post_types)."'";
|
320 |
+
$tutor_posts = $wpdb->get_col("SELECT ID from {$wpdb->posts} WHERE post_type in({$post_type_strings}) ;");
|
321 |
+
|
322 |
+
if (is_array($tutor_posts) && count($tutor_posts)){
|
323 |
+
foreach ($tutor_posts as $post_id){
|
324 |
+
//Delete categories
|
325 |
+
$terms = wp_get_object_terms( $post_id, 'course-category' );
|
326 |
+
foreach( $terms as $term ){
|
327 |
+
/**D*/ wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-category' );
|
328 |
+
}
|
329 |
+
|
330 |
+
//Delete tags if available
|
331 |
+
$terms = wp_get_object_terms( $post_id, 'course-tag' );
|
332 |
+
foreach( $terms as $term ){
|
333 |
+
/**D*/ wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-tag' );
|
334 |
+
}
|
335 |
+
|
336 |
+
//Delete All Meta
|
337 |
+
/**D*/ $wpdb->delete($wpdb->postmeta, array('post_id' => $post_id) );
|
338 |
+
/**D*/ $wpdb->delete($wpdb->posts, array('ID' => $post_id) );
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* Deleting Comments (reviews, questions, quiz_answers, etc)
|
344 |
+
*/
|
345 |
+
$tutor_comments = $wpdb->get_col("SELECT comment_ID from {$wpdb->comments} WHERE comment_agent = 'comment_agent' ;");
|
346 |
+
$comments_ids_strings = "'".implode("','", $tutor_comments)."'";
|
347 |
+
if (is_array($tutor_comments) && count($tutor_comments)){
|
348 |
+
/**D*/ $wpdb->query("DELETE from {$wpdb->commentmeta} WHERE comment_ID in({$comments_ids_strings}) ");
|
349 |
+
}
|
350 |
+
/**D*/ $wpdb->delete($wpdb->comments, array('comment_agent' => 'comment_agent'));
|
351 |
+
|
352 |
+
/**
|
353 |
+
* Delete Options
|
354 |
+
*/
|
355 |
+
|
356 |
+
/**D*/ delete_option('tutor_option');
|
357 |
+
/**D*/ $wpdb->delete($wpdb->usermeta, array('meta_key' => '_is_tutor_student'));
|
358 |
+
/**D*/ $wpdb->delete($wpdb->usermeta, array('meta_key' => '_tutor_instructor_approved'));
|
359 |
+
/**D*/ $wpdb->delete($wpdb->usermeta, array('meta_key' => '_tutor_instructor_status'));
|
360 |
+
/**D*/ $wpdb->delete($wpdb->usermeta, array('meta_key' => '_is_tutor_instructor'));
|
361 |
+
/**D*/ $wpdb->query("DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_tutor_completed_lesson_id_%' ");
|
362 |
+
|
363 |
+
deactivate_plugins($plugin_file);
|
364 |
+
}
|
365 |
+
|
366 |
+
wp_redirect('plugins.php');
|
367 |
+
die();
|
368 |
+
}
|
369 |
+
|
370 |
+
public function plugin_action_links($actions){
|
371 |
+
/*$hasPro = tutor()->has_pro;
|
372 |
+
|
373 |
+
if(!$hasPro){
|
374 |
+
$actions['tutor_pro_link'] = '<a href="https://www.themeum.com/product/tutor-lms/#pricing?utm_source=tutor_plugin_action_link&utm_medium=wordpress_dashboard&utm_campaign=go_premium" target="_blank"><span
|
375 |
+
style="color: #39a700eb; font-weight: bold;">'.__('Upgrade to Pro', 'wp-megamenu').'</span></a>';
|
376 |
+
}*/
|
377 |
+
|
378 |
+
$is_erase_data = tutor_utils()->get_option('delete_on_uninstall');
|
379 |
+
|
380 |
+
if ($is_erase_data) {
|
381 |
+
$plugin_file = tutor()->basename;
|
382 |
+
if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) {
|
383 |
+
if ( isset( $actions['deactivate'] ) ) {
|
384 |
+
$actions['deactivate'] = '<a href="admin.php?page=tutor-uninstall">' . __('Uninstall', 'tutor') . '</a>';
|
385 |
+
}
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
$actions['settings'] = '<a href="admin.php?page=tutor_settings">' . __('Settings', 'tutor') . '</a>';
|
390 |
+
return $actions;
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
+
|
395 |
+
}
|
classes/Ajax.php
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Ajax{
|
8 |
+
public function __construct() {
|
9 |
+
add_action('wp_ajax_sync_video_playback', array($this, 'sync_video_playback'));
|
10 |
+
add_action('wp_ajax_nopriv_sync_video_playback', array($this, 'sync_video_playback_noprev'));
|
11 |
+
add_action('wp_ajax_tutor_place_rating', array($this, 'tutor_place_rating'));
|
12 |
+
|
13 |
+
add_action('wp_ajax_tutor_ask_question', array($this, 'tutor_ask_question'));
|
14 |
+
add_action('wp_ajax_tutor_add_answer', array($this, 'tutor_add_answer'));
|
15 |
+
|
16 |
+
add_action('wp_ajax_tutor_course_add_to_wishlist', array($this, 'tutor_course_add_to_wishlist'));
|
17 |
+
add_action('wp_ajax_nopriv_tutor_course_add_to_wishlist', array($this, 'tutor_course_add_to_wishlist'));
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Addon Enable Disable Control
|
21 |
+
*/
|
22 |
+
add_action('wp_ajax_addon_enable_disable', array($this, 'addon_enable_disable'));
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Update video information and data when necessary
|
27 |
+
*
|
28 |
+
* @since v.1.0.0
|
29 |
+
*/
|
30 |
+
public function sync_video_playback(){
|
31 |
+
tutor_utils()->checking_nonce();
|
32 |
+
|
33 |
+
$duration = sanitize_text_field($_POST['duration']);
|
34 |
+
$currentTime = sanitize_text_field($_POST['currentTime']);
|
35 |
+
$post_id = sanitize_text_field($_POST['post_id']);
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Update posts attached video
|
39 |
+
*/
|
40 |
+
$video = tutor_utils()->get_video($post_id);
|
41 |
+
|
42 |
+
if ($duration) {
|
43 |
+
$video['duration_sec'] = $duration; //secs
|
44 |
+
$video['playtime'] = tutor_utils()->playtime_string( $duration );
|
45 |
+
$video['runtime'] = tutor_utils()->playtime_array( $duration );
|
46 |
+
}
|
47 |
+
tutor_utils()->update_video($post_id, $video);
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Sync Lesson Reading Info by Users
|
51 |
+
*/
|
52 |
+
|
53 |
+
$user_id = get_current_user_id();
|
54 |
+
|
55 |
+
$best_watch_time = tutor_utils()->get_lesson_reading_info($post_id, $user_id, 'video_best_watched_time');
|
56 |
+
if ($best_watch_time < $currentTime){
|
57 |
+
tutor_utils()->update_lesson_reading_info($post_id, $user_id, 'video_best_watched_time', $currentTime);
|
58 |
+
}
|
59 |
+
|
60 |
+
if (tutor_utils()->avalue_dot('is_ended', $_POST)){
|
61 |
+
tutor_utils()->mark_lesson_complete($post_id);
|
62 |
+
}
|
63 |
+
exit();
|
64 |
+
}
|
65 |
+
|
66 |
+
public function sync_video_playback_noprev(){
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
public function tutor_place_rating(){
|
72 |
+
global $wpdb;
|
73 |
+
|
74 |
+
//TODO: Check nonce
|
75 |
+
|
76 |
+
$rating = sanitize_text_field(tutor_utils()->avalue_dot('rating', $_POST));
|
77 |
+
$course_id = sanitize_text_field(tutor_utils()->avalue_dot('course_id', $_POST));
|
78 |
+
|
79 |
+
$review = wp_kses_post(tutor_utils()->avalue_dot('review', $_POST));
|
80 |
+
|
81 |
+
|
82 |
+
$user_id = get_current_user_id();
|
83 |
+
$user = get_userdata($user_id);
|
84 |
+
$date = date("Y-m-d H:i:s");
|
85 |
+
|
86 |
+
do_action('tutor_before_rating_placed');
|
87 |
+
|
88 |
+
$previous_rating_id = $wpdb->get_var("select comment_ID from {$wpdb->comments} WHERE comment_post_ID={$course_id} AND user_id = {$user_id} AND comment_type = 'tutor_course_rating' LIMIT 1;");
|
89 |
+
|
90 |
+
$review_ID = $previous_rating_id;
|
91 |
+
if ( $previous_rating_id){
|
92 |
+
if ($review){
|
93 |
+
$wpdb->update( $wpdb->comments, array('comment_content' => $review),
|
94 |
+
array('comment_ID' => $previous_rating_id)
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
if ($rating){
|
99 |
+
$wpdb->update( $wpdb->commentmeta, array('meta_value' => $rating),
|
100 |
+
array('comment_id' => $previous_rating_id, 'meta_key' => 'tutor_rating')
|
101 |
+
);
|
102 |
+
}
|
103 |
+
}else{
|
104 |
+
$data = array(
|
105 |
+
'comment_post_ID' => $course_id,
|
106 |
+
'comment_approved' => 'approved',
|
107 |
+
'comment_type' => 'tutor_course_rating',
|
108 |
+
'comment_date' => $date,
|
109 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
110 |
+
'user_id' => $user_id,
|
111 |
+
'comment_author' => $user->user_login,
|
112 |
+
'comment_agent' => 'TutorLMSPlugin',
|
113 |
+
);
|
114 |
+
if ($review){
|
115 |
+
$data['comment_content'] = $review;
|
116 |
+
}
|
117 |
+
|
118 |
+
$wpdb->insert($wpdb->comments, $data);
|
119 |
+
$comment_id = (int) $wpdb->insert_id;
|
120 |
+
$review_ID = $comment_id;
|
121 |
+
|
122 |
+
if ($comment_id && $rating){
|
123 |
+
$result = $wpdb->insert( $wpdb->commentmeta, array(
|
124 |
+
'comment_id' => $comment_id,
|
125 |
+
'meta_key' => 'tutor_rating',
|
126 |
+
'meta_value' => $rating
|
127 |
+
) );
|
128 |
+
|
129 |
+
do_action('tutor_after_rating_placed', $comment_id);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
$data = array('msg' => __('Rating placed success', 'tutor'), 'review_id' => $review_ID, 'review' => $review);
|
134 |
+
wp_send_json_success($data);
|
135 |
+
}
|
136 |
+
|
137 |
+
public function tutor_ask_question(){
|
138 |
+
tutor_utils()->checking_nonce();
|
139 |
+
|
140 |
+
global $wpdb;
|
141 |
+
|
142 |
+
$course_id = (int) sanitize_text_field($_POST['tutor_course_id']);
|
143 |
+
$question_title = sanitize_text_field($_POST['question_title']);
|
144 |
+
$question = wp_kses_post($_POST['question']);
|
145 |
+
|
146 |
+
if (empty($question) || empty($question_title)){
|
147 |
+
wp_send_json_error(__('Empty question title or body', 'tutor'));
|
148 |
+
}
|
149 |
+
|
150 |
+
$user_id = get_current_user_id();
|
151 |
+
$user = get_userdata($user_id);
|
152 |
+
$date = date("Y-m-d H:i:s");
|
153 |
+
|
154 |
+
do_action('tutor_before_add_question', $course_id);
|
155 |
+
$data = apply_filters('tutor_add_question_data', array(
|
156 |
+
'comment_post_ID' => $course_id,
|
157 |
+
'comment_author' => $user->user_login,
|
158 |
+
'comment_date' => $date,
|
159 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
160 |
+
'comment_content' => $question,
|
161 |
+
'comment_approved' => 'waiting_for_answer',
|
162 |
+
'comment_agent' => 'TutorLMSPlugin',
|
163 |
+
'comment_type' => 'tutor_q_and_a',
|
164 |
+
'user_id' => $user_id,
|
165 |
+
));
|
166 |
+
|
167 |
+
$wpdb->insert($wpdb->comments, $data);
|
168 |
+
$comment_id = (int) $wpdb->insert_id;
|
169 |
+
|
170 |
+
if ($comment_id){
|
171 |
+
$result = $wpdb->insert( $wpdb->commentmeta, array(
|
172 |
+
'comment_id' => $comment_id,
|
173 |
+
'meta_key' => 'tutor_question_title',
|
174 |
+
'meta_value' => $question_title
|
175 |
+
) );
|
176 |
+
}
|
177 |
+
do_action('tutor_after_add_question', $course_id, $comment_id);
|
178 |
+
|
179 |
+
wp_send_json_success(__('Question has been added successfully', 'tutor'));
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
public function tutor_add_answer(){
|
184 |
+
tutor_utils()->checking_nonce();
|
185 |
+
global $wpdb;
|
186 |
+
|
187 |
+
$answer = wp_kses_post($_POST['answer']);
|
188 |
+
if ( ! $answer){
|
189 |
+
wp_send_json_error(__('Please write answer', 'tutor'));
|
190 |
+
}
|
191 |
+
|
192 |
+
$question_id = (int) sanitize_text_field($_POST['question_id']);
|
193 |
+
$question = tutor_utils()->get_qa_question($question_id);
|
194 |
+
|
195 |
+
$user_id = get_current_user_id();
|
196 |
+
$user = get_userdata($user_id);
|
197 |
+
$date = date("Y-m-d H:i:s");
|
198 |
+
|
199 |
+
do_action('tutor_before_answer_to_question');
|
200 |
+
$data = apply_filters('tutor_add_answer_data', array(
|
201 |
+
'comment_post_ID' => $question->comment_post_ID,
|
202 |
+
'comment_author' => $user->user_login,
|
203 |
+
'comment_date' => $date,
|
204 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
205 |
+
'comment_content' => $answer,
|
206 |
+
'comment_approved' => 'approved',
|
207 |
+
'comment_agent' => 'TutorLMSPlugin',
|
208 |
+
'comment_type' => 'tutor_q_and_a',
|
209 |
+
'comment_parent' => $question_id,
|
210 |
+
'user_id' => $user_id,
|
211 |
+
));
|
212 |
+
|
213 |
+
$wpdb->insert($wpdb->comments, $data);
|
214 |
+
$comment_id = (int) $wpdb->insert_id;
|
215 |
+
do_action('tutor_after_answer_to_question', $comment_id);
|
216 |
+
|
217 |
+
wp_send_json_success(__('Answer has been added successfully', 'tutor'));
|
218 |
+
}
|
219 |
+
|
220 |
+
|
221 |
+
public function tutor_course_add_to_wishlist(){
|
222 |
+
$course_id = (int) sanitize_text_field($_POST['course_id']);
|
223 |
+
if ( ! is_user_logged_in()){
|
224 |
+
wp_send_json_error(array('redirect_to' => wp_login_url( wp_get_referer() ) ) );
|
225 |
+
}
|
226 |
+
global $wpdb;
|
227 |
+
|
228 |
+
$user_id = get_current_user_id();
|
229 |
+
$if_added_to_list = $wpdb->get_row("select * from {$wpdb->usermeta} WHERE user_id = {$user_id} AND meta_key = '_tutor_course_wishlist' AND meta_value = {$course_id} ;");
|
230 |
+
|
231 |
+
if ( $if_added_to_list){
|
232 |
+
$wpdb->delete($wpdb->usermeta, array('user_id' => $user_id, 'meta_key' => '_tutor_course_wishlist', 'meta_value' => $course_id ));
|
233 |
+
wp_send_json_success(array('status' => 'removed', 'msg' => __('Course removed from wish list', 'tutor')));
|
234 |
+
}else{
|
235 |
+
update_user_meta($user_id, '_tutor_course_wishlist', $course_id);
|
236 |
+
wp_send_json_success(array('status' => 'added', 'msg' => __('Course added to wish list', 'tutor')));
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Method for enable / disable addons
|
242 |
+
*/
|
243 |
+
public function addon_enable_disable(){
|
244 |
+
$addonsConfig = maybe_unserialize(get_option('tutor_addons_config'));
|
245 |
+
|
246 |
+
$isEnable = (bool) sanitize_text_field(tutor_utils()->avalue_dot('isEnable', $_POST));
|
247 |
+
$addonFieldName = sanitize_text_field(tutor_utils()->avalue_dot('addonFieldName', $_POST));
|
248 |
+
|
249 |
+
if ($isEnable){
|
250 |
+
$addonsConfig[$addonFieldName]['is_enable'] = 1;
|
251 |
+
}else{
|
252 |
+
$addonsConfig[$addonFieldName]['is_enable'] = 0;
|
253 |
+
}
|
254 |
+
|
255 |
+
update_option('tutor_addons_config', $addonsConfig);
|
256 |
+
|
257 |
+
wp_send_json_success();
|
258 |
+
}
|
259 |
+
|
260 |
+
}
|
classes/Assets.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Assets{
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
|
11 |
+
add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
|
12 |
+
|
13 |
+
add_action( 'admin_head', array($this, 'tutor_add_mce_button'));
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
add_filter( 'get_the_generator_html', array($this, 'tutor_generator_tag'), 10, 2 );
|
18 |
+
add_filter( 'get_the_generator_xhtml', array($this, 'tutor_generator_tag'), 10, 2 );
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
public function admin_scripts(){
|
24 |
+
wp_enqueue_style('tutor-select2', tutor()->url.'assets/packages/select2/select2.min.css', array(), tutor()->version);
|
25 |
+
wp_enqueue_style('tutor-admin', tutor()->url.'assets/css/tutor-admin.css', array(), tutor()->version);
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Scripts
|
29 |
+
*/
|
30 |
+
wp_enqueue_media();
|
31 |
+
wp_enqueue_script('jquery-ui-slider');
|
32 |
+
wp_enqueue_script('tutor-select2', tutor()->url.'assets/packages/select2/select2.min.js', array('jquery'), tutor()->version, true );
|
33 |
+
wp_enqueue_script('tutor-admin', tutor()->url.'assets/js/tutor-admin.js', array('jquery'), tutor()->version, true );
|
34 |
+
|
35 |
+
$tutor_localize_data = array();
|
36 |
+
if ( ! empty($_GET['taxonomy']) && ( $_GET['taxonomy'] === 'course-category' || $_GET['taxonomy'] === 'course-tag') ){
|
37 |
+
$tutor_localize_data['open_tutor_admin_menu'] = true;
|
38 |
+
}
|
39 |
+
|
40 |
+
wp_localize_script('tutor-admin', 'tutor_data', $tutor_localize_data);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Load frontend scripts
|
45 |
+
*/
|
46 |
+
public function frontend_scripts(){
|
47 |
+
|
48 |
+
wp_enqueue_editor();
|
49 |
+
|
50 |
+
$localize_data = array(
|
51 |
+
'ajaxurl' => admin_url('admin-ajax.php'),
|
52 |
+
'nonce_key' => tutor()->nonce,
|
53 |
+
tutor()->nonce => wp_create_nonce( tutor()->nonce_action ),
|
54 |
+
);
|
55 |
+
|
56 |
+
|
57 |
+
//Plyr
|
58 |
+
wp_enqueue_style( 'tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.css', array(), tutor()->version );
|
59 |
+
wp_enqueue_script( 'tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.polyfilled.min.js', array( 'jquery' ), tutor()->version, true );
|
60 |
+
|
61 |
+
//Including player assets if video exists
|
62 |
+
if (tutor_utils()->has_video_in_single()) {
|
63 |
+
|
64 |
+
$localize_data['post_id'] = get_the_ID();
|
65 |
+
$localize_data['best_watch_time'] = 0;
|
66 |
+
|
67 |
+
$best_watch_time = tutor_utils()->get_lesson_reading_info(get_the_ID(), 0, 'video_best_watched_time');
|
68 |
+
if ($best_watch_time > 0){
|
69 |
+
$localize_data['best_watch_time'] = $best_watch_time;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
if (tutor_utils()->get_option('load_tutor_css')){
|
74 |
+
wp_enqueue_style('tutor-frontend', tutor()->url.'assets/css/tutor-front.css', array(), tutor()->version);
|
75 |
+
}
|
76 |
+
if (tutor_utils()->get_option('load_tutor_js')) {
|
77 |
+
wp_enqueue_script( 'tutor-frontend', tutor()->url . 'assets/js/tutor-front.js', array( 'jquery' ), tutor()->version, true );
|
78 |
+
wp_localize_script('tutor-frontend', '_tutorobject', $localize_data);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Add Tinymce button for placing shortcode
|
85 |
+
*/
|
86 |
+
function tutor_add_mce_button() {
|
87 |
+
|
88 |
+
// check user permissions
|
89 |
+
if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
// check if WYSIWYG is enabled
|
93 |
+
if ( 'true' == get_user_option( 'rich_editing' ) ) {
|
94 |
+
add_filter( 'mce_external_plugins', array($this, 'tutor_add_tinymce_js') );
|
95 |
+
add_filter( 'mce_buttons', array($this, 'tutor_register_mce_button') );
|
96 |
+
}
|
97 |
+
}
|
98 |
+
// Declare script for new button
|
99 |
+
function tutor_add_tinymce_js( $plugin_array ) {
|
100 |
+
$plugin_array['tutor_button'] = tutor()->url .'assets/js/mce-button.js';
|
101 |
+
return $plugin_array;
|
102 |
+
}
|
103 |
+
// Register new button in the editor
|
104 |
+
function tutor_register_mce_button( $buttons ) {
|
105 |
+
array_push( $buttons, 'tutor_button' );
|
106 |
+
return $buttons;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Output generator tag to aid debugging.
|
112 |
+
*
|
113 |
+
* @param string $gen Generator.
|
114 |
+
* @param string $type Type.
|
115 |
+
* @return string
|
116 |
+
*/
|
117 |
+
function tutor_generator_tag( $gen, $type ) {
|
118 |
+
switch ( $type ) {
|
119 |
+
case 'html':
|
120 |
+
$gen .= "\n" . '<meta name="generator" content="TutorLMS ' . esc_attr( TUTOR_VERSION ) . '">';
|
121 |
+
break;
|
122 |
+
case 'xhtml':
|
123 |
+
$gen .= "\n" . '<meta name="generator" content="TutorLMS ' . esc_attr( TUTOR_VERSION ) . '" />';
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
return $gen;
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
classes/Course.php
ADDED
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Course extends Tutor_Base {
|
8 |
+
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
12 |
+
add_action('save_post_'.$this->course_post_type, array($this, 'save_course_meta'));
|
13 |
+
add_action('wp_ajax_tutor_add_course_topic', array($this, 'tutor_add_course_topic'));
|
14 |
+
add_action('wp_ajax_tutor_update_topic', array($this, 'tutor_update_topic'));
|
15 |
+
|
16 |
+
//Add Column
|
17 |
+
add_filter( "manage_{$this->course_post_type}_posts_columns", array($this, 'add_column'), 10,1 );
|
18 |
+
add_action( "manage_{$this->course_post_type}_posts_custom_column" , array($this, 'custom_lesson_column'), 10, 2 );
|
19 |
+
|
20 |
+
add_action('admin_action_tutor_delete_topic', array($this, 'tutor_delete_topic'));
|
21 |
+
add_action('admin_action_tutor_delete_announcement', array($this, 'tutor_delete_announcement'));
|
22 |
+
|
23 |
+
//Frontend Action
|
24 |
+
add_action('template_redirect', array($this, 'enroll_now'));
|
25 |
+
add_action('template_redirect', array($this, 'mark_course_complete'));
|
26 |
+
|
27 |
+
//Modal Perform
|
28 |
+
add_action('wp_ajax_tutor_load_instructors_modal', array($this, 'tutor_load_instructors_modal'));
|
29 |
+
add_action('wp_ajax_tutor_add_instructors_to_course', array($this, 'tutor_add_instructors_to_course'));
|
30 |
+
add_action('wp_ajax_detach_instructor_from_course', array($this, 'detach_instructor_from_course'));
|
31 |
+
}
|
32 |
+
/**
|
33 |
+
* Registering metabox
|
34 |
+
*/
|
35 |
+
public function register_meta_box(){
|
36 |
+
$coursePostType = tutor()->course_post_type;
|
37 |
+
|
38 |
+
add_meta_box( 'tutor-course-topics', __( 'Course Builder', 'tutor' ), array($this, 'course_meta_box'), $coursePostType );
|
39 |
+
add_meta_box( 'tutor-course-additional-data', __( 'Additional Data', 'tutor' ), array($this, 'course_additional_data_meta_box'), $coursePostType );
|
40 |
+
add_meta_box( 'tutor-course-videos', __( 'Video', 'tutor' ), array($this, 'video_metabox'), $coursePostType );
|
41 |
+
add_meta_box( 'tutor-instructors', __( 'Instructors', 'tutor' ), array($this, 'instructors_metabox'), $coursePostType );
|
42 |
+
add_meta_box( 'tutor-announcements', __( 'Announcements', 'tutor' ), array($this, 'announcements_metabox'), $coursePostType );
|
43 |
+
}
|
44 |
+
public function course_meta_box(){
|
45 |
+
include tutor()->path.'views/metabox/course-topics.php';
|
46 |
+
}
|
47 |
+
public function course_additional_data_meta_box(){
|
48 |
+
include tutor()->path.'views/metabox/course-additional-data.php';
|
49 |
+
}
|
50 |
+
public function video_metabox(){
|
51 |
+
include tutor()->path.'views/metabox/video-metabox.php';
|
52 |
+
}
|
53 |
+
|
54 |
+
public function announcements_metabox(){
|
55 |
+
include tutor()->path.'views/metabox/announcements-metabox.php';
|
56 |
+
}
|
57 |
+
|
58 |
+
public function instructors_metabox(){
|
59 |
+
include tutor()->path.'views/metabox/instructors-metabox.php';
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @param $post_ID
|
64 |
+
*
|
65 |
+
* Insert Topic and attached it with Course
|
66 |
+
*/
|
67 |
+
public function save_course_meta($post_ID){
|
68 |
+
global $wpdb;
|
69 |
+
/**
|
70 |
+
* Insert Topic
|
71 |
+
*/
|
72 |
+
if ( ! empty($_POST['topic_title'])) {
|
73 |
+
$topic_title = sanitize_text_field( $_POST['topic_title'] );
|
74 |
+
$topic_summery = wp_kses_post( $_POST['topic_summery'] );
|
75 |
+
|
76 |
+
$post_arr = array(
|
77 |
+
'post_type' => 'topics',
|
78 |
+
'post_title' => $topic_title,
|
79 |
+
'post_content' => $topic_summery,
|
80 |
+
'post_status' => 'publish',
|
81 |
+
'post_author' => get_current_user_id(),
|
82 |
+
'post_parent' => $post_ID,
|
83 |
+
);
|
84 |
+
wp_insert_post( $post_arr );
|
85 |
+
}
|
86 |
+
|
87 |
+
//Course Duration
|
88 |
+
if ( ! empty($_POST['course_duration'])){
|
89 |
+
$video = tutor_utils()->sanitize_array($_POST['course_duration']);
|
90 |
+
update_post_meta($post_ID, '_course_duration', $video);
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( ! empty($_POST['course_level'])){
|
94 |
+
$course_level = sanitize_text_field($_POST['course_level']);
|
95 |
+
update_post_meta($post_ID, '_tutor_course_level', $course_level);
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( ! empty($_POST['course_benefits'])){
|
99 |
+
$course_benefits = wp_kses_post($_POST['course_benefits']);
|
100 |
+
update_post_meta($post_ID, '_tutor_course_benefits', $course_benefits);
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( ! empty($_POST['course_requirements'])){
|
104 |
+
$requirements = wp_kses_post($_POST['course_requirements']);
|
105 |
+
update_post_meta($post_ID, '_tutor_course_requirements', $requirements);
|
106 |
+
}
|
107 |
+
|
108 |
+
if ( ! empty($_POST['course_target_audience'])){
|
109 |
+
$target_audience = wp_kses_post($_POST['course_target_audience']);
|
110 |
+
update_post_meta($post_ID, '_tutor_course_target_audience', $target_audience);
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( ! empty($_POST['course_material_includes'])){
|
114 |
+
$material_includes = wp_kses_post($_POST['course_material_includes']);
|
115 |
+
update_post_meta($post_ID, '_tutor_course_material_includes', $material_includes);
|
116 |
+
}
|
117 |
+
/**
|
118 |
+
* Sorting Topics and lesson
|
119 |
+
*/
|
120 |
+
if ( ! empty($_POST['tutor_topics_lessons_sorting'])){
|
121 |
+
$new_order = sanitize_text_field(stripslashes($_POST['tutor_topics_lessons_sorting']));
|
122 |
+
$order = json_decode($new_order, true);
|
123 |
+
|
124 |
+
if (is_array($order) && count($order)){
|
125 |
+
$i = 0;
|
126 |
+
foreach ($order as $topic ){
|
127 |
+
$i++;
|
128 |
+
$wpdb->update(
|
129 |
+
$wpdb->posts,
|
130 |
+
array('menu_order' => $i),
|
131 |
+
array('ID' => $topic['topic_id'])
|
132 |
+
);
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Removing All lesson with topic
|
136 |
+
*/
|
137 |
+
|
138 |
+
$wpdb->update(
|
139 |
+
$wpdb->posts,
|
140 |
+
array('post_parent' => 0),
|
141 |
+
array('post_parent' => $topic['topic_id'])
|
142 |
+
);
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Lesson Attaching with topic ID
|
146 |
+
* sorting lesson
|
147 |
+
*/
|
148 |
+
if (isset($topic['lesson_ids'])){
|
149 |
+
$lesson_ids = $topic['lesson_ids'];
|
150 |
+
}else{
|
151 |
+
$lesson_ids = array();
|
152 |
+
}
|
153 |
+
if (count($lesson_ids)){
|
154 |
+
foreach ($lesson_ids as $lesson_key => $lesson_id ){
|
155 |
+
$wpdb->update(
|
156 |
+
$wpdb->posts,
|
157 |
+
array('post_parent' => $topic['topic_id'], 'menu_order' => $lesson_key),
|
158 |
+
array('ID' => $lesson_id)
|
159 |
+
);
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
//Video
|
168 |
+
if ( ! empty($_POST['video']['source'])){
|
169 |
+
$video = tutor_utils()->sanitize_array($_POST['video']);
|
170 |
+
update_post_meta($post_ID, '_video', $video);
|
171 |
+
}
|
172 |
+
|
173 |
+
//Announcements
|
174 |
+
$announcement_title = tutor_utils()->avalue_dot('announcements.title', $_POST );
|
175 |
+
if ( ! empty($announcement_title)){
|
176 |
+
$title = sanitize_text_field(tutor_utils()->avalue_dot('announcements.title', $_POST ));
|
177 |
+
$content = wp_kses_post(tutor_utils()->avalue_dot('announcements.content', $_POST ));
|
178 |
+
|
179 |
+
$post_arr = array(
|
180 |
+
'post_type' => 'tutor_announcements',
|
181 |
+
'post_title' => $title,
|
182 |
+
'post_content' => $content,
|
183 |
+
'post_status' => 'publish',
|
184 |
+
'post_author' => get_current_user_id(),
|
185 |
+
'post_parent' => $post_ID,
|
186 |
+
);
|
187 |
+
wp_insert_post( $post_arr );
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Tutor add course topic
|
193 |
+
*/
|
194 |
+
public function tutor_add_course_topic(){
|
195 |
+
if (empty($_POST['topic_title'])) {
|
196 |
+
wp_send_json_error();
|
197 |
+
}
|
198 |
+
$course_id = (int) tutor_utils()->avalue_dot('tutor_topic_course_ID', $_POST);
|
199 |
+
$next_topic_order_id = tutor_utils()->get_next_topic_order_id($course_id);
|
200 |
+
|
201 |
+
$topic_title = sanitize_text_field( $_POST['topic_title'] );
|
202 |
+
$topic_summery = wp_kses_post( $_POST['topic_summery'] );
|
203 |
+
|
204 |
+
$post_arr = array(
|
205 |
+
'post_type' => 'topics',
|
206 |
+
'post_title' => $topic_title,
|
207 |
+
'post_content' => $topic_summery,
|
208 |
+
'post_status' => 'publish',
|
209 |
+
'post_author' => get_current_user_id(),
|
210 |
+
'post_parent' => $course_id,
|
211 |
+
'menu_order' => $next_topic_order_id,
|
212 |
+
);
|
213 |
+
$current_topic_id = wp_insert_post( $post_arr );
|
214 |
+
|
215 |
+
ob_start();
|
216 |
+
include tutor()->path.'views/metabox/course-contents.php';
|
217 |
+
$course_contents = ob_get_clean();
|
218 |
+
|
219 |
+
wp_send_json_success(array('course_contents' => $course_contents));
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Update the topic
|
224 |
+
*/
|
225 |
+
public function tutor_update_topic(){
|
226 |
+
$topic_id = (int) sanitize_text_field($_POST['topic_id']);
|
227 |
+
$topic_title = sanitize_text_field($_POST['topic_title']);
|
228 |
+
$topic_summery = wp_kses_post($_POST['topic_summery']);
|
229 |
+
|
230 |
+
$topic_attr = array(
|
231 |
+
'ID' => $topic_id,
|
232 |
+
'post_title' => $topic_title,
|
233 |
+
'post_content' => $topic_summery,
|
234 |
+
);
|
235 |
+
wp_update_post( $topic_attr );
|
236 |
+
|
237 |
+
wp_send_json_success(array('msg' => __('Topic has been updated', 'tutor') ));
|
238 |
+
}
|
239 |
+
|
240 |
+
|
241 |
+
/**
|
242 |
+
* @param $columns
|
243 |
+
*
|
244 |
+
* @return mixed
|
245 |
+
*
|
246 |
+
* Add Lesson column
|
247 |
+
*/
|
248 |
+
|
249 |
+
public function add_column($columns){
|
250 |
+
$date_col = $columns['date'];
|
251 |
+
unset($columns['date']);
|
252 |
+
$columns['lessons'] = __('Lessons', 'tutor');
|
253 |
+
$columns['students'] = __('Students', 'tutor');
|
254 |
+
$columns['price'] = __('Price', 'tutor');
|
255 |
+
$columns['date'] = $date_col;
|
256 |
+
|
257 |
+
return $columns;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* @param $column
|
262 |
+
* @param $post_id
|
263 |
+
*
|
264 |
+
*/
|
265 |
+
public function custom_lesson_column($column, $post_id ){
|
266 |
+
if ($column === 'lessons'){
|
267 |
+
echo tutor_utils()->get_lesson_count_by_course($post_id);
|
268 |
+
}
|
269 |
+
|
270 |
+
if ($column === 'students'){
|
271 |
+
echo tutor_utils()->count_enrolled_users_by_course($post_id);
|
272 |
+
}
|
273 |
+
|
274 |
+
if ($column === 'price'){
|
275 |
+
$price = tutor_utils()->get_course_price($post_id);
|
276 |
+
|
277 |
+
if ($price){
|
278 |
+
if (function_exists('wc_price')){
|
279 |
+
echo '<span class="tutor-label-success">'.wc_price($price).'</span>';
|
280 |
+
}else{
|
281 |
+
echo '<span class="tutor-label-success">'.$price.'</span>';
|
282 |
+
}
|
283 |
+
}else{
|
284 |
+
echo 'free';
|
285 |
+
}
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
public function tutor_delete_topic(){
|
291 |
+
if (!isset($_GET[tutor()->nonce]) || !wp_verify_nonce($_GET[tutor()->nonce], tutor()->nonce_action)) {
|
292 |
+
exit();
|
293 |
+
}
|
294 |
+
if ( ! isset($_GET['topic_id'])){
|
295 |
+
exit();
|
296 |
+
}
|
297 |
+
|
298 |
+
global $wpdb;
|
299 |
+
|
300 |
+
$topic_id = (int) sanitize_text_field($_GET['topic_id']);
|
301 |
+
$wpdb->update(
|
302 |
+
$wpdb->posts,
|
303 |
+
array('post_parent' => 0),
|
304 |
+
array('post_parent' => $topic_id)
|
305 |
+
);
|
306 |
+
|
307 |
+
$wpdb->delete(
|
308 |
+
$wpdb->postmeta,
|
309 |
+
array('post_id' => $topic_id)
|
310 |
+
);
|
311 |
+
|
312 |
+
wp_delete_post($topic_id);
|
313 |
+
wp_safe_redirect(wp_get_referer());
|
314 |
+
}
|
315 |
+
|
316 |
+
public function tutor_delete_announcement(){
|
317 |
+
tutor_utils()->checking_nonce('get');
|
318 |
+
|
319 |
+
$announcement_id = (int) sanitize_text_field($_GET['topic_id']);
|
320 |
+
|
321 |
+
wp_delete_post($announcement_id);
|
322 |
+
wp_safe_redirect(wp_get_referer());
|
323 |
+
}
|
324 |
+
|
325 |
+
public function enroll_now(){
|
326 |
+
//Checking if action comes from Enroll form
|
327 |
+
if ( ! isset($_POST['tutor_course_action']) || $_POST['tutor_course_action'] !== '_tutor_course_enroll_now' || ! isset($_POST['tutor_course_id']) ){
|
328 |
+
return;
|
329 |
+
}
|
330 |
+
//Checking Nonce
|
331 |
+
tutor_utils()->checking_nonce();
|
332 |
+
|
333 |
+
$user_id = get_current_user_id();
|
334 |
+
if ( ! $user_id){
|
335 |
+
exit(__('Please Sign In first', 'tutor'));
|
336 |
+
}
|
337 |
+
|
338 |
+
$course_id = (int) sanitize_text_field($_POST['tutor_course_id']);
|
339 |
+
$user_id = get_current_user_id();
|
340 |
+
|
341 |
+
/**
|
342 |
+
* TODO: need to check purchase information
|
343 |
+
*/
|
344 |
+
|
345 |
+
$is_purchasable = tutor_utils()->is_course_purchasable($course_id);
|
346 |
+
|
347 |
+
/**
|
348 |
+
* If is is not purchasable, it's free, and enroll right now
|
349 |
+
*
|
350 |
+
* if purchasable, then process purchase.
|
351 |
+
*
|
352 |
+
* @since: v.1.0.0
|
353 |
+
*/
|
354 |
+
if ($is_purchasable){
|
355 |
+
//process purchase
|
356 |
+
|
357 |
+
}else{
|
358 |
+
//Free enroll
|
359 |
+
tutor_utils()->do_enroll($course_id);
|
360 |
+
}
|
361 |
+
|
362 |
+
$referer_url = wp_get_referer();
|
363 |
+
wp_redirect($referer_url);
|
364 |
+
}
|
365 |
+
|
366 |
+
/**
|
367 |
+
*
|
368 |
+
* Mark complete completed
|
369 |
+
*
|
370 |
+
* @since v.1.0.0
|
371 |
+
*/
|
372 |
+
public function mark_course_complete(){
|
373 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_complete_course' ){
|
374 |
+
return;
|
375 |
+
}
|
376 |
+
//Checking nonce
|
377 |
+
tutor_utils()->checking_nonce();
|
378 |
+
|
379 |
+
$user_id = get_current_user_id();
|
380 |
+
|
381 |
+
//TODO: need to show view if not signed_in
|
382 |
+
if ( ! $user_id){
|
383 |
+
die(__('Please Sign-In', 'tutor'));
|
384 |
+
}
|
385 |
+
|
386 |
+
$course_id = (int) sanitize_text_field($_POST['course_id']);
|
387 |
+
|
388 |
+
do_action('tutor_course_complete_before', $course_id);
|
389 |
+
/**
|
390 |
+
* Marking course completed at Comment
|
391 |
+
*/
|
392 |
+
|
393 |
+
global $wpdb;
|
394 |
+
|
395 |
+
$date = date("Y-m-d H:i:s");
|
396 |
+
|
397 |
+
//Making sure that, hash is unique
|
398 |
+
do{
|
399 |
+
$hash = substr(md5(wp_generate_password(32).$date.$course_id.$user_id), 0, 16);
|
400 |
+
$hasHash = (int) $wpdb->get_var("SELECT COUNT(comment_ID) from {$wpdb->comments} WHERE comment_agent = 'TutorLMSPlugin' AND comment_type = 'course_completed' AND comment_content = '{$hash}' ");
|
401 |
+
}while($hasHash > 0);
|
402 |
+
|
403 |
+
$data = array(
|
404 |
+
'comment_post_ID' => $course_id,
|
405 |
+
'comment_author' => $user_id,
|
406 |
+
'comment_date' => $date,
|
407 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
408 |
+
'comment_content' => $hash, //Identification Hash
|
409 |
+
'comment_approved' => 'approved',
|
410 |
+
'comment_agent' => 'TutorLMSPlugin',
|
411 |
+
'comment_type' => 'course_completed',
|
412 |
+
'user_id' => $user_id,
|
413 |
+
);
|
414 |
+
|
415 |
+
$wpdb->insert($wpdb->comments, $data);
|
416 |
+
|
417 |
+
do_action('tutor_course_complete_after', $course_id);
|
418 |
+
|
419 |
+
wp_redirect(get_the_permalink($course_id));
|
420 |
+
}
|
421 |
+
|
422 |
+
|
423 |
+
public function tutor_load_instructors_modal(){
|
424 |
+
global $wpdb;
|
425 |
+
|
426 |
+
$course_id = (int) sanitize_text_field($_POST['course_id']);
|
427 |
+
$search_terms = sanitize_text_field(tutor_utils()->avalue_dot('search_terms', $_POST));
|
428 |
+
|
429 |
+
$saved_instructors = tutor_utils()->get_instructors_by_course($course_id);
|
430 |
+
|
431 |
+
$instructors = array();
|
432 |
+
|
433 |
+
|
434 |
+
$not_in_sql = '';
|
435 |
+
if ($saved_instructors){
|
436 |
+
$saved_instructors_ids = wp_list_pluck($saved_instructors, 'ID');
|
437 |
+
$instructor_not_in_ids = implode(',', $saved_instructors_ids);
|
438 |
+
$activated = apply_filters('tutor_instructor_query_when_exists', " AND ID <1 ");
|
439 |
+
$not_in_sql = $activated."AND ID NOT IN($instructor_not_in_ids) ";
|
440 |
+
}
|
441 |
+
|
442 |
+
$search_sql = '';
|
443 |
+
if ($search_terms){
|
444 |
+
$search_sql = "AND user_login like '%{$search_terms}%' or user_nicename like '%{$search_terms}%' or display_name like '%{$search_terms}%' ";
|
445 |
+
}
|
446 |
+
|
447 |
+
$instructors = $wpdb->get_results("select ID, display_name from {$wpdb->users}
|
448 |
+
INNER JOIN {$wpdb->usermeta} ON ID = user_id AND meta_key = '_tutor_instructor_status' AND meta_value = 'approved'
|
449 |
+
WHERE ID > 0 {$not_in_sql} {$search_sql} limit 10 ");
|
450 |
+
|
451 |
+
$output = '';
|
452 |
+
if (is_array($instructors) && count($instructors)){
|
453 |
+
$instructor_output = '';
|
454 |
+
foreach ($instructors as $instructor){
|
455 |
+
$instructor_output .= "<p><label><input type='radio' name='tutor_instructor_ids[]' value='{$instructor->ID}' > {$instructor->display_name} </label></p>";
|
456 |
+
}
|
457 |
+
|
458 |
+
$output .= apply_filters('tutor_course_instructors_html', $instructor_output, $instructors);
|
459 |
+
$output .= '<p class="quiz-search-suggest-text">'.__('Search to get the specific instructors', 'tutor').'</p>';
|
460 |
+
|
461 |
+
}else{
|
462 |
+
$output .= __('No instructor available or you have already added maximum instructors', 'tutor');
|
463 |
+
}
|
464 |
+
|
465 |
+
wp_send_json_success(array('output' => $output));
|
466 |
+
}
|
467 |
+
|
468 |
+
public function tutor_add_instructors_to_course(){
|
469 |
+
$course_id = (int) sanitize_text_field($_POST['course_id']);
|
470 |
+
$instructor_ids = tutor_utils()->avalue_dot('tutor_instructor_ids', $_POST);
|
471 |
+
|
472 |
+
if (is_array($instructor_ids) && count($instructor_ids)){
|
473 |
+
foreach ($instructor_ids as $instructor_id){
|
474 |
+
add_user_meta($instructor_id, '_tutor_instructor_course_id', $course_id);
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
$saved_instructors = tutor_utils()->get_instructors_by_course($course_id);
|
479 |
+
$output = '';
|
480 |
+
|
481 |
+
if ($saved_instructors){
|
482 |
+
foreach ($saved_instructors as $t){
|
483 |
+
|
484 |
+
$output .= '<div id="added-instructor-id-'.$t->ID.'" class="added-instructor-item added-instructor-item-'.$t->ID.'" data-instructor-id="'.$t->ID.'">
|
485 |
+
<span class="instructor-icon">'.get_avatar($t->ID, 30).'</span>
|
486 |
+
<span class="instructor-name"> '.$t->display_name.' </span>
|
487 |
+
<span class="instructor-control">
|
488 |
+
<a href="javascript:;" class="tutor-instructor-delete-btn"><i class="tutor-icon-garbage"></i></a>
|
489 |
+
</span>
|
490 |
+
</div>';
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
|
495 |
+
wp_send_json_success(array('output' => $output));
|
496 |
+
}
|
497 |
+
|
498 |
+
public function detach_instructor_from_course(){
|
499 |
+
global $wpdb;
|
500 |
+
|
501 |
+
$instructor_id = (int) sanitize_text_field($_POST['instructor_id']);
|
502 |
+
$course_id = (int) sanitize_text_field($_POST['course_id']);
|
503 |
+
|
504 |
+
$wpdb->delete($wpdb->usermeta, array('user_id' => $instructor_id, 'meta_key' => '_tutor_instructor_course_id', 'meta_value' => $course_id) );
|
505 |
+
wp_send_json_success();
|
506 |
+
}
|
507 |
+
|
508 |
+
|
509 |
+
}
|
classes/Gutenberg.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Gutenberg class
|
4 |
+
*
|
5 |
+
* @author: themeum
|
6 |
+
* @author_uri: https://themeum.com
|
7 |
+
* @package Tutor
|
8 |
+
* @since v.1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
namespace TUTOR;
|
13 |
+
|
14 |
+
|
15 |
+
if ( ! defined( 'ABSPATH' ) )
|
16 |
+
exit;
|
17 |
+
|
18 |
+
class Gutenberg {
|
19 |
+
|
20 |
+
public function __construct() {
|
21 |
+
if ( ! function_exists('register_block_type')){
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
add_action( 'init', array($this, 'register_blocks') );
|
26 |
+
add_filter('block_categories', array($this, 'registering_new_block_category'), 10, 2);
|
27 |
+
|
28 |
+
add_action('wp_ajax_render_block_tutor', array($this, 'render_block_tutor'));
|
29 |
+
}
|
30 |
+
|
31 |
+
function register_blocks() {
|
32 |
+
wp_register_script(
|
33 |
+
'tutor-student-registration-block', tutor()->url . 'assets/js/gutenberg_blocks.js', array( 'wp-blocks', 'wp-element' )
|
34 |
+
);
|
35 |
+
|
36 |
+
register_block_type( 'tutor-gutenberg/student-registration', array(
|
37 |
+
'editor_script' => 'tutor-student-registration-block',
|
38 |
+
'render_callback' => array($this, 'render_block_student_registration'),
|
39 |
+
) );
|
40 |
+
register_block_type( 'tutor-gutenberg/student-dashboard', array(
|
41 |
+
'editor_script' => 'tutor-student-registration-block',
|
42 |
+
'render_callback' => array($this, 'render_block_tutor_student_dashboard'),
|
43 |
+
) );
|
44 |
+
register_block_type( 'tutor-gutenberg/instructor-registration', array(
|
45 |
+
'editor_script' => 'tutor-student-registration-block',
|
46 |
+
'render_callback' => array($this, 'render_block_tutor_instructor_registration_form'),
|
47 |
+
) );
|
48 |
+
}
|
49 |
+
|
50 |
+
public function registering_new_block_category($categories, $post ){
|
51 |
+
return array_merge(
|
52 |
+
array(
|
53 |
+
array(
|
54 |
+
'slug' => 'tutor',
|
55 |
+
'title' => __( 'Tutor LMS', 'tutor' ),
|
56 |
+
),
|
57 |
+
),
|
58 |
+
$categories
|
59 |
+
);
|
60 |
+
}
|
61 |
+
|
62 |
+
public function render_block_student_registration($args){
|
63 |
+
return do_shortcode("[tutor_student_registration_form]");
|
64 |
+
}
|
65 |
+
public function render_block_tutor_student_dashboard($args){
|
66 |
+
return do_shortcode("[tutor_student_dashboard]");
|
67 |
+
}
|
68 |
+
public function render_block_tutor_instructor_registration_form($args){
|
69 |
+
return do_shortcode("[tutor_instructor_registration_form]");
|
70 |
+
}
|
71 |
+
|
72 |
+
//For editor
|
73 |
+
public function render_block_tutor(){
|
74 |
+
$shortcode = sanitize_text_field($_POST['shortcode']);
|
75 |
+
wp_send_json_success(do_shortcode("[{$shortcode}]"));
|
76 |
+
}
|
77 |
+
|
78 |
+
}
|
classes/Instructor.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Instructor
|
5 |
+
* @package TUTOR
|
6 |
+
*
|
7 |
+
* @since v.1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
namespace TUTOR;
|
11 |
+
|
12 |
+
|
13 |
+
class Instructor {
|
14 |
+
|
15 |
+
protected $error_msgs = '';
|
16 |
+
public function __construct() {
|
17 |
+
add_action('template_redirect', array($this, 'register_instructor'));
|
18 |
+
add_action('template_redirect', array($this, 'apply_instructor'));
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Register new user and mark him as instructor
|
24 |
+
*
|
25 |
+
* @since v.1.0.0
|
26 |
+
*/
|
27 |
+
public function register_instructor(){
|
28 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_register_instructor' ){
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
//Checking nonce
|
32 |
+
tutor_utils()->checking_nonce();
|
33 |
+
|
34 |
+
$required_fields = apply_filters('tutor_instructor_registration_required_fields', array(
|
35 |
+
'first_name' => __('First name field is required', 'tutor'),
|
36 |
+
'last_name' => __('Last name field is required', 'tutor'),
|
37 |
+
'email' => __('E-Mail field is required', 'tutor'),
|
38 |
+
'user_login' => __('User Name field is required', 'tutor'),
|
39 |
+
'phone_number' => __('Phone Number field is required', 'tutor'),
|
40 |
+
'password' => __('Password field is required', 'tutor'),
|
41 |
+
'password_confirmation' => __('Password Confirmation field is required', 'tutor'),
|
42 |
+
));
|
43 |
+
|
44 |
+
$validation_errors = array();
|
45 |
+
foreach ($required_fields as $required_key => $required_value){
|
46 |
+
if (empty($_POST[$required_key])){
|
47 |
+
$validation_errors[$required_key] = $required_value;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
if (!filter_var(tutor_utils()->input_old('email'), FILTER_VALIDATE_EMAIL)) {
|
52 |
+
$validation_errors['email'] = __('Valid E-Mail is required', 'tutor');
|
53 |
+
}
|
54 |
+
if (tutor_utils()->input_old('password') !== tutor_utils()->input_old('password_confirmation')){
|
55 |
+
$validation_errors['password_confirmation'] = __('Confirm password does not matched with Password field', 'tutor');
|
56 |
+
}
|
57 |
+
|
58 |
+
if (count($validation_errors)){
|
59 |
+
$this->error_msgs = $validation_errors;
|
60 |
+
add_filter('tutor_instructor_register_validation_errors', array($this, 'tutor_instructor_form_validation_errors'));
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
$first_name = sanitize_text_field(tutor_utils()->input_old('first_name'));
|
65 |
+
$last_name = sanitize_text_field(tutor_utils()->input_old('last_name'));
|
66 |
+
$email = sanitize_text_field(tutor_utils()->input_old('email'));
|
67 |
+
$user_login = sanitize_text_field(tutor_utils()->input_old('user_login'));
|
68 |
+
$phone_number = sanitize_text_field(tutor_utils()->input_old('phone_number'));
|
69 |
+
$password = sanitize_text_field(tutor_utils()->input_old('password'));
|
70 |
+
$tutor_profile_bio = wp_kses_post(tutor_utils()->input_old('tutor_profile_bio'));
|
71 |
+
|
72 |
+
$userdata = array(
|
73 |
+
'user_login' => $user_login,
|
74 |
+
'user_email' => $email,
|
75 |
+
'first_name' => $first_name,
|
76 |
+
'last_name' => $last_name,
|
77 |
+
//'role' => tutor()->instructor_role,
|
78 |
+
'user_pass' => $password,
|
79 |
+
);
|
80 |
+
|
81 |
+
$user_id = wp_insert_user( $userdata ) ;
|
82 |
+
if ( ! is_wp_error($user_id)){
|
83 |
+
update_user_meta($user_id, 'phone_number', $phone_number);
|
84 |
+
update_user_meta($user_id, 'description', $tutor_profile_bio);
|
85 |
+
update_user_meta($user_id, '_tutor_profile_bio', $tutor_profile_bio);
|
86 |
+
|
87 |
+
update_user_meta($user_id, '_is_tutor_instructor', time());
|
88 |
+
update_user_meta($user_id, '_tutor_instructor_status', apply_filters('tutor_initial_instructor_status', 'pending'));
|
89 |
+
|
90 |
+
$user = get_user_by( 'id', $user_id );
|
91 |
+
if( $user ) {
|
92 |
+
wp_set_current_user( $user_id, $user->user_login );
|
93 |
+
wp_set_auth_cookie( $user_id );
|
94 |
+
}
|
95 |
+
}else{
|
96 |
+
$this->error_msgs = $user_id->get_error_messages();
|
97 |
+
add_filter('tutor_instructor_register_validation_errors', array($this, 'tutor_instructor_form_validation_errors'));
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
102 |
+
die();
|
103 |
+
}
|
104 |
+
|
105 |
+
public function tutor_instructor_form_validation_errors(){
|
106 |
+
return $this->error_msgs;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
*
|
111 |
+
* Usage for instructor applying when a user already logged in
|
112 |
+
*
|
113 |
+
* @since v.1.0.0
|
114 |
+
*/
|
115 |
+
public function apply_instructor(){
|
116 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_apply_instructor' ){
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
//Checking nonce
|
120 |
+
tutor_utils()->checking_nonce();
|
121 |
+
|
122 |
+
$user_id = get_current_user_id();
|
123 |
+
if ($user_id){
|
124 |
+
if (tutor_utils()->is_instructor()){
|
125 |
+
die(__('Already applied for instructor', 'tutor'));
|
126 |
+
}else{
|
127 |
+
update_user_meta($user_id, '_is_tutor_instructor', time());
|
128 |
+
update_user_meta($user_id, '_tutor_instructor_status', apply_filters('tutor_initial_instructor_status', 'pending'));
|
129 |
+
}
|
130 |
+
}else{
|
131 |
+
die(__('Permission denied', 'tutor'));
|
132 |
+
}
|
133 |
+
|
134 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
135 |
+
die();
|
136 |
+
}
|
137 |
+
|
138 |
+
}
|
classes/Instructors_List.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
if (! class_exists('Tutor_List_Table')){
|
8 |
+
include_once tutor()->path.'classes/Tutor_List_Table.php';
|
9 |
+
}
|
10 |
+
|
11 |
+
class Instructors_List extends \Tutor_List_Table {
|
12 |
+
function __construct(){
|
13 |
+
global $status, $page;
|
14 |
+
|
15 |
+
//Set parent defaults
|
16 |
+
parent::__construct( array(
|
17 |
+
'singular' => 'instructor', //singular name of the listed records
|
18 |
+
'plural' => 'instructors', //plural name of the listed records
|
19 |
+
'ajax' => false //does this table support ajax?
|
20 |
+
) );
|
21 |
+
}
|
22 |
+
|
23 |
+
function column_default($item, $column_name){
|
24 |
+
switch($column_name){
|
25 |
+
case 'user_email':
|
26 |
+
case 'display_name':
|
27 |
+
return $item->$column_name;
|
28 |
+
default:
|
29 |
+
return print_r($item,true); //Show the whole array for troubleshooting purposes
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
function column_total_course($item){
|
34 |
+
global $wpdb;
|
35 |
+
$course_post_type = tutor()->course_post_type;
|
36 |
+
|
37 |
+
$total_course = (int) $wpdb->get_var("select count(ID) from {$wpdb->posts} WHERE post_author={$item->ID} AND post_type='{$course_post_type}' ");
|
38 |
+
|
39 |
+
echo $total_course;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @param $item
|
44 |
+
*
|
45 |
+
* Completed Course by User
|
46 |
+
*/
|
47 |
+
function column_status($item){
|
48 |
+
$status = tutor_utils()->instructor_status($item->ID, false);
|
49 |
+
$status_name = tutor_utils()->instructor_status($item->ID);
|
50 |
+
echo "<span class='tutor-status-context tutor-status-{$status}-context'>{$status_name}</span>";
|
51 |
+
}
|
52 |
+
|
53 |
+
function column_display_name($item){
|
54 |
+
//Build row actions
|
55 |
+
$actions = array(
|
56 |
+
//'edit' => sprintf('<a href="?page=%s&action=%s&instructor=%s">Edit</a>',$_REQUEST['page'],'edit',$item->ID),
|
57 |
+
//'delete' => sprintf('<a href="?page=%s&action=%s&instructor=%s">Delete</a>',$_REQUEST['page'],'delete',$item->ID),
|
58 |
+
);
|
59 |
+
|
60 |
+
$status = tutor_utils()->instructor_status($item->ID, false);
|
61 |
+
|
62 |
+
switch ($status){
|
63 |
+
case 'pending':
|
64 |
+
$actions['approved'] = sprintf('<a href="?page=%s&action=%s&instructor=%s">Approve</a>',$_REQUEST['page'],'approve',$item->ID);
|
65 |
+
break;
|
66 |
+
case 'approved':
|
67 |
+
$actions['blocked'] = sprintf('<a href="?page=%s&action=%s&instructor=%s">Block</a>',$_REQUEST['page'],'blocked',$item->ID);
|
68 |
+
break;
|
69 |
+
case 'blocked':
|
70 |
+
$actions['approved'] = sprintf('<a href="?page=%s&action=%s&instructor=%s">Un Block</a>',$_REQUEST['page'],'approve',$item->ID);
|
71 |
+
break;
|
72 |
+
}
|
73 |
+
//Return the title contents
|
74 |
+
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
75 |
+
$item->display_name,
|
76 |
+
$item->ID,
|
77 |
+
$this->row_actions($actions)
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
function column_cb($item){
|
82 |
+
return sprintf(
|
83 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
84 |
+
/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("instructor")
|
85 |
+
/*$2%s*/ $item->ID //The value of the checkbox should be the record's id
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
function get_columns(){
|
90 |
+
$columns = array(
|
91 |
+
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
|
92 |
+
'display_name' => __('Name', 'tutor'),
|
93 |
+
'user_email' => __('E-Mail', 'tutor'),
|
94 |
+
'total_course' => __('Total Course', 'tutor'),
|
95 |
+
'status' => __('Status', 'tutor'),
|
96 |
+
);
|
97 |
+
return $columns;
|
98 |
+
}
|
99 |
+
|
100 |
+
function get_sortable_columns() {
|
101 |
+
$sortable_columns = array(
|
102 |
+
//'display_name' => array('title',false), //true means it's already sorted
|
103 |
+
);
|
104 |
+
return $sortable_columns;
|
105 |
+
}
|
106 |
+
|
107 |
+
function get_bulk_actions() {
|
108 |
+
$actions = array(
|
109 |
+
//'delete' => 'Delete'
|
110 |
+
);
|
111 |
+
return $actions;
|
112 |
+
}
|
113 |
+
|
114 |
+
function process_bulk_action() {
|
115 |
+
if( 'approve' === $this->current_action() ) {
|
116 |
+
$instructor_id = (int) sanitize_text_field($_GET['instructor']);
|
117 |
+
|
118 |
+
do_action('tutor_before_approved_instructor', $instructor_id);
|
119 |
+
|
120 |
+
update_user_meta($instructor_id, '_tutor_instructor_status', 'approved');
|
121 |
+
update_user_meta($instructor_id, '_tutor_instructor_approved', time());
|
122 |
+
|
123 |
+
$instructor = new \WP_User($instructor_id);
|
124 |
+
$instructor->add_role(tutor()->instructor_role);
|
125 |
+
|
126 |
+
//TODO: send E-Mail to this user about instructor approval, should via hook
|
127 |
+
do_action('tutor_after_approved_instructor', $instructor_id);
|
128 |
+
|
129 |
+
wp_redirect(wp_get_referer());
|
130 |
+
}
|
131 |
+
|
132 |
+
if( 'blocked' === $this->current_action() ) {
|
133 |
+
$instructor_id = (int) sanitize_text_field($_GET['instructor']);
|
134 |
+
|
135 |
+
do_action('tutor_before_blocked_instructor', $instructor_id);
|
136 |
+
update_user_meta($instructor_id, '_tutor_instructor_status', 'blocked');
|
137 |
+
|
138 |
+
$instructor = new \WP_User($instructor_id);
|
139 |
+
$instructor->remove_role(tutor()->instructor_role);
|
140 |
+
do_action('tutor_after_blocked_instructor', $instructor_id);
|
141 |
+
|
142 |
+
//TODO: send E-Mail to this user about instructor blocked, should via hook
|
143 |
+
wp_redirect(wp_get_referer());
|
144 |
+
}
|
145 |
+
|
146 |
+
//Detect when a bulk action is being triggered...
|
147 |
+
if( 'delete'===$this->current_action() ) {
|
148 |
+
wp_die('Items deleted (or they would be if we had items to delete)!');
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
function prepare_items() {
|
153 |
+
$per_page = 20;
|
154 |
+
|
155 |
+
$search_term = '';
|
156 |
+
if (isset($_REQUEST['s'])){
|
157 |
+
$search_term = sanitize_text_field($_REQUEST['s']);
|
158 |
+
}
|
159 |
+
|
160 |
+
$columns = $this->get_columns();
|
161 |
+
$hidden = array();
|
162 |
+
$sortable = $this->get_sortable_columns();
|
163 |
+
|
164 |
+
$this->_column_headers = array($columns, $hidden, $sortable);
|
165 |
+
$this->process_bulk_action();
|
166 |
+
|
167 |
+
$current_page = $this->get_pagenum();
|
168 |
+
|
169 |
+
$total_items = tutor_utils()->get_total_instructors($search_term);
|
170 |
+
$this->items = tutor_utils()->get_instructors(($current_page-1)*$per_page, $per_page, $search_term);
|
171 |
+
|
172 |
+
$this->set_pagination_args( array(
|
173 |
+
'total_items' => $total_items,
|
174 |
+
'per_page' => $per_page,
|
175 |
+
'total_pages' => ceil($total_items/$per_page)
|
176 |
+
) );
|
177 |
+
}
|
178 |
+
}
|
classes/Lesson.php
ADDED
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Lesson extends Tutor_Base {
|
8 |
+
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
12 |
+
add_action('save_post_'.$this->lesson_post_type, array($this, "save_lesson_meta"));
|
13 |
+
|
14 |
+
|
15 |
+
//add_action('wp_ajax_tutor_create_lesson', array($this, "tutor_create_lesson"));
|
16 |
+
//add_action('wp_ajax_tutor_update_inline_lesson', array($this, "tutor_update_inline_lesson"));
|
17 |
+
|
18 |
+
add_action('wp_ajax_tutor_load_edit_lesson_modal', array($this, "tutor_load_edit_lesson_modal"));
|
19 |
+
add_action('wp_ajax_tutor_modal_create_or_update_lesson', array($this, "tutor_modal_create_or_update_lesson"));
|
20 |
+
add_action('wp_ajax_tutor_delete_lesson_by_id', array($this, "tutor_delete_lesson_by_id"));
|
21 |
+
|
22 |
+
add_filter('get_sample_permalink', array($this, 'change_lesson_permalink'), 10, 2);
|
23 |
+
add_action('admin_init', array($this, 'flush_rewrite_rules'));
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Add Column
|
27 |
+
*/
|
28 |
+
|
29 |
+
add_filter( "manage_{$this->lesson_post_type}_posts_columns", array($this, 'add_column'), 10,1 );
|
30 |
+
add_action( "manage_{$this->lesson_post_type}_posts_custom_column" , array($this, 'custom_lesson_column'), 10, 2 );
|
31 |
+
|
32 |
+
//Frontend Action
|
33 |
+
add_action('template_redirect', array($this, 'mark_lesson_complete'));
|
34 |
+
|
35 |
+
add_action('wp_ajax_tutor_render_lesson_content', array($this, "tutor_render_lesson_content"));
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Registering metabox
|
40 |
+
*/
|
41 |
+
public function register_meta_box(){
|
42 |
+
$lesson_post_type = $this->lesson_post_type;
|
43 |
+
|
44 |
+
add_meta_box( 'tutor-course-select', __( 'Select Course', 'tutor' ), array($this, 'lesson_metabox'), $lesson_post_type );
|
45 |
+
add_meta_box( 'tutor-lesson-videos', __( 'Lesson Video', 'tutor' ), array($this, 'lesson_video_metabox'), $lesson_post_type );
|
46 |
+
add_meta_box( 'tutor-lesson-attachments', __( 'Attachments', 'tutor' ), array($this, 'lesson_attachments_metabox'), $lesson_post_type );
|
47 |
+
}
|
48 |
+
|
49 |
+
public function lesson_metabox(){
|
50 |
+
include tutor()->path.'views/metabox/lesson-metabox.php';
|
51 |
+
}
|
52 |
+
|
53 |
+
public function lesson_video_metabox(){
|
54 |
+
include tutor()->path.'views/metabox/video-metabox.php';
|
55 |
+
}
|
56 |
+
|
57 |
+
public function lesson_attachments_metabox(){
|
58 |
+
include tutor()->path.'views/metabox/lesson-attachments-metabox.php';
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* @param $post_ID
|
63 |
+
*
|
64 |
+
* Saving lesson meta and assets
|
65 |
+
*
|
66 |
+
*/
|
67 |
+
public function save_lesson_meta($post_ID){
|
68 |
+
//Course
|
69 |
+
if (isset($_POST['selected_course'])) {
|
70 |
+
$course_id = (int) sanitize_text_field( $_POST['selected_course'] );
|
71 |
+
if ( $course_id ) {
|
72 |
+
update_post_meta( $post_ID, '_tutor_course_id_for_lesson', $course_id );
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
//Video
|
77 |
+
if ( ! empty($_POST['video']['source'])){
|
78 |
+
$video = tutor_utils()->sanitize_array($_POST['video']);
|
79 |
+
update_post_meta($post_ID, '_video', $video);
|
80 |
+
}
|
81 |
+
|
82 |
+
//Attachments
|
83 |
+
$attachments = array();
|
84 |
+
if ( ! empty($_POST['tutor_attachments'])){
|
85 |
+
$attachments = tutor_utils()->sanitize_array($_POST['tutor_attachments']);
|
86 |
+
$attachments = array_unique($attachments);
|
87 |
+
}
|
88 |
+
update_post_meta($post_ID, '_tutor_attachments', $attachments);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Create Lesson from topic area in course builder
|
93 |
+
*/
|
94 |
+
|
95 |
+
/*
|
96 |
+
public function tutor_create_lesson(){
|
97 |
+
$course_id = (int) sanitize_text_field( $_POST['course_id'] );
|
98 |
+
$topic_id = (int) sanitize_text_field( $_POST['topic_id'] );
|
99 |
+
$lesson_title = sanitize_text_field($_POST['lesson_title']);
|
100 |
+
|
101 |
+
$post_arr = array(
|
102 |
+
'post_type' => $this->lesson_post_type,
|
103 |
+
'post_title' => $lesson_title,
|
104 |
+
'post_status' => 'publish',
|
105 |
+
'post_author' => get_current_user_id(),
|
106 |
+
'post_parent' => $topic_id,
|
107 |
+
);
|
108 |
+
$post_ID = wp_insert_post( $post_arr );
|
109 |
+
|
110 |
+
if ( $course_id && $post_ID ) {
|
111 |
+
update_post_meta( $post_ID, '_tutor_course_id_for_lesson', $course_id );
|
112 |
+
|
113 |
+
ob_start();
|
114 |
+
include tutor()->path.'views/metabox/course-contents.php';
|
115 |
+
$course_contents = ob_get_clean();
|
116 |
+
|
117 |
+
wp_send_json_success(array('course_contents' => $course_contents));
|
118 |
+
}
|
119 |
+
|
120 |
+
wp_send_json_error();
|
121 |
+
}
|
122 |
+
|
123 |
+
|
124 |
+
public function tutor_update_inline_lesson(){
|
125 |
+
$lesson_id = (int) sanitize_text_field( $_POST['lesson_id'] );
|
126 |
+
$lesson_title = sanitize_text_field($_POST['lesson_title']);
|
127 |
+
|
128 |
+
$post_arr = array(
|
129 |
+
'ID' => $lesson_id,
|
130 |
+
'post_title' => $lesson_title,
|
131 |
+
);
|
132 |
+
wp_update_post( $post_arr );
|
133 |
+
wp_send_json_success();
|
134 |
+
}
|
135 |
+
|
136 |
+
*/
|
137 |
+
|
138 |
+
public function tutor_load_edit_lesson_modal(){
|
139 |
+
$lesson_id = (int) tutor_utils()->avalue_dot('lesson_id', $_POST);
|
140 |
+
$topic_id = (int) sanitize_text_field( $_POST['topic_id'] );
|
141 |
+
|
142 |
+
/**
|
143 |
+
* If Lesson Not Exists, create One
|
144 |
+
*/
|
145 |
+
if ( ! $lesson_id){
|
146 |
+
$course_id = (int) sanitize_text_field( $_POST['course_id'] );
|
147 |
+
|
148 |
+
$post_arr = array(
|
149 |
+
'post_type' => $this->lesson_post_type,
|
150 |
+
'post_title' => __('Draft Lesson', 'tutor'),
|
151 |
+
'post_status' => 'publish',
|
152 |
+
'post_author' => get_current_user_id(),
|
153 |
+
'post_parent' => $topic_id,
|
154 |
+
);
|
155 |
+
$lesson_id = wp_insert_post( $post_arr );
|
156 |
+
if ($lesson_id ) {
|
157 |
+
update_post_meta( $lesson_id, '_tutor_course_id_for_lesson', $course_id );
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
$post = get_post($lesson_id);
|
162 |
+
|
163 |
+
ob_start();
|
164 |
+
include tutor()->path.'views/modal/edit-lesson.php';
|
165 |
+
$output = ob_get_clean();
|
166 |
+
|
167 |
+
wp_send_json_success(array('output' => $output));
|
168 |
+
}
|
169 |
+
|
170 |
+
public function tutor_modal_create_or_update_lesson(){
|
171 |
+
$lesson_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('lesson_id', $_POST));
|
172 |
+
$_lesson_thumbnail_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('_lesson_thumbnail_id', $_POST));
|
173 |
+
|
174 |
+
$title = sanitize_text_field($_POST['lesson_title']);
|
175 |
+
$lesson_content = wp_kses_post($_POST['lesson_content']);
|
176 |
+
|
177 |
+
$lesson_data = array(
|
178 |
+
'ID' => $lesson_id,
|
179 |
+
'post_title' => $title,
|
180 |
+
'post_content' => $lesson_content,
|
181 |
+
);
|
182 |
+
|
183 |
+
if ($_lesson_thumbnail_id){
|
184 |
+
$lesson_data['_thumbnail_id'] = $_lesson_thumbnail_id;
|
185 |
+
}
|
186 |
+
wp_update_post($lesson_data);
|
187 |
+
|
188 |
+
$course_id = tutor_utils()->get_course_id_by_lesson($lesson_id);
|
189 |
+
ob_start();
|
190 |
+
include tutor()->path.'views/metabox/course-contents.php';
|
191 |
+
$course_contents = ob_get_clean();
|
192 |
+
|
193 |
+
wp_send_json_success(array('course_contents' => $course_contents));
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Delete Lesson from course builder
|
198 |
+
*/
|
199 |
+
public function tutor_delete_lesson_by_id(){
|
200 |
+
$lesson_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('lesson_id', $_POST));
|
201 |
+
wp_delete_post($lesson_id, true);
|
202 |
+
delete_post_meta($lesson_id, '_tutor_course_id_for_lesson');
|
203 |
+
wp_send_json_success();
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* @param $uri
|
209 |
+
* @param $lesson_id
|
210 |
+
*
|
211 |
+
* @return mixed
|
212 |
+
*
|
213 |
+
* Changed the URI based
|
214 |
+
*/
|
215 |
+
|
216 |
+
public function change_lesson_permalink($uri, $lesson_id){
|
217 |
+
$post = get_post($lesson_id);
|
218 |
+
|
219 |
+
if ($post && $post->post_type === $this->lesson_post_type){
|
220 |
+
$uri_base = trailingslashit(site_url());
|
221 |
+
|
222 |
+
$sample_course = "sample-course";
|
223 |
+
$is_course = get_post_meta(get_the_ID(), '_tutor_course_id_for_lesson', true);
|
224 |
+
if ($is_course){
|
225 |
+
$course = get_post($is_course);
|
226 |
+
if ($course){
|
227 |
+
$sample_course = $course->post_name;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
$new_course_base = $uri_base."course/{$sample_course}/lesson/%pagename%/";
|
232 |
+
$uri[0] = $new_course_base;
|
233 |
+
}
|
234 |
+
|
235 |
+
return $uri;
|
236 |
+
}
|
237 |
+
|
238 |
+
|
239 |
+
public function flush_rewrite_rules(){
|
240 |
+
$is_required_flush = get_option('required_rewrite_flush');
|
241 |
+
if ($is_required_flush){
|
242 |
+
flush_rewrite_rules();
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
public function add_column($columns){
|
248 |
+
$date_col = $columns['date'];
|
249 |
+
unset($columns['date']);
|
250 |
+
$columns['course'] = __('Course', 'tutor');
|
251 |
+
$columns['date'] = $date_col;
|
252 |
+
|
253 |
+
return $columns;
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* @param $column
|
258 |
+
* @param $post_id
|
259 |
+
*
|
260 |
+
*/
|
261 |
+
public function custom_lesson_column($column, $post_id ){
|
262 |
+
if ($column === 'course'){
|
263 |
+
|
264 |
+
$course_id = get_post_meta($post_id, '_tutor_course_id_for_lesson', true);
|
265 |
+
if ($course_id){
|
266 |
+
echo '<a href="'.admin_url('post.php?post='.$course_id.'&action=edit').'">'.get_the_title($course_id).'</a>';
|
267 |
+
}
|
268 |
+
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
*
|
274 |
+
* Mark lesson completed
|
275 |
+
*
|
276 |
+
* @since v.1.0.0
|
277 |
+
*/
|
278 |
+
public function mark_lesson_complete(){
|
279 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_complete_lesson' ){
|
280 |
+
return;
|
281 |
+
}
|
282 |
+
//Checking nonce
|
283 |
+
tutor_utils()->checking_nonce();
|
284 |
+
|
285 |
+
$user_id = get_current_user_id();
|
286 |
+
|
287 |
+
//TODO: need to show view if not signed_in
|
288 |
+
if ( ! $user_id){
|
289 |
+
die(__('Please Sign-In', 'tutor'));
|
290 |
+
}
|
291 |
+
|
292 |
+
$lesson_id = (int) sanitize_text_field($_POST['lesson_id']);
|
293 |
+
|
294 |
+
do_action('tutor_lesson_completed_before', $lesson_id);
|
295 |
+
/**
|
296 |
+
* Marking lesson at user meta, meta format, _tutor_completed_lesson_id_{id} and value = time();
|
297 |
+
*/
|
298 |
+
tutor_utils()->mark_lesson_complete($lesson_id);
|
299 |
+
|
300 |
+
do_action('tutor_lesson_completed_after', $lesson_id);
|
301 |
+
|
302 |
+
|
303 |
+
wp_redirect(get_the_permalink($lesson_id));
|
304 |
+
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Render the lesson content
|
308 |
+
*/
|
309 |
+
public function tutor_render_lesson_content(){
|
310 |
+
$lesson_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('lesson_id', $_POST));
|
311 |
+
|
312 |
+
ob_start();
|
313 |
+
global $post;
|
314 |
+
|
315 |
+
$post = get_post($lesson_id);
|
316 |
+
setup_postdata($post);
|
317 |
+
tutor_lesson_content();
|
318 |
+
wp_reset_postdata();
|
319 |
+
|
320 |
+
$html = ob_get_clean();
|
321 |
+
wp_send_json_success(array('html' => $html));
|
322 |
+
}
|
323 |
+
|
324 |
+
}
|
325 |
+
|
326 |
+
|
classes/Options.php
ADDED
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Tutor;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Options {
|
8 |
+
|
9 |
+
public $option;
|
10 |
+
public $options_attr;
|
11 |
+
|
12 |
+
public function __construct() {
|
13 |
+
$this->option = (array) maybe_unserialize(get_option('tutor_option'));
|
14 |
+
$this->options_attr = $this->options_attr();
|
15 |
+
|
16 |
+
//Saving option
|
17 |
+
add_action('wp_ajax_tutor_option_save', array($this, 'tutor_option_save'));
|
18 |
+
}
|
19 |
+
|
20 |
+
private function get($key = null, $default = false){
|
21 |
+
$option = $this->option;
|
22 |
+
if (empty($option) || ! is_array($option)){
|
23 |
+
return $default;
|
24 |
+
}
|
25 |
+
if ( ! $key){
|
26 |
+
return $option;
|
27 |
+
}
|
28 |
+
if (array_key_exists($key, $option)){
|
29 |
+
return apply_filters($key, $option[$key]);
|
30 |
+
}
|
31 |
+
//Access array value via dot notation, such as option->get('value.subvalue')
|
32 |
+
if (strpos($key, '.')){
|
33 |
+
$option_key_array = explode('.', $key);
|
34 |
+
$new_option = $option;
|
35 |
+
foreach ($option_key_array as $dotKey){
|
36 |
+
if (isset($new_option[$dotKey])){
|
37 |
+
$new_option = $new_option[$dotKey];
|
38 |
+
}else{
|
39 |
+
return $default;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
return apply_filters($key, $new_option);
|
43 |
+
}
|
44 |
+
|
45 |
+
return $default;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function tutor_option_save(){
|
49 |
+
if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce( $_POST['_wpnonce'], 'tutor_option_save' ) ){
|
50 |
+
exit();
|
51 |
+
}
|
52 |
+
|
53 |
+
$option = (array) isset($_POST['tutor_option']) ? $_POST['tutor_option'] : array();
|
54 |
+
$option = apply_filters('tutor_option_input', $option);
|
55 |
+
update_option('tutor_option', $option);
|
56 |
+
|
57 |
+
//re-sync settings
|
58 |
+
init::tutor_activate();
|
59 |
+
|
60 |
+
wp_send_json_success( array('msg' => __('Option Updated', 'tutor') ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
public function options_attr(){
|
64 |
+
$pages = tutor_utils()->get_pages();
|
65 |
+
|
66 |
+
//$course_base = tutor_utils()->course_archive_page_url();
|
67 |
+
$lesson_url = site_url().'/course/'.'sample-course/<code>lessons</code>/sample-lesson/';
|
68 |
+
|
69 |
+
$student_url = tutor_utils()->profile_url();
|
70 |
+
|
71 |
+
$attempts_allowed = array();
|
72 |
+
$attempts_allowed['unlimited'] = __('Unlimited' , 'tutor');
|
73 |
+
$attempts_allowed = array_merge($attempts_allowed, array_combine(range(1,20), range(1,20)));
|
74 |
+
|
75 |
+
$attr = array(
|
76 |
+
'general' => array(
|
77 |
+
'label' => __('General', 'tutor'),
|
78 |
+
'sections' => array(
|
79 |
+
'general' => array(
|
80 |
+
'label' => __('General', 'tutor'),
|
81 |
+
'desc' => __('General Settings', 'tutor'),
|
82 |
+
'fields' => array(
|
83 |
+
'enable_public_profile' => array(
|
84 |
+
'type' => 'checkbox',
|
85 |
+
'label' => __('Enable Public Profile', 'tutor'),
|
86 |
+
'default' => '0',
|
87 |
+
'desc' => __('Enable this to make a profile publicly visible', 'tutor')."<br />" .$student_url,
|
88 |
+
),
|
89 |
+
'load_tutor_css' => array(
|
90 |
+
'type' => 'checkbox',
|
91 |
+
'label' => __('Load Tutor default CSS', 'tutor'),
|
92 |
+
'default' => '1',
|
93 |
+
'desc' => __('If your theme has its own styling, then you can turn it off to load CSS from the plugin directory', 'tutor'),
|
94 |
+
),
|
95 |
+
'load_tutor_js' => array(
|
96 |
+
'type' => 'checkbox',
|
97 |
+
'label' => __('Load Tutor default JavaScript', 'tutor'),
|
98 |
+
'default' => '1',
|
99 |
+
'desc' => __('If you have put required script in your theme javascript file, then you can turn it off to load JavaScript from the plugin directory', 'tutor'),
|
100 |
+
),
|
101 |
+
'student_must_login_to_view_course' => array(
|
102 |
+
'type' => 'checkbox',
|
103 |
+
'label' => __('Course Permission', 'tutor'),
|
104 |
+
'desc' => __('Students must be logged in to view course', 'tutor'),
|
105 |
+
),
|
106 |
+
'delete_on_uninstall' => array(
|
107 |
+
'type' => 'checkbox',
|
108 |
+
'label' => __('Erase upon uninstallation', 'tutor'),
|
109 |
+
'desc' => __('Delete all data during uninstall', 'tutor'),
|
110 |
+
),
|
111 |
+
)
|
112 |
+
)
|
113 |
+
),
|
114 |
+
),
|
115 |
+
'course' => array(
|
116 |
+
'label' => __('Course', 'tutor'),
|
117 |
+
'sections' => array(
|
118 |
+
'general' => array(
|
119 |
+
'label' => __('General', 'tutor'),
|
120 |
+
'desc' => __('Course Settings', 'tutor'),
|
121 |
+
'fields' => array(
|
122 |
+
'display_course_instructors' => array(
|
123 |
+
'type' => 'checkbox',
|
124 |
+
'label' => __('Display instructors profile', 'tutor'),
|
125 |
+
'label_title' => __('Show the instructor profile on course single page.', 'tutor'),
|
126 |
+
),
|
127 |
+
'enable_q_and_a_on_course' => array(
|
128 |
+
'type' => 'checkbox',
|
129 |
+
'label' => __('Enable Q & A on course', 'tutor'),
|
130 |
+
'default' => '0',
|
131 |
+
'desc' => __('Allow student to place their questions and answers on the course page, only enrolled student can do this', 'tutor'),
|
132 |
+
),
|
133 |
+
),
|
134 |
+
),
|
135 |
+
'archive' => array(
|
136 |
+
'label' => __('Archive', 'tutor'),
|
137 |
+
'desc' => __('Course Archive Settings', 'tutor'),
|
138 |
+
'fields' => array(
|
139 |
+
'course_archive_page' => array(
|
140 |
+
'type' => 'select',
|
141 |
+
'label' => __('Course Archive Page', 'tutor'),
|
142 |
+
'default' => '0',
|
143 |
+
'options' => $pages,
|
144 |
+
'desc' => __('Choose the page from the dropdown list where you want to show all of the courses', 'tutor'),
|
145 |
+
),
|
146 |
+
'courses_col_per_row' => array(
|
147 |
+
'type' => 'slider',
|
148 |
+
'label' => __('Column per row', 'tutor'),
|
149 |
+
'default' => '4',
|
150 |
+
'options' => array('min'=> 1, 'max' => 6),
|
151 |
+
'desc' => __('Define how many column you want to show on the course single page', 'tutor'),
|
152 |
+
),
|
153 |
+
'courses_per_page' => array(
|
154 |
+
'type' => 'slider',
|
155 |
+
'label' => __('Courses Per Page', 'tutor'),
|
156 |
+
'default' => '12',
|
157 |
+
'options' => array('min'=> 1, 'max' => 20),
|
158 |
+
'desc' => __('Define how many courses you want to show per page', 'tutor'),
|
159 |
+
),
|
160 |
+
),
|
161 |
+
),
|
162 |
+
),
|
163 |
+
),
|
164 |
+
'lesson' => array(
|
165 |
+
'label' => __('Lessons', 'tutor'),
|
166 |
+
'sections' => array(
|
167 |
+
'lesson_settings' => array(
|
168 |
+
'label' => __('Lesson Settings', 'tutor'),
|
169 |
+
'desc' => __('Lesson settings will be here', 'tutor'),
|
170 |
+
'fields' => array(
|
171 |
+
'lesson_permalink_base' => array(
|
172 |
+
'type' => 'text',
|
173 |
+
'label' => __('Lesson Permalink Base', 'tutor'),
|
174 |
+
'default' => 'lessons',
|
175 |
+
'desc' => $lesson_url,
|
176 |
+
),
|
177 |
+
|
178 |
+
),
|
179 |
+
|
180 |
+
),
|
181 |
+
|
182 |
+
),
|
183 |
+
),
|
184 |
+
'quiz' => array(
|
185 |
+
'label' => __('Quiz', 'tutor'),
|
186 |
+
'sections' => array(
|
187 |
+
'general' => array(
|
188 |
+
'label' => __('Quiz', 'tutor'),
|
189 |
+
'desc' => __('The values you set here define the default values that are used in the settings form when you create a new quiz.', 'tutor'),
|
190 |
+
'fields' => array(
|
191 |
+
'quiz_time_limit' => array(
|
192 |
+
'type' => 'group_fields',
|
193 |
+
'label' => __('Time Limit', 'tutor'),
|
194 |
+
'desc' => __('Default time limit for quizzes. 0 means no time limit.', 'tutor'),
|
195 |
+
'group_fields' => array(
|
196 |
+
'value' => array(
|
197 |
+
'type' => 'text',
|
198 |
+
'default' => '0',
|
199 |
+
),
|
200 |
+
'time' => array(
|
201 |
+
'type' => 'select',
|
202 |
+
'default' => 'minutes',
|
203 |
+
'select_options' => false,
|
204 |
+
'options' => array(
|
205 |
+
'weeks' => __('Weeks', 'tutor'),
|
206 |
+
'days' => __('Days', 'tutor'),
|
207 |
+
'hours' => __('Hours', 'tutor'),
|
208 |
+
'minutes' => __('Minutes', 'tutor'),
|
209 |
+
'seconds' => __('Seconds', 'tutor'),
|
210 |
+
),
|
211 |
+
),
|
212 |
+
),
|
213 |
+
),
|
214 |
+
|
215 |
+
'quiz_when_time_expires' => array(
|
216 |
+
'type' => 'select',
|
217 |
+
'label' => __('When time expires', 'tutor'),
|
218 |
+
'default' => 'minutes',
|
219 |
+
'select_options' => false,
|
220 |
+
'options' => array(
|
221 |
+
'autosubmit' => __('Current attempts are submitted automatically', 'tutor'),
|
222 |
+
'graceperiod' => __('There is a grace period when current attempts can be submitted, but no more questions answered', 'tutor'),
|
223 |
+
'autoabandon' => __('Attempts must be submitted before time expires, otherwise they will not be counted', 'tutor'),
|
224 |
+
),
|
225 |
+
'desc' => __('What should happen by default if a student does not submit the quiz before time expires.', 'tutor'),
|
226 |
+
),
|
227 |
+
|
228 |
+
'quiz_attempts_allowed' => array(
|
229 |
+
'type' => 'slider',
|
230 |
+
'label' => __('Attempts allowed', 'tutor'),
|
231 |
+
'default' => '10',
|
232 |
+
'options' => array('min'=> 0, 'max' => 20),
|
233 |
+
'desc' => __('Restriction on the number of attempts students are allowed to take for a quiz. 0 for no limit', 'tutor'),
|
234 |
+
),
|
235 |
+
|
236 |
+
'quiz_grade_method' => array(
|
237 |
+
'type' => 'select',
|
238 |
+
'label' => __('Grading method', 'tutor'),
|
239 |
+
'default' => 'minutes',
|
240 |
+
'select_options' => false,
|
241 |
+
'options' => array(
|
242 |
+
'highest_grade' => __('Highest Grade', 'tutor'),
|
243 |
+
'average_grade' => __('Average Grade', 'tutor'),
|
244 |
+
'first_attempt' => __('First Attempt', 'tutor'),
|
245 |
+
'last_attempt' => __('Last Attempt', 'tutor'),
|
246 |
+
),
|
247 |
+
'desc' => __('When multiple attempts are allowed, which method should be used to calculate a student\'s final grade for the quiz.', 'tutor'),
|
248 |
+
),
|
249 |
+
)
|
250 |
+
)
|
251 |
+
),
|
252 |
+
),
|
253 |
+
'instructors' => array(
|
254 |
+
'label' => __('Instructors', 'tutor'),
|
255 |
+
'sections' => array(
|
256 |
+
'general' => array(
|
257 |
+
'label' => __('Instructor Profile Settings', 'tutor'),
|
258 |
+
'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
|
259 |
+
'fields' => array(
|
260 |
+
'instructor_register_page' => array(
|
261 |
+
'type' => 'select',
|
262 |
+
'label' => __('Instructor Register Page', 'tutor'),
|
263 |
+
'default' => '0',
|
264 |
+
'options' => $pages,
|
265 |
+
'desc' => __('This will be instructor register page', 'tutor'),
|
266 |
+
),
|
267 |
+
'instructor_can_publish_course' => array(
|
268 |
+
'type' => 'checkbox',
|
269 |
+
'label' => __('Can publish course', 'tutor'),
|
270 |
+
'default' => '0',
|
271 |
+
'desc' => __('Define if a instructor can publish his courses directly or not, if unchecked, they can still add courses, but it will go to admin for review', 'tutor'),
|
272 |
+
),
|
273 |
+
),
|
274 |
+
),
|
275 |
+
),
|
276 |
+
),
|
277 |
+
|
278 |
+
'students' => array(
|
279 |
+
'label' => __('Students', 'tutor'),
|
280 |
+
'sections' => array(
|
281 |
+
'general' => array(
|
282 |
+
'label' => __('Student Profile settings', 'tutor'),
|
283 |
+
'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
|
284 |
+
'fields' => array(
|
285 |
+
'student_register_page' => array(
|
286 |
+
'type' => 'select',
|
287 |
+
'label' => __('Student Register Page', 'tutor'),
|
288 |
+
'default' => '0',
|
289 |
+
'options' => $pages,
|
290 |
+
'desc' => __('Choose the page for student registration page', 'tutor'),
|
291 |
+
),
|
292 |
+
'student_dashboard' => array(
|
293 |
+
'type' => 'select',
|
294 |
+
'label' => __('Student Dashboard', 'tutor'),
|
295 |
+
'default' => '0',
|
296 |
+
'options' => $pages,
|
297 |
+
'desc' => __('This page will show students related stuff, like my courses, order, etc', 'tutor'),
|
298 |
+
),
|
299 |
+
|
300 |
+
'students_own_review_show_at_profile' => array(
|
301 |
+
'type' => 'checkbox',
|
302 |
+
'label' => __('Show reviews on profile', 'tutor'),
|
303 |
+
'label_title' => __('Enable students review on their profile', 'tutor'),
|
304 |
+
'default' => '0',
|
305 |
+
'desc' => __('Enabling this will allow the reviews written by each individual students on their profile', 'tutor')."<br />" .$student_url,
|
306 |
+
),
|
307 |
+
'show_courses_completed_by_student' => array(
|
308 |
+
'type' => 'checkbox',
|
309 |
+
'label' => __('Show Completed Course', 'tutor'),
|
310 |
+
'default' => '0',
|
311 |
+
'desc' => __('Completed courses will be show on student profile', 'tutor')."<br />".$student_url,
|
312 |
+
),
|
313 |
+
|
314 |
+
),
|
315 |
+
),
|
316 |
+
),
|
317 |
+
),
|
318 |
+
|
319 |
+
|
320 |
+
);
|
321 |
+
|
322 |
+
return apply_filters('tutor/options/attr', $attr);
|
323 |
+
}
|
324 |
+
|
325 |
+
|
326 |
+
/**
|
327 |
+
* @param array $field
|
328 |
+
*
|
329 |
+
* @return string
|
330 |
+
*
|
331 |
+
* Generate Option Field
|
332 |
+
*/
|
333 |
+
public function generate_field($field = array()){
|
334 |
+
ob_start();
|
335 |
+
include tutor()->path.'views/options/option_field.php';
|
336 |
+
return ob_get_clean();
|
337 |
+
}
|
338 |
+
|
339 |
+
public function field_type($field = array()){
|
340 |
+
ob_start();
|
341 |
+
include tutor()->path."views/options/field-types/{$field['type']}.php";
|
342 |
+
return ob_get_clean();
|
343 |
+
}
|
344 |
+
|
345 |
+
public function generate(){
|
346 |
+
ob_start();
|
347 |
+
include tutor()->path.'views/options/options_generator.php';
|
348 |
+
return ob_get_clean();
|
349 |
+
}
|
350 |
+
|
351 |
+
|
352 |
+
|
353 |
+
}
|
classes/Post_types.php
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
if ( ! defined( 'ABSPATH' ) )
|
4 |
+
exit;
|
5 |
+
|
6 |
+
class Post_types{
|
7 |
+
|
8 |
+
public $course_post_type;
|
9 |
+
public $lesson_post_type;
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
$this->course_post_type = tutor()->course_post_type;
|
13 |
+
$this->lesson_post_type = tutor()->lesson_post_type;
|
14 |
+
|
15 |
+
add_action( 'init', array($this, 'register_course_post_types') );
|
16 |
+
add_action( 'init', array($this, 'register_lesson_post_types') );
|
17 |
+
//add_action( 'init', array($this, 'register_quiz_post_types') );
|
18 |
+
//add_action( 'init', array($this, 'register_quiz_question_post_types') );
|
19 |
+
}
|
20 |
+
|
21 |
+
public function register_course_post_types() {
|
22 |
+
$labels = array(
|
23 |
+
'name' => _x( 'Courses', 'post type general name', 'tutor' ),
|
24 |
+
'singular_name' => _x( 'Course', 'post type singular name', 'tutor' ),
|
25 |
+
'menu_name' => _x( 'Courses', 'admin menu', 'tutor' ),
|
26 |
+
'name_admin_bar' => _x( 'Course', 'add new on admin bar', 'tutor' ),
|
27 |
+
'add_new' => _x( 'Add New', $this->course_post_type, 'tutor' ),
|
28 |
+
'add_new_item' => __( 'Add New Course', 'tutor' ),
|
29 |
+
'new_item' => __( 'New Course', 'tutor' ),
|
30 |
+
'edit_item' => __( 'Edit Course', 'tutor' ),
|
31 |
+
'view_item' => __( 'View Course', 'tutor' ),
|
32 |
+
'all_items' => __( 'Courses', 'tutor' ),
|
33 |
+
'search_items' => __( 'Search Courses', 'tutor' ),
|
34 |
+
'parent_item_colon' => __( 'Parent Courses:', 'tutor' ),
|
35 |
+
'not_found' => __( 'No courses found.', 'tutor' ),
|
36 |
+
'not_found_in_trash' => __( 'No courses found in Trash.', 'tutor' )
|
37 |
+
);
|
38 |
+
|
39 |
+
$args = array(
|
40 |
+
'labels' => $labels,
|
41 |
+
'description' => __( 'Description.', 'tutor' ),
|
42 |
+
'public' => true,
|
43 |
+
'publicly_queryable' => true,
|
44 |
+
'show_ui' => true,
|
45 |
+
'show_in_menu' => 'tutor',
|
46 |
+
'query_var' => true,
|
47 |
+
'rewrite' => array( 'slug' => $this->course_post_type ),
|
48 |
+
'menu_icon' => 'dashicons-book-alt',
|
49 |
+
'capability_type' => 'post',
|
50 |
+
'has_archive' => true,
|
51 |
+
'hierarchical' => false,
|
52 |
+
'menu_position' => null,
|
53 |
+
'taxonomies' => array( 'course-category', 'course-tag' ),
|
54 |
+
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt'),
|
55 |
+
|
56 |
+
'capabilities' => array(
|
57 |
+
'edit_post' => 'edit_tutor_course',
|
58 |
+
'read_post' => 'read_tutor_course',
|
59 |
+
'delete_post' => 'delete_tutor_course',
|
60 |
+
'delete_posts' => 'delete_tutor_courses',
|
61 |
+
'edit_posts' => 'edit_tutor_courses',
|
62 |
+
'edit_others_posts' => 'edit_others_tutor_courses',
|
63 |
+
'publish_posts' => 'publish_tutor_courses',
|
64 |
+
'read_private_posts' => 'read_private_tutor_courses',
|
65 |
+
'create_posts' => 'edit_tutor_courses',
|
66 |
+
),
|
67 |
+
);
|
68 |
+
|
69 |
+
register_post_type($this->course_post_type, $args);
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Taxonomy
|
73 |
+
*/
|
74 |
+
$labels = array(
|
75 |
+
'name' => _x( 'Categories', 'taxonomy general name', 'tutor' ),
|
76 |
+
'singular_name' => _x( 'Category', 'taxonomy singular name', 'tutor' ),
|
77 |
+
'search_items' => __( 'Search Categories', 'tutor' ),
|
78 |
+
'popular_items' => __( 'Popular Categories', 'tutor' ),
|
79 |
+
'all_items' => __( 'All Categories', 'tutor' ),
|
80 |
+
'parent_item' => null,
|
81 |
+
'parent_item_colon' => null,
|
82 |
+
'edit_item' => __( 'Edit Category', 'tutor' ),
|
83 |
+
'update_item' => __( 'Update Category', 'tutor' ),
|
84 |
+
'add_new_item' => __( 'Add New Category', 'tutor' ),
|
85 |
+
'new_item_name' => __( 'New Category Name', 'tutor' ),
|
86 |
+
'separate_items_with_commas' => __( 'Separate categories with commas', 'tutor' ),
|
87 |
+
'add_or_remove_items' => __( 'Add or remove categories', 'tutor' ),
|
88 |
+
'choose_from_most_used' => __( 'Choose from the most used categories', 'tutor' ),
|
89 |
+
'not_found' => __( 'No categories found.', 'tutor' ),
|
90 |
+
'menu_name' => __( 'Categories', 'tutor' ),
|
91 |
+
);
|
92 |
+
|
93 |
+
$args = array(
|
94 |
+
'hierarchical' => true,
|
95 |
+
'labels' => $labels,
|
96 |
+
'show_ui' => true,
|
97 |
+
'show_admin_column' => true,
|
98 |
+
'update_count_callback' => '_update_post_term_count',
|
99 |
+
'query_var' => true,
|
100 |
+
'rewrite' => array( 'slug' => 'course-category' ),
|
101 |
+
);
|
102 |
+
|
103 |
+
register_taxonomy( 'course-category', $this->course_post_type, $args );
|
104 |
+
|
105 |
+
$labels = array(
|
106 |
+
'name' => _x( 'Tags', 'taxonomy general name', 'tutor' ),
|
107 |
+
'singular_name' => _x( 'Tag', 'taxonomy singular name', 'tutor' ),
|
108 |
+
'search_items' => __( 'Search Tags', 'tutor' ),
|
109 |
+
'popular_items' => __( 'Popular Tags', 'tutor' ),
|
110 |
+
'all_items' => __( 'All Tags', 'tutor' ),
|
111 |
+
'parent_item' => null,
|
112 |
+
'parent_item_colon' => null,
|
113 |
+
'edit_item' => __( 'Edit Tag', 'tutor' ),
|
114 |
+
'update_item' => __( 'Update Tag', 'tutor' ),
|
115 |
+
'add_new_item' => __( 'Add New Tag', 'tutor' ),
|
116 |
+
'new_item_name' => __( 'New Tag Name', 'tutor' ),
|
117 |
+
'separate_items_with_commas' => __( 'Separate tags with commas', 'tutor' ),
|
118 |
+
'add_or_remove_items' => __( 'Add or remove tags', 'tutor' ),
|
119 |
+
'choose_from_most_used' => __( 'Choose from the most used tags', 'tutor' ),
|
120 |
+
'not_found' => __( 'No tags found.', 'tutor' ),
|
121 |
+
'menu_name' => __( 'Tags', 'tutor' ),
|
122 |
+
);
|
123 |
+
|
124 |
+
$args = array(
|
125 |
+
'hierarchical' => false,
|
126 |
+
'labels' => $labels,
|
127 |
+
'show_ui' => true,
|
128 |
+
'show_admin_column' => true,
|
129 |
+
'update_count_callback' => '_update_post_term_count',
|
130 |
+
'query_var' => true,
|
131 |
+
'rewrite' => array( 'slug' => 'course-tag' ),
|
132 |
+
);
|
133 |
+
|
134 |
+
register_taxonomy( 'course-tag', $this->course_post_type, $args );
|
135 |
+
}
|
136 |
+
|
137 |
+
public function register_lesson_post_types() {
|
138 |
+
$labels = array(
|
139 |
+
'name' => _x( 'Lessons', 'post type general name', 'tutor' ),
|
140 |
+
'singular_name' => _x( 'Lesson', 'post type singular name', 'tutor' ),
|
141 |
+
'menu_name' => _x( 'Lessons', 'admin menu', 'tutor' ),
|
142 |
+
'name_admin_bar' => _x( 'Lesson', 'add new on admin bar', 'tutor' ),
|
143 |
+
'add_new' => _x( 'Add New', $this->lesson_post_type, 'tutor' ),
|
144 |
+
'add_new_item' => __( 'Add New Lesson', 'tutor' ),
|
145 |
+
'new_item' => __( 'New Lesson', 'tutor' ),
|
146 |
+
'edit_item' => __( 'Edit Lesson', 'tutor' ),
|
147 |
+
'view_item' => __( 'View Lesson', 'tutor' ),
|
148 |
+
'all_items' => __( 'Lessons', 'tutor' ),
|
149 |
+
'search_items' => __( 'Search Lessons', 'tutor' ),
|
150 |
+
'parent_item_colon' => __( 'Parent Lessons:', 'tutor' ),
|
151 |
+
'not_found' => __( 'No lessons found.', 'tutor' ),
|
152 |
+
'not_found_in_trash' => __( 'No lessons found in Trash.', 'tutor' )
|
153 |
+
);
|
154 |
+
|
155 |
+
$args = array(
|
156 |
+
'labels' => $labels,
|
157 |
+
'description' => __( 'Description.', 'tutor' ),
|
158 |
+
'public' => true,
|
159 |
+
'publicly_queryable' => true,
|
160 |
+
'show_ui' => true,
|
161 |
+
'show_in_menu' => 'tutor',
|
162 |
+
'query_var' => true,
|
163 |
+
'rewrite' => array( 'slug' => $this->lesson_post_type ),
|
164 |
+
'menu_icon' => 'dashicons-list-view',
|
165 |
+
'capability_type' => 'post',
|
166 |
+
'has_archive' => true,
|
167 |
+
'hierarchical' => false,
|
168 |
+
'menu_position' => null,
|
169 |
+
'supports' => array( 'title', 'editor', 'thumbnail'),
|
170 |
+
'capabilities' => array(
|
171 |
+
'edit_post' => 'edit_tutor_lesson',
|
172 |
+
'read_post' => 'read_tutor_lesson',
|
173 |
+
'delete_post' => 'delete_tutor_lesson',
|
174 |
+
'delete_posts' => 'delete_tutor_lessons',
|
175 |
+
'edit_posts' => 'edit_tutor_lessons',
|
176 |
+
'edit_others_posts' => 'edit_others_tutor_lessons',
|
177 |
+
'publish_posts' => 'publish_tutor_lessons',
|
178 |
+
'read_private_posts' => 'read_private_tutor_lessons',
|
179 |
+
'create_posts' => 'edit_tutor_lessons',
|
180 |
+
),
|
181 |
+
);
|
182 |
+
|
183 |
+
register_post_type( $this->lesson_post_type, $args );
|
184 |
+
}
|
185 |
+
|
186 |
+
public function register_quiz_post_types() {
|
187 |
+
$labels = array(
|
188 |
+
'name' => _x( 'Quizzes', 'post type general name', 'tutor' ),
|
189 |
+
'singular_name' => _x( 'Quiz', 'post type singular name', 'tutor' ),
|
190 |
+
'menu_name' => _x( 'Quizzes', 'admin menu', 'tutor' ),
|
191 |
+
'name_admin_bar' => _x( 'Quiz', 'add new on admin bar', 'tutor' ),
|
192 |
+
'add_new' => _x( 'Add New', $this->lesson_post_type, 'tutor' ),
|
193 |
+
'add_new_item' => __( 'Add New Quiz', 'tutor' ),
|
194 |
+
'new_item' => __( 'New Quiz', 'tutor' ),
|
195 |
+
'edit_item' => __( 'Edit Quiz', 'tutor' ),
|
196 |
+
'view_item' => __( 'View Quiz', 'tutor' ),
|
197 |
+
'all_items' => __( 'Quizzes', 'tutor' ),
|
198 |
+
'search_items' => __( 'Search Quizzes', 'tutor' ),
|
199 |
+
'parent_item_colon' => __( 'Parent Quizzes:', 'tutor' ),
|
200 |
+
'not_found' => __( 'No quizzes found.', 'tutor' ),
|
201 |
+
'not_found_in_trash' => __( 'No quizzes found in Trash.', 'tutor' )
|
202 |
+
);
|
203 |
+
|
204 |
+
$args = array(
|
205 |
+
'labels' => $labels,
|
206 |
+
'description' => __( 'Description.', 'tutor' ),
|
207 |
+
'public' => true,
|
208 |
+
'publicly_queryable' => true,
|
209 |
+
'show_ui' => true,
|
210 |
+
'show_in_menu' => 'tutor',
|
211 |
+
'query_var' => true,
|
212 |
+
'rewrite' => array( 'slug' => $this->lesson_post_type ),
|
213 |
+
'menu_icon' => 'dashicons-editor-help',
|
214 |
+
'capability_type' => 'post',
|
215 |
+
'has_archive' => true,
|
216 |
+
'hierarchical' => false,
|
217 |
+
'menu_position' => null,
|
218 |
+
'supports' => array( 'title', 'editor'),
|
219 |
+
'capabilities' => array(
|
220 |
+
'edit_post' => 'edit_tutor_quiz',
|
221 |
+
'read_post' => 'read_tutor_quiz',
|
222 |
+
'delete_post' => 'delete_tutor_quiz',
|
223 |
+
'delete_posts' => 'delete_tutor_quizzes',
|
224 |
+
'edit_posts' => 'edit_tutor_quizzes',
|
225 |
+
'edit_others_posts' => 'edit_others_tutor_quizzes',
|
226 |
+
'publish_posts' => 'publish_tutor_quizzes',
|
227 |
+
'read_private_posts' => 'read_private_tutor_quizzes',
|
228 |
+
'create_posts' => 'edit_tutor_quizzes',
|
229 |
+
),
|
230 |
+
);
|
231 |
+
|
232 |
+
register_post_type( 'tutor_quiz', $args );
|
233 |
+
}
|
234 |
+
|
235 |
+
public function register_quiz_question_post_types() {
|
236 |
+
$labels = array(
|
237 |
+
'name' => _x( 'Questions', 'post type general name', 'tutor' ),
|
238 |
+
'singular_name' => _x( 'Question', 'post type singular name', 'tutor' ),
|
239 |
+
'menu_name' => _x( 'Questions', 'admin menu', 'tutor' ),
|
240 |
+
'name_admin_bar' => _x( 'Question', 'add new on admin bar', 'tutor' ),
|
241 |
+
'add_new' => _x( 'Add New', $this->lesson_post_type, 'tutor' ),
|
242 |
+
'add_new_item' => __( 'Add New Question', 'tutor' ),
|
243 |
+
'new_item' => __( 'New Question', 'tutor' ),
|
244 |
+
'edit_item' => __( 'Edit Question', 'tutor' ),
|
245 |
+
'view_item' => __( 'View Question', 'tutor' ),
|
246 |
+
'all_items' => __( 'Questions', 'tutor' ),
|
247 |
+
'search_items' => __( 'Search Questions', 'tutor' ),
|
248 |
+
'parent_item_colon' => __( 'Parent Questions:', 'tutor' ),
|
249 |
+
'not_found' => __( 'No questions found.', 'tutor' ),
|
250 |
+
'not_found_in_trash' => __( 'No questions found in Trash.', 'tutor' )
|
251 |
+
);
|
252 |
+
|
253 |
+
$args = array(
|
254 |
+
'labels' => $labels,
|
255 |
+
'description' => __( 'Description.', 'tutor' ),
|
256 |
+
'public' => true,
|
257 |
+
'publicly_queryable' => true,
|
258 |
+
'show_ui' => true,
|
259 |
+
'show_in_menu' => 'tutor',
|
260 |
+
'query_var' => true,
|
261 |
+
'rewrite' => array( 'slug' => $this->lesson_post_type ),
|
262 |
+
'menu_icon' => 'dashicons-editor-help',
|
263 |
+
'capability_type' => 'post',
|
264 |
+
'has_archive' => true,
|
265 |
+
'hierarchical' => false,
|
266 |
+
'menu_position' => null,
|
267 |
+
'supports' => array( ''),
|
268 |
+
'capabilities' => array(
|
269 |
+
'edit_post' => 'edit_tutor_question',
|
270 |
+
'read_post' => 'read_tutor_question',
|
271 |
+
'delete_post' => 'delete_tutor_question',
|
272 |
+
'delete_posts' => 'delete_tutor_questions',
|
273 |
+
'edit_posts' => 'edit_tutor_questions',
|
274 |
+
'edit_others_posts' => 'edit_others_tutor_questions',
|
275 |
+
'publish_posts' => 'publish_tutor_questions',
|
276 |
+
'read_private_posts' => 'read_private_tutor_questions',
|
277 |
+
'create_posts' => 'edit_tutor_questions',
|
278 |
+
),
|
279 |
+
);
|
280 |
+
|
281 |
+
register_post_type( 'tutor_question', $args );
|
282 |
+
}
|
283 |
+
}
|
classes/Q_and_A.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Q_and_A{
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
add_action('admin_post_tutor_place_answer', array($this, 'place_answer'));
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
public function place_answer(){
|
15 |
+
tutor_utils()->checking_nonce();
|
16 |
+
|
17 |
+
global $wpdb;
|
18 |
+
|
19 |
+
$answer = wp_kses_post($_POST['answer']);
|
20 |
+
$question_id = (int) sanitize_text_field($_POST['question_id']);
|
21 |
+
$question = tutor_utils()->get_qa_question($question_id);
|
22 |
+
|
23 |
+
$user_id = get_current_user_id();
|
24 |
+
$user = get_userdata($user_id);
|
25 |
+
$date = date("Y-m-d H:i:s");
|
26 |
+
|
27 |
+
do_action('tutor_before_answer_to_question');
|
28 |
+
|
29 |
+
$data = apply_filters('tutor_answer_to_question_data', array(
|
30 |
+
'comment_post_ID' => $question->comment_post_ID,
|
31 |
+
'comment_author' => $user->user_login,
|
32 |
+
'comment_date' => $date,
|
33 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
34 |
+
'comment_content' => $answer,
|
35 |
+
'comment_approved' => 'approved',
|
36 |
+
'comment_agent' => 'TutorLMSPlugin',
|
37 |
+
'comment_type' => 'tutor_q_and_a',
|
38 |
+
'comment_parent' => $question_id,
|
39 |
+
'user_id' => $user_id,
|
40 |
+
));
|
41 |
+
|
42 |
+
|
43 |
+
$wpdb->insert($wpdb->comments, $data);
|
44 |
+
$answer_id = (int) $wpdb->insert_id;
|
45 |
+
|
46 |
+
if ($answer_id){
|
47 |
+
$wpdb->update($wpdb->comments, array('comment_approved' => 'answered'), array('comment_ID' =>$question_id ) );
|
48 |
+
do_action('tutor_after_answer_to_question', $answer_id );
|
49 |
+
}
|
50 |
+
|
51 |
+
wp_redirect(wp_get_referer());
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
classes/Question.php
ADDED
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace TUTOR;
|
5 |
+
|
6 |
+
|
7 |
+
class Question {
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
11 |
+
//save question type during first add question
|
12 |
+
add_action('save_post_tutor_question', array($this, 'save_question_type'), 10, 1);
|
13 |
+
|
14 |
+
add_action('wp_ajax_quiz_page_add_new_question', array($this, 'quiz_page_add_new_question'));
|
15 |
+
add_action('wp_ajax_update_tutor_question', array($this, 'update_tutor_question'));
|
16 |
+
add_action('wp_ajax_quiz_add_answer_to_question', array($this, 'quiz_add_answer_to_question'));
|
17 |
+
add_action('wp_ajax_quiz_delete_answer_option', array($this, 'quiz_delete_answer_option'));
|
18 |
+
add_action('wp_ajax_quiz_question_type_changed', array($this, 'quiz_question_type_changed'));
|
19 |
+
add_action('wp_ajax_quiz_question_delete', array($this, 'quiz_question_delete'));
|
20 |
+
add_action('wp_ajax_sorting_quiz_questions', array($this, 'sorting_quiz_questions'));
|
21 |
+
|
22 |
+
|
23 |
+
add_filter( "manage_tutor_question_posts_columns", array($this, 'add_column'), 10,1 );
|
24 |
+
add_action( "manage_tutor_question_posts_custom_column" , array($this, 'custom_question_column'), 10, 2 );
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
public function register_meta_box(){
|
29 |
+
add_meta_box( 'tutor-question', __( 'Question', 'tutor' ), array($this, 'quiz_question'), 'tutor_question' );
|
30 |
+
}
|
31 |
+
|
32 |
+
public function save_question_type($post_ID){
|
33 |
+
$question_type = get_post_meta($post_ID, '_question_type', true);
|
34 |
+
if ( ! $question_type){
|
35 |
+
update_post_meta($post_ID, '_question_type', 'true_false');
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
public function quiz_question(){
|
40 |
+
global $post;
|
41 |
+
$question = $post;
|
42 |
+
|
43 |
+
$is_question_edit_page = true;
|
44 |
+
|
45 |
+
include tutor()->path."views/metabox/quiz/single-question-item.php";
|
46 |
+
}
|
47 |
+
|
48 |
+
public function quiz_questions(){
|
49 |
+
include tutor()->path.'views/metabox/quiz_questions.php';
|
50 |
+
}
|
51 |
+
|
52 |
+
public function quiz_page_add_new_question(){
|
53 |
+
global $wpdb;
|
54 |
+
|
55 |
+
$question_title = sanitize_text_field($_POST['question_title']);
|
56 |
+
$question_type = sanitize_text_field($_POST['question_type']);
|
57 |
+
$quiz_id = (int) sanitize_text_field($_POST['quiz_id']);
|
58 |
+
|
59 |
+
$question_html = '';
|
60 |
+
|
61 |
+
$next_question_order = tutor_utils()->quiz_next_question_order_id($quiz_id);
|
62 |
+
|
63 |
+
$post_arr = array(
|
64 |
+
'post_type' => 'tutor_question',
|
65 |
+
'post_title' => $question_title,
|
66 |
+
'post_status' => 'publish',
|
67 |
+
'post_author' => get_current_user_id(),
|
68 |
+
'post_parent' => $quiz_id,
|
69 |
+
'menu_order' => $next_question_order,
|
70 |
+
);
|
71 |
+
$question_id = wp_insert_post( $post_arr );
|
72 |
+
|
73 |
+
if ($question_id){
|
74 |
+
update_post_meta($question_id,'_question_type', $question_type);
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Insert True/False
|
78 |
+
*/
|
79 |
+
if ($question_type === 'true_false') {
|
80 |
+
$answer_option = array(
|
81 |
+
'answer_option_text' => __( 'True', 'tutor' ),
|
82 |
+
'is_correct' => '1',
|
83 |
+
);
|
84 |
+
$data = apply_filters( 'tutor_quiz_adding_answer_option_to_question', array(
|
85 |
+
'comment_post_ID' => $question_id,
|
86 |
+
'comment_content' => json_encode( $answer_option ),
|
87 |
+
'comment_approved' => 'approved',
|
88 |
+
'comment_agent' => 'TutorLMSPlugin',
|
89 |
+
'comment_type' => 'quiz_answer_option',
|
90 |
+
) );
|
91 |
+
$wpdb->insert( $wpdb->comments, $data );
|
92 |
+
|
93 |
+
$answer_option = array(
|
94 |
+
'answer_option_text' => __( 'False', 'tutor' ),
|
95 |
+
'is_correct' => '0',
|
96 |
+
);
|
97 |
+
$data = apply_filters( 'tutor_quiz_adding_answer_option_to_question', array(
|
98 |
+
'comment_post_ID' => $question_id,
|
99 |
+
'comment_content' => json_encode( $answer_option ),
|
100 |
+
'comment_approved' => 'approved',
|
101 |
+
'comment_agent' => 'TutorLMSPlugin',
|
102 |
+
'comment_type' => 'quiz_answer_option',
|
103 |
+
) );
|
104 |
+
$wpdb->insert( $wpdb->comments, $data );
|
105 |
+
}
|
106 |
+
|
107 |
+
ob_start();
|
108 |
+
$question = get_post($question_id);
|
109 |
+
include tutor()->path."views/metabox/quiz/single-question-item.php";
|
110 |
+
$question_html = ob_get_clean();
|
111 |
+
}
|
112 |
+
|
113 |
+
wp_send_json_success(array('question_html' => $question_html));
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
public function update_tutor_question(){
|
118 |
+
global $wpdb;
|
119 |
+
$questions = $_POST['tutor_question'];
|
120 |
+
|
121 |
+
if ( ! is_array($questions) || ! count($questions)){
|
122 |
+
wp_send_json_error();
|
123 |
+
}
|
124 |
+
|
125 |
+
//die(print_r($_POST['tutor_question']));
|
126 |
+
|
127 |
+
foreach ($questions as $question_ID => $question_data){
|
128 |
+
$title = sanitize_text_field(tutor_utils()->avalue_dot('question_title', $question_data));
|
129 |
+
$description = wp_kses_post(tutor_utils()->avalue_dot('question_description', $question_data));
|
130 |
+
|
131 |
+
$type = sanitize_text_field(tutor_utils()->avalue_dot('question_type', $question_data));
|
132 |
+
$mark = sanitize_text_field(tutor_utils()->avalue_dot('question_mark', $question_data));
|
133 |
+
$hints = sanitize_text_field(tutor_utils()->avalue_dot('question_hints', $question_data));
|
134 |
+
|
135 |
+
$post_arr = array(
|
136 |
+
'ID' => $question_ID,
|
137 |
+
'post_title' => $title,
|
138 |
+
'post_content' => $description,
|
139 |
+
);
|
140 |
+
wp_update_post($post_arr);
|
141 |
+
|
142 |
+
update_post_meta($question_ID, '_question_hints', $hints);
|
143 |
+
update_post_meta($question_ID, '_question_mark', $mark);
|
144 |
+
update_post_meta($question_ID, '_question_type', $type);
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Answer Option
|
148 |
+
*/
|
149 |
+
if ($type === 'true_false'){
|
150 |
+
//If true/false, reset answer
|
151 |
+
$previous_answers = tutor_utils()->get_quiz_answer_options_by_question($question_ID);
|
152 |
+
|
153 |
+
if ($previous_answers){
|
154 |
+
foreach ($previous_answers as $previous_answer){
|
155 |
+
$answer_content = json_decode($previous_answer->comment_content, true);
|
156 |
+
$answer_content['is_correct'] = '0';
|
157 |
+
$wpdb->update($wpdb->comments, array('comment_content' => json_encode($answer_content)), array('comment_ID' => $previous_answer->comment_ID) );
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
$answer_options = tutor_utils()->avalue_dot('answer_option', $question_data);
|
163 |
+
$answer_corrects = tutor_utils()->avalue_dot('answer_option_is_correct', $question_data);
|
164 |
+
|
165 |
+
if (is_array($answer_options) && count($answer_options)){
|
166 |
+
foreach ($answer_options as $answer_option_ID => $answer_option){
|
167 |
+
$is_correct = '0';
|
168 |
+
|
169 |
+
if ($type === 'multiple_choice'){
|
170 |
+
$is_correct = isset($answer_corrects[$answer_option_ID]) && $answer_corrects[$answer_option_ID] == '1' ? '1' : '0';
|
171 |
+
}elseif ($type === 'single_choice' || $type === 'true_false'){
|
172 |
+
$correct_answer_id = sanitize_text_field(tutor_utils()->avalue_dot('answer_option_is_correct', $question_data));
|
173 |
+
$is_correct = $correct_answer_id == $answer_option_ID ? '1' : '0';
|
174 |
+
}
|
175 |
+
|
176 |
+
$update_data = array(
|
177 |
+
'answer_option_text' => $answer_option,
|
178 |
+
'is_correct' => $is_correct,
|
179 |
+
);
|
180 |
+
$wpdb->update($wpdb->comments, array('comment_content' => json_encode($update_data)), array('comment_ID' =>$answer_option_ID ) );
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
wp_send_json_success();
|
186 |
+
}
|
187 |
+
|
188 |
+
public function quiz_add_answer_to_question(){
|
189 |
+
global $wpdb;
|
190 |
+
|
191 |
+
$question_id = (int) sanitize_text_field($_POST['question_id']);
|
192 |
+
$question_type = get_post_meta($question_id, '_question_type', true);
|
193 |
+
|
194 |
+
$answer_option = array(
|
195 |
+
'answer_option_text' => __('New answer option', 'tutor'),
|
196 |
+
'is_correct' => '0',
|
197 |
+
);
|
198 |
+
|
199 |
+
if ($question_type === 'true_false'){
|
200 |
+
$answer_option['answer_option_text'] = __('True/False', 'tutor');
|
201 |
+
}
|
202 |
+
|
203 |
+
$data = apply_filters('tutor_quiz_adding_answer_option_to_question', array(
|
204 |
+
'comment_post_ID' => $question_id,
|
205 |
+
'comment_content' => json_encode($answer_option),
|
206 |
+
'comment_approved' => 'approved',
|
207 |
+
'comment_agent' => 'TutorLMSPlugin',
|
208 |
+
'comment_type' => 'quiz_answer_option',
|
209 |
+
));
|
210 |
+
|
211 |
+
$wpdb->insert($wpdb->comments, $data);
|
212 |
+
$answer_option_id = (int) $wpdb->insert_id;
|
213 |
+
|
214 |
+
$quiz_answer_option = (object) array_merge(array('comment_ID' => $answer_option_id), $data );
|
215 |
+
|
216 |
+
ob_start();
|
217 |
+
include tutor()->path."views/metabox/quiz/individual-answer-option-{$question_type}-tr.php";
|
218 |
+
$answer_option_tr = ob_get_clean();
|
219 |
+
|
220 |
+
wp_send_json_success(array('data_tr' => $answer_option_tr));
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
public function quiz_delete_answer_option(){
|
225 |
+
global $wpdb;
|
226 |
+
$answer_option_id = (int) sanitize_text_field($_POST['answer_option_id']);
|
227 |
+
$wpdb->delete($wpdb->comments, array('comment_ID' => $answer_option_id));
|
228 |
+
wp_send_json_success();
|
229 |
+
}
|
230 |
+
|
231 |
+
public function quiz_question_type_changed(){
|
232 |
+
global $wpdb;
|
233 |
+
|
234 |
+
$question_id = (int) sanitize_text_field($_POST['question_id']);
|
235 |
+
$question_type = sanitize_text_field($_POST['question_type']);
|
236 |
+
|
237 |
+
$question = get_post($question_id);
|
238 |
+
|
239 |
+
/**
|
240 |
+
* If we found true false type, we will keep only 2 answer options
|
241 |
+
*/
|
242 |
+
|
243 |
+
if ($question_type === 'true_false'){
|
244 |
+
$quiz_answer_options = tutor_utils()->get_quiz_answer_options_by_question($question->ID);
|
245 |
+
$quiz_answer_options = array_slice($quiz_answer_options, 0, 2);
|
246 |
+
|
247 |
+
$keep_answer_ids = wp_list_pluck($quiz_answer_options, 'comment_ID');
|
248 |
+
$keep_answer_ids = implode( ',', array_map( 'absint', $keep_answer_ids ) );
|
249 |
+
$wpdb->query( "DELETE FROM {$wpdb->comments} WHERE comment_post_ID = {$question_id} AND comment_type = 'quiz_answer_option' AND comment_ID NOT IN($keep_answer_ids)" );
|
250 |
+
}
|
251 |
+
|
252 |
+
ob_start();
|
253 |
+
include tutor()->path."views/metabox/quiz/multi-answer-options.php";
|
254 |
+
$answer_options = ob_get_clean();
|
255 |
+
|
256 |
+
wp_send_json_success(array('multi_answer_options' =>$answer_options ));
|
257 |
+
}
|
258 |
+
|
259 |
+
public function quiz_question_delete(){
|
260 |
+
global $wpdb;
|
261 |
+
|
262 |
+
$question_id = (int) sanitize_text_field($_POST['question_id']);
|
263 |
+
wp_delete_post($question_id, true);
|
264 |
+
|
265 |
+
wp_send_json_success();
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Sorting Order
|
270 |
+
*/
|
271 |
+
|
272 |
+
public function sorting_quiz_questions(){
|
273 |
+
global $wpdb;
|
274 |
+
$questions = tutor_utils()->avalue_dot('questions', $_POST);
|
275 |
+
$question_ids = wp_list_pluck($questions, 'question_id');
|
276 |
+
|
277 |
+
$i = 1;
|
278 |
+
foreach ($question_ids as $question_id){
|
279 |
+
$wpdb->update($wpdb->posts, array('menu_order' => $i), array('ID'=> $question_id) );
|
280 |
+
$i++;
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
public function add_column($columns){
|
285 |
+
$date_col = $columns['date'];
|
286 |
+
unset($columns['date']);
|
287 |
+
$columns['quiz'] = __('Quiz', 'tutor');
|
288 |
+
$columns['date'] = $date_col;
|
289 |
+
|
290 |
+
return $columns;
|
291 |
+
}
|
292 |
+
|
293 |
+
public function custom_question_column($column, $post_id ){
|
294 |
+
if ($column === 'quiz'){
|
295 |
+
$quiz_id = tutor_utils()->get_quiz_id_by_question($post_id);
|
296 |
+
|
297 |
+
if ($quiz_id){
|
298 |
+
echo '<a href="'.admin_url('post.php?post='.$quiz_id.'&action=edit').'">'.get_the_title($quiz_id).'</a>';
|
299 |
+
}
|
300 |
+
}
|
301 |
+
}
|
302 |
+
|
303 |
+
}
|
classes/Question_Answers_List.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
if (! class_exists('Tutor_List_Table')){
|
8 |
+
include_once tutor()->path.'classes/Tutor_List_Table.php';
|
9 |
+
}
|
10 |
+
|
11 |
+
class Question_Answers_List extends \Tutor_List_Table {
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
global $status, $page;
|
15 |
+
|
16 |
+
//Set parent defaults
|
17 |
+
parent::__construct( array(
|
18 |
+
'singular' => 'question', //singular name of the listed records
|
19 |
+
'plural' => 'questions', //plural name of the listed records
|
20 |
+
'ajax' => false //does this table support ajax?
|
21 |
+
) );
|
22 |
+
}
|
23 |
+
|
24 |
+
function column_default($item, $column_name){
|
25 |
+
switch($column_name){
|
26 |
+
case 'user_email':
|
27 |
+
case 'display_name':
|
28 |
+
case 'post_title':
|
29 |
+
case 'answer_count':
|
30 |
+
return $item->$column_name;
|
31 |
+
default:
|
32 |
+
return print_r($item,true); //Show the whole array for troubleshooting purposes
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
function column_question($item){
|
37 |
+
//Build row actions
|
38 |
+
$actions = array(
|
39 |
+
//'edit' => sprintf('<a href="?page=%s&action=%s&instructor=%s">Edit</a>',$_REQUEST['page'],'edit',$item->comment_ID),
|
40 |
+
//'delete' => sprintf('<a href="?page=%s&action=%s&instructor=%s">Delete</a>',$_REQUEST['page'],'delete',$item->comment_ID),
|
41 |
+
);
|
42 |
+
|
43 |
+
$actions['answer'] = sprintf('<a href="?page=%s&sub_page=%s&question_id=%s">Answer</a>',$_REQUEST['page'],'answer',$item->comment_ID);
|
44 |
+
//$actions['delete'] = sprintf('<a href="?page=%s&action=%s&question_id=%s">Delete</a>',$_REQUEST['page'],'delete',$item->comment_ID);
|
45 |
+
|
46 |
+
//Return the title contents
|
47 |
+
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
48 |
+
$item->comment_content,
|
49 |
+
$item->comment_ID,
|
50 |
+
$this->row_actions($actions)
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
function column_cb($item){
|
55 |
+
return sprintf(
|
56 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
57 |
+
/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("instructor")
|
58 |
+
/*$2%s*/ $item->comment_ID //The value of the checkbox should be the record's id
|
59 |
+
);
|
60 |
+
}
|
61 |
+
|
62 |
+
function column_course($item) {
|
63 |
+
|
64 |
+
return $item->comment_ID;
|
65 |
+
}
|
66 |
+
|
67 |
+
function get_columns(){
|
68 |
+
$columns = array(
|
69 |
+
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
|
70 |
+
'question' => __('Question', 'tutor'),
|
71 |
+
'display_name' => __('Student', 'tutor'),
|
72 |
+
'post_title' => __('Course', 'tutor'),
|
73 |
+
'answer_count' => __('Answer', 'tutor'),
|
74 |
+
);
|
75 |
+
return $columns;
|
76 |
+
}
|
77 |
+
|
78 |
+
function get_sortable_columns() {
|
79 |
+
$sortable_columns = array(
|
80 |
+
//'display_name' => array('title',false), //true means it's already sorted
|
81 |
+
);
|
82 |
+
return $sortable_columns;
|
83 |
+
}
|
84 |
+
|
85 |
+
function get_bulk_actions() {
|
86 |
+
$actions = array(
|
87 |
+
'delete' => 'Delete'
|
88 |
+
);
|
89 |
+
return $actions;
|
90 |
+
}
|
91 |
+
|
92 |
+
function process_bulk_action() {
|
93 |
+
global $wpdb;
|
94 |
+
|
95 |
+
//Detect when a bulk action is being triggered...
|
96 |
+
if( 'delete' === $this->current_action() ) {
|
97 |
+
if ( empty($_GET['question']) || ! is_array($_GET['question'])){
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
$question_ids = array_map('sanitize_text_field', $_GET['question']);
|
102 |
+
$question_ids = implode( ',', array_map( 'absint', $question_ids ) );
|
103 |
+
|
104 |
+
//Deleting question (comment), child question and question meta (comment meta)
|
105 |
+
$wpdb->query( "DELETE FROM {$wpdb->comments} WHERE {$wpdb->comments}.comment_ID IN($question_ids)" );
|
106 |
+
$wpdb->query( "DELETE FROM {$wpdb->comments} WHERE {$wpdb->comments}.comment_parent IN($question_ids)" );
|
107 |
+
$wpdb->query( "DELETE FROM {$wpdb->commentmeta} WHERE {$wpdb->commentmeta}.comment_id IN($question_ids)" );
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
function prepare_items() {
|
112 |
+
$per_page = 20;
|
113 |
+
|
114 |
+
$search_term = '';
|
115 |
+
if (isset($_REQUEST['s'])){
|
116 |
+
$search_term = sanitize_text_field($_REQUEST['s']);
|
117 |
+
}
|
118 |
+
|
119 |
+
$columns = $this->get_columns();
|
120 |
+
$hidden = array();
|
121 |
+
$sortable = $this->get_sortable_columns();
|
122 |
+
|
123 |
+
$this->_column_headers = array($columns, $hidden, $sortable);
|
124 |
+
$this->process_bulk_action();
|
125 |
+
|
126 |
+
$current_page = $this->get_pagenum();
|
127 |
+
|
128 |
+
$total_items = tutor_utils()->get_total_qa_question($search_term);
|
129 |
+
$this->items = tutor_utils()->get_qa_questions(($current_page-1)*$per_page, $per_page, $search_term);
|
130 |
+
|
131 |
+
$this->set_pagination_args( array(
|
132 |
+
'total_items' => $total_items,
|
133 |
+
'per_page' => $per_page,
|
134 |
+
'total_pages' => ceil($total_items/$per_page)
|
135 |
+
) );
|
136 |
+
}
|
137 |
+
}
|
classes/Quiz.php
ADDED
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Quize class
|
5 |
+
*
|
6 |
+
* @author: themeum
|
7 |
+
* @author_uri: https://themeum.com
|
8 |
+
* @package Tutor
|
9 |
+
* @since v.1.0.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace TUTOR;
|
13 |
+
|
14 |
+
if ( ! defined( 'ABSPATH' ) )
|
15 |
+
exit;
|
16 |
+
|
17 |
+
class Quiz {
|
18 |
+
|
19 |
+
public function __construct() {
|
20 |
+
add_filter( "manage_tutor_quiz_posts_columns", array($this, 'add_column'), 10,1 );
|
21 |
+
add_action( "manage_tutor_quiz_posts_custom_column" , array($this, 'custom_question_column'), 10, 2 );
|
22 |
+
|
23 |
+
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
24 |
+
add_action('save_post_tutor_quiz', array($this, 'save_quiz_meta'));
|
25 |
+
|
26 |
+
add_action('wp_ajax_tutor_load_quiz_modal', array($this, 'tutor_load_quiz_modal'));
|
27 |
+
add_action('wp_ajax_tutor_add_quiz_to_post', array($this, 'tutor_add_quiz_to_post'));
|
28 |
+
add_action('wp_ajax_remove_quiz_from_post', array($this, 'remove_quiz_from_post'));
|
29 |
+
|
30 |
+
add_action('wp_ajax_tutor_quiz_timeout', array($this, 'tutor_quiz_timeout'));
|
31 |
+
|
32 |
+
//User take the quiz
|
33 |
+
add_action('template_redirect', array($this, 'start_the_quiz'));
|
34 |
+
add_action('template_redirect', array($this, 'answering_quiz'));
|
35 |
+
add_action('template_redirect', array($this, 'finishing_quiz_attempt'));
|
36 |
+
|
37 |
+
add_action('admin_action_review_quiz_answer', array($this, 'review_quiz_answer'));
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
public function add_column($columns){
|
43 |
+
$date_col = $columns['date'];
|
44 |
+
unset($columns['date']);
|
45 |
+
$columns['quiz'] = __('Course', 'tutor');
|
46 |
+
$columns['questions'] = __('Questions', 'tutor');
|
47 |
+
$columns['date'] = $date_col;
|
48 |
+
|
49 |
+
return $columns;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function custom_question_column($column, $post_id ){
|
53 |
+
if ($column === 'quiz'){
|
54 |
+
$quiz = tutor_utils()->get_course_by_quiz($post_id);
|
55 |
+
|
56 |
+
if ($quiz){
|
57 |
+
echo '<a href="'.admin_url('post.php?post='.$quiz->ID.'&action=edit').'">'.get_the_title($quiz->ID).'</a>';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
if ($column === 'questions'){
|
62 |
+
echo tutor_utils()->total_questions_for_student_by_quiz($post_id);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
public function register_meta_box(){
|
68 |
+
add_meta_box( 'tutor-quiz-questions', __( 'Questions', 'tutor' ), array($this, 'quiz_questions'), 'tutor_quiz' );
|
69 |
+
add_meta_box( 'tutor-quiz-settings', __( 'Settings', 'tutor' ), array($this, 'quiz_settings'), 'tutor_quiz' );
|
70 |
+
}
|
71 |
+
|
72 |
+
public function quiz_questions(){
|
73 |
+
include tutor()->path.'views/metabox/quiz_questions.php';
|
74 |
+
}
|
75 |
+
|
76 |
+
public function quiz_settings(){
|
77 |
+
include tutor()->path.'views/metabox/quizzes.php';
|
78 |
+
}
|
79 |
+
|
80 |
+
public function save_quiz_meta($post_ID){
|
81 |
+
if (isset($_POST['quiz_option'])){
|
82 |
+
$quiz_option = tutor_utils()->sanitize_array($_POST['quiz_option']);
|
83 |
+
update_post_meta($post_ID, 'tutor_quiz_option', $quiz_option);
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
public function tutor_load_quiz_modal(){
|
88 |
+
$quiz_for_post_id = (int) sanitize_text_field($_POST['quiz_for_post_id']);
|
89 |
+
|
90 |
+
$search_terms = sanitize_text_field(tutor_utils()->avalue_dot('search_terms', $_POST));
|
91 |
+
$quizzes = tutor_utils()->get_unattached_quiz(array('search_term' => $search_terms));
|
92 |
+
|
93 |
+
$output = '';
|
94 |
+
if ($quizzes){
|
95 |
+
foreach ($quizzes as $quiz){
|
96 |
+
$output .= "<p><label><input type='checkbox' name='quiz_for[{$quiz_for_post_id}][quiz_id][]' value='{$quiz->ID}' > {$quiz->post_title} </label></p>";
|
97 |
+
}
|
98 |
+
$output .= '<p class="quiz-search-suggest-text">Search the quiz to get specific quiz</p>';
|
99 |
+
}else{
|
100 |
+
$add_question_url = admin_url('post-new.php?post_type=tutor_quiz');
|
101 |
+
$output .= sprintf('No quiz available right now, please %s add some quiz %s', '<a href="'.$add_question_url.'" target="_blank">', '</a>' );
|
102 |
+
}
|
103 |
+
|
104 |
+
ob_start();
|
105 |
+
?>
|
106 |
+
<div class="tutor-option-field-row">
|
107 |
+
<div class="tutor-option-field-label">
|
108 |
+
<label for="">
|
109 |
+
<?php _e('New quiz title', 'tutor'); ?>
|
110 |
+
</label>
|
111 |
+
</div>
|
112 |
+
<div class="tutor-option-field">
|
113 |
+
<input type="text" name="quiz_title" placeholder="<?php _e('Place quiz title to create new quiz', 'tutor'); ?>" >
|
114 |
+
<p class="desc"><?php _e('Provide a quiz title to create a quiz from here.'); ?></p>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
<?php
|
119 |
+
$output .= ob_get_clean();
|
120 |
+
|
121 |
+
wp_send_json_success(array('output' => $output));
|
122 |
+
}
|
123 |
+
|
124 |
+
public function tutor_add_quiz_to_post(){
|
125 |
+
global $wpdb;
|
126 |
+
|
127 |
+
$quiz_data = tutor_utils()->avalue_dot('quiz_for', $_POST);
|
128 |
+
|
129 |
+
$output = '';
|
130 |
+
$post_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('parent_post_id', $_POST)) ;
|
131 |
+
if ($quiz_data){
|
132 |
+
foreach ($quiz_data as $post_id => $quiz_ids_a);
|
133 |
+
|
134 |
+
$quiz_ids = tutor_utils()->avalue_dot('quiz_id', $quiz_ids_a);
|
135 |
+
foreach ($quiz_ids as $quiz_id){
|
136 |
+
$wpdb->update($wpdb->posts, array('post_parent' => $post_id), array('ID' => $quiz_id) );
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
$quiz_title = sanitize_text_field(tutor_utils()->avalue_dot('quiz_title', $_POST));
|
141 |
+
if ($quiz_title){
|
142 |
+
wp_insert_post(array(
|
143 |
+
'post_parent' => $post_id,
|
144 |
+
'post_title' => $quiz_title,
|
145 |
+
'post_type' => 'tutor_quiz',
|
146 |
+
'post_status' => 'publish',
|
147 |
+
));
|
148 |
+
}
|
149 |
+
|
150 |
+
if ($post_id) {
|
151 |
+
ob_start();
|
152 |
+
$attached_quizzes = tutor_utils()->get_attached_quiz( $post_id );
|
153 |
+
if ( $attached_quizzes ) {
|
154 |
+
foreach ( $attached_quizzes as $attached_quiz ) {
|
155 |
+
?>
|
156 |
+
<div id="added-quiz-id-<?php echo $attached_quiz->ID; ?>" class="added-quiz-item added-quiz-item-<?php echo $attached_quiz->ID; ?>" data-quiz-id="<?php echo $attached_quiz->ID; ?>">
|
157 |
+
<span class="quiz-icon"><i class="dashicons dashicons-clock"></i></span>
|
158 |
+
<span class="quiz-name">
|
159 |
+
<?php edit_post_link( $attached_quiz->post_title, null, null, $attached_quiz->ID ); ?>
|
160 |
+
</span>
|
161 |
+
<span class="quiz-control">
|
162 |
+
<a href="javascript:;" class="tutor-quiz-delete-btn"><i class="dashicons dashicons-trash"></i></a>
|
163 |
+
</span>
|
164 |
+
</div>
|
165 |
+
<?php
|
166 |
+
}
|
167 |
+
}
|
168 |
+
$output .= ob_get_clean();
|
169 |
+
}
|
170 |
+
|
171 |
+
wp_send_json_success(array('output' => $output));
|
172 |
+
}
|
173 |
+
|
174 |
+
public function remove_quiz_from_post(){
|
175 |
+
global $wpdb;
|
176 |
+
$quiz_id = (int) tutor_utils()->avalue_dot('quiz_id', $_POST);
|
177 |
+
$wpdb->update($wpdb->posts, array('post_parent' => 0), array('ID' => $quiz_id) );
|
178 |
+
wp_send_json_success();
|
179 |
+
}
|
180 |
+
|
181 |
+
public function start_the_quiz(){
|
182 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_start_quiz' ){
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
//Checking nonce
|
186 |
+
tutor_utils()->checking_nonce();
|
187 |
+
|
188 |
+
if ( ! is_user_logged_in()){
|
189 |
+
//TODO: need to set a view in the next version
|
190 |
+
die('Please sign in to do this operation');
|
191 |
+
}
|
192 |
+
|
193 |
+
global $wpdb;
|
194 |
+
|
195 |
+
$user_id = get_current_user_id();
|
196 |
+
$user = get_userdata($user_id);
|
197 |
+
|
198 |
+
$quiz_id = (int) sanitize_text_field($_POST['quiz_id']);
|
199 |
+
$quiz = get_post($quiz_id);
|
200 |
+
$date = date("Y-m-d H:i:s");
|
201 |
+
|
202 |
+
$attempts_allowed = tutor_utils()->get_quiz_option($quiz_id, 'attempts_allowed', 0);
|
203 |
+
|
204 |
+
do_action('tutor_before_start_quiz', $quiz_id);
|
205 |
+
$data = array(
|
206 |
+
'comment_post_ID' => $quiz_id, //QuizID
|
207 |
+
'comment_author' => $user->user_login,
|
208 |
+
'comment_date' => $date,
|
209 |
+
'comment_date_gmt' => get_gmt_from_date($date),
|
210 |
+
'comment_approved' => 'quiz_started', //quiz_timeup, quiz_complete
|
211 |
+
'comment_agent' => 'TutorLMSPlugin',
|
212 |
+
'comment_type' => 'tutor_quiz_attempt',
|
213 |
+
'comment_parent' => $quiz->post_parent, //Quiz Parent Attached Course || Lesson || Topic
|
214 |
+
'user_id' => $user_id,
|
215 |
+
);
|
216 |
+
|
217 |
+
$wpdb->insert($wpdb->comments, $data);
|
218 |
+
$attempt_id = (int) $wpdb->insert_id;
|
219 |
+
|
220 |
+
$time_limit = tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_value');
|
221 |
+
$time_limit_seconds = 0;
|
222 |
+
$time_type = 'seconds';
|
223 |
+
if ($time_limit){
|
224 |
+
$time_type = tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_type');
|
225 |
+
|
226 |
+
switch ($time_type){
|
227 |
+
case 'seconds':
|
228 |
+
$time_limit_seconds = $time_limit;
|
229 |
+
break;
|
230 |
+
case 'minutes':
|
231 |
+
$time_limit_seconds = $time_limit * 60;
|
232 |
+
break;
|
233 |
+
case 'hours':
|
234 |
+
$time_limit_seconds = $time_limit * 60 * 60;
|
235 |
+
break;
|
236 |
+
case 'days':
|
237 |
+
$time_limit_seconds = $time_limit * 60 * 60 * 24;
|
238 |
+
break;
|
239 |
+
case 'weeks':
|
240 |
+
$time_limit_seconds = $time_limit * 60 * 60 * 24 * 7;
|
241 |
+
break;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
$max_question_allowed = tutor_utils()->max_questions_for_take_quiz($quiz_id);
|
246 |
+
$quiz_attempt_info = array(
|
247 |
+
'time_limit' => $time_limit,
|
248 |
+
'time_type' => $time_type,
|
249 |
+
'time_limit_seconds' => $time_limit_seconds,
|
250 |
+
'total_question' => $max_question_allowed,
|
251 |
+
'answered_question' => 0,
|
252 |
+
'current_question' => 0,
|
253 |
+
'marks_earned' => 0,
|
254 |
+
'answers' => array(),
|
255 |
+
);
|
256 |
+
|
257 |
+
//answers format
|
258 |
+
/*
|
259 |
+
array(
|
260 |
+
'0' => array( 'questionID' => 344, 'has_correct' => 1, //or 0 for false, 'questionSiNo' => 1
|
261 |
+
'answers_list' => array(
|
262 |
+
'answers_id' => array('selected_answerId_1', 'selected_answerId_2', 'or_line_answer_text')
|
263 |
+
)
|
264 |
+
),
|
265 |
+
|
266 |
+
'1' => array( 'questionID' => 654, 'has_correct' => 0, //or 0 for false, 'questionSiNo' => 2
|
267 |
+
'answers_list' => array(
|
268 |
+
'answers_id' => array('selected_answerId_1', 'selected_answerId_2', 'or_line_answer_text')
|
269 |
+
)
|
270 |
+
),
|
271 |
+
);
|
272 |
+
*/
|
273 |
+
|
274 |
+
update_comment_meta($attempt_id, 'quiz_attempt_info', $quiz_attempt_info);
|
275 |
+
update_comment_meta($attempt_id, 'earned_mark_percent', '0');
|
276 |
+
|
277 |
+
do_action('tutor_after_start_quiz', $quiz_id, $attempt_id);
|
278 |
+
|
279 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
280 |
+
die();
|
281 |
+
}
|
282 |
+
|
283 |
+
|
284 |
+
public function answering_quiz(){
|
285 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_answering_quiz_question' ){
|
286 |
+
return;
|
287 |
+
}
|
288 |
+
//Checking nonce
|
289 |
+
tutor_utils()->checking_nonce();
|
290 |
+
|
291 |
+
if ( ! is_user_logged_in()){
|
292 |
+
die('Please sign in to do this operation');
|
293 |
+
}
|
294 |
+
|
295 |
+
global $wpdb;
|
296 |
+
|
297 |
+
$user_id = get_current_user_id();
|
298 |
+
$attempt_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('attempt_id', $_POST));
|
299 |
+
$post_question_id = (int) sanitize_text_field(tutor_utils()->avalue_dot('quiz_question_id', $_POST));
|
300 |
+
$attempt = tutor_utils()->get_attempt($attempt_id);
|
301 |
+
|
302 |
+
if ( ! $attempt || $user_id != $attempt->user_id){
|
303 |
+
die('Operation not allowed, attempt not found or permission denied');
|
304 |
+
}
|
305 |
+
|
306 |
+
$attempt_info = tutor_utils()->quiz_attempt_info($attempt_id);
|
307 |
+
$given_answers = tutor_utils()->avalue_dot("attempt.{$attempt_id}.quiz_question.{$post_question_id}", $_POST);
|
308 |
+
|
309 |
+
$plus_mark = 0;
|
310 |
+
$minus_mark = 0;
|
311 |
+
$is_answer_corrected = false;
|
312 |
+
|
313 |
+
$answers = array(
|
314 |
+
'questionID' => $post_question_id,
|
315 |
+
);
|
316 |
+
|
317 |
+
$question_type = get_post_meta($post_question_id, '_question_type', true);
|
318 |
+
$question_mark = get_post_meta($post_question_id, '_question_mark', true);
|
319 |
+
|
320 |
+
if ($given_answers){
|
321 |
+
$answers['status'] = 'answered'; //or 0 for false, 'questionSiNo' => 2
|
322 |
+
$answers['has_correct'] = 0;
|
323 |
+
|
324 |
+
$saved_answers = tutor_utils()->get_quiz_answer_options_by_question($post_question_id);
|
325 |
+
$corrects_answer_ids = array();
|
326 |
+
if (is_array($saved_answers) && count($saved_answers)){
|
327 |
+
foreach ($saved_answers as $saved_answer){
|
328 |
+
$saved_answer_info = json_decode($saved_answer->comment_content);
|
329 |
+
|
330 |
+
if ( ! empty($saved_answer_info->is_correct) && $saved_answer_info->is_correct){
|
331 |
+
$corrects_answer_ids[] = $saved_answer->comment_ID;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
if ($question_type === 'multiple_choice'){
|
337 |
+
$given_answers = (array) $given_answers;
|
338 |
+
}
|
339 |
+
|
340 |
+
//TODO: need to provide support for question type more if we add
|
341 |
+
//Checking if all answer corrects
|
342 |
+
if ($question_type === 'true_false' || $question_type === 'multiple_choice' || $question_type === 'single_choice'){
|
343 |
+
if ($question_type === 'multiple_choice') {
|
344 |
+
$is_answer_corrected = count(array_intersect($given_answers, $corrects_answer_ids)) == count($given_answers);
|
345 |
+
}else{
|
346 |
+
$is_answer_corrected = in_array($given_answers, $corrects_answer_ids);
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
if ($is_answer_corrected){
|
351 |
+
$plus_mark = $question_mark;
|
352 |
+
$answers['has_correct'] = 1;
|
353 |
+
}else{
|
354 |
+
//TODO: Do operation for incorrect answer
|
355 |
+
}
|
356 |
+
|
357 |
+
$answers['plus_mark'] = $plus_mark;
|
358 |
+
$answers['minus_mark'] = $minus_mark;
|
359 |
+
|
360 |
+
$answers['answers_list'] = array(
|
361 |
+
'answer_type' => $question_type,
|
362 |
+
'answer_ids' => $given_answers
|
363 |
+
);
|
364 |
+
}else{
|
365 |
+
//If not answered, that means users skipped the questions
|
366 |
+
$answers = array(
|
367 |
+
'questionID' => $post_question_id, 'status' => 'skipped', 'has_correct' => 0, //or 0 for false, 'questionSiNo' => 2
|
368 |
+
'plus_mark' => 0,
|
369 |
+
'minus_mark' => 0,
|
370 |
+
'answers_list' => array()
|
371 |
+
);
|
372 |
+
}
|
373 |
+
|
374 |
+
$answers['question_mark'] = $question_mark;
|
375 |
+
|
376 |
+
if ($is_answer_corrected){
|
377 |
+
if (isset($attempt_info['marks_earned'])){
|
378 |
+
//If not found
|
379 |
+
$attempt_info['marks_earned'] = $attempt_info['marks_earned'] + $plus_mark;
|
380 |
+
}else{
|
381 |
+
$attempt_info['marks_earned'] = $plus_mark;
|
382 |
+
}
|
383 |
+
}else{
|
384 |
+
if ( ! isset($attempt_info['marks_earned'])){
|
385 |
+
$attempt_info['marks_earned'] = 0;
|
386 |
+
}
|
387 |
+
|
388 |
+
//Todo: mark minus if necessary
|
389 |
+
}
|
390 |
+
|
391 |
+
$attempt_info['answers'][] = $answers;
|
392 |
+
tutor_utils()->quiz_update_attempt_info($attempt_id, $attempt_info);
|
393 |
+
|
394 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
395 |
+
die();
|
396 |
+
}
|
397 |
+
|
398 |
+
/**
|
399 |
+
* Quiz attempt will be finish here
|
400 |
+
*
|
401 |
+
*/
|
402 |
+
|
403 |
+
public function finishing_quiz_attempt(){
|
404 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_finish_quiz_attempt' ){
|
405 |
+
return;
|
406 |
+
}
|
407 |
+
//Checking nonce
|
408 |
+
tutor_utils()->checking_nonce();
|
409 |
+
|
410 |
+
if ( ! is_user_logged_in()){
|
411 |
+
die('Please sign in to do this operation');
|
412 |
+
}
|
413 |
+
|
414 |
+
|
415 |
+
global $wpdb;
|
416 |
+
|
417 |
+
$quiz_id = (int) sanitize_text_field($_POST['quiz_id']);
|
418 |
+
|
419 |
+
$is_started_quiz = tutor_utils()->is_started_quiz($quiz_id);
|
420 |
+
$attempt_id = $is_started_quiz->comment_ID;
|
421 |
+
|
422 |
+
if ($is_started_quiz) {
|
423 |
+
do_action('tutor_quiz_finished_before', $attempt_id);
|
424 |
+
|
425 |
+
$quiz_attempt_info = tutor_utils()->quiz_attempt_info( $attempt_id );
|
426 |
+
$answers = tutor_utils()->avalue_dot('answers', $quiz_attempt_info);
|
427 |
+
|
428 |
+
$total_marks = 0;
|
429 |
+
if (is_array($answers)){
|
430 |
+
$total_marks = array_sum(wp_list_pluck($answers, 'question_mark'));
|
431 |
+
}
|
432 |
+
|
433 |
+
$quiz_attempt_info['total_marks'] = $total_marks;
|
434 |
+
$pass_mark_percent = tutor_utils()->get_quiz_option($quiz_id,'passing_grade');
|
435 |
+
$quiz_attempt_info['pass_mark_percent'] = $pass_mark_percent;
|
436 |
+
$quiz_attempt_info['submission_time'] = time();
|
437 |
+
|
438 |
+
//Updating Attempt Info
|
439 |
+
tutor_utils()->quiz_update_attempt_info($attempt_id, $quiz_attempt_info);
|
440 |
+
|
441 |
+
$wpdb->update($wpdb->comments, array('comment_approved' => 'quiz_finished'), array('comment_ID' => $attempt_id));
|
442 |
+
|
443 |
+
do_action('tutor_quiz_finished_after', $attempt_id);
|
444 |
+
}
|
445 |
+
|
446 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
447 |
+
die();
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Quiz timeout by ajax
|
452 |
+
*/
|
453 |
+
public function tutor_quiz_timeout(){
|
454 |
+
global $wpdb;
|
455 |
+
|
456 |
+
$quiz_id = (int) sanitize_text_field($_POST['quiz_id']);
|
457 |
+
|
458 |
+
$is_started_quiz = tutor_utils()->is_started_quiz($quiz_id);
|
459 |
+
$attempt_id = $is_started_quiz->comment_ID;
|
460 |
+
|
461 |
+
if ($is_started_quiz) {
|
462 |
+
$quiz_attempt_info = tutor_utils()->quiz_attempt_info( $attempt_id );
|
463 |
+
$answers = tutor_utils()->avalue_dot('answers', $quiz_attempt_info);
|
464 |
+
|
465 |
+
$total_marks = 0;
|
466 |
+
if (is_array($answers)){
|
467 |
+
$total_marks = array_sum(wp_list_pluck($answers, 'question_mark'));
|
468 |
+
}
|
469 |
+
|
470 |
+
$quiz_attempt_info['total_marks'] = $total_marks;
|
471 |
+
$pass_mark_percent = tutor_utils()->get_quiz_option($quiz_id,'passing_grade');
|
472 |
+
$quiz_attempt_info['pass_mark_percent'] = $pass_mark_percent;
|
473 |
+
|
474 |
+
//Updating Attempt Info
|
475 |
+
tutor_utils()->quiz_update_attempt_info($attempt_id, $quiz_attempt_info);
|
476 |
+
|
477 |
+
$wpdb->update($wpdb->comments, array('comment_approved' => 'quiz_timeout'), array('comment_ID' => $attempt_id));
|
478 |
+
wp_send_json_success();
|
479 |
+
}
|
480 |
+
|
481 |
+
wp_send_json_error(__('Quiz has been timeout already', 'tutor'));
|
482 |
+
}
|
483 |
+
|
484 |
+
/**
|
485 |
+
* Review the answer and change individual answer result
|
486 |
+
*/
|
487 |
+
|
488 |
+
public function review_quiz_answer(){
|
489 |
+
$attempt_id = (int) sanitize_text_field($_GET['attempt_id']);
|
490 |
+
$answer_index = (int) sanitize_text_field($_GET['answer_index']);
|
491 |
+
$mark_as = sanitize_text_field($_GET['mark_as']);
|
492 |
+
|
493 |
+
$attempt_info = tutor_utils()->quiz_attempt_info($attempt_id);
|
494 |
+
|
495 |
+
$previous_answer = $attempt_info['answers'][$answer_index];
|
496 |
+
$previous_correct = tutor_utils()->avalue_dot('has_correct', $previous_answer);
|
497 |
+
|
498 |
+
if ($mark_as === 'correct' && ! $previous_correct ){
|
499 |
+
$previous_answer['has_correct'] = 1;
|
500 |
+
$previous_answer['plus_mark'] = $previous_answer['question_mark'];
|
501 |
+
$previous_answer['minus_mark'] = 0;
|
502 |
+
$attempt_info['marks_earned'] = $attempt_info['marks_earned'] + $previous_answer['question_mark'];
|
503 |
+
|
504 |
+
}elseif($mark_as === 'incorrect' && $previous_correct){
|
505 |
+
$previous_answer['has_correct'] = 0;
|
506 |
+
$previous_answer['plus_mark'] = 0;
|
507 |
+
$previous_answer['minus_mark'] = 0;
|
508 |
+
$attempt_info['marks_earned'] = $attempt_info['marks_earned'] - $previous_answer['question_mark'];
|
509 |
+
}
|
510 |
+
|
511 |
+
$attempt_info['answers'][$answer_index] = $previous_answer;
|
512 |
+
$attempt_info['manual_reviewed'] = time();
|
513 |
+
|
514 |
+
tutor_utils()->quiz_update_attempt_info($attempt_id, $attempt_info);
|
515 |
+
|
516 |
+
wp_redirect(admin_url("admin.php?page=tutor_quiz_attempts&sub_page=view_attempt&attempt_id=".$attempt_id));
|
517 |
+
die();
|
518 |
+
}
|
519 |
+
|
520 |
+
}
|
classes/Quiz_Attempts_List.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
if (! class_exists('Tutor_List_Table')){
|
8 |
+
include_once tutor()->path.'classes/Tutor_List_Table.php';
|
9 |
+
}
|
10 |
+
|
11 |
+
class Quiz_Attempts_List extends \Tutor_List_Table {
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
global $status, $page;
|
15 |
+
|
16 |
+
//Set parent defaults
|
17 |
+
parent::__construct( array(
|
18 |
+
'singular' => 'attempt', //singular name of the listed records
|
19 |
+
'plural' => 'attempts', //plural name of the listed records
|
20 |
+
'ajax' => false //does this table support ajax?
|
21 |
+
) );
|
22 |
+
}
|
23 |
+
|
24 |
+
function column_default($item, $column_name){
|
25 |
+
switch($column_name){
|
26 |
+
case 'unknown_col':
|
27 |
+
return $item->$column_name;
|
28 |
+
default:
|
29 |
+
//return print_r($item,true); //Show the whole array for troubleshooting purposes
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
function column_student($item){
|
34 |
+
$actions = array();
|
35 |
+
|
36 |
+
$actions['answer'] = sprintf('<a href="?page=%s&sub_page=%s&attempt_id=%s">'.__('Review', 'tutor').'</a>',$_REQUEST['page'],'view_attempt',$item->comment_ID);
|
37 |
+
//$actions['delete'] = sprintf('<a href="?page=%s&action=%s&attempt_id=%s">Delete</a>',$_REQUEST['page'],'delete',$item->comment_ID);
|
38 |
+
|
39 |
+
$quiz_title = '<strong>'.$item->display_name.'</strong> <br />'.$item->user_email.'<br /><br />'. human_time_diff(strtotime
|
40 |
+
($item->comment_date)).__(' ago', 'tutor');
|
41 |
+
|
42 |
+
//Return the title contents
|
43 |
+
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
44 |
+
$quiz_title,
|
45 |
+
$item->comment_ID,
|
46 |
+
$this->row_actions($actions)
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
function column_quiz($item){
|
51 |
+
return $item->post_title;
|
52 |
+
}
|
53 |
+
|
54 |
+
function column_cb($item){
|
55 |
+
return sprintf(
|
56 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
57 |
+
/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("instructor")
|
58 |
+
/*$2%s*/ $item->comment_ID //The value of the checkbox should be the record's id
|
59 |
+
);
|
60 |
+
}
|
61 |
+
|
62 |
+
function column_course($item) {
|
63 |
+
$quiz = tutor_utils()->get_course_by_quiz($item->comment_post_ID);
|
64 |
+
|
65 |
+
if ($quiz) {
|
66 |
+
$title = get_the_title( $quiz->ID );
|
67 |
+
return "<a href='" . admin_url( "post.php?post={$quiz->ID}&action=edit" ) . "'>{$title}</a>";
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
function column_total_questions($item) {
|
73 |
+
$attempt_info = maybe_unserialize($item->quiz_attempt_info);
|
74 |
+
|
75 |
+
echo tutor_utils()->avalue_dot('total_question', $attempt_info);
|
76 |
+
}
|
77 |
+
|
78 |
+
function column_earned_marks($item){
|
79 |
+
$attempt_info = maybe_unserialize($item->quiz_attempt_info);
|
80 |
+
|
81 |
+
$answers_mark = wp_list_pluck(tutor_utils()->avalue_dot('answers', $attempt_info), 'question_mark' );
|
82 |
+
$total_marks = array_sum($answers_mark);
|
83 |
+
|
84 |
+
$marks_earned = tutor_utils()->avalue_dot('marks_earned', $attempt_info);
|
85 |
+
$earned_percentage = $marks_earned > 0 ? ( number_format(($marks_earned * 100) / $total_marks)) : 0;
|
86 |
+
|
87 |
+
$pass_mark_percent = tutor_utils()->avalue_dot('pass_mark_percent', $attempt_info);
|
88 |
+
|
89 |
+
$output = $marks_earned." out of {$total_marks} ({$earned_percentage}%) ";
|
90 |
+
if ($earned_percentage >= $pass_mark_percent){
|
91 |
+
$output .= '<span class="result-pass">'.__('Pass', 'tutor').'</span>';
|
92 |
+
}else{
|
93 |
+
$output .= '<span class="result-fail">'.__('Fail', 'tutor').'</span>';
|
94 |
+
}
|
95 |
+
|
96 |
+
return $output;
|
97 |
+
}
|
98 |
+
|
99 |
+
function column_attempt_status($item){
|
100 |
+
$status = ucwords(str_replace('quiz_', '', $item->attempt_status));
|
101 |
+
return "<span class='tutor-status-context {$item->attempt_status}'>{$status}</span>";
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
function get_columns(){
|
106 |
+
$columns = array(
|
107 |
+
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
|
108 |
+
'student' => __('Students', 'tutor'),
|
109 |
+
'quiz' => __('Quiz', 'tutor'),
|
110 |
+
'course' => __('Course', 'tutor'),
|
111 |
+
'total_questions' => __('Total Questions', 'tutor'),
|
112 |
+
'earned_marks' => __('Earned Mark', 'tutor'),
|
113 |
+
'attempt_status' => __('Earned Mark', 'tutor'),
|
114 |
+
);
|
115 |
+
return $columns;
|
116 |
+
}
|
117 |
+
|
118 |
+
function get_sortable_columns() {
|
119 |
+
$sortable_columns = array(
|
120 |
+
//'display_name' => array('title',false), //true means it's already sorted
|
121 |
+
);
|
122 |
+
return $sortable_columns;
|
123 |
+
}
|
124 |
+
|
125 |
+
function get_bulk_actions() {
|
126 |
+
$actions = array(
|
127 |
+
'delete' => 'Delete'
|
128 |
+
);
|
129 |
+
return $actions;
|
130 |
+
}
|
131 |
+
|
132 |
+
function process_bulk_action() {
|
133 |
+
global $wpdb;
|
134 |
+
|
135 |
+
//Detect when a bulk action is being triggered...
|
136 |
+
if( 'delete' === $this->current_action() ) {
|
137 |
+
if ( empty($_GET['attempt']) || ! is_array($_GET['attempt'])){
|
138 |
+
return;
|
139 |
+
}
|
140 |
+
|
141 |
+
$attempt_ids = array_map('sanitize_text_field', $_GET['attempt']);
|
142 |
+
$attempt_ids = implode( ',', array_map( 'absint', $attempt_ids ) );
|
143 |
+
|
144 |
+
//Deleting attempt (comment), child attempt and attempt meta (comment meta)
|
145 |
+
$wpdb->query( "DELETE FROM {$wpdb->comments} WHERE {$wpdb->comments}.comment_ID IN($attempt_ids)" );
|
146 |
+
$wpdb->query( "DELETE FROM {$wpdb->commentmeta} WHERE {$wpdb->commentmeta}.comment_id IN($attempt_ids)" );
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
function prepare_items() {
|
151 |
+
$per_page = 20;
|
152 |
+
|
153 |
+
$search_term = '';
|
154 |
+
if (isset($_REQUEST['s'])){
|
155 |
+
$search_term = sanitize_text_field($_REQUEST['s']);
|
156 |
+
}
|
157 |
+
|
158 |
+
$columns = $this->get_columns();
|
159 |
+
$hidden = array();
|
160 |
+
$sortable = $this->get_sortable_columns();
|
161 |
+
|
162 |
+
$this->_column_headers = array($columns, $hidden, $sortable);
|
163 |
+
$this->process_bulk_action();
|
164 |
+
|
165 |
+
$current_page = $this->get_pagenum();
|
166 |
+
|
167 |
+
$total_items = tutor_utils()->get_total_quiz_attempts($search_term);
|
168 |
+
$this->items = tutor_utils()->get_quiz_attempts(($current_page-1)*$per_page, $per_page, $search_term);
|
169 |
+
|
170 |
+
$this->set_pagination_args( array(
|
171 |
+
'total_items' => $total_items,
|
172 |
+
'per_page' => $per_page,
|
173 |
+
'total_pages' => ceil($total_items/$per_page)
|
174 |
+
) );
|
175 |
+
}
|
176 |
+
}
|
classes/Rewrite_Rules.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class Rewrite_Rules extends Tutor_Base {
|
8 |
+
|
9 |
+
|
10 |
+
public function __construct() {
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
add_filter( 'query_vars', array($this, 'tutor_register_query_vars') );
|
14 |
+
add_action('generate_rewrite_rules', array($this, 'add_rewrite_rules'));
|
15 |
+
|
16 |
+
//Lesson Permalink
|
17 |
+
add_filter('post_type_link', array($this, 'change_lesson_single_url'), 1, 2);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function tutor_register_query_vars( $vars ) {
|
21 |
+
$vars[] = 'course_subpage';
|
22 |
+
$vars[] = 'lesson_video';
|
23 |
+
$vars[] = 'tutor_dashboard_page';
|
24 |
+
|
25 |
+
$enable_public_profile = tutor_utils()->get_option('enable_public_profile');
|
26 |
+
if ($enable_public_profile){
|
27 |
+
$vars[] = 'tutor_student_username';
|
28 |
+
$vars[] = 'profile_sub_page';
|
29 |
+
}
|
30 |
+
|
31 |
+
return $vars;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function add_rewrite_rules($wp_rewrite){
|
35 |
+
$new_rules = array(
|
36 |
+
//Lesson Permalink
|
37 |
+
$this->course_post_type."/(.+?)/{$this->lesson_base_permalink}/(.+?)/?$" => "index.php?post_type={$this->lesson_post_type}&name=".$wp_rewrite->preg_index(2),
|
38 |
+
//Quiz Permalink
|
39 |
+
$this->course_post_type."/(.+?)/tutor_quiz/(.+?)/?$" => "index.php?post_type=tutor_quiz&name=".$wp_rewrite->preg_index(2),
|
40 |
+
//Private Video URL
|
41 |
+
"video-url/(.+?)/?$" => "index.php?post_type={$this->lesson_post_type}&lesson_video=true&name=". $wp_rewrite->preg_index(1),
|
42 |
+
//Student Public Profile URL
|
43 |
+
"profile/(.+?)/(.+?)/?$" => "index.php?tutor_student_username=". $wp_rewrite->preg_index(1)."&profile_sub_page=".$wp_rewrite->preg_index(2),
|
44 |
+
"profile/(.+?)/?$" => "index.php?tutor_student_username=". $wp_rewrite->preg_index(1),
|
45 |
+
);
|
46 |
+
|
47 |
+
//Nav Items
|
48 |
+
$course_nav_items = tutor_utils()->course_sub_pages();
|
49 |
+
//$course_nav_items = array_keys($course_nav_items);
|
50 |
+
|
51 |
+
if (is_array($course_nav_items) && count($course_nav_items)){
|
52 |
+
foreach ($course_nav_items as $nav_key => $nav_item){
|
53 |
+
$new_rules[$this->course_post_type."/(.+?)/{$nav_key}/?$"] ='index.php?post_type=course&name='.$wp_rewrite->preg_index(1).'&course_subpage='.$nav_key;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
//Student Dashboard URL
|
58 |
+
$dashboard_pages = tutor_utils()->tutor_student_dashboard_pages();
|
59 |
+
foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
|
60 |
+
$new_rules["(.+?)/{$dashboard_key}/?$"] ='index.php?pagename='.$wp_rewrite->preg_index(1).'&tutor_dashboard_page=' .$dashboard_key;
|
61 |
+
}
|
62 |
+
|
63 |
+
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @param $post_link
|
68 |
+
* @param int $id
|
69 |
+
*
|
70 |
+
* @return string
|
71 |
+
*
|
72 |
+
* Change the lesson permalink
|
73 |
+
*/
|
74 |
+
function change_lesson_single_url($post_link, $id=0){
|
75 |
+
$post = get_post($id);
|
76 |
+
|
77 |
+
global $wpdb;
|
78 |
+
|
79 |
+
$course_base_slug = 'sample-course';
|
80 |
+
|
81 |
+
if( is_object($post) && $post->post_type == $this->lesson_post_type){
|
82 |
+
//Lesson Permalink
|
83 |
+
$course_id = get_post_meta($post->ID, '_tutor_course_id_for_lesson', true);
|
84 |
+
|
85 |
+
if ($course_id){
|
86 |
+
$course = $wpdb->get_row("select {$wpdb->posts}.post_name from {$wpdb->posts} where ID = {$course_id} ");
|
87 |
+
if ($course){
|
88 |
+
$course_base_slug = $course->post_name;
|
89 |
+
}
|
90 |
+
return home_url("/{$this->course_post_type}/{$course_base_slug}/{$this->lesson_base_permalink}/". $post->post_name.'/');
|
91 |
+
}else{
|
92 |
+
return home_url("/{$this->course_post_type}/sample-course/{$this->lesson_base_permalink}/". $post->post_name.'/');
|
93 |
+
}
|
94 |
+
}elseif (is_object($post) && $post->post_type === 'tutor_quiz'){
|
95 |
+
//Quiz Permalink
|
96 |
+
$course = $wpdb->get_row("select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$post->post_parent} ");
|
97 |
+
if ($course){
|
98 |
+
//Checking if this topic
|
99 |
+
if ($course->post_type !== $this->course_post_type){
|
100 |
+
$course = $wpdb->get_row("select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$course->post_parent} ");
|
101 |
+
}
|
102 |
+
//Checking if this lesson
|
103 |
+
if ($course->post_type !== $this->course_post_type){
|
104 |
+
$course = $wpdb->get_row("select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$course->post_parent} ");
|
105 |
+
}
|
106 |
+
|
107 |
+
return home_url("/{$this->course_post_type}/".$course->post_name."/tutor_quiz/". $post->post_name.'/');
|
108 |
+
}else{
|
109 |
+
return home_url("/{$this->course_post_type}/sample-course/tutor_quiz/". $post->post_name.'/');
|
110 |
+
}
|
111 |
+
}
|
112 |
+
return $post_link;
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
|
classes/Shortcode.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Shortcode
|
4 |
+
* @package TUTOR
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace TUTOR;
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
class Shortcode {
|
15 |
+
|
16 |
+
public function __construct() {
|
17 |
+
add_shortcode('tutor_student_registration_form', array($this, 'student_registration_form'));
|
18 |
+
add_shortcode('tutor_student_dashboard', array($this, 'tutor_student_dashboard'));
|
19 |
+
add_shortcode('tutor_instructor_registration_form', array($this, 'instructor_registration_form'));
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @return mixed
|
24 |
+
*
|
25 |
+
* Instructor Registration Shortcode
|
26 |
+
*
|
27 |
+
* @since v.1.0.0
|
28 |
+
*/
|
29 |
+
public function student_registration_form(){
|
30 |
+
ob_start();
|
31 |
+
if (is_user_logged_in()){
|
32 |
+
tutor_load_template( 'dashboard.student.logged-in' );
|
33 |
+
}else{
|
34 |
+
tutor_load_template( 'dashboard.student.registration' );
|
35 |
+
}
|
36 |
+
return apply_filters( 'tutor/student/register', ob_get_clean() );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @return mixed
|
41 |
+
*
|
42 |
+
* Tutor Dashboard for students
|
43 |
+
*
|
44 |
+
* @since v.1.0.0
|
45 |
+
*/
|
46 |
+
public function tutor_student_dashboard(){
|
47 |
+
ob_start();
|
48 |
+
if (is_user_logged_in()){
|
49 |
+
tutor_load_template( 'dashboard.student.index' );
|
50 |
+
}else{
|
51 |
+
tutor_load_template( 'global.login' );
|
52 |
+
}
|
53 |
+
return apply_filters( 'tutor_dashboard/student/index', ob_get_clean() );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return mixed
|
58 |
+
*
|
59 |
+
* Instructor Registration Shortcode
|
60 |
+
*
|
61 |
+
* @since v.1.0.0
|
62 |
+
*/
|
63 |
+
public function instructor_registration_form(){
|
64 |
+
ob_start();
|
65 |
+
if (is_user_logged_in()){
|
66 |
+
tutor_load_template( 'dashboard.instructor.logged-in' );
|
67 |
+
}else{
|
68 |
+
tutor_load_template( 'dashboard.instructor.registration' );
|
69 |
+
}
|
70 |
+
return apply_filters( 'tutor_dashboard/student/index', ob_get_clean() );
|
71 |
+
}
|
72 |
+
|
73 |
+
}
|
classes/Student.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Instructor
|
5 |
+
* @package TUTOR
|
6 |
+
*
|
7 |
+
* @since v.1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
namespace TUTOR;
|
11 |
+
|
12 |
+
|
13 |
+
class Student {
|
14 |
+
|
15 |
+
protected $error_msgs = '';
|
16 |
+
public function __construct() {
|
17 |
+
add_action('template_redirect', array($this, 'register_student'));
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Register new user and mark him as student
|
22 |
+
*
|
23 |
+
* @since v.1.0.0
|
24 |
+
*/
|
25 |
+
public function register_student(){
|
26 |
+
if ( ! isset($_POST['tutor_action']) || $_POST['tutor_action'] !== 'tutor_register_student' ){
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
//Checking nonce
|
30 |
+
tutor_utils()->checking_nonce();
|
31 |
+
|
32 |
+
$required_fields = apply_filters('tutor_student_registration_required_fields', array(
|
33 |
+
'first_name' => __('First name field is required', 'tutor'),
|
34 |
+
'last_name' => __('Last name field is required', 'tutor'),
|
35 |
+
'email' => __('E-Mail field is required', 'tutor'),
|
36 |
+
'user_login' => __('User Name field is required', 'tutor'),
|
37 |
+
'phone_number' => __('Phone Number field is required', 'tutor'),
|
38 |
+
'password' => __('Password field is required', 'tutor'),
|
39 |
+
'password_confirmation' => __('Password Confirmation field is required', 'tutor'),
|
40 |
+
));
|
41 |
+
|
42 |
+
$validation_errors = array();
|
43 |
+
foreach ($required_fields as $required_key => $required_value){
|
44 |
+
if (empty($_POST[$required_key])){
|
45 |
+
$validation_errors[$required_key] = $required_value;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
if (!filter_var(tutor_utils()->input_old('email'), FILTER_VALIDATE_EMAIL)) {
|
50 |
+
$validation_errors['email'] = __('Valid E-Mail is required', 'tutor');
|
51 |
+
}
|
52 |
+
if (tutor_utils()->input_old('password') !== tutor_utils()->input_old('password_confirmation')){
|
53 |
+
$validation_errors['password_confirmation'] = __('Confirm password does not matched with Password field', 'tutor');
|
54 |
+
}
|
55 |
+
|
56 |
+
if (count($validation_errors)){
|
57 |
+
$this->error_msgs = $validation_errors;
|
58 |
+
add_filter('tutor_student_register_validation_errors', array($this, 'tutor_student_form_validation_errors'));
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
$first_name = sanitize_text_field(tutor_utils()->input_old('first_name'));
|
63 |
+
$last_name = sanitize_text_field(tutor_utils()->input_old('last_name'));
|
64 |
+
$email = sanitize_text_field(tutor_utils()->input_old('email'));
|
65 |
+
$user_login = sanitize_text_field(tutor_utils()->input_old('user_login'));
|
66 |
+
$phone_number = sanitize_text_field(tutor_utils()->input_old('phone_number'));
|
67 |
+
$password = sanitize_text_field(tutor_utils()->input_old('password'));
|
68 |
+
$tutor_profile_bio = wp_kses_post(tutor_utils()->input_old('tutor_profile_bio'));
|
69 |
+
|
70 |
+
$userdata = array(
|
71 |
+
'user_login' => $user_login,
|
72 |
+
'user_email' => $email,
|
73 |
+
'first_name' => $first_name,
|
74 |
+
'last_name' => $last_name,
|
75 |
+
//'role' => tutor()->student_role,
|
76 |
+
'user_pass' => $password,
|
77 |
+
);
|
78 |
+
|
79 |
+
$user_id = wp_insert_user( $userdata ) ;
|
80 |
+
if ( ! is_wp_error($user_id)){
|
81 |
+
update_user_meta($user_id, 'phone_number', $phone_number);
|
82 |
+
update_user_meta($user_id, 'description', $tutor_profile_bio);
|
83 |
+
update_user_meta($user_id, '_tutor_profile_bio', $tutor_profile_bio);
|
84 |
+
|
85 |
+
$user = get_user_by( 'id', $user_id );
|
86 |
+
if( $user ) {
|
87 |
+
wp_set_current_user( $user_id, $user->user_login );
|
88 |
+
wp_set_auth_cookie( $user_id );
|
89 |
+
}
|
90 |
+
}else{
|
91 |
+
$this->error_msgs = $user_id->get_error_messages();
|
92 |
+
add_filter('tutor_student_register_validation_errors', array($this, 'tutor_student_form_validation_errors'));
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
|
96 |
+
wp_redirect(tutor_utils()->input_old('_wp_http_referer'));
|
97 |
+
die();
|
98 |
+
}
|
99 |
+
|
100 |
+
public function tutor_student_form_validation_errors(){
|
101 |
+
return $this->error_msgs;
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
}
|
classes/Students_List.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
if (! class_exists('Tutor_List_Table')){
|
8 |
+
include_once tutor()->path.'classes/Tutor_List_Table.php';
|
9 |
+
}
|
10 |
+
|
11 |
+
class Students_List extends \Tutor_List_Table {
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
global $status, $page;
|
15 |
+
|
16 |
+
//Set parent defaults
|
17 |
+
parent::__construct( array(
|
18 |
+
'singular' => 'student', //singular name of the listed records
|
19 |
+
'plural' => 'students', //plural name of the listed records
|
20 |
+
'ajax' => false //does this table support ajax?
|
21 |
+
) );
|
22 |
+
}
|
23 |
+
|
24 |
+
function column_default($item, $column_name){
|
25 |
+
switch($column_name){
|
26 |
+
case 'user_email':
|
27 |
+
case 'display_name':
|
28 |
+
return $item->$column_name;
|
29 |
+
default:
|
30 |
+
return print_r($item,true); //Show the whole array for troubleshooting purposes
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @param $item
|
36 |
+
*
|
37 |
+
* Completed Course by User
|
38 |
+
*/
|
39 |
+
function column_completed_course($item){
|
40 |
+
$user_id = $item->ID;
|
41 |
+
|
42 |
+
$courses = tutor_utils()->get_courses_by_user($user_id);
|
43 |
+
if ($courses && is_array($courses->posts) && count($courses->posts)){
|
44 |
+
foreach ($courses->posts as $course){
|
45 |
+
echo '<a href="'.get_the_permalink($course->ID).'" target="_blank">'.$course->post_title.'</a>';
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/*
|
51 |
+
function column_display_name($item){
|
52 |
+
//Build row actions
|
53 |
+
$actions = array(
|
54 |
+
'edit' => sprintf('<a href="?page=%s&action=%s&student=%s">Edit</a>',$_REQUEST['page'],'edit',$item->ID),
|
55 |
+
'delete' => sprintf('<a href="?page=%s&action=%s&student=%s">Delete</a>',$_REQUEST['page'],'delete',$item->ID),
|
56 |
+
);
|
57 |
+
|
58 |
+
//Return the title contents
|
59 |
+
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
60 |
+
$item->display_name,
|
61 |
+
$item->ID,
|
62 |
+
$this->row_actions($actions)
|
63 |
+
);
|
64 |
+
}*/
|
65 |
+
|
66 |
+
function column_cb($item){
|
67 |
+
return sprintf(
|
68 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
69 |
+
/*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("student")
|
70 |
+
/*$2%s*/ $item->ID //The value of the checkbox should be the record's id
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
function get_columns(){
|
75 |
+
$columns = array(
|
76 |
+
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
|
77 |
+
'display_name' => __('Name', 'tutor'),
|
78 |
+
'user_email' => __('E-Mail', 'tutor'),
|
79 |
+
'completed_course' => __('Completed Course', 'tutor'),
|
80 |
+
);
|
81 |
+
return $columns;
|
82 |
+
}
|
83 |
+
|
84 |
+
function get_sortable_columns() {
|
85 |
+
$sortable_columns = array(
|
86 |
+
//'display_name' => array('title',false), //true means it's already sorted
|
87 |
+
);
|
88 |
+
return $sortable_columns;
|
89 |
+
}
|
90 |
+
|
91 |
+
function get_bulk_actions() {
|
92 |
+
$actions = array(
|
93 |
+
//'delete' => 'Delete'
|
94 |
+
);
|
95 |
+
return $actions;
|
96 |
+
}
|
97 |
+
|
98 |
+
function process_bulk_action() {
|
99 |
+
//Detect when a bulk action is being triggered...
|
100 |
+
if( 'delete'===$this->current_action() ) {
|
101 |
+
wp_die('Items deleted (or they would be if we had items to delete)!');
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
function prepare_items() {
|
106 |
+
$per_page = 20;
|
107 |
+
|
108 |
+
$search_term = '';
|
109 |
+
if (isset($_REQUEST['s'])){
|
110 |
+
$search_term = sanitize_text_field($_REQUEST['s']);
|
111 |
+
}
|
112 |
+
|
113 |
+
$columns = $this->get_columns();
|
114 |
+
$hidden = array();
|
115 |
+
$sortable = $this->get_sortable_columns();
|
116 |
+
|
117 |
+
$this->_column_headers = array($columns, $hidden, $sortable);
|
118 |
+
//$this->process_bulk_action();
|
119 |
+
|
120 |
+
$current_page = $this->get_pagenum();
|
121 |
+
|
122 |
+
$total_items = tutor_utils()->get_total_students($search_term);
|
123 |
+
$this->items = tutor_utils()->get_students(($current_page-1)*$per_page, $per_page, $search_term);;
|
124 |
+
|
125 |
+
$this->set_pagination_args( array(
|
126 |
+
'total_items' => $total_items, //WE have to calculate the total number of items
|
127 |
+
'per_page' => $per_page, //WE have to determine how many items to show on a page
|
128 |
+
'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages
|
129 |
+
) );
|
130 |
+
}
|
131 |
+
}
|
classes/Template.php
ADDED
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template Class
|
4 |
+
*
|
5 |
+
* @since: v.1.0.0
|
6 |
+
*/
|
7 |
+
namespace TUTOR;
|
8 |
+
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
|
14 |
+
class Template extends Tutor_Base {
|
15 |
+
|
16 |
+
public function __construct() {
|
17 |
+
parent::__construct();
|
18 |
+
|
19 |
+
add_action( 'pre_get_posts', array($this, 'limit_course_query_archive'), 1 );
|
20 |
+
|
21 |
+
add_filter( 'template_include', array($this, 'load_course_archive_template'), 99 );
|
22 |
+
add_filter( 'template_include', array($this, 'load_single_course_template'), 99 );
|
23 |
+
add_filter( 'template_include', array($this, 'load_single_lesson_template'), 99 );
|
24 |
+
add_filter( 'template_include', array($this, 'play_private_video'), 99 );
|
25 |
+
add_filter( 'template_include', array($this, 'load_quiz_template'), 99 );
|
26 |
+
|
27 |
+
add_filter( 'template_include', array($this, 'student_public_profile'), 99 );
|
28 |
+
add_filter( 'pre_get_document_title', array($this, 'student_public_profile_title') );
|
29 |
+
|
30 |
+
add_filter('the_content', array($this, 'convert_static_page_to_template'));
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param $template
|
35 |
+
*
|
36 |
+
* @return bool|string
|
37 |
+
*
|
38 |
+
* Load default template for course
|
39 |
+
*
|
40 |
+
* @since v.1.0.0
|
41 |
+
*
|
42 |
+
*/
|
43 |
+
public function load_course_archive_template($template){
|
44 |
+
global $wp_query;
|
45 |
+
|
46 |
+
$post_type = get_query_var('post_type');
|
47 |
+
$course_category = get_query_var('course-category');
|
48 |
+
|
49 |
+
if ( ($post_type === $this->course_post_type || ! empty($course_category) ) && $wp_query->is_archive){
|
50 |
+
$template = tutor_get_template('archive-course');
|
51 |
+
return $template;
|
52 |
+
}
|
53 |
+
|
54 |
+
return $template;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param $query
|
59 |
+
*
|
60 |
+
* limit for course archive listing
|
61 |
+
*
|
62 |
+
* Make a page to archive listing for courses
|
63 |
+
*/
|
64 |
+
public function limit_course_query_archive($query){
|
65 |
+
if ($query->is_main_query() && ! $query->is_feed() && ! is_admin() && is_page() ){
|
66 |
+
$queried_object = get_queried_object();
|
67 |
+
if ($queried_object instanceof \WP_Post){
|
68 |
+
$page_id = $queried_object->ID;
|
69 |
+
$selected_archive_page = (int) tutor_utils()->get_option('course_archive_page');
|
70 |
+
|
71 |
+
if ($page_id === $selected_archive_page){
|
72 |
+
$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
|
73 |
+
query_posts(array('post_type' => $this->course_post_type, 'paged' => $paged ));
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( $query->is_archive && $query->is_main_query() && ! $query->is_feed() && ! is_admin() ){
|
79 |
+
$post_type = get_query_var('post_type');
|
80 |
+
$course_category = get_query_var('course-category');
|
81 |
+
if ( ($post_type === $this->course_post_type || ! empty($course_category) )){
|
82 |
+
$courses_per_page = (int) tutor_utils()->get_option('courses_per_page', 10);
|
83 |
+
$query->set('posts_per_page', $courses_per_page);
|
84 |
+
|
85 |
+
$course_filter = 'newest_first';
|
86 |
+
if ( ! empty($_GET['tutor_course_filter'])){
|
87 |
+
$course_filter = sanitize_text_field($_GET['tutor_course_filter']);
|
88 |
+
}
|
89 |
+
switch ($course_filter){
|
90 |
+
case 'newest_first':
|
91 |
+
$query->set('orderby', 'ID');
|
92 |
+
$query->set('order', 'desc');
|
93 |
+
break;
|
94 |
+
case 'oldest_first':
|
95 |
+
$query->set('orderby', 'ID');
|
96 |
+
$query->set('order', 'asc');
|
97 |
+
break;
|
98 |
+
case 'course_title_az':
|
99 |
+
$query->set('orderby', 'post_title');
|
100 |
+
$query->set('order', 'asc');
|
101 |
+
break;
|
102 |
+
case 'course_title_za':
|
103 |
+
$query->set('orderby', 'post_title');
|
104 |
+
$query->set('order', 'desc');
|
105 |
+
break;
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* @param $template
|
114 |
+
*
|
115 |
+
* @return bool|string
|
116 |
+
*
|
117 |
+
* Load Single Course Template
|
118 |
+
*
|
119 |
+
* @since v.1.0.0
|
120 |
+
*/
|
121 |
+
public function load_single_course_template($template){
|
122 |
+
global $wp_query;
|
123 |
+
|
124 |
+
if ($wp_query->is_single && ! empty($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] === $this->course_post_type){
|
125 |
+
$student_must_login_to_view_course = tutor_utils()->get_option('student_must_login_to_view_course');
|
126 |
+
if ($student_must_login_to_view_course){
|
127 |
+
return tutor_get_template('login');
|
128 |
+
}
|
129 |
+
|
130 |
+
if (empty( $wp_query->query_vars['course_subpage'])) {
|
131 |
+
$template = tutor_get_template( 'single-course' );
|
132 |
+
if ( is_user_logged_in() ) {
|
133 |
+
if ( tutor_utils()->is_enrolled() ) {
|
134 |
+
$template = tutor_get_template( 'single-course-enrolled' );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}else{
|
138 |
+
//If Course Subpage Exists
|
139 |
+
if ( is_user_logged_in() ) {
|
140 |
+
$course_subpage = $wp_query->query_vars['course_subpage'];
|
141 |
+
$template = tutor_get_template( 'single-course-enrolled-'.$course_subpage);
|
142 |
+
}else{
|
143 |
+
$template = tutor_get_template('login');
|
144 |
+
}
|
145 |
+
}
|
146 |
+
return $template;
|
147 |
+
}
|
148 |
+
return $template;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* @param $template
|
153 |
+
*
|
154 |
+
* @return bool|string
|
155 |
+
*
|
156 |
+
* Load lesson template
|
157 |
+
*
|
158 |
+
* @since v.1.0.0
|
159 |
+
*/
|
160 |
+
|
161 |
+
public function load_single_lesson_template($template){
|
162 |
+
global $wp_query;
|
163 |
+
|
164 |
+
if ($wp_query->is_single && ! empty($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] === $this->lesson_post_type){
|
165 |
+
$page_id = get_the_ID();
|
166 |
+
|
167 |
+
do_action('tutor_lesson_load_before', $template);
|
168 |
+
|
169 |
+
setup_postdata($page_id);
|
170 |
+
|
171 |
+
if (is_user_logged_in()){
|
172 |
+
$is_course_enrolled = tutor_utils()->is_course_enrolled_by_lesson();
|
173 |
+
|
174 |
+
if ($is_course_enrolled) {
|
175 |
+
$template = tutor_get_template( 'single-lesson' );
|
176 |
+
}else{
|
177 |
+
//You need to enroll first
|
178 |
+
$template = tutor_get_template( 'single.lesson.required-enroll' );
|
179 |
+
}
|
180 |
+
}else{
|
181 |
+
$template = tutor_get_template('login');
|
182 |
+
}
|
183 |
+
wp_reset_postdata();
|
184 |
+
|
185 |
+
return apply_filters('tutor_lesson_template', $template);
|
186 |
+
}
|
187 |
+
return $template;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* @param $template
|
192 |
+
*
|
193 |
+
* @return mixed
|
194 |
+
*
|
195 |
+
* Play the video in this url.
|
196 |
+
*/
|
197 |
+
public function play_private_video($template){
|
198 |
+
global $wp_query;
|
199 |
+
|
200 |
+
if ($wp_query->is_single && ! empty($wp_query->query_vars['lesson_video']) && $wp_query->query_vars['lesson_video'] === 'true') {
|
201 |
+
|
202 |
+
$isPublicVideo = apply_filters('tutor_video_stream_is_public', false, get_the_ID());
|
203 |
+
if ($isPublicVideo){
|
204 |
+
$video_info = tutor_utils()->get_video_info();
|
205 |
+
if ( $video_info ) {
|
206 |
+
$stream = new Video_Stream( $video_info->path );
|
207 |
+
$stream->start();
|
208 |
+
}
|
209 |
+
exit();
|
210 |
+
}
|
211 |
+
|
212 |
+
if (tutor_utils()->is_course_enrolled_by_lesson()) {
|
213 |
+
$video_info = tutor_utils()->get_video_info();
|
214 |
+
if ( $video_info ) {
|
215 |
+
$stream = new Video_Stream( $video_info->path );
|
216 |
+
$stream->start();
|
217 |
+
}
|
218 |
+
}else{
|
219 |
+
_e('Permission denied', 'tutor');
|
220 |
+
}
|
221 |
+
exit();
|
222 |
+
}
|
223 |
+
|
224 |
+
return $template;
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* @param $content
|
229 |
+
*
|
230 |
+
* @return mixed
|
231 |
+
*
|
232 |
+
* Tutor Dashboard Page, Responsible to show student dashboard
|
233 |
+
*
|
234 |
+
* @since v.1.0.0
|
235 |
+
*/
|
236 |
+
public function convert_static_page_to_template($content){
|
237 |
+
//Student Registration Page
|
238 |
+
$student_dashboard_page_id = (int) tutor_utils()->get_option('student_dashboard');
|
239 |
+
if ($student_dashboard_page_id === get_the_ID()){
|
240 |
+
$shortcode = new Shortcode();
|
241 |
+
return $shortcode->tutor_student_dashboard();
|
242 |
+
}
|
243 |
+
|
244 |
+
//Instructor Registration Page
|
245 |
+
$instructor_register_page_page_id = (int) tutor_utils()->get_option('instructor_register_page');
|
246 |
+
if ($instructor_register_page_page_id === get_the_ID()){
|
247 |
+
$shortcode = new Shortcode();
|
248 |
+
return $shortcode->instructor_registration_form();
|
249 |
+
}
|
250 |
+
|
251 |
+
$student_register_page_id = (int) tutor_utils()->get_option('student_register_page');
|
252 |
+
if ($student_register_page_id === get_the_ID()){
|
253 |
+
$shortcode = new Shortcode();
|
254 |
+
return $shortcode->student_registration_form();
|
255 |
+
}
|
256 |
+
|
257 |
+
return $content;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* @param $template
|
262 |
+
*
|
263 |
+
* @return bool|string
|
264 |
+
*
|
265 |
+
* @since v.1.0.0
|
266 |
+
*/
|
267 |
+
public function load_quiz_template($template){
|
268 |
+
global $wp_query;
|
269 |
+
|
270 |
+
if ($wp_query->is_single && ! empty($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] === 'tutor_quiz'){
|
271 |
+
if (is_user_logged_in()){
|
272 |
+
$template = tutor_get_template( 'single-quiz' );
|
273 |
+
}else{
|
274 |
+
$template = tutor_get_template('login');
|
275 |
+
}
|
276 |
+
return $template;
|
277 |
+
}
|
278 |
+
return $template;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* @param $template
|
283 |
+
*
|
284 |
+
* @return bool|string
|
285 |
+
*
|
286 |
+
* @since v.1.0.0
|
287 |
+
*/
|
288 |
+
public function student_public_profile($template){
|
289 |
+
global $wp_query;
|
290 |
+
|
291 |
+
if ( ! empty($wp_query->query['tutor_student_username'])){
|
292 |
+
$template = tutor_get_template( 'student-public-profile' );
|
293 |
+
}
|
294 |
+
|
295 |
+
return $template;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* @return string
|
300 |
+
* Show student Profile
|
301 |
+
*
|
302 |
+
* @since v.1.0.0
|
303 |
+
*/
|
304 |
+
public function student_public_profile_title(){
|
305 |
+
global $wp_query;
|
306 |
+
|
307 |
+
if ( ! empty($wp_query->query['tutor_student_username'])){
|
308 |
+
global $wpdb;
|
309 |
+
|
310 |
+
$user_name = sanitize_text_field($wp_query->query['tutor_student_username']);
|
311 |
+
$user = $wpdb->get_row("select display_name from {$wpdb->users} WHERE user_login = '{$user_name}' limit 1; ");
|
312 |
+
|
313 |
+
if ( ! empty($user->display_name)){
|
314 |
+
return sprintf("%s's Profile page ", $user->display_name );
|
315 |
+
}
|
316 |
+
}
|
317 |
+
return '';
|
318 |
+
}
|
319 |
+
|
320 |
+
|
321 |
+
}
|
classes/Theme_Compatibility.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Integration class
|
4 |
+
*
|
5 |
+
* @author: themeum
|
6 |
+
* @author_uri: https://themeum.com
|
7 |
+
* @package Tutor
|
8 |
+
* @since v.1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
namespace TUTOR;
|
13 |
+
|
14 |
+
|
15 |
+
class Theme_Compatibility {
|
16 |
+
|
17 |
+
public function __construct() {
|
18 |
+
$template = trailingslashit(get_template());
|
19 |
+
$tutor_path = tutor()->path;
|
20 |
+
|
21 |
+
$compatibility_theme_path = $tutor_path.'includes/theme-compatibility/'.$template.'functions.php';
|
22 |
+
|
23 |
+
if (file_exists($compatibility_theme_path)){
|
24 |
+
include $compatibility_theme_path;
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
classes/Tools.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace TUTOR;
|
4 |
+
|
5 |
+
|
6 |
+
class Tools {
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
add_action('tutor_once_in_day_run_schedule', array($this, 'delete_auto_draft_posts'));
|
10 |
+
}
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Delete draft question schedule basis
|
14 |
+
*/
|
15 |
+
public function delete_auto_draft_posts() {
|
16 |
+
global $wpdb;
|
17 |
+
|
18 |
+
$draft_questions_ids = $wpdb->get_col("SELECT ID from {$wpdb->posts} WHERE post_type = 'tutor_question' AND post_status = 'auto-draft' ");
|
19 |
+
if (is_array($draft_questions_ids) && count($draft_questions_ids)){
|
20 |
+
foreach ($draft_questions_ids as $draft_questions_id){
|
21 |
+
wp_delete_post($draft_questions_id, true);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
classes/Tutor_Base.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: mhshohel
|
5 |
+
* Date: 17/9/18
|
6 |
+
* Time: 1:33 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace TUTOR;
|
10 |
+
|
11 |
+
|
12 |
+
class Tutor_Base {
|
13 |
+
|
14 |
+
public $course_post_type;
|
15 |
+
public $lesson_post_type;
|
16 |
+
|
17 |
+
public $lesson_base_permalink;
|
18 |
+
|
19 |
+
public function __construct() {
|
20 |
+
|
21 |
+
$this->course_post_type = tutor()->course_post_type;
|
22 |
+
$this->lesson_post_type = tutor()->lesson_post_type;
|
23 |
+
|
24 |
+
//Lesson Permalink
|
25 |
+
$this->lesson_base_permalink = tutor_utils()->get_option('lesson_permalink_base');
|
26 |
+
if ( ! $this->lesson_base_permalink){
|
27 |
+
$this->lesson_base_permalink = $this->lesson_post_type;
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
}
|
classes/Tutor_List_Table.php
ADDED
@@ -0,0 +1,1326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: mhshohel
|
5 |
+
* Date: 24/9/18
|
6 |
+
* Time: 12:03 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Base class for displaying a list of items in an ajaxified HTML table.
|
15 |
+
*
|
16 |
+
* @since 3.1.0
|
17 |
+
* @access private
|
18 |
+
*/
|
19 |
+
class Tutor_List_Table {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The current list of items.
|
23 |
+
*
|
24 |
+
* @since 3.1.0
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
+
public $items;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Various information about the current table.
|
31 |
+
*
|
32 |
+
* @since 3.1.0
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected $_args;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Various information needed for displaying the pagination.
|
39 |
+
*
|
40 |
+
* @since 3.1.0
|
41 |
+
* @var array
|
42 |
+
*/
|
43 |
+
protected $_pagination_args = array();
|
44 |
+
|
45 |
+
/**
|
46 |
+
* The current screen.
|
47 |
+
*
|
48 |
+
* @since 3.1.0
|
49 |
+
* @var object
|
50 |
+
*/
|
51 |
+
protected $screen;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Cached bulk actions.
|
55 |
+
*
|
56 |
+
* @since 3.1.0
|
57 |
+
* @var array
|
58 |
+
*/
|
59 |
+
private $_actions;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Cached pagination output.
|
63 |
+
*
|
64 |
+
* @since 3.1.0
|
65 |
+
* @var string
|
66 |
+
*/
|
67 |
+
private $_pagination;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* The view switcher modes.
|
71 |
+
*
|
72 |
+
* @since 4.1.0
|
73 |
+
* @var array
|
74 |
+
*/
|
75 |
+
protected $modes = array();
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Stores the value returned by ->get_column_info().
|
79 |
+
*
|
80 |
+
* @since 4.1.0
|
81 |
+
* @var array
|
82 |
+
*/
|
83 |
+
protected $_column_headers;
|
84 |
+
|
85 |
+
/**
|
86 |
+
* {@internal Missing Summary}
|
87 |
+
*
|
88 |
+
* @var array
|
89 |
+
*/
|
90 |
+
protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
|
91 |
+
|
92 |
+
/**
|
93 |
+
* {@internal Missing Summary}
|
94 |
+
*
|
95 |
+
* @var array
|
96 |
+
*/
|
97 |
+
protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
|
98 |
+
'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
|
99 |
+
'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
|
100 |
+
'single_row_columns' );
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Constructor.
|
104 |
+
*
|
105 |
+
* The child class should call this constructor from its own constructor to override
|
106 |
+
* the default $args.
|
107 |
+
*
|
108 |
+
* @since 3.1.0
|
109 |
+
*
|
110 |
+
* @param array|string $args {
|
111 |
+
* Array or string of arguments.
|
112 |
+
*
|
113 |
+
* @type string $plural Plural value used for labels and the objects being listed.
|
114 |
+
* This affects things such as CSS class-names and nonces used
|
115 |
+
* in the list table, e.g. 'posts'. Default empty.
|
116 |
+
* @type string $singular Singular label for an object being listed, e.g. 'post'.
|
117 |
+
* Default empty
|
118 |
+
* @type bool $ajax Whether the list table supports Ajax. This includes loading
|
119 |
+
* and sorting data, for example. If true, the class will call
|
120 |
+
* the _js_vars() method in the footer to provide variables
|
121 |
+
* to any scripts handling Ajax events. Default false.
|
122 |
+
* @type string $screen String containing the hook name used to determine the current
|
123 |
+
* screen. If left null, the current screen will be automatically set.
|
124 |
+
* Default null.
|
125 |
+
* }
|
126 |
+
*/
|
127 |
+
public function __construct( $args = array() ) {
|
128 |
+
$args = wp_parse_args( $args, array(
|
129 |
+
'plural' => '',
|
130 |
+
'singular' => '',
|
131 |
+
'ajax' => false,
|
132 |
+
'screen' => null,
|
133 |
+
) );
|
134 |
+
|
135 |
+
$this->screen = convert_to_screen( $args['screen'] );
|
136 |
+
|
137 |
+
add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
|
138 |
+
|
139 |
+
if ( !$args['plural'] )
|
140 |
+
$args['plural'] = $this->screen->base;
|
141 |
+
|
142 |
+
$args['plural'] = sanitize_key( $args['plural'] );
|
143 |
+
$args['singular'] = sanitize_key( $args['singular'] );
|
144 |
+
|
145 |
+
$this->_args = $args;
|
146 |
+
|
147 |
+
if ( $args['ajax'] ) {
|
148 |
+
// wp_enqueue_script( 'list-table' );
|
149 |
+
add_action( 'admin_footer', array( $this, '_js_vars' ) );
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( empty( $this->modes ) ) {
|
153 |
+
$this->modes = array(
|
154 |
+
'list' => __( 'List View' ),
|
155 |
+
'excerpt' => __( 'Excerpt View' )
|
156 |
+
);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Make private properties readable for backward compatibility.
|
162 |
+
*
|
163 |
+
* @since 4.0.0
|
164 |
+
*
|
165 |
+
* @param string $name Property to get.
|
166 |
+
* @return mixed Property.
|
167 |
+
*/
|
168 |
+
public function __get( $name ) {
|
169 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
170 |
+
return $this->$name;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Make private properties settable for backward compatibility.
|
176 |
+
*
|
177 |
+
* @since 4.0.0
|
178 |
+
*
|
179 |
+
* @param string $name Property to check if set.
|
180 |
+
* @param mixed $value Property value.
|
181 |
+
* @return mixed Newly-set property.
|
182 |
+
*/
|
183 |
+
public function __set( $name, $value ) {
|
184 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
185 |
+
return $this->$name = $value;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Make private properties checkable for backward compatibility.
|
191 |
+
*
|
192 |
+
* @since 4.0.0
|
193 |
+
*
|
194 |
+
* @param string $name Property to check if set.
|
195 |
+
* @return bool Whether the property is set.
|
196 |
+
*/
|
197 |
+
public function __isset( $name ) {
|
198 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
199 |
+
return isset( $this->$name );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Make private properties un-settable for backward compatibility.
|
205 |
+
*
|
206 |
+
* @since 4.0.0
|
207 |
+
*
|
208 |
+
* @param string $name Property to unset.
|
209 |
+
*/
|
210 |
+
public function __unset( $name ) {
|
211 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
212 |
+
unset( $this->$name );
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Make private/protected methods readable for backward compatibility.
|
218 |
+
*
|
219 |
+
* @since 4.0.0
|
220 |
+
*
|
221 |
+
* @param callable $name Method to call.
|
222 |
+
* @param array $arguments Arguments to pass when calling.
|
223 |
+
* @return mixed|bool Return value of the callback, false otherwise.
|
224 |
+
*/
|
225 |
+
public function __call( $name, $arguments ) {
|
226 |
+
if ( in_array( $name, $this->compat_methods ) ) {
|
227 |
+
return call_user_func_array( array( $this, $name ), $arguments );
|
228 |
+
}
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Checks the current user's permissions
|
234 |
+
*
|
235 |
+
* @since 3.1.0
|
236 |
+
* @abstract
|
237 |
+
*/
|
238 |
+
public function ajax_user_can() {
|
239 |
+
die( 'function Tutor_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Prepares the list of items for displaying.
|
244 |
+
* @uses Tutor_List_Table::set_pagination_args()
|
245 |
+
*
|
246 |
+
* @since 3.1.0
|
247 |
+
* @abstract
|
248 |
+
*/
|
249 |
+
public function prepare_items() {
|
250 |
+
die( 'function Tutor_List_Table::prepare_items() must be over-ridden in a sub-class.' );
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* An internal method that sets all the necessary pagination arguments
|
255 |
+
*
|
256 |
+
* @since 3.1.0
|
257 |
+
*
|
258 |
+
* @param array|string $args Array or string of arguments with information about the pagination.
|
259 |
+
*/
|
260 |
+
protected function set_pagination_args( $args ) {
|
261 |
+
$args = wp_parse_args( $args, array(
|
262 |
+
'total_items' => 0,
|
263 |
+
'total_pages' => 0,
|
264 |
+
'per_page' => 0,
|
265 |
+
) );
|
266 |
+
|
267 |
+
if ( !$args['total_pages'] && $args['per_page'] > 0 )
|
268 |
+
$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
|
269 |
+
|
270 |
+
// Redirect if page number is invalid and headers are not already sent.
|
271 |
+
if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
|
272 |
+
wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
|
273 |
+
exit;
|
274 |
+
}
|
275 |
+
|
276 |
+
$this->_pagination_args = $args;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Access the pagination args.
|
281 |
+
*
|
282 |
+
* @since 3.1.0
|
283 |
+
*
|
284 |
+
* @param string $key Pagination argument to retrieve. Common values include 'total_items',
|
285 |
+
* 'total_pages', 'per_page', or 'infinite_scroll'.
|
286 |
+
* @return int Number of items that correspond to the given pagination argument.
|
287 |
+
*/
|
288 |
+
public function get_pagination_arg( $key ) {
|
289 |
+
if ( 'page' === $key ) {
|
290 |
+
return $this->get_pagenum();
|
291 |
+
}
|
292 |
+
|
293 |
+
if ( isset( $this->_pagination_args[$key] ) ) {
|
294 |
+
return $this->_pagination_args[$key];
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Whether the table has items to display or not
|
300 |
+
*
|
301 |
+
* @since 3.1.0
|
302 |
+
*
|
303 |
+
* @return bool
|
304 |
+
*/
|
305 |
+
public function has_items() {
|
306 |
+
return !empty( $this->items );
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Message to be displayed when there are no items
|
311 |
+
*
|
312 |
+
* @since 3.1.0
|
313 |
+
*/
|
314 |
+
public function no_items() {
|
315 |
+
_e( 'No items found.' );
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Displays the search box.
|
320 |
+
*
|
321 |
+
* @since 3.1.0
|
322 |
+
*
|
323 |
+
* @param string $text The 'submit' button label.
|
324 |
+
* @param string $input_id ID attribute value for the search input field.
|
325 |
+
*/
|
326 |
+
public function search_box( $text, $input_id ) {
|
327 |
+
if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
|
328 |
+
return;
|
329 |
+
|
330 |
+
$input_id = $input_id . '-search-input';
|
331 |
+
|
332 |
+
if ( ! empty( $_REQUEST['orderby'] ) )
|
333 |
+
echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
|
334 |
+
if ( ! empty( $_REQUEST['order'] ) )
|
335 |
+
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
|
336 |
+
if ( ! empty( $_REQUEST['post_mime_type'] ) )
|
337 |
+
echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
|
338 |
+
if ( ! empty( $_REQUEST['detached'] ) )
|
339 |
+
echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
|
340 |
+
?>
|
341 |
+
<p class="search-box">
|
342 |
+
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
|
343 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
|
344 |
+
<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
|
345 |
+
</p>
|
346 |
+
<?php
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Get an associative array ( id => link ) with the list
|
351 |
+
* of views available on this table.
|
352 |
+
*
|
353 |
+
* @since 3.1.0
|
354 |
+
*
|
355 |
+
* @return array
|
356 |
+
*/
|
357 |
+
protected function get_views() {
|
358 |
+
return array();
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Display the list of views available on this table.
|
363 |
+
*
|
364 |
+
* @since 3.1.0
|
365 |
+
*/
|
366 |
+
public function views() {
|
367 |
+
$views = $this->get_views();
|
368 |
+
/**
|
369 |
+
* Filters the list of available list table views.
|
370 |
+
*
|
371 |
+
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
372 |
+
* to the ID of the current screen, usually a string.
|
373 |
+
*
|
374 |
+
* @since 3.5.0
|
375 |
+
*
|
376 |
+
* @param array $views An array of available list table views.
|
377 |
+
*/
|
378 |
+
$views = apply_filters( "views_{$this->screen->id}", $views );
|
379 |
+
|
380 |
+
if ( empty( $views ) )
|
381 |
+
return;
|
382 |
+
|
383 |
+
$this->screen->render_screen_reader_content( 'heading_views' );
|
384 |
+
|
385 |
+
echo "<ul class='subsubsub'>\n";
|
386 |
+
foreach ( $views as $class => $view ) {
|
387 |
+
$views[ $class ] = "\t<li class='$class'>$view";
|
388 |
+
}
|
389 |
+
echo implode( " |</li>\n", $views ) . "</li>\n";
|
390 |
+
echo "</ul>";
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Get an associative array ( option_name => option_title ) with the list
|
395 |
+
* of bulk actions available on this table.
|
396 |
+
*
|
397 |
+
* @since 3.1.0
|
398 |
+
*
|
399 |
+
* @return array
|
400 |
+
*/
|
401 |
+
protected function get_bulk_actions() {
|
402 |
+
return array();
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Display the bulk actions dropdown.
|
407 |
+
*
|
408 |
+
* @since 3.1.0
|
409 |
+
*
|
410 |
+
* @param string $which The location of the bulk actions: 'top' or 'bottom'.
|
411 |
+
* This is designated as optional for backward compatibility.
|
412 |
+
*/
|
413 |
+
protected function bulk_actions( $which = '' ) {
|
414 |
+
if ( is_null( $this->_actions ) ) {
|
415 |
+
$this->_actions = $this->get_bulk_actions();
|
416 |
+
/**
|
417 |
+
* Filters the list table Bulk Actions drop-down.
|
418 |
+
*
|
419 |
+
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
420 |
+
* to the ID of the current screen, usually a string.
|
421 |
+
*
|
422 |
+
* This filter can currently only be used to remove bulk actions.
|
423 |
+
*
|
424 |
+
* @since 3.5.0
|
425 |
+
*
|
426 |
+
* @param array $actions An array of the available bulk actions.
|
427 |
+
*/
|
428 |
+
$this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
|
429 |
+
$two = '';
|
430 |
+
} else {
|
431 |
+
$two = '2';
|
432 |
+
}
|
433 |
+
|
434 |
+
if ( empty( $this->_actions ) )
|
435 |
+
return;
|
436 |
+
|
437 |
+
echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
|
438 |
+
echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
|
439 |
+
echo '<option value="-1">' . __( 'Bulk Actions' ) . "</option>\n";
|
440 |
+
|
441 |
+
foreach ( $this->_actions as $name => $title ) {
|
442 |
+
$class = 'edit' === $name ? ' class="hide-if-no-js"' : '';
|
443 |
+
|
444 |
+
echo "\t" . '<option value="' . $name . '"' . $class . '>' . $title . "</option>\n";
|
445 |
+
}
|
446 |
+
|
447 |
+
echo "</select>\n";
|
448 |
+
|
449 |
+
submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
|
450 |
+
echo "\n";
|
451 |
+
}
|
452 |
+
|
453 |
+
/**
|
454 |
+
* Get the current action selected from the bulk actions dropdown.
|
455 |
+
*
|
456 |
+
* @since 3.1.0
|
457 |
+
*
|
458 |
+
* @return string|false The action name or False if no action was selected
|
459 |
+
*/
|
460 |
+
public function current_action() {
|
461 |
+
if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
|
462 |
+
return false;
|
463 |
+
|
464 |
+
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
|
465 |
+
return $_REQUEST['action'];
|
466 |
+
|
467 |
+
if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
|
468 |
+
return $_REQUEST['action2'];
|
469 |
+
|
470 |
+
return false;
|
471 |
+
}
|
472 |
+
|
473 |
+
/**
|
474 |
+
* Generate row actions div
|
475 |
+
*
|
476 |
+
* @since 3.1.0
|
477 |
+
*
|
478 |
+
* @param array $actions The list of actions
|
479 |
+
* @param bool $always_visible Whether the actions should be always visible
|
480 |
+
* @return string
|
481 |
+
*/
|
482 |
+
protected function row_actions( $actions, $always_visible = false ) {
|
483 |
+
$action_count = count( $actions );
|
484 |
+
$i = 0;
|
485 |
+
|
486 |
+
if ( !$action_count )
|
487 |
+
return '';
|
488 |
+
|
489 |
+
$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
|
490 |
+
foreach ( $actions as $action => $link ) {
|
491 |
+
++$i;
|
492 |
+
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
493 |
+
$out .= "<span class='$action'>$link$sep</span>";
|
494 |
+
}
|
495 |
+
$out .= '</div>';
|
496 |
+
|
497 |
+
$out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
|
498 |
+
|
499 |
+
return $out;
|
500 |
+
}
|
501 |
+
|
502 |
+
/**
|
503 |
+
* Display a monthly dropdown for filtering items
|
504 |
+
*
|
505 |
+
* @since 3.1.0
|
506 |
+
*
|
507 |
+
* @global wpdb $wpdb
|
508 |
+
* @global WP_Locale $wp_locale
|
509 |
+
*
|
510 |
+
* @param string $post_type
|
511 |
+
*/
|
512 |
+
protected function months_dropdown( $post_type ) {
|
513 |
+
global $wpdb, $wp_locale;
|
514 |
+
|
515 |
+
/**
|
516 |
+
* Filters whether to remove the 'Months' drop-down from the post list table.
|
517 |
+
*
|
518 |
+
* @since 4.2.0
|
519 |
+
*
|
520 |
+
* @param bool $disable Whether to disable the drop-down. Default false.
|
521 |
+
* @param string $post_type The post type.
|
522 |
+
*/
|
523 |
+
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
|
524 |
+
return;
|
525 |
+
}
|
526 |
+
|
527 |
+
$extra_checks = "AND post_status != 'auto-draft'";
|
528 |
+
if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
|
529 |
+
$extra_checks .= " AND post_status != 'trash'";
|
530 |
+
} elseif ( isset( $_GET['post_status'] ) ) {
|
531 |
+
$extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );
|
532 |
+
}
|
533 |
+
|
534 |
+
$months = $wpdb->get_results( $wpdb->prepare( "
|
535 |
+
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
536 |
+
FROM $wpdb->posts
|
537 |
+
WHERE post_type = %s
|
538 |
+
$extra_checks
|
539 |
+
ORDER BY post_date DESC
|
540 |
+
", $post_type ) );
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Filters the 'Months' drop-down results.
|
544 |
+
*
|
545 |
+
* @since 3.7.0
|
546 |
+
*
|
547 |
+
* @param object $months The months drop-down query results.
|
548 |
+
* @param string $post_type The post type.
|
549 |
+
*/
|
550 |
+
$months = apply_filters( 'months_dropdown_results', $months, $post_type );
|
551 |
+
|
552 |
+
$month_count = count( $months );
|
553 |
+
|
554 |
+
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
|
555 |
+
return;
|
556 |
+
|
557 |
+
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
558 |
+
?>
|
559 |
+
<label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
|
560 |
+
<select name="m" id="filter-by-date">
|
561 |
+
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
|
562 |
+
<?php
|
563 |
+
foreach ( $months as $arc_row ) {
|
564 |
+
if ( 0 == $arc_row->year )
|
565 |
+
continue;
|
566 |
+
|
567 |
+
$month = zeroise( $arc_row->month, 2 );
|
568 |
+
$year = $arc_row->year;
|
569 |
+
|
570 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
571 |
+
selected( $m, $year . $month, false ),
|
572 |
+
esc_attr( $arc_row->year . $month ),
|
573 |
+
/* translators: 1: month name, 2: 4-digit year */
|
574 |
+
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
|
575 |
+
);
|
576 |
+
}
|
577 |
+
?>
|
578 |
+
</select>
|
579 |
+
<?php
|
580 |
+
}
|
581 |
+
|
582 |
+
/**
|
583 |
+
* Display a view switcher
|
584 |
+
*
|
585 |
+
* @since 3.1.0
|
586 |
+
*
|
587 |
+
* @param string $current_mode
|
588 |
+
*/
|
589 |
+
protected function view_switcher( $current_mode ) {
|
590 |
+
?>
|
591 |
+
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
|
592 |
+
<div class="view-switch">
|
593 |
+
<?php
|
594 |
+
foreach ( $this->modes as $mode => $title ) {
|
595 |
+
$classes = array( 'view-' . $mode );
|
596 |
+
if ( $current_mode === $mode )
|
597 |
+
$classes[] = 'current';
|
598 |
+
printf(
|
599 |
+
"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
|
600 |
+
esc_url( add_query_arg( 'mode', $mode ) ),
|
601 |
+
implode( ' ', $classes ),
|
602 |
+
$title
|
603 |
+
);
|
604 |
+
}
|
605 |
+
?>
|
606 |
+
</div>
|
607 |
+
<?php
|
608 |
+
}
|
609 |
+
|
610 |
+
/**
|
611 |
+
* Display a comment count bubble
|
612 |
+
*
|
613 |
+
* @since 3.1.0
|
614 |
+
*
|
615 |
+
* @param int $post_id The post ID.
|
616 |
+
* @param int $pending_comments Number of pending comments.
|
617 |
+
*/
|
618 |
+
protected function comments_bubble( $post_id, $pending_comments ) {
|
619 |
+
$approved_comments = get_comments_number();
|
620 |
+
|
621 |
+
$approved_comments_number = number_format_i18n( $approved_comments );
|
622 |
+
$pending_comments_number = number_format_i18n( $pending_comments );
|
623 |
+
|
624 |
+
$approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
|
625 |
+
$approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
|
626 |
+
$pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
|
627 |
+
|
628 |
+
// No comments at all.
|
629 |
+
if ( ! $approved_comments && ! $pending_comments ) {
|
630 |
+
printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
|
631 |
+
__( 'No comments' )
|
632 |
+
);
|
633 |
+
// Approved comments have different display depending on some conditions.
|
634 |
+
} elseif ( $approved_comments ) {
|
635 |
+
printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
636 |
+
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
|
637 |
+
$approved_comments_number,
|
638 |
+
$pending_comments ? $approved_phrase : $approved_only_phrase
|
639 |
+
);
|
640 |
+
} else {
|
641 |
+
printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
|
642 |
+
$approved_comments_number,
|
643 |
+
$pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
|
644 |
+
);
|
645 |
+
}
|
646 |
+
|
647 |
+
if ( $pending_comments ) {
|
648 |
+
printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
649 |
+
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
|
650 |
+
$pending_comments_number,
|
651 |
+
$pending_phrase
|
652 |
+
);
|
653 |
+
} else {
|
654 |
+
printf( '<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
|
655 |
+
$pending_comments_number,
|
656 |
+
$approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
|
657 |
+
);
|
658 |
+
}
|
659 |
+
}
|
660 |
+
|
661 |
+
/**
|
662 |
+
* Get the current page number
|
663 |
+
*
|
664 |
+
* @since 3.1.0
|
665 |
+
*
|
666 |
+
* @return int
|
667 |
+
*/
|
668 |
+
public function get_pagenum() {
|
669 |
+
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
|
670 |
+
|
671 |
+
if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
|
672 |
+
$pagenum = $this->_pagination_args['total_pages'];
|
673 |
+
|
674 |
+
return max( 1, $pagenum );
|
675 |
+
}
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Get number of items to display on a single page
|
679 |
+
*
|
680 |
+
* @since 3.1.0
|
681 |
+
*
|
682 |
+
* @param string $option
|
683 |
+
* @param int $default
|
684 |
+
* @return int
|
685 |
+
*/
|
686 |
+
protected function get_items_per_page( $option, $default = 20 ) {
|
687 |
+
$per_page = (int) get_user_option( $option );
|
688 |
+
if ( empty( $per_page ) || $per_page < 1 )
|
689 |
+
$per_page = $default;
|
690 |
+
|
691 |
+
/**
|
692 |
+
* Filters the number of items to be displayed on each page of the list table.
|
693 |
+
*
|
694 |
+
* The dynamic hook name, $option, refers to the `per_page` option depending
|
695 |
+
* on the type of list table in use. Possible values include: 'edit_comments_per_page',
|
696 |
+
* 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
|
697 |
+
* 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
|
698 |
+
* 'edit_{$post_type}_per_page', etc.
|
699 |
+
*
|
700 |
+
* @since 2.9.0
|
701 |
+
*
|
702 |
+
* @param int $per_page Number of items to be displayed. Default 20.
|
703 |
+
*/
|
704 |
+
return (int) apply_filters( "{$option}", $per_page );
|
705 |
+
}
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Display the pagination.
|
709 |
+
*
|
710 |
+
* @since 3.1.0
|
711 |
+
*
|
712 |
+
* @param string $which
|
713 |
+
*/
|
714 |
+
protected function pagination( $which ) {
|
715 |
+
if ( empty( $this->_pagination_args ) ) {
|
716 |
+
return;
|
717 |
+
}
|
718 |
+
|
719 |
+
$total_items = $this->_pagination_args['total_items'];
|
720 |
+
$total_pages = $this->_pagination_args['total_pages'];
|
721 |
+
$infinite_scroll = false;
|
722 |
+
if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
|
723 |
+
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
|
724 |
+
}
|
725 |
+
|
726 |
+
if ( 'top' === $which && $total_pages > 1 ) {
|
727 |
+
$this->screen->render_screen_reader_content( 'heading_pagination' );
|
728 |
+
}
|
729 |
+
|
730 |
+
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
731 |
+
|
732 |
+
$current = $this->get_pagenum();
|
733 |
+
$removable_query_args = wp_removable_query_args();
|
734 |
+
|
735 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
736 |
+
|
737 |
+
$current_url = remove_query_arg( $removable_query_args, $current_url );
|
738 |
+
|
739 |
+
$page_links = array();
|
740 |
+
|
741 |
+
$total_pages_before = '<span class="paging-input">';
|
742 |
+
$total_pages_after = '</span></span>';
|
743 |
+
|
744 |
+
$disable_first = $disable_last = $disable_prev = $disable_next = false;
|
745 |
+
|
746 |
+
if ( $current == 1 ) {
|
747 |
+
$disable_first = true;
|
748 |
+
$disable_prev = true;
|
749 |
+
}
|
750 |
+
if ( $current == 2 ) {
|
751 |
+
$disable_first = true;
|
752 |
+
}
|
753 |
+
if ( $current == $total_pages ) {
|
754 |
+
$disable_last = true;
|
755 |
+
$disable_next = true;
|
756 |
+
}
|
757 |
+
if ( $current == $total_pages - 1 ) {
|
758 |
+
$disable_last = true;
|
759 |
+
}
|
760 |
+
|
761 |
+
if ( $disable_first ) {
|
762 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">«</span>';
|
763 |
+
} else {
|
764 |
+
$page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
765 |
+
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
766 |
+
__( 'First page' ),
|
767 |
+
'«'
|
768 |
+
);
|
769 |
+
}
|
770 |
+
|
771 |
+
if ( $disable_prev ) {
|
772 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">‹</span>';
|
773 |
+
} else {
|
774 |
+
$page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
775 |
+
esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
|
776 |
+
__( 'Previous page' ),
|
777 |
+
'‹'
|
778 |
+
);
|
779 |
+
}
|
780 |
+
|
781 |
+
if ( 'bottom' === $which ) {
|
782 |
+
$html_current_page = $current;
|
783 |
+
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
|
784 |
+
} else {
|
785 |
+
$html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
|
786 |
+
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
|
787 |
+
$current,
|
788 |
+
strlen( $total_pages )
|
789 |
+
);
|
790 |
+
}
|
791 |
+
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
792 |
+
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
|
793 |
+
|
794 |
+
if ( $disable_next ) {
|
795 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">›</span>';
|
796 |
+
} else {
|
797 |
+
$page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
798 |
+
esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
|
799 |
+
__( 'Next page' ),
|
800 |
+
'›'
|
801 |
+
);
|
802 |
+
}
|
803 |
+
|
804 |
+
if ( $disable_last ) {
|
805 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">»</span>';
|
806 |
+
} else {
|
807 |
+
$page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
808 |
+
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
809 |
+
__( 'Last page' ),
|
810 |
+
'»'
|
811 |
+
);
|
812 |
+
}
|
813 |
+
|
814 |
+
$pagination_links_class = 'pagination-links';
|
815 |
+
if ( ! empty( $infinite_scroll ) ) {
|
816 |
+
$pagination_links_class .= ' hide-if-js';
|
817 |
+
}
|
818 |
+
$output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
|
819 |
+
|
820 |
+
if ( $total_pages ) {
|
821 |
+
$page_class = $total_pages < 2 ? ' one-page' : '';
|
822 |
+
} else {
|
823 |
+
$page_class = ' no-pages';
|
824 |
+
}
|
825 |
+
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
826 |
+
|
827 |
+
echo $this->_pagination;
|
828 |
+
}
|
829 |
+
|
830 |
+
/**
|
831 |
+
* Get a list of columns. The format is:
|
832 |
+
* 'internal-name' => 'Title'
|
833 |
+
*
|
834 |
+
* @since 3.1.0
|
835 |
+
* @abstract
|
836 |
+
*
|
837 |
+
* @return array
|
838 |
+
*/
|
839 |
+
public function get_columns() {
|
840 |
+
die( 'function Tutor_List_Table::get_columns() must be over-ridden in a sub-class.' );
|
841 |
+
}
|
842 |
+
|
843 |
+
/**
|
844 |
+
* Get a list of sortable columns. The format is:
|
845 |
+
* 'internal-name' => 'orderby'
|
846 |
+
* or
|
847 |
+
* 'internal-name' => array( 'orderby', true )
|
848 |
+
*
|
849 |
+
* The second format will make the initial sorting order be descending
|
850 |
+
*
|
851 |
+
* @since 3.1.0
|
852 |
+
*
|
853 |
+
* @return array
|
854 |
+
*/
|
855 |
+
protected function get_sortable_columns() {
|
856 |
+
return array();
|
857 |
+
}
|
858 |
+
|
859 |
+
/**
|
860 |
+
* Gets the name of the default primary column.
|
861 |
+
*
|
862 |
+
* @since 4.3.0
|
863 |
+
*
|
864 |
+
* @return string Name of the default primary column, in this case, an empty string.
|
865 |
+
*/
|
866 |
+
protected function get_default_primary_column_name() {
|
867 |
+
$columns = $this->get_columns();
|
868 |
+
$column = '';
|
869 |
+
|
870 |
+
if ( empty( $columns ) ) {
|
871 |
+
return $column;
|
872 |
+
}
|
873 |
+
|
874 |
+
// We need a primary defined so responsive views show something,
|
875 |
+
// so let's fall back to the first non-checkbox column.
|
876 |
+
foreach ( $columns as $col => $column_name ) {
|
877 |
+
if ( 'cb' === $col ) {
|
878 |
+
continue;
|
879 |
+
}
|
880 |
+
|
881 |
+
$column = $col;
|
882 |
+
break;
|
883 |
+
}
|
884 |
+
|
885 |
+
return $column;
|
886 |
+
}
|
887 |
+
|
888 |
+
/**
|
889 |
+
* Public wrapper for Tutor_List_Table::get_default_primary_column_name().
|
890 |
+
*
|
891 |
+
* @since 4.4.0
|
892 |
+
*
|
893 |
+
* @return string Name of the default primary column.
|
894 |
+
*/
|
895 |
+
public function get_primary_column() {
|
896 |
+
return $this->get_primary_column_name();
|
897 |
+
}
|
898 |
+
|
899 |
+
/**
|
900 |
+
* Gets the name of the primary column.
|
901 |
+
*
|
902 |
+
* @since 4.3.0
|
903 |
+
*
|
904 |
+
* @return string The name of the primary column.
|
905 |
+
*/
|
906 |
+
protected function get_primary_column_name() {
|
907 |
+
$columns = get_column_headers( $this->screen );
|
908 |
+
$default = $this->get_default_primary_column_name();
|
909 |
+
|
910 |
+
// If the primary column doesn't exist fall back to the
|
911 |
+
// first non-checkbox column.
|
912 |
+
if ( ! isset( $columns[ $default ] ) ) {
|
913 |
+
$default = Tutor_List_Table::get_default_primary_column_name();
|
914 |
+
}
|
915 |
+
|
916 |
+
/**
|
917 |
+
* Filters the name of the primary column for the current list table.
|
918 |
+
*
|
919 |
+
* @since 4.3.0
|
920 |
+
*
|
921 |
+
* @param string $default Column name default for the specific list table, e.g. 'name'.
|
922 |
+
* @param string $context Screen ID for specific list table, e.g. 'plugins'.
|
923 |
+
*/
|
924 |
+
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
|
925 |
+
|
926 |
+
if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
|
927 |
+
$column = $default;
|
928 |
+
}
|
929 |
+
|
930 |
+
return $column;
|
931 |
+
}
|
932 |
+
|
933 |
+
/**
|
934 |
+
* Get a list of all, hidden and sortable columns, with filter applied
|
935 |
+
*
|
936 |
+
* @since 3.1.0
|
937 |
+
*
|
938 |
+
* @return array
|
939 |
+
*/
|
940 |
+
protected function get_column_info() {
|
941 |
+
// $_column_headers is already set / cached
|
942 |
+
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
|
943 |
+
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
|
944 |
+
// In 4.3, we added a fourth argument for primary column.
|
945 |
+
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
|
946 |
+
foreach ( $this->_column_headers as $key => $value ) {
|
947 |
+
$column_headers[ $key ] = $value;
|
948 |
+
}
|
949 |
+
|
950 |
+
return $column_headers;
|
951 |
+
}
|
952 |
+
|
953 |
+
$columns = get_column_headers( $this->screen );
|
954 |
+
$hidden = get_hidden_columns( $this->screen );
|
955 |
+
|
956 |
+
$sortable_columns = $this->get_sortable_columns();
|
957 |
+
/**
|
958 |
+
* Filters the list table sortable columns for a specific screen.
|
959 |
+
*
|
960 |
+
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
961 |
+
* to the ID of the current screen, usually a string.
|
962 |
+
*
|
963 |
+
* @since 3.5.0
|
964 |
+
*
|
965 |
+
* @param array $sortable_columns An array of sortable columns.
|
966 |
+
*/
|
967 |
+
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
|
968 |
+
|
969 |
+
$sortable = array();
|
970 |
+
foreach ( $_sortable as $id => $data ) {
|
971 |
+
if ( empty( $data ) )
|
972 |
+
continue;
|
973 |
+
|
974 |
+
$data = (array) $data;
|
975 |
+
if ( !isset( $data[1] ) )
|
976 |
+
$data[1] = false;
|
977 |
+
|
978 |
+
$sortable[$id] = $data;
|
979 |
+
}
|
980 |
+
|
981 |
+
$primary = $this->get_primary_column_name();
|
982 |
+
$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
|
983 |
+
|
984 |
+
return $this->_column_headers;
|
985 |
+
}
|
986 |
+
|
987 |
+
/**
|
988 |
+
* Return number of visible columns
|
989 |
+
*
|
990 |
+
* @since 3.1.0
|
991 |
+
*
|
992 |
+
* @return int
|
993 |
+
*/
|
994 |
+
public function get_column_count() {
|
995 |
+
list ( $columns, $hidden ) = $this->get_column_info();
|
996 |
+
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
|
997 |
+
return count( $columns ) - count( $hidden );
|
998 |
+
}
|
999 |
+
|
1000 |
+
/**
|
1001 |
+
* Print column headers, accounting for hidden and sortable columns.
|
1002 |
+
*
|
1003 |
+
* @since 3.1.0
|
1004 |
+
*
|
1005 |
+
* @staticvar int $cb_counter
|
1006 |
+
*
|
1007 |
+
* @param bool $with_id Whether to set the id attribute or not
|
1008 |
+
*/
|
1009 |
+
public function print_column_headers( $with_id = true ) {
|
1010 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1011 |
+
|
1012 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
1013 |
+
$current_url = remove_query_arg( 'paged', $current_url );
|
1014 |
+
|
1015 |
+
if ( isset( $_GET['orderby'] ) ) {
|
1016 |
+
$current_orderby = $_GET['orderby'];
|
1017 |
+
} else {
|
1018 |
+
$current_orderby = '';
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
|
1022 |
+
$current_order = 'desc';
|
1023 |
+
} else {
|
1024 |
+
$current_order = 'asc';
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
if ( ! empty( $columns['cb'] ) ) {
|
1028 |
+
static $cb_counter = 1;
|
1029 |
+
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
|
1030 |
+
. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
|
1031 |
+
$cb_counter++;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
foreach ( $columns as $column_key => $column_display_name ) {
|
1035 |
+
$class = array( 'manage-column', "column-$column_key" );
|
1036 |
+
|
1037 |
+
if ( in_array( $column_key, $hidden ) ) {
|
1038 |
+
$class[] = 'hidden';
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
if ( 'cb' === $column_key )
|
1042 |
+
$class[] = 'check-column';
|
1043 |
+
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
|
1044 |
+
$class[] = 'num';
|
1045 |
+
|
1046 |
+
if ( $column_key === $primary ) {
|
1047 |
+
$class[] = 'column-primary';
|
1048 |
+
}
|
1049 |
+
|
1050 |
+
if ( isset( $sortable[$column_key] ) ) {
|
1051 |
+
list( $orderby, $desc_first ) = $sortable[$column_key];
|
1052 |
+
|
1053 |
+
if ( $current_orderby === $orderby ) {
|
1054 |
+
$order = 'asc' === $current_order ? 'desc' : 'asc';
|
1055 |
+
$class[] = 'sorted';
|
1056 |
+
$class[] = $current_order;
|
1057 |
+
} else {
|
1058 |
+
$order = $desc_first ? 'desc' : 'asc';
|
1059 |
+
$class[] = 'sortable';
|
1060 |
+
$class[] = $desc_first ? 'asc' : 'desc';
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
1067 |
+
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
1068 |
+
$id = $with_id ? "id='$column_key'" : '';
|
1069 |
+
|
1070 |
+
if ( !empty( $class ) )
|
1071 |
+
$class = "class='" . join( ' ', $class ) . "'";
|
1072 |
+
|
1073 |
+
echo "<$tag $scope $id $class>$column_display_name</$tag>";
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
/**
|
1078 |
+
* Display the table
|
1079 |
+
*
|
1080 |
+
* @since 3.1.0
|
1081 |
+
*/
|
1082 |
+
public function display() {
|
1083 |
+
$singular = $this->_args['singular'];
|
1084 |
+
|
1085 |
+
$this->display_tablenav( 'top' );
|
1086 |
+
|
1087 |
+
$this->screen->render_screen_reader_content( 'heading_list' );
|
1088 |
+
?>
|
1089 |
+
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
1090 |
+
<thead>
|
1091 |
+
<tr>
|
1092 |
+
<?php $this->print_column_headers(); ?>
|
1093 |
+
</tr>
|
1094 |
+
</thead>
|
1095 |
+
|
1096 |
+
<tbody id="the-list"<?php
|
1097 |
+
if ( $singular ) {
|
1098 |
+
echo " data-wp-lists='list:$singular'";
|
1099 |
+
} ?>>
|
1100 |
+
<?php $this->display_rows_or_placeholder(); ?>
|
1101 |
+
</tbody>
|
1102 |
+
|
1103 |
+
<tfoot>
|
1104 |
+
<tr>
|
1105 |
+
<?php $this->print_column_headers( false ); ?>
|
1106 |
+
</tr>
|
1107 |
+
</tfoot>
|
1108 |
+
|
1109 |
+
</table>
|
1110 |
+
<?php
|
1111 |
+
$this->display_tablenav( 'bottom' );
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
/**
|
1115 |
+
* Get a list of CSS classes for the Tutor_List_Table table tag.
|
1116 |
+
*
|
1117 |
+
* @since 3.1.0
|
1118 |
+
*
|
1119 |
+
* @return array List of CSS classes for the table tag.
|
1120 |
+
*/
|
1121 |
+
protected function get_table_classes() {
|
1122 |
+
return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
/**
|
1126 |
+
* Generate the table navigation above or below the table
|
1127 |
+
*
|
1128 |
+
* @since 3.1.0
|
1129 |
+
* @param string $which
|
1130 |
+
*/
|
1131 |
+
protected function display_tablenav( $which ) {
|
1132 |
+
if ( 'top' === $which ) {
|
1133 |
+
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
|
1134 |
+
}
|
1135 |
+
?>
|
1136 |
+
<div class="tablenav <?php echo esc_attr( $which ); ?>">
|
1137 |
+
|
1138 |
+
<?php if ( $this->has_items() ): ?>
|
1139 |
+
<div class="alignleft actions bulkactions">
|
1140 |
+
<?php $this->bulk_actions( $which ); ?>
|
1141 |
+
</div>
|
1142 |
+
<?php endif;
|
1143 |
+
$this->extra_tablenav( $which );
|
1144 |
+
$this->pagination( $which );
|
1145 |
+
?>
|
1146 |
+
|
1147 |
+
<br class="clear" />
|
1148 |
+
</div>
|
1149 |
+
<?php
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
/**
|
1153 |
+
* Extra controls to be displayed between bulk actions and pagination
|
1154 |
+
*
|
1155 |
+
* @since 3.1.0
|
1156 |
+
*
|
1157 |
+
* @param string $which
|
1158 |
+
*/
|
1159 |
+
protected function extra_tablenav( $which ) {}
|
1160 |
+
|
1161 |
+
/**
|
1162 |
+
* Generate the tbody element for the list table.
|
1163 |
+
*
|
1164 |
+
* @since 3.1.0
|
1165 |
+
*/
|
1166 |
+
public function display_rows_or_placeholder() {
|
1167 |
+
if ( $this->has_items() ) {
|
1168 |
+
$this->display_rows();
|
1169 |
+
} else {
|
1170 |
+
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
1171 |
+
$this->no_items();
|
1172 |
+
echo '</td></tr>';
|
1173 |
+
}
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
/**
|
1177 |
+
* Generate the table rows
|
1178 |
+
*
|
1179 |
+
* @since 3.1.0
|
1180 |
+
*/
|
1181 |
+
public function display_rows() {
|
1182 |
+
foreach ( $this->items as $item )
|
1183 |
+
$this->single_row( $item );
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
/**
|
1187 |
+
* Generates content for a single row of the table
|
1188 |
+
*
|
1189 |
+
* @since 3.1.0
|
1190 |
+
*
|
1191 |
+
* @param object $item The current item
|
1192 |
+
*/
|
1193 |
+
public function single_row( $item ) {
|
1194 |
+
echo '<tr>';
|
1195 |
+
$this->single_row_columns( $item );
|
1196 |
+
echo '</tr>';
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
/**
|
1200 |
+
*
|
1201 |
+
* @param object $item
|
1202 |
+
* @param string $column_name
|
1203 |
+
*/
|
1204 |
+
protected function column_default( $item, $column_name ) {}
|
1205 |
+
|
1206 |
+
/**
|
1207 |
+
*
|
1208 |
+
* @param object $item
|
1209 |
+
*/
|
1210 |
+
protected function column_cb( $item ) {}
|
1211 |
+
|
1212 |
+
/**
|
1213 |
+
* Generates the columns for a single row of the table
|
1214 |
+
*
|
1215 |
+
* @since 3.1.0
|
1216 |
+
*
|
1217 |
+
* @param object $item The current item
|
1218 |
+
*/
|
1219 |
+
protected function single_row_columns( $item ) {
|
1220 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1221 |
+
|
1222 |
+
foreach ( $columns as $column_name => $column_display_name ) {
|
1223 |
+
$classes = "$column_name column-$column_name";
|
1224 |
+
if ( $primary === $column_name ) {
|
1225 |
+
$classes .= ' has-row-actions column-primary';
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
if ( in_array( $column_name, $hidden ) ) {
|
1229 |
+
$classes .= ' hidden';
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
// Comments column uses HTML in the display name with screen reader text.
|
1233 |
+
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
|
1234 |
+
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
|
1235 |
+
|
1236 |
+
$attributes = "class='$classes' $data";
|
1237 |
+
|
1238 |
+
if ( 'cb' === $column_name ) {
|
1239 |
+
echo '<th scope="row" class="check-column">';
|
1240 |
+
echo $this->column_cb( $item );
|
1241 |
+
echo '</th>';
|
1242 |
+
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
|
1243 |
+
echo call_user_func(
|
1244 |
+
array( $this, '_column_' . $column_name ),
|
1245 |
+
$item,
|
1246 |
+
$classes,
|
1247 |
+
$data,
|
1248 |
+
$primary
|
1249 |
+
);
|
1250 |
+
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
|
1251 |
+
echo "<td $attributes>";
|
1252 |
+
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
|
1253 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1254 |
+
echo "</td>";
|
1255 |
+
} else {
|
1256 |
+
echo "<td $attributes>";
|
1257 |
+
echo $this->column_default( $item, $column_name );
|
1258 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1259 |
+
echo "</td>";
|
1260 |
+
}
|
1261 |
+
}
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
/**
|
1265 |
+
* Generates and display row actions links for the list table.
|
1266 |
+
*
|
1267 |
+
* @since 4.3.0
|
1268 |
+
*
|
1269 |
+
* @param object $item The item being acted upon.
|
1270 |
+
* @param string $column_name Current column name.
|
1271 |
+
* @param string $primary Primary column name.
|
1272 |
+
* @return string The row actions HTML, or an empty string if the current column is the primary column.
|
1273 |
+
*/
|
1274 |
+
protected function handle_row_actions( $item, $column_name, $primary ) {
|
1275 |
+
return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
|
1276 |
+
}
|
1277 |
+
|
1278 |
+
/**
|
1279 |
+
* Handle an incoming ajax request (called from admin-ajax.php)
|
1280 |
+
*
|
1281 |
+
* @since 3.1.0
|
1282 |
+
*/
|
1283 |
+
public function ajax_response() {
|
1284 |
+
$this->prepare_items();
|
1285 |
+
|
1286 |
+
ob_start();
|
1287 |
+
if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
|
1288 |
+
$this->display_rows();
|
1289 |
+
} else {
|
1290 |
+
$this->display_rows_or_placeholder();
|
1291 |
+
}
|
1292 |
+
|
1293 |
+
$rows = ob_get_clean();
|
1294 |
+
|
1295 |
+
$response = array( 'rows' => $rows );
|
1296 |
+
|
1297 |
+
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
1298 |
+
$response['total_items_i18n'] = sprintf(
|
1299 |
+
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
|
1300 |
+
number_format_i18n( $this->_pagination_args['total_items'] )
|
1301 |
+
);
|
1302 |
+
}
|
1303 |
+
if ( isset( $this->_pagination_args['total_pages'] ) ) {
|
1304 |
+
$response['total_pages'] = $this->_pagination_args['total_pages'];
|
1305 |
+
$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
die( wp_json_encode( $response ) );
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
/**
|
1312 |
+
* Send required variables to JavaScript land
|
1313 |
+
*
|
1314 |
+
*/
|
1315 |
+
public function _js_vars() {
|
1316 |
+
$args = array(
|
1317 |
+
'class' => get_class( $this ),
|
1318 |
+
'screen' => array(
|
1319 |
+
'id' => $this->screen->id,
|
1320 |
+
'base' => $this->screen->base,
|
1321 |
+
)
|
1322 |
+
);
|
1323 |
+
|
1324 |
+
printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
|
1325 |
+
}
|
1326 |
+
}
|
classes/User.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace TUTOR;
|
4 |
+
|
5 |
+
|
6 |
+
class User {
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
add_action('edit_user_profile', array($this, 'edit_user_profile'));
|
10 |
+
add_action('show_user_profile', array($this, 'edit_user_profile'), 10, 1);
|
11 |
+
|
12 |
+
add_action('profile_update', array($this, 'profile_update'));
|
13 |
+
}
|
14 |
+
|
15 |
+
public function edit_user_profile($user){
|
16 |
+
include tutor()->path.'views/metabox/user-profile-fields.php';
|
17 |
+
}
|
18 |
+
|
19 |
+
public function profile_update($user_id){
|
20 |
+
$_tutor_profile_job_title = sanitize_text_field(tutor_utils()->avalue_dot('_tutor_profile_job_title', $_POST));
|
21 |
+
$_tutor_profile_bio = wp_kses_post(tutor_utils()->avalue_dot('_tutor_profile_bio', $_POST));
|
22 |
+
$_tutor_profile_photo = sanitize_text_field(tutor_utils()->avalue_dot('_tutor_profile_photo', $_POST));
|
23 |
+
|
24 |
+
update_user_meta($user_id, '_tutor_profile_job_title', $_tutor_profile_job_title);
|
25 |
+
update_user_meta($user_id, '_tutor_profile_bio', $_tutor_profile_bio);
|
26 |
+
update_user_meta($user_id, '_tutor_profile_photo', $_tutor_profile_photo);
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
classes/Utils.php
ADDED
@@ -0,0 +1,2838 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
|
8 |
+
class Utils {
|
9 |
+
/**
|
10 |
+
* @param null $key
|
11 |
+
* @param bool $default
|
12 |
+
*
|
13 |
+
* @return array|bool|mixed
|
14 |
+
*
|
15 |
+
* Get option data
|
16 |
+
*
|
17 |
+
* @since v.1.0.0
|
18 |
+
*/
|
19 |
+
public function get_option($key = null, $default = false){
|
20 |
+
$option = (array) maybe_unserialize(get_option('tutor_option'));
|
21 |
+
|
22 |
+
if (empty($option) || ! is_array($option)){
|
23 |
+
return $default;
|
24 |
+
}
|
25 |
+
if ( ! $key){
|
26 |
+
return $option;
|
27 |
+
}
|
28 |
+
if (array_key_exists($key, $option)){
|
29 |
+
return apply_filters($key, $option[$key]);
|
30 |
+
}
|
31 |
+
//Access array value via dot notation, such as option->get('value.subvalue')
|
32 |
+
if (strpos($key, '.')){
|
33 |
+
$option_key_array = explode('.', $key);
|
34 |
+
|
35 |
+
$new_option = $option;
|
36 |
+
foreach ($option_key_array as $dotKey){
|
37 |
+
if (isset($new_option[$dotKey])){
|
38 |
+
$new_option = $new_option[$dotKey];
|
39 |
+
}else{
|
40 |
+
return $default;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return apply_filters($key, $new_option);
|
44 |
+
}
|
45 |
+
|
46 |
+
return $default;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @param null $key
|
51 |
+
* @param bool $value
|
52 |
+
*
|
53 |
+
* Update Option
|
54 |
+
*/
|
55 |
+
|
56 |
+
public function update_option($key = null, $value = false){
|
57 |
+
$option = (array) maybe_unserialize(get_option('tutor_option'));
|
58 |
+
$option[$key] = $value;
|
59 |
+
update_option('tutor_option', $option);
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @param null $key
|
64 |
+
* @param array $array
|
65 |
+
*
|
66 |
+
* @return array|bool|mixed
|
67 |
+
*
|
68 |
+
* get array value by dot notation
|
69 |
+
*
|
70 |
+
* @since v.1.0.0
|
71 |
+
*
|
72 |
+
*/
|
73 |
+
|
74 |
+
public function avalue_dot($key = null, $array = array()){
|
75 |
+
$array = (array) $array;
|
76 |
+
if ( ! $key || ! count($array) ){
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
$option_key_array = explode('.', $key);
|
80 |
+
|
81 |
+
$value = $array;
|
82 |
+
|
83 |
+
foreach ($option_key_array as $dotKey){
|
84 |
+
if (isset($value[$dotKey])){
|
85 |
+
$value = $value[$dotKey];
|
86 |
+
}else{
|
87 |
+
return false;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return $value;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* @return array
|
95 |
+
*
|
96 |
+
* Get all pages
|
97 |
+
*/
|
98 |
+
public function get_pages(){
|
99 |
+
$pages = array();
|
100 |
+
$wp_pages = get_pages();
|
101 |
+
if (is_array($wp_pages) && count($wp_pages)){
|
102 |
+
foreach ($wp_pages as $page){
|
103 |
+
$pages[$page->ID] = $page->post_title;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
return $pages;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @return string
|
111 |
+
*
|
112 |
+
* Get course archive URL
|
113 |
+
*/
|
114 |
+
public function course_archive_page_url(){
|
115 |
+
$course_post_type = tutor()->course_post_type;
|
116 |
+
$course_page_url = trailingslashit(home_url()).$course_post_type;
|
117 |
+
|
118 |
+
$course_archive_page = $this->get_option('course_archive_page');
|
119 |
+
if ($course_archive_page && $course_archive_page !== '-1'){
|
120 |
+
$course_page_url = get_permalink($course_archive_page);
|
121 |
+
}
|
122 |
+
return trailingslashit($course_page_url);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @param int $student_id
|
127 |
+
*
|
128 |
+
* @return string
|
129 |
+
*
|
130 |
+
* Get student URL
|
131 |
+
*/
|
132 |
+
|
133 |
+
public function profile_url($student_id = 0){
|
134 |
+
$site_url = trailingslashit(home_url()).'profile/';
|
135 |
+
$user_name = '';
|
136 |
+
|
137 |
+
$student_id = $this->get_user_id($student_id);
|
138 |
+
if ($student_id){
|
139 |
+
global $wpdb;
|
140 |
+
$user = $wpdb->get_row("SELECT user_login from {$wpdb->users} WHERE ID = {$student_id} ");
|
141 |
+
if ($user){
|
142 |
+
$user_name = $user->user_login;
|
143 |
+
}
|
144 |
+
}else{
|
145 |
+
$user_name = 'user_name';
|
146 |
+
}
|
147 |
+
|
148 |
+
return $site_url.$user_name;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* @param string $user_login
|
153 |
+
*
|
154 |
+
* @return array|null|object
|
155 |
+
*
|
156 |
+
* Get user by user login
|
157 |
+
*/
|
158 |
+
public function get_user_by_login($user_login = ''){
|
159 |
+
global $wpdb;
|
160 |
+
$user_login = sanitize_text_field($user_login);
|
161 |
+
$user = $wpdb->get_row("SELECT * from {$wpdb->users} WHERE user_login = '{$user_login}'");
|
162 |
+
return $user;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* @return bool
|
167 |
+
*
|
168 |
+
* Check if WooCommerce Activated
|
169 |
+
*/
|
170 |
+
|
171 |
+
public function has_wc(){
|
172 |
+
$activated_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ));
|
173 |
+
//$depends = array('woocommerce/woocommerce.php', 'tutor-woocommerce/tutor-woocommerce.php');
|
174 |
+
$depends = array('woocommerce/woocommerce.php');
|
175 |
+
$has = count(array_intersect($depends, $activated_plugins)) == count($depends);
|
176 |
+
|
177 |
+
return $has;
|
178 |
+
}
|
179 |
+
|
180 |
+
public function has_edd(){
|
181 |
+
$activated_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ));
|
182 |
+
//$depends = array('easy-digital-downloads/easy-digital-downloads.php', 'tutor-edd/tutor-edd.php');
|
183 |
+
$depends = array('easy-digital-downloads/easy-digital-downloads.php');
|
184 |
+
$has = count(array_intersect($depends, $activated_plugins)) == count($depends);
|
185 |
+
|
186 |
+
return $has;
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* @return mixed
|
191 |
+
*
|
192 |
+
*
|
193 |
+
*/
|
194 |
+
public function languages(){
|
195 |
+
$language_codes = array(
|
196 |
+
'en' => 'English' ,
|
197 |
+
'aa' => 'Afar' ,
|
198 |
+
'ab' => 'Abkhazian' ,
|
199 |
+
'af' => 'Afrikaans' ,
|
200 |
+
'am' => 'Amharic' ,
|
201 |
+
'ar' => 'Arabic' ,
|
202 |
+
'as' => 'Assamese' ,
|
203 |
+
'ay' => 'Aymara' ,
|
204 |
+
'az' => 'Azerbaijani' ,
|
205 |
+
'ba' => 'Bashkir' ,
|
206 |
+
'be' => 'Byelorussian' ,
|
207 |
+
'bg' => 'Bulgarian' ,
|
208 |
+
'bh' => 'Bihari' ,
|
209 |
+
'bi' => 'Bislama' ,
|
210 |
+
'bn' => 'Bengali/Bangla' ,
|
211 |
+
'bo' => 'Tibetan' ,
|
212 |
+
'br' => 'Breton' ,
|
213 |
+
'ca' => 'Catalan' ,
|
214 |
+
'co' => 'Corsican' ,
|
215 |
+
'cs' => 'Czech' ,
|
216 |
+
'cy' => 'Welsh' ,
|
217 |
+
'da' => 'Danish' ,
|
218 |
+
'de' => 'German' ,
|
219 |
+
'dz' => 'Bhutani' ,
|
220 |
+
'el' => 'Greek' ,
|
221 |
+
'eo' => 'Esperanto' ,
|
222 |
+
'es' => 'Spanish' ,
|
223 |
+
'et' => 'Estonian' ,
|
224 |
+
'eu' => 'Basque' ,
|
225 |
+
'fa' => 'Persian' ,
|
226 |
+
'fi' => 'Finnish' ,
|
227 |
+
'fj' => 'Fiji' ,
|
228 |
+
'fo' => 'Faeroese' ,
|
229 |
+
'fr' => 'French' ,
|
230 |
+
'fy' => 'Frisian' ,
|
231 |
+
'ga' => 'Irish' ,
|
232 |
+
'gd' => 'Scots/Gaelic' ,
|
233 |
+
'gl' => 'Galician' ,
|
234 |
+
'gn' => 'Guarani' ,
|
235 |
+
'gu' => 'Gujarati' ,
|
236 |
+
'ha' => 'Hausa' ,
|
237 |
+
'hi' => 'Hindi' ,
|
238 |
+
'hr' => 'Croatian' ,
|
239 |
+
'hu' => 'Hungarian' ,
|
240 |
+
'hy' => 'Armenian' ,
|
241 |
+
'ia' => 'Interlingua' ,
|
242 |
+
'ie' => 'Interlingue' ,
|
243 |
+
'ik' => 'Inupiak' ,
|
244 |
+
'in' => 'Indonesian' ,
|
245 |
+
'is' => 'Icelandic' ,
|
246 |
+
'it' => 'Italian' ,
|
247 |
+
'iw' => 'Hebrew' ,
|
248 |
+
'ja' => 'Japanese' ,
|
249 |
+
'ji' => 'Yiddish' ,
|
250 |
+
'jw' => 'Javanese' ,
|
251 |
+
'ka' => 'Georgian' ,
|
252 |
+
'kk' => 'Kazakh' ,
|
253 |
+
'kl' => 'Greenlandic' ,
|
254 |
+
'km' => 'Cambodian' ,
|
255 |
+
'kn' => 'Kannada' ,
|
256 |
+
'ko' => 'Korean' ,
|
257 |
+
'ks' => 'Kashmiri' ,
|
258 |
+
'ku' => 'Kurdish' ,
|
259 |
+
'ky' => 'Kirghiz' ,
|
260 |
+
'la' => 'Latin' ,
|
261 |
+
'ln' => 'Lingala' ,
|
262 |
+
'lo' => 'Laothian' ,
|
263 |
+
'lt' => 'Lithuanian' ,
|
264 |
+
'lv' => 'Latvian/Lettish' ,
|
265 |
+
'mg' => 'Malagasy' ,
|
266 |
+
'mi' => 'Maori' ,
|
267 |
+
'mk' => 'Macedonian' ,
|
268 |
+
'ml' => 'Malayalam' ,
|
269 |
+
'mn' => 'Mongolian' ,
|
270 |
+
'mo' => 'Moldavian' ,
|
271 |
+
'mr' => 'Marathi' ,
|
272 |
+
'ms' => 'Malay' ,
|
273 |
+
'mt' => 'Maltese' ,
|
274 |
+
'my' => 'Burmese' ,
|
275 |
+
'na' => 'Nauru' ,
|
276 |
+
'ne' => 'Nepali' ,
|
277 |
+
'nl' => 'Dutch' ,
|
278 |
+
'no' => 'Norwegian' ,
|
279 |
+
'oc' => 'Occitan' ,
|
280 |
+
'om' => '(Afan)/Oromoor/Oriya' ,
|
281 |
+
'pa' => 'Punjabi' ,
|
282 |
+
'pl' => 'Polish' ,
|
283 |
+
'ps' => 'Pashto/Pushto' ,
|
284 |
+
'pt' => 'Portuguese' ,
|
285 |
+
'qu' => 'Quechua' ,
|
286 |
+
'rm' => 'Rhaeto-Romance' ,
|
287 |
+
'rn' => 'Kirundi' ,
|
288 |
+
'ro' => 'Romanian' ,
|
289 |
+
'ru' => 'Russian' ,
|
290 |
+
'rw' => 'Kinyarwanda' ,
|
291 |
+
'sa' => 'Sanskrit' ,
|
292 |
+
'sd' => 'Sindhi' ,
|
293 |
+
'sg' => 'Sangro' ,
|
294 |
+
'sh' => 'Serbo-Croatian' ,
|
295 |
+
'si' => 'Singhalese' ,
|
296 |
+
'sk' => 'Slovak' ,
|
297 |
+
'sl' => 'Slovenian' ,
|
298 |
+
'sm' => 'Samoan' ,
|
299 |
+
'sn' => 'Shona' ,
|
300 |
+
'so' => 'Somali' ,
|
301 |
+
'sq' => 'Albanian' ,
|
302 |
+
'sr' => 'Serbian' ,
|
303 |
+
'ss' => 'Siswati' ,
|
304 |
+
'st' => 'Sesotho' ,
|
305 |
+
'su' => 'Sundanese' ,
|
306 |
+
'sv' => 'Swedish' ,
|
307 |
+
'sw' => 'Swahili' ,
|
308 |
+
'ta' => 'Tamil' ,
|
309 |
+
'te' => 'Tegulu' ,
|
310 |
+
'tg' => 'Tajik' ,
|
311 |
+
'th' => 'Thai' ,
|
312 |
+
'ti' => 'Tigrinya' ,
|
313 |
+
'tk' => 'Turkmen' ,
|
314 |
+
'tl' => 'Tagalog' ,
|
315 |
+
'tn' => 'Setswana' ,
|
316 |
+
'to' => 'Tonga' ,
|
317 |
+
'tr' => 'Turkish' ,
|
318 |
+
'ts' => 'Tsonga' ,
|
319 |
+
'tt' => 'Tatar' ,
|
320 |
+
'tw' => 'Twi' ,
|
321 |
+
'uk' => 'Ukrainian' ,
|
322 |
+
'ur' => 'Urdu' ,
|
323 |
+
'uz' => 'Uzbek' ,
|
324 |
+
'vi' => 'Vietnamese' ,
|
325 |
+
'vo' => 'Volapuk' ,
|
326 |
+
'wo' => 'Wolof' ,
|
327 |
+
'xh' => 'Xhosa' ,
|
328 |
+
'yo' => 'Yoruba' ,
|
329 |
+
'zh' => 'Chinese' ,
|
330 |
+
'zu' => 'Zulu' ,
|
331 |
+
);
|
332 |
+
|
333 |
+
return apply_filters('tutor/utils/languages', $language_codes);
|
334 |
+
}
|
335 |
+
|
336 |
+
public function print_view($value = ''){
|
337 |
+
echo '<pre>';
|
338 |
+
print_r($value);
|
339 |
+
echo '</pre>';
|
340 |
+
}
|
341 |
+
|
342 |
+
public function get_courses($excludes = array()){
|
343 |
+
global $wpdb;
|
344 |
+
|
345 |
+
|
346 |
+
$excludes = (array) $excludes;
|
347 |
+
$exclude_query = '';
|
348 |
+
if (count($excludes)){
|
349 |
+
$exclude_query = implode("','", $excludes);
|
350 |
+
}
|
351 |
+
|
352 |
+
$course_post_type = tutor()->course_post_type;
|
353 |
+
$query = $wpdb->get_results("SELECT ID, post_author, post_title, post_name,post_status, menu_order
|
354 |
+
from {$wpdb->posts} WHERE post_status = 'publish'
|
355 |
+
AND ID NOT IN('$exclude_query')
|
356 |
+
AND post_type = '{$course_post_type}' ");
|
357 |
+
return $query;
|
358 |
+
}
|
359 |
+
|
360 |
+
public function get_courses_for_instructors($instructor_id = 0){
|
361 |
+
global $wpdb;
|
362 |
+
|
363 |
+
$instructor_id = $this->get_user_id($instructor_id);
|
364 |
+
|
365 |
+
$course_post_type = tutor()->course_post_type;
|
366 |
+
$query = $wpdb->get_results("SELECT ID, post_author, post_title, post_name,post_status, menu_order
|
367 |
+
from {$wpdb->posts}
|
368 |
+
WHERE post_author = {$instructor_id}
|
369 |
+
AND post_status IN ('publish', 'pending')
|
370 |
+
AND post_type = '{$course_post_type}' ");
|
371 |
+
return $query;
|
372 |
+
}
|
373 |
+
|
374 |
+
public function get_course_count_by_instructor($instructor_id){
|
375 |
+
global $wpdb;
|
376 |
+
|
377 |
+
$course_post_type = tutor()->course_post_type;
|
378 |
+
$count = $wpdb->get_var("SELECT COUNT(ID) from {$wpdb->posts}
|
379 |
+
INNER JOIN {$wpdb->usermeta} ON user_id = {$instructor_id} AND meta_key = '_tutor_instructor_course_id' AND meta_value = ID
|
380 |
+
WHERE post_status = 'publish'
|
381 |
+
AND post_type = '{$course_post_type}' ; ");
|
382 |
+
|
383 |
+
return $count;
|
384 |
+
}
|
385 |
+
|
386 |
+
public function get_courses_by_instructor($instructor_id){
|
387 |
+
global $wpdb;
|
388 |
+
|
389 |
+
$course_post_type = tutor()->course_post_type;
|
390 |
+
|
391 |
+
$querystr = "
|
392 |
+
SELECT $wpdb->posts.*
|
393 |
+
FROM $wpdb->posts
|
394 |
+
INNER JOIN {$wpdb->usermeta} ON $wpdb->usermeta.user_id = {$instructor_id} AND $wpdb->usermeta.meta_key = '_tutor_instructor_course_id' AND $wpdb->usermeta.meta_value = $wpdb->posts.ID
|
395 |
+
|
396 |
+
|
397 |
+
WHERE $wpdb->posts.post_status = 'publish'
|
398 |
+
AND $wpdb->posts.post_type = '{$course_post_type}'
|
399 |
+
AND $wpdb->posts.post_date < NOW()
|
400 |
+
ORDER BY $wpdb->posts.post_date DESC";
|
401 |
+
|
402 |
+
$pageposts = $wpdb->get_results($querystr, OBJECT);
|
403 |
+
return $pageposts;
|
404 |
+
}
|
405 |
+
|
406 |
+
public function get_archive_page_course_count(){
|
407 |
+
global $wp_query;
|
408 |
+
return $wp_query->post_count;
|
409 |
+
}
|
410 |
+
|
411 |
+
public function get_course_count(){
|
412 |
+
global $wpdb;
|
413 |
+
|
414 |
+
$course_post_type = tutor()->course_post_type;
|
415 |
+
$count = $wpdb->get_var("SELECT COUNT(ID) from {$wpdb->posts} WHERE post_status = 'publish' AND post_type = '{$course_post_type}'; ");
|
416 |
+
return $count;
|
417 |
+
}
|
418 |
+
|
419 |
+
public function get_lesson_count(){
|
420 |
+
global $wpdb;
|
421 |
+
|
422 |
+
$lesson_post_type = tutor()->lesson_post_type;
|
423 |
+
$count = $wpdb->get_var("SELECT COUNT(ID) from {$wpdb->posts} WHERE post_status = 'publish' AND post_type = '{$lesson_post_type}'; ");
|
424 |
+
return $count;
|
425 |
+
}
|
426 |
+
|
427 |
+
public function get_lesson($course_id = 0, $limit = 10){
|
428 |
+
$course_id = $this->get_post_id($course_id);
|
429 |
+
|
430 |
+
$lesson_post_type = tutor()->lesson_post_type;
|
431 |
+
$args = array(
|
432 |
+
'post_status' => 'publish',
|
433 |
+
'post_type' => $lesson_post_type,
|
434 |
+
'posts_per_page' => $limit,
|
435 |
+
'meta_query' => array(
|
436 |
+
array(
|
437 |
+
'key' => '_tutor_course_id_for_lesson',
|
438 |
+
'value' => $course_id,
|
439 |
+
'compare' => '=',
|
440 |
+
),
|
441 |
+
),
|
442 |
+
);
|
443 |
+
$query = new \WP_Query($args);
|
444 |
+
|
445 |
+
return $query;
|
446 |
+
}
|
447 |
+
|
448 |
+
public function get_lesson_count_by_course($course_id = 0){
|
449 |
+
$course_id = $this->get_post_id($course_id);
|
450 |
+
global $wpdb;
|
451 |
+
|
452 |
+
$count_lesson = $wpdb->get_var("select count(meta_id) from {$wpdb->postmeta} where meta_key = '_tutor_course_id_for_lesson' AND meta_value = {$course_id} ");
|
453 |
+
|
454 |
+
return (int) $count_lesson;
|
455 |
+
}
|
456 |
+
|
457 |
+
public function get_completed_lesson_count_by_course($course_id = 0, $user_id = 0){
|
458 |
+
$course_id = $this->get_post_id($course_id);
|
459 |
+
$user_id = $this->get_user_id($user_id);
|
460 |
+
global $wpdb;
|
461 |
+
|
462 |
+
$completed_lesson_ids = $wpdb->get_col("select post_id from {$wpdb->postmeta} where meta_key = '_tutor_course_id_for_lesson' AND meta_value = {$course_id} ");
|
463 |
+
|
464 |
+
$count = 0;
|
465 |
+
if (is_array($completed_lesson_ids) && count($completed_lesson_ids)){
|
466 |
+
$completed_lesson_meta_ids = array();
|
467 |
+
foreach ($completed_lesson_ids as $lesson_id){
|
468 |
+
$completed_lesson_meta_ids[] = '_tutor_completed_lesson_id_'.$lesson_id;
|
469 |
+
}
|
470 |
+
$in_ids = implode("','", $completed_lesson_meta_ids);
|
471 |
+
|
472 |
+
$count = (int) $wpdb->get_var("select count(umeta_id) from {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key in('{$in_ids}') ");
|
473 |
+
}
|
474 |
+
|
475 |
+
return $count;
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* @param int $course_id
|
480 |
+
* @param int $user_id
|
481 |
+
*
|
482 |
+
* @return float|int
|
483 |
+
*
|
484 |
+
*/
|
485 |
+
public function get_course_completed_percent($course_id = 0, $user_id = 0){
|
486 |
+
$course_id = $this->get_post_id($course_id);
|
487 |
+
$user_id = $this->get_user_id($user_id);
|
488 |
+
|
489 |
+
$total_lesson = $this->get_lesson_count_by_course($course_id);
|
490 |
+
$completed_lesson = $this->get_completed_lesson_count_by_course($course_id, $user_id);
|
491 |
+
|
492 |
+
if ($total_lesson > 0 && $completed_lesson > 0){
|
493 |
+
return number_format(($completed_lesson * 100) / $total_lesson, 1);
|
494 |
+
}
|
495 |
+
|
496 |
+
return 0;
|
497 |
+
}
|
498 |
+
|
499 |
+
public function get_topics($course_id = 0){
|
500 |
+
$course_id = $this->get_post_id($course_id);
|
501 |
+
|
502 |
+
$args = array(
|
503 |
+
'post_type' => 'topics',
|
504 |
+
'post_parent' => $course_id,
|
505 |
+
'orderby' => 'menu_order',
|
506 |
+
'order' => 'ASC',
|
507 |
+
'posts_per_page' => -1,
|
508 |
+
);
|
509 |
+
|
510 |
+
$query = new \WP_Query($args);
|
511 |
+
return $query;
|
512 |
+
}
|
513 |
+
|
514 |
+
public function get_next_topic_order_id($course_ID){
|
515 |
+
global $wpdb;
|
516 |
+
|
517 |
+
$last_order = (int) $wpdb->get_var("SELECT MAX(menu_order) FROM {$wpdb->posts} WHERE post_parent = {$course_ID} AND post_type = 'topics';");
|
518 |
+
return $last_order + 1;
|
519 |
+
}
|
520 |
+
|
521 |
+
public function get_lessons_by_topic($topics_id = 0, $limit = 10){
|
522 |
+
$topics_id = $this->get_post_id($topics_id);
|
523 |
+
|
524 |
+
$lesson_post_type = tutor()->lesson_post_type;
|
525 |
+
$args = array(
|
526 |
+
'post_type' => $lesson_post_type,
|
527 |
+
'post_parent' => $topics_id,
|
528 |
+
'posts_per_page' => $limit,
|
529 |
+
'orderby' => 'menu_order',
|
530 |
+
'order' => 'ASC',
|
531 |
+
);
|
532 |
+
|
533 |
+
$query = new \WP_Query($args);
|
534 |
+
|
535 |
+
return $query;
|
536 |
+
}
|
537 |
+
|
538 |
+
public function checking_nonce($request_method = 'post'){
|
539 |
+
if ($request_method === 'post'){
|
540 |
+
if (!isset($_POST[tutor()->nonce]) || !wp_verify_nonce($_POST[tutor()->nonce], tutor()->nonce_action)) {
|
541 |
+
exit();
|
542 |
+
}
|
543 |
+
}else{
|
544 |
+
if (!isset($_GET[tutor()->nonce]) || !wp_verify_nonce($_GET[tutor()->nonce], tutor()->nonce_action)) {
|
545 |
+
exit();
|
546 |
+
}
|
547 |
+
}
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* @param int $course_id
|
552 |
+
*
|
553 |
+
* @return bool
|
554 |
+
*
|
555 |
+
* @since v.1.0.0
|
556 |
+
*/
|
557 |
+
public function is_course_purchasable($course_id = 0){
|
558 |
+
return apply_filters('is_course_purchasable', false, $course_id);
|
559 |
+
}
|
560 |
+
|
561 |
+
/**
|
562 |
+
* @param int $course_id
|
563 |
+
*
|
564 |
+
* @return null|string
|
565 |
+
*
|
566 |
+
* get course price in digits format if any
|
567 |
+
*
|
568 |
+
* @since v.1.0.0
|
569 |
+
*/
|
570 |
+
|
571 |
+
public function get_course_price($course_id = 0){
|
572 |
+
$course_id = $this->get_post_id($course_id);
|
573 |
+
|
574 |
+
$price = null;
|
575 |
+
|
576 |
+
if ($this->is_course_purchasable()) {
|
577 |
+
if ($this->has_wc()){
|
578 |
+
$product_id = tutor_utils()->get_course_product_id($course_id);
|
579 |
+
$product = wc_get_product( $product_id );
|
580 |
+
|
581 |
+
if ( $product ) {
|
582 |
+
$price = $product->get_price();
|
583 |
+
}
|
584 |
+
}else{
|
585 |
+
$price = apply_filters('get_tutor_course_price', null, $course_id);
|
586 |
+
}
|
587 |
+
|
588 |
+
}
|
589 |
+
|
590 |
+
return $price;
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* @param int $course_id
|
595 |
+
*
|
596 |
+
* @return array|bool|null|object
|
597 |
+
*
|
598 |
+
* Check if current user has been enrolled or not
|
599 |
+
*
|
600 |
+
* @since v.1.0.0
|
601 |
+
*/
|
602 |
+
|
603 |
+
public function is_enrolled($course_id = 0, $user_id = 0){
|
604 |
+
$course_id = $this->get_post_id($course_id);
|
605 |
+
$user_id = $this->get_user_id($user_id);
|
606 |
+
|
607 |
+
if (is_user_logged_in()) {
|
608 |
+
global $wpdb;
|
609 |
+
|
610 |
+
$getEnrolledInfo = $wpdb->get_row( "select ID, post_author, post_date,post_date_gmt,post_title from {$wpdb->posts} WHERE post_type = 'tutor_enrolled' AND post_parent = {$course_id} AND post_author = {$user_id} AND post_status = 'completed'; " );
|
611 |
+
|
612 |
+
if ( $getEnrolledInfo ) {
|
613 |
+
return $getEnrolledInfo;
|
614 |
+
}
|
615 |
+
}
|
616 |
+
return false;
|
617 |
+
}
|
618 |
+
|
619 |
+
public function has_any_enrolled($course_id = 0, $user_id = 0){
|
620 |
+
$course_id = $this->get_post_id($course_id);
|
621 |
+
$user_id = $this->get_user_id($user_id);
|
622 |
+
|
623 |
+
if (is_user_logged_in()) {
|
624 |
+
global $wpdb;
|
625 |
+
|
626 |
+
$getEnrolledInfo = $wpdb->get_row( "select ID, post_author, post_date,post_date_gmt,post_title from {$wpdb->posts} WHERE post_type = 'tutor_enrolled' AND post_parent = {$course_id} AND post_author = {$user_id}; " );
|
627 |
+
|
628 |
+
if ( $getEnrolledInfo ) {
|
629 |
+
return $getEnrolledInfo;
|
630 |
+
}
|
631 |
+
}
|
632 |
+
return false;
|
633 |
+
}
|
634 |
+
|
635 |
+
/**
|
636 |
+
* @param int $lesson_id
|
637 |
+
* @param int $user_id
|
638 |
+
*
|
639 |
+
* @return array|bool|null|object
|
640 |
+
*
|
641 |
+
* Get the course Enrolled confirmation by lesson ID
|
642 |
+
*
|
643 |
+
* @since v.1.0.0
|
644 |
+
*/
|
645 |
+
|
646 |
+
public function is_course_enrolled_by_lesson($lesson_id = 0, $user_id = 0){
|
647 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
648 |
+
$user_id = $this->get_user_id($user_id);
|
649 |
+
|
650 |
+
return $this->is_enrolled($this->get_course_id_by_lesson($lesson_id));
|
651 |
+
}
|
652 |
+
|
653 |
+
/**
|
654 |
+
* @param int $lesson_id
|
655 |
+
*
|
656 |
+
* @return bool|mixed
|
657 |
+
*
|
658 |
+
* Get the course ID by Lesson
|
659 |
+
*
|
660 |
+
* @since v.1.0.0
|
661 |
+
*/
|
662 |
+
public function get_course_id_by_lesson($lesson_id = 0){
|
663 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
664 |
+
return get_post_meta($lesson_id, '_tutor_course_id_for_lesson', true);
|
665 |
+
}
|
666 |
+
|
667 |
+
/**
|
668 |
+
* @param int $course_id
|
669 |
+
*
|
670 |
+
* @return bool|false|string
|
671 |
+
*
|
672 |
+
* Get first lesson of a course
|
673 |
+
*
|
674 |
+
* @since v.1.0.0
|
675 |
+
*/
|
676 |
+
public function get_course_first_lesson($course_id = 0){
|
677 |
+
$course_id = $this->get_post_id($course_id);
|
678 |
+
global $wpdb;
|
679 |
+
|
680 |
+
$lesson_id = $wpdb->get_var("
|
681 |
+
SELECT post_id as lesson_id
|
682 |
+
FROM $wpdb->postmeta
|
683 |
+
INNER JOIN {$wpdb->posts} ON post_id = {$wpdb->posts}.ID
|
684 |
+
WHERE meta_key = '_tutor_course_id_for_lesson' AND meta_value = {$course_id}
|
685 |
+
|
686 |
+
ORDER BY menu_order ASC LIMIT 1
|
687 |
+
");
|
688 |
+
|
689 |
+
/*
|
690 |
+
$lesson_id = $wpdb->get_var(" select main_posts.ID from {$wpdb->posts} main_posts
|
691 |
+
WHERE post_parent =
|
692 |
+
(SELECT sub_posts.ID FROM {$wpdb->posts} sub_posts
|
693 |
+
WHERE post_type = 'topics' AND
|
694 |
+
sub_posts.post_parent = {$course_id} ORDER BY sub_posts.menu_order ASC LIMIT 1 )
|
695 |
+
ORDER BY main_posts.menu_order ASC LIMIT 1 ;");
|
696 |
+
*/
|
697 |
+
|
698 |
+
if ($lesson_id){
|
699 |
+
return get_permalink($lesson_id);
|
700 |
+
}
|
701 |
+
return false;
|
702 |
+
}
|
703 |
+
|
704 |
+
/*
|
705 |
+
*
|
706 |
+
* Get course sub pages in course dashboard
|
707 |
+
*
|
708 |
+
* @since v.1.0.0
|
709 |
+
*/
|
710 |
+
public function course_sub_pages(){
|
711 |
+
$nav_items = array(
|
712 |
+
'overview' => __('Overview', 'tutor'),
|
713 |
+
);
|
714 |
+
|
715 |
+
$enable_q_and_a_on_course = tutor_utils()->get_option('enable_q_and_a_on_course');
|
716 |
+
if ($enable_q_and_a_on_course){
|
717 |
+
$nav_items['questions'] = __('Q&A', 'tutor');
|
718 |
+
}
|
719 |
+
$nav_items['announcements'] = __('Announcements', 'tutor');
|
720 |
+
|
721 |
+
return apply_filters('tutor_course/single/enrolled/nav_items', $nav_items);
|
722 |
+
}
|
723 |
+
|
724 |
+
/**
|
725 |
+
* @param int $post_id
|
726 |
+
*
|
727 |
+
* @return bool|array
|
728 |
+
*
|
729 |
+
* @since v.1.0.0
|
730 |
+
*/
|
731 |
+
public function get_video($post_id = 0){
|
732 |
+
$post_id = $this->get_post_id($post_id);
|
733 |
+
$attachments = get_post_meta($post_id, '_video', true);
|
734 |
+
if ($attachments) {
|
735 |
+
$attachments = maybe_unserialize($attachments);
|
736 |
+
}
|
737 |
+
return $attachments;
|
738 |
+
}
|
739 |
+
|
740 |
+
/**
|
741 |
+
* @param int $post_id
|
742 |
+
* @param array $video_data
|
743 |
+
*
|
744 |
+
* @return bool
|
745 |
+
*
|
746 |
+
* Update the video Info
|
747 |
+
*/
|
748 |
+
public function update_video($post_id = 0, $video_data = array()){
|
749 |
+
$post_id = $this->get_post_id($post_id);
|
750 |
+
|
751 |
+
if (is_array($video_data) && count($video_data)){
|
752 |
+
update_post_meta($post_id, '_video', $video_data);
|
753 |
+
}
|
754 |
+
}
|
755 |
+
|
756 |
+
/**
|
757 |
+
* @param int $post_id
|
758 |
+
*
|
759 |
+
* @return bool|mixed
|
760 |
+
*
|
761 |
+
* @since v.1.0.0
|
762 |
+
*/
|
763 |
+
public function get_attachments($post_id = 0){
|
764 |
+
$post_id = $this->get_post_id($post_id);
|
765 |
+
$attachments_arr = array();
|
766 |
+
$attachments = maybe_unserialize(get_post_meta($post_id, '_tutor_attachments', true));
|
767 |
+
|
768 |
+
$font_icons = apply_filters('tutor_file_types_icon', array(
|
769 |
+
'archive',
|
770 |
+
'audio',
|
771 |
+
'code',
|
772 |
+
'default',
|
773 |
+
'document',
|
774 |
+
'interactive',
|
775 |
+
'spreadsheet',
|
776 |
+
'text',
|
777 |
+
'video',
|
778 |
+
'image',
|
779 |
+
));
|
780 |
+
|
781 |
+
if ( is_array($attachments) && count($attachments)) {
|
782 |
+
foreach ( $attachments as $attachment ) {
|
783 |
+
$url = wp_get_attachment_url( $attachment );
|
784 |
+
$file_type = wp_check_filetype( $url );
|
785 |
+
$ext = $file_type['ext'];
|
786 |
+
$title = get_the_title($attachment);
|
787 |
+
|
788 |
+
$file_path = get_attached_file( $attachment );
|
789 |
+
$size_bytes = file_exists($file_path) ? filesize( $file_path ) : 0;
|
790 |
+
$size = size_format( $size_bytes, 2 );
|
791 |
+
$type = wp_ext2type( $ext );
|
792 |
+
|
793 |
+
$icon = 'default';
|
794 |
+
if ( $type && in_array( $type, $font_icons ) ) {
|
795 |
+
$icon = $type;
|
796 |
+
}
|
797 |
+
|
798 |
+
$data = array(
|
799 |
+
'post_id' => $post_id,
|
800 |
+
'id' => $attachment,
|
801 |
+
'url' => $url,
|
802 |
+
'name' => $title . '.' . $ext,
|
803 |
+
'title' => $title,
|
804 |
+
'ext' => $ext,
|
805 |
+
'size' => $size,
|
806 |
+
'size_bytes' => $size_bytes,
|
807 |
+
'icon' => $icon,
|
808 |
+
);
|
809 |
+
|
810 |
+
$attachments_arr[] = (object) apply_filters( 'tutor/posts/attachments', $data );
|
811 |
+
}
|
812 |
+
}
|
813 |
+
|
814 |
+
return $attachments_arr;
|
815 |
+
}
|
816 |
+
|
817 |
+
|
818 |
+
/**
|
819 |
+
* @param $seconds
|
820 |
+
*
|
821 |
+
* @return string
|
822 |
+
*
|
823 |
+
* return seconds to formatted playtime
|
824 |
+
*
|
825 |
+
* @since v.1.0.0
|
826 |
+
*/
|
827 |
+
public function playtime_string($seconds) {
|
828 |
+
$sign = (($seconds < 0) ? '-' : '');
|
829 |
+
$seconds = round(abs($seconds));
|
830 |
+
$H = (int) floor( $seconds / 3600);
|
831 |
+
$M = (int) floor(($seconds - (3600 * $H) ) / 60);
|
832 |
+
$S = (int) round( $seconds - (3600 * $H) - (60 * $M) );
|
833 |
+
return $sign.($H ? $H.':' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).':'.str_pad($S, 2, 0, STR_PAD_LEFT);
|
834 |
+
}
|
835 |
+
|
836 |
+
/**
|
837 |
+
* @param $seconds
|
838 |
+
*
|
839 |
+
* @return array
|
840 |
+
*
|
841 |
+
* Get the playtime in array
|
842 |
+
*/
|
843 |
+
public function playtime_array($seconds){
|
844 |
+
$run_time_format = array(
|
845 |
+
'hours' => '00',
|
846 |
+
'minutes' => '00',
|
847 |
+
'seconds' => '00',
|
848 |
+
);
|
849 |
+
|
850 |
+
if ($seconds <= 0 ){
|
851 |
+
return $run_time_format;
|
852 |
+
}
|
853 |
+
|
854 |
+
$playTimeString = $this->playtime_string($seconds);
|
855 |
+
$timeInArray = explode(':', $playTimeString);
|
856 |
+
|
857 |
+
$run_time_size = count($timeInArray);
|
858 |
+
if ($run_time_size === 3){
|
859 |
+
$run_time_format['hours'] = $timeInArray[0];
|
860 |
+
$run_time_format['minutes'] = $timeInArray[1];
|
861 |
+
$run_time_format['seconds'] = $timeInArray[2];
|
862 |
+
}elseif($run_time_size === 2){
|
863 |
+
$run_time_format['minutes'] = $timeInArray[0];
|
864 |
+
$run_time_format['seconds'] = $timeInArray[1];
|
865 |
+
}
|
866 |
+
|
867 |
+
return $run_time_format;
|
868 |
+
}
|
869 |
+
|
870 |
+
public function seconds_to_time_context($seconds) {
|
871 |
+
$sign = (($seconds < 0) ? '-' : '');
|
872 |
+
$seconds = round(abs($seconds));
|
873 |
+
$H = (int) floor( $seconds / 3600);
|
874 |
+
$M = (int) floor(($seconds - (3600 * $H) ) / 60);
|
875 |
+
$S = (int) round( $seconds - (3600 * $H) - (60 * $M) );
|
876 |
+
|
877 |
+
return $sign.($H ? $H.'h ' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).'m '.str_pad($S, 2, 0, STR_PAD_LEFT).'s';
|
878 |
+
}
|
879 |
+
|
880 |
+
/**
|
881 |
+
* @param int $lesson_id
|
882 |
+
*
|
883 |
+
* @return bool|object
|
884 |
+
*
|
885 |
+
* @since v.1.0.0
|
886 |
+
*/
|
887 |
+
|
888 |
+
public function get_video_info($lesson_id = 0){
|
889 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
890 |
+
$video = $this->get_video($lesson_id);
|
891 |
+
|
892 |
+
if ( ! $video){
|
893 |
+
return false;
|
894 |
+
}
|
895 |
+
|
896 |
+
$info = array(
|
897 |
+
'playtime' => '00:00',
|
898 |
+
);
|
899 |
+
|
900 |
+
$types = apply_filters('tutor_video_types', array("mp4"=>"video/mp4", "webm"=>"video/webm", "ogg"=>"video/ogg"));
|
901 |
+
|
902 |
+
$videoSource = $this->avalue_dot('source', $video);
|
903 |
+
if ($videoSource === 'html5'){
|
904 |
+
$sourceVideoID = $this->avalue_dot('source_video_id', $video);
|
905 |
+
$video_info = get_post_meta($sourceVideoID, '_wp_attachment_metadata', true);
|
906 |
+
|
907 |
+
if ($video_info){
|
908 |
+
$path = get_attached_file($sourceVideoID);
|
909 |
+
$info['playtime'] = $video_info['length_formatted'];
|
910 |
+
$info['path'] = $path;
|
911 |
+
$info['url'] = wp_get_attachment_url($sourceVideoID);
|
912 |
+
$info['ext'] = strtolower(pathinfo($path, PATHINFO_EXTENSION));
|
913 |
+
$info['type'] = $types[$info['ext']];
|
914 |
+
}
|
915 |
+
}
|
916 |
+
|
917 |
+
if ($videoSource !== 'html5'){
|
918 |
+
$video = maybe_unserialize(get_post_meta($lesson_id, '_video', true));
|
919 |
+
|
920 |
+
$runtimeHours = tutor_utils()->avalue_dot('runtime.hours', $video);
|
921 |
+
$runtimeMinutes = tutor_utils()->avalue_dot('runtime.minutes', $video);
|
922 |
+
$runtimeSeconds = tutor_utils()->avalue_dot('runtime.seconds', $video);
|
923 |
+
|
924 |
+
$runtimeHours = $runtimeHours ? $runtimeHours : '00';
|
925 |
+
$runtimeMinutes = $runtimeMinutes ? $runtimeMinutes : '00';
|
926 |
+
$runtimeSeconds = $runtimeSeconds ? $runtimeSeconds : '00';
|
927 |
+
|
928 |
+
$info['playtime'] = "$runtimeHours:$runtimeMinutes:$runtimeSeconds";
|
929 |
+
}
|
930 |
+
|
931 |
+
$info = array_merge($info, $video);
|
932 |
+
|
933 |
+
return (object) $info;
|
934 |
+
}
|
935 |
+
|
936 |
+
/**
|
937 |
+
* @param int $post_id
|
938 |
+
*
|
939 |
+
* @return bool
|
940 |
+
*
|
941 |
+
* Ensure if attached video is self hosted or not
|
942 |
+
*/
|
943 |
+
public function is_html5_video($post_id = 0){
|
944 |
+
$post_id = $this->get_post_id($post_id);
|
945 |
+
|
946 |
+
$video = $this->get_video($post_id);
|
947 |
+
if ( ! $video){
|
948 |
+
return false;
|
949 |
+
}
|
950 |
+
$videoSource = $this->avalue_dot('source', $video);
|
951 |
+
return $videoSource === 'html5';
|
952 |
+
}
|
953 |
+
|
954 |
+
/**
|
955 |
+
*
|
956 |
+
* return lesson type icon
|
957 |
+
*
|
958 |
+
* @param int $lesson_id
|
959 |
+
* @param bool $html
|
960 |
+
* @param bool $echo
|
961 |
+
*
|
962 |
+
* @return string
|
963 |
+
*
|
964 |
+
* @since v.1.0.0
|
965 |
+
*/
|
966 |
+
|
967 |
+
public function get_lesson_type_icon($lesson_id = 0, $html = false, $echo = false){
|
968 |
+
$post_id = $this->get_post_id($lesson_id);
|
969 |
+
$video = tutor_utils()->get_video_info($post_id);
|
970 |
+
|
971 |
+
$play_time = false;
|
972 |
+
if ($video){
|
973 |
+
$play_time = $video->playtime;
|
974 |
+
}
|
975 |
+
|
976 |
+
$tutor_lesson_type_icon = $play_time ? 'youtube' : 'document';
|
977 |
+
|
978 |
+
if ($html){
|
979 |
+
$tutor_lesson_type_icon = "<i class='tutor-icon-$tutor_lesson_type_icon'></i> ";
|
980 |
+
}
|
981 |
+
|
982 |
+
if ($tutor_lesson_type_icon){
|
983 |
+
echo $tutor_lesson_type_icon;
|
984 |
+
}
|
985 |
+
|
986 |
+
return $tutor_lesson_type_icon;
|
987 |
+
}
|
988 |
+
|
989 |
+
/**
|
990 |
+
* @param int $lesson_id
|
991 |
+
* @param int $user_id
|
992 |
+
*
|
993 |
+
* @return bool|mixed
|
994 |
+
*
|
995 |
+
* @since v.1.0.0
|
996 |
+
*/
|
997 |
+
|
998 |
+
public function is_completed_lesson($lesson_id = 0, $user_id = 0){
|
999 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
1000 |
+
$user_id = $this->get_user_id($user_id);
|
1001 |
+
|
1002 |
+
$is_completed = get_user_meta($user_id, '_tutor_completed_lesson_id_'.$lesson_id, true);
|
1003 |
+
|
1004 |
+
if ($is_completed){
|
1005 |
+
return $is_completed;
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
return false;
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
/**
|
1012 |
+
* @param int $course_id
|
1013 |
+
* @param int $user_id
|
1014 |
+
*
|
1015 |
+
* @return array|bool|null|object|void
|
1016 |
+
*
|
1017 |
+
* Determine if a course completed
|
1018 |
+
*/
|
1019 |
+
|
1020 |
+
public function is_completed_course($course_id = 0, $user_id = 0){
|
1021 |
+
global $wpdb;
|
1022 |
+
$course_id = $this->get_post_id($course_id);
|
1023 |
+
$user_id = $this->get_user_id($user_id);
|
1024 |
+
|
1025 |
+
$is_completed = $wpdb->get_row("SELECT comment_ID,
|
1026 |
+
comment_post_ID as course_id,
|
1027 |
+
comment_author as completed_user_id,
|
1028 |
+
comment_date as completion_date,
|
1029 |
+
comment_content as completed_hash
|
1030 |
+
from {$wpdb->comments}
|
1031 |
+
WHERE comment_agent = 'TutorLMSPlugin'
|
1032 |
+
AND comment_type = 'course_completed'
|
1033 |
+
AND comment_post_ID = {$course_id}
|
1034 |
+
AND user_id = {$user_id} ;");
|
1035 |
+
|
1036 |
+
if ($is_completed){
|
1037 |
+
return $is_completed;
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
return false;
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
/**
|
1044 |
+
* @param array $input
|
1045 |
+
*
|
1046 |
+
* @return array
|
1047 |
+
*
|
1048 |
+
* Sanitize input array
|
1049 |
+
*/
|
1050 |
+
public function sanitize_array($input = array()){
|
1051 |
+
$array = array();
|
1052 |
+
|
1053 |
+
if (is_array($input) && count($input)){
|
1054 |
+
foreach ($input as $key => $value){
|
1055 |
+
if (is_array($value)){
|
1056 |
+
$array[$key] = $this->sanitize_array($value);
|
1057 |
+
}else{
|
1058 |
+
$key = sanitize_text_field($key);
|
1059 |
+
$value = sanitize_text_field($value);
|
1060 |
+
$array[$key] = $value;
|
1061 |
+
}
|
1062 |
+
}
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
return $array;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
public function has_video_in_single($post_id = 0){
|
1069 |
+
if (is_single()) {
|
1070 |
+
$post_id = $this->get_post_id($post_id);
|
1071 |
+
|
1072 |
+
$video = $this->get_video( $post_id );
|
1073 |
+
if ( $video ) {
|
1074 |
+
return $video;
|
1075 |
+
}
|
1076 |
+
}
|
1077 |
+
return false;
|
1078 |
+
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
/**
|
1082 |
+
* @param int $start
|
1083 |
+
* @param int $limit
|
1084 |
+
* @param string $search_term
|
1085 |
+
* @param int $course_id
|
1086 |
+
*
|
1087 |
+
* @return array|null|object
|
1088 |
+
*
|
1089 |
+
*
|
1090 |
+
* Get the enrolled students for all courses.
|
1091 |
+
*
|
1092 |
+
* Pass course id in 4th parameter to get students course wise.
|
1093 |
+
*
|
1094 |
+
* @since v.1.0.0
|
1095 |
+
*/
|
1096 |
+
public function get_students($start = 0, $limit = 10, $search_term = ''){
|
1097 |
+
$meta_key = '_is_tutor_student';
|
1098 |
+
|
1099 |
+
global $wpdb;
|
1100 |
+
|
1101 |
+
if ($search_term){
|
1102 |
+
$search_term = " AND ( {$wpdb->users}.display_name LIKE '%{$search_term}%' OR {$wpdb->users}.user_email LIKE '%{$search_term}%' ) ";
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
$students = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS {$wpdb->users}.* FROM {$wpdb->users}
|
1106 |
+
INNER JOIN {$wpdb->usermeta}
|
1107 |
+
ON ( {$wpdb->users}.ID = {$wpdb->usermeta}.user_id )
|
1108 |
+
WHERE 1=1 AND ( {$wpdb->usermeta}.meta_key = '{$meta_key}' ) {$search_term}
|
1109 |
+
ORDER BY {$wpdb->usermeta}.meta_value DESC
|
1110 |
+
LIMIT {$start}, {$limit} ");
|
1111 |
+
|
1112 |
+
return $students;
|
1113 |
+
}
|
1114 |
+
|
1115 |
+
/**
|
1116 |
+
* @return int
|
1117 |
+
*
|
1118 |
+
* @since v.1.0.0
|
1119 |
+
*
|
1120 |
+
* get the total students
|
1121 |
+
* pass course id to get course wise total students
|
1122 |
+
*/
|
1123 |
+
public function get_total_students($search_term = ''){
|
1124 |
+
$meta_key = '_is_tutor_student';
|
1125 |
+
|
1126 |
+
global $wpdb;
|
1127 |
+
|
1128 |
+
if ($search_term){
|
1129 |
+
$search_term = " AND ( {$wpdb->users}.display_name LIKE '%{$search_term}%' OR {$wpdb->users}.user_email LIKE '%{$search_term}%' ) ";
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
$count = $wpdb->get_var("SELECT COUNT({$wpdb->users}.ID) FROM {$wpdb->users} INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = {$wpdb->usermeta}.user_id ) WHERE 1=1 AND ( {$wpdb->usermeta}.meta_key = '{$meta_key}' ) $search_term ");
|
1133 |
+
|
1134 |
+
return (int) $count;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
public function get_completed_courses_ids_by_user($user_id = 0){
|
1138 |
+
global $wpdb;
|
1139 |
+
|
1140 |
+
$user_id = $this->get_user_id($user_id);
|
1141 |
+
|
1142 |
+
$course_ids = (array) $wpdb->get_col("SELECT comment_post_ID as course_id
|
1143 |
+
from {$wpdb->comments}
|
1144 |
+
WHERE comment_agent = 'TutorLMSPlugin'
|
1145 |
+
AND comment_type = 'course_completed'
|
1146 |
+
AND user_id = {$user_id} ;");
|
1147 |
+
|
1148 |
+
return $course_ids;
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
/**
|
1152 |
+
* @param int $user_id
|
1153 |
+
*
|
1154 |
+
* @return bool|\WP_Query
|
1155 |
+
*
|
1156 |
+
* Return courses by user_id
|
1157 |
+
*/
|
1158 |
+
public function get_courses_by_user($user_id = 0){
|
1159 |
+
$user_id = $this->get_user_id($user_id);
|
1160 |
+
$course_ids = $this->get_completed_courses_ids_by_user($user_id);
|
1161 |
+
|
1162 |
+
if (count($course_ids)){
|
1163 |
+
$course_post_type = tutor()->course_post_type;
|
1164 |
+
$course_args = array(
|
1165 |
+
'post_type' => $course_post_type,
|
1166 |
+
'post_status' => 'publish',
|
1167 |
+
'post__in' => $course_ids,
|
1168 |
+
);
|
1169 |
+
|
1170 |
+
return new \WP_Query($course_args);
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
return false;
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
/**
|
1177 |
+
* @param int $user_id
|
1178 |
+
*
|
1179 |
+
* @return bool|\WP_Query
|
1180 |
+
*
|
1181 |
+
* Get the active course by user
|
1182 |
+
*/
|
1183 |
+
|
1184 |
+
public function get_active_courses_by_user($user_id = 0){
|
1185 |
+
$user_id = $this->get_user_id($user_id);
|
1186 |
+
|
1187 |
+
$course_ids = $this->get_completed_courses_ids_by_user($user_id);
|
1188 |
+
$enrolled_course_ids = $this->get_enrolled_courses_ids_by_user($user_id);
|
1189 |
+
$active_courses = array_diff($enrolled_course_ids, $course_ids);
|
1190 |
+
|
1191 |
+
if (count($active_courses)){
|
1192 |
+
$course_post_type = tutor()->course_post_type;
|
1193 |
+
$course_args = array(
|
1194 |
+
'post_type' => $course_post_type,
|
1195 |
+
'post_status' => 'publish',
|
1196 |
+
'post__in' => $active_courses,
|
1197 |
+
);
|
1198 |
+
|
1199 |
+
return new \WP_Query($course_args);
|
1200 |
+
}
|
1201 |
+
|
1202 |
+
return false;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
public function get_enrolled_courses_ids_by_user($user_id = 0){
|
1206 |
+
global $wpdb;
|
1207 |
+
$user_id = $this->get_user_id($user_id);
|
1208 |
+
$course_ids = $wpdb->get_col("select post_parent from {$wpdb->posts} WHERE post_type = 'tutor_enrolled' AND post_author = {$user_id} AND post_status = 'completed'; ");
|
1209 |
+
|
1210 |
+
return $course_ids;
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
/**
|
1214 |
+
* @param int $course_id
|
1215 |
+
*
|
1216 |
+
* @return int
|
1217 |
+
*
|
1218 |
+
* Get the total enrolled users at course
|
1219 |
+
*/
|
1220 |
+
public function count_enrolled_users_by_course($course_id = 0){
|
1221 |
+
global $wpdb;
|
1222 |
+
$course_id = $this->get_post_id($course_id);
|
1223 |
+
|
1224 |
+
$course_ids = $wpdb->get_var("select COUNT(ID) from {$wpdb->posts} WHERE post_type = 'tutor_enrolled' AND post_parent = {$course_id} AND post_status = 'completed'; ");
|
1225 |
+
|
1226 |
+
return (int) $course_ids;
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
/**
|
1230 |
+
* @param int $user_id
|
1231 |
+
*
|
1232 |
+
* @return bool|\WP_Query
|
1233 |
+
*
|
1234 |
+
* Get the enrolled courses by user
|
1235 |
+
*/
|
1236 |
+
public function get_enrolled_courses_by_user($user_id = 0){
|
1237 |
+
global $wpdb;
|
1238 |
+
|
1239 |
+
$user_id = $this->get_user_id($user_id);
|
1240 |
+
$course_ids = $this->get_enrolled_courses_ids_by_user($user_id);
|
1241 |
+
|
1242 |
+
if (count($course_ids)){
|
1243 |
+
$course_post_type = tutor()->course_post_type;
|
1244 |
+
$course_args = array(
|
1245 |
+
'post_type' => $course_post_type,
|
1246 |
+
'post_status' => 'publish',
|
1247 |
+
'post__in' => $course_ids,
|
1248 |
+
);
|
1249 |
+
return new \WP_Query($course_args);
|
1250 |
+
}
|
1251 |
+
return false;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
|
1255 |
+
/**
|
1256 |
+
* @param int $post_id
|
1257 |
+
*
|
1258 |
+
* @return string
|
1259 |
+
*
|
1260 |
+
* Get the video streaming URL by post/lesson/course ID
|
1261 |
+
*/
|
1262 |
+
public function get_video_stream_url($post_id = 0){
|
1263 |
+
$post_id = $this->get_post_id($post_id);
|
1264 |
+
$post = get_post($post_id);
|
1265 |
+
|
1266 |
+
if ($post->post_type === tutor()->lesson_post_type ){
|
1267 |
+
$video_url = trailingslashit(home_url()).'video-url/'.$post->post_name;
|
1268 |
+
}else{
|
1269 |
+
$video_info = tutor_utils()->get_video_info($post_id);
|
1270 |
+
$video_url = $video_info->url;
|
1271 |
+
}
|
1272 |
+
|
1273 |
+
return $video_url;
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
/**
|
1277 |
+
* @param int $lesson_id
|
1278 |
+
* @param int $user_id
|
1279 |
+
*
|
1280 |
+
* @return array|bool|mixed
|
1281 |
+
*
|
1282 |
+
* Get student lesson reading current info
|
1283 |
+
*
|
1284 |
+
* @since v.1.0.0
|
1285 |
+
*/
|
1286 |
+
public function get_lesson_reading_info_full($lesson_id = 0, $user_id = 0){
|
1287 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
1288 |
+
$user_id = $this->get_user_id($user_id);
|
1289 |
+
|
1290 |
+
$lesson_info = (array) maybe_unserialize(get_user_meta($user_id, '_lesson_reading_info', true));
|
1291 |
+
return $this->avalue_dot($lesson_id, $lesson_info);
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
public function get_post_id($post_id = 0){
|
1295 |
+
if ( ! $post_id){
|
1296 |
+
$post_id = get_the_ID();
|
1297 |
+
if ( ! $post_id){
|
1298 |
+
return false;
|
1299 |
+
}
|
1300 |
+
}
|
1301 |
+
|
1302 |
+
return $post_id;
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
public function get_user_id($user_id = 0){
|
1306 |
+
if ( ! $user_id){
|
1307 |
+
$user_id = get_current_user_id();
|
1308 |
+
if ( ! $user_id){
|
1309 |
+
return false;
|
1310 |
+
}
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
return $user_id;
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
/**
|
1317 |
+
* @param int $lesson_id
|
1318 |
+
* @param int $user_id
|
1319 |
+
* @param string $key
|
1320 |
+
*
|
1321 |
+
* @return array|bool|mixed
|
1322 |
+
*
|
1323 |
+
* Get lesson reading info by key
|
1324 |
+
*
|
1325 |
+
* @since v.1.0.0
|
1326 |
+
*/
|
1327 |
+
|
1328 |
+
public function get_lesson_reading_info($lesson_id = 0, $user_id = 0, $key = ''){
|
1329 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
1330 |
+
$user_id = $this->get_user_id($user_id);
|
1331 |
+
|
1332 |
+
$lesson_info = $this->get_lesson_reading_info_full($lesson_id, $user_id);
|
1333 |
+
|
1334 |
+
return $this->avalue_dot($key, $lesson_info);
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
/**
|
1338 |
+
* @param int $lesson_id
|
1339 |
+
* @param int $user_id
|
1340 |
+
* @param array $data
|
1341 |
+
*
|
1342 |
+
* @return bool
|
1343 |
+
*
|
1344 |
+
* Update student lesson reading info
|
1345 |
+
*
|
1346 |
+
* @since v.1.0.0
|
1347 |
+
*/
|
1348 |
+
public function update_lesson_reading_info($lesson_id = 0, $user_id = 0, $key = '', $value = ''){
|
1349 |
+
$lesson_id = $this->get_post_id($lesson_id);
|
1350 |
+
$user_id = $this->get_user_id($user_id);
|
1351 |
+
|
1352 |
+
if ($key && $value){
|
1353 |
+
$lesson_info = (array) maybe_unserialize(get_user_meta($user_id, '_lesson_reading_info', true));
|
1354 |
+
$lesson_info[$lesson_id][$key] = $value;
|
1355 |
+
update_user_meta($user_id, '_lesson_reading_info', $lesson_info);
|
1356 |
+
}
|
1357 |
+
}
|
1358 |
+
|
1359 |
+
/**
|
1360 |
+
* @param string $url
|
1361 |
+
*
|
1362 |
+
* @return bool
|
1363 |
+
*
|
1364 |
+
* Get the Youtube Video ID from URL
|
1365 |
+
*
|
1366 |
+
* @since v.1.0.0
|
1367 |
+
*/
|
1368 |
+
public function get_youtube_video_id($url = ''){
|
1369 |
+
if (!$url){
|
1370 |
+
return false;
|
1371 |
+
}
|
1372 |
+
preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match);
|
1373 |
+
|
1374 |
+
if (isset($match[1])) {
|
1375 |
+
$youtube_id = $match[1];
|
1376 |
+
return $youtube_id;
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
return false;
|
1380 |
+
}
|
1381 |
+
|
1382 |
+
/**
|
1383 |
+
* @param string $url
|
1384 |
+
*
|
1385 |
+
* @return bool
|
1386 |
+
*
|
1387 |
+
* Get the vimeo video id from URL
|
1388 |
+
*
|
1389 |
+
* @since v.1.0.0
|
1390 |
+
*/
|
1391 |
+
public function get_vimeo_video_id($url = ''){
|
1392 |
+
if (preg_match('%^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$%im', $url, $match)) {
|
1393 |
+
if (isset($match[3])){
|
1394 |
+
return $match[3];
|
1395 |
+
}
|
1396 |
+
}
|
1397 |
+
return false;
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
/**
|
1401 |
+
* @param int $post_id
|
1402 |
+
*
|
1403 |
+
* Mark lesson complete
|
1404 |
+
*/
|
1405 |
+
public function mark_lesson_complete($post_id = 0, $user_id = 0){
|
1406 |
+
$post_id = $this->get_post_id($post_id);
|
1407 |
+
$user_id = $this->get_user_id($user_id);
|
1408 |
+
update_user_meta($user_id, '_tutor_completed_lesson_id_'.$post_id, time());
|
1409 |
+
}
|
1410 |
+
|
1411 |
+
/**
|
1412 |
+
* Saving enroll information to posts table
|
1413 |
+
* post_author = enrolled_student_id (wp_users id)
|
1414 |
+
* post_parent = enrolled course id
|
1415 |
+
*
|
1416 |
+
* @type: call when need
|
1417 |
+
* @return bool;
|
1418 |
+
*/
|
1419 |
+
public function do_enroll($course_id = 0, $order_id = 0){
|
1420 |
+
if ( ! $course_id){
|
1421 |
+
return false;
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
do_action('tutor_before_enroll', $course_id);
|
1425 |
+
$user_id = get_current_user_id();
|
1426 |
+
$title = __('Course Enrolled', 'tutor')." – ".date_i18n(get_option('date_format')) .' @ '.date_i18n(get_option('time_format') ) ;
|
1427 |
+
|
1428 |
+
$enrolment_status = 'completed';
|
1429 |
+
|
1430 |
+
if ($this->is_course_purchasable($course_id)) {
|
1431 |
+
/**
|
1432 |
+
* We need to verify this enrollment, we will change the status later after payment confirmation
|
1433 |
+
*/
|
1434 |
+
$enrolment_status = 'pending';
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
$enroll_data = apply_filters('tutor_enroll_data',
|
1438 |
+
array(
|
1439 |
+
'post_type' => 'tutor_enrolled',
|
1440 |
+
'post_title' => $title,
|
1441 |
+
'post_status' => $enrolment_status,
|
1442 |
+
'post_author' => $user_id,
|
1443 |
+
'post_parent' => $course_id,
|
1444 |
+
)
|
1445 |
+
);
|
1446 |
+
|
1447 |
+
// Insert the post into the database
|
1448 |
+
$isEnrolled = wp_insert_post( $enroll_data );
|
1449 |
+
if ($isEnrolled) {
|
1450 |
+
do_action('tutor_after_enroll', $course_id, $isEnrolled);
|
1451 |
+
|
1452 |
+
//Mark Current User as Students with user meta data
|
1453 |
+
update_user_meta( $user_id, '_is_tutor_student', time() );
|
1454 |
+
|
1455 |
+
if ($order_id) {
|
1456 |
+
//Mark order for course and user
|
1457 |
+
$product_id = $this->get_course_product_id($course_id);
|
1458 |
+
update_post_meta( $isEnrolled, '_tutor_enrolled_by_order_id', $order_id );
|
1459 |
+
update_post_meta( $isEnrolled, '_tutor_enrolled_by_product_id', $product_id );
|
1460 |
+
update_post_meta( $order_id, '_is_tutor_order_for_course', time() );
|
1461 |
+
update_post_meta( $order_id, '_tutor_order_for_course_id_'.$course_id, $isEnrolled );
|
1462 |
+
}
|
1463 |
+
return true;
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
return false;
|
1467 |
+
}
|
1468 |
+
|
1469 |
+
public function complete_course_enroll($order_id){
|
1470 |
+
if ( ! tutor_utils()->is_tutor_order($order_id)){
|
1471 |
+
return;
|
1472 |
+
}
|
1473 |
+
|
1474 |
+
global $wpdb;
|
1475 |
+
|
1476 |
+
$enrolled_ids_with_course = $this->get_course_enrolled_ids_by_order_id($order_id);
|
1477 |
+
if ($enrolled_ids_with_course){
|
1478 |
+
$enrolled_ids = wp_list_pluck($enrolled_ids_with_course, 'enrolled_id');
|
1479 |
+
|
1480 |
+
if (is_array($enrolled_ids) && count($enrolled_ids)){
|
1481 |
+
foreach ($enrolled_ids as $enrolled_id){
|
1482 |
+
$wpdb->update( $wpdb->posts, array( 'post_status' => 'completed' ), array( 'ID' => $enrolled_id ) );
|
1483 |
+
}
|
1484 |
+
}
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
/**
|
1489 |
+
* @param $order_id
|
1490 |
+
*
|
1491 |
+
* @return array|bool
|
1492 |
+
*/
|
1493 |
+
public function get_course_enrolled_ids_by_order_id($order_id){
|
1494 |
+
global $wpdb;
|
1495 |
+
//Getting all of courses ids within this order
|
1496 |
+
|
1497 |
+
$courses_ids = $wpdb->get_results("SELECT * FROM {$wpdb->postmeta} WHERE post_id = {$order_id} AND meta_key LIKE '_tutor_order_for_course_id_%' ");
|
1498 |
+
|
1499 |
+
if (is_array($courses_ids) && count($courses_ids)){
|
1500 |
+
$course_enrolled_by_order = array();
|
1501 |
+
foreach ($courses_ids as $courses_id){
|
1502 |
+
$course_id = str_replace('_tutor_order_for_course_id_', '',$courses_id->meta_key);
|
1503 |
+
//array(order_id => array('course_id' => $course_id, 'enrolled_id' => enrolled_id))
|
1504 |
+
$course_enrolled_by_order[$courses_id->post_id] = array('course_id' => $course_id, 'enrolled_id' => $courses_id->meta_value);
|
1505 |
+
}
|
1506 |
+
return $course_enrolled_by_order;
|
1507 |
+
}
|
1508 |
+
return false;
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
/**
|
1512 |
+
* Get wc product in efficient query
|
1513 |
+
*
|
1514 |
+
* @since v.1.0.0
|
1515 |
+
*/
|
1516 |
+
|
1517 |
+
/**
|
1518 |
+
* @return array|null|object
|
1519 |
+
*
|
1520 |
+
* WooCommerce specific utils
|
1521 |
+
*/
|
1522 |
+
public function get_wc_products_db(){
|
1523 |
+
global $wpdb;
|
1524 |
+
$query = $wpdb->get_results("SELECT ID, post_title from {$wpdb->posts} WHERE post_status = 'publish' AND post_type = 'product' ");
|
1525 |
+
|
1526 |
+
return $query;
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
public function get_course_product_id($course_id = 0){
|
1530 |
+
$course_id = $this->get_post_id($course_id);
|
1531 |
+
return (int) get_post_meta($course_id, '_tutor_course_product_id', true);
|
1532 |
+
}
|
1533 |
+
|
1534 |
+
public function product_belongs_with_course($product_id = 0){
|
1535 |
+
global $wpdb;
|
1536 |
+
|
1537 |
+
$query = $wpdb->get_row("select * from {$wpdb->postmeta} WHERE meta_key='_tutor_course_product_id' AND meta_value = {$product_id} limit 1 ");
|
1538 |
+
return $query;
|
1539 |
+
}
|
1540 |
+
|
1541 |
+
/**
|
1542 |
+
* #End WooCommerce specific utils
|
1543 |
+
*/
|
1544 |
+
|
1545 |
+
public function get_enrolled_statuses(){
|
1546 |
+
return array (
|
1547 |
+
'pending',
|
1548 |
+
'processing',
|
1549 |
+
'on-hold',
|
1550 |
+
'completed',
|
1551 |
+
'cancelled',
|
1552 |
+
'refunded',
|
1553 |
+
'failed',
|
1554 |
+
);
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
public function is_tutor_order($order_id){
|
1558 |
+
return get_post_meta($order_id, '_is_tutor_order_for_course', true);
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
/**
|
1562 |
+
* @return mixed
|
1563 |
+
*
|
1564 |
+
* Tutor Dashboard Pages
|
1565 |
+
*/
|
1566 |
+
|
1567 |
+
public function tutor_student_dashboard_pages(){
|
1568 |
+
$nav_items = array(
|
1569 |
+
'index' => __('Home', 'tutor'),
|
1570 |
+
'my-courses' => __('My Courses', 'tutor'),
|
1571 |
+
'active-courses' => __('Active Courses', 'tutor'),
|
1572 |
+
'completed-courses' => __('Completed Courses', 'tutor'),
|
1573 |
+
'wishlist' => __('WishList', 'tutor'),
|
1574 |
+
);
|
1575 |
+
|
1576 |
+
return apply_filters('tutor_dashboard/student/pages', $nav_items);
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
|
1580 |
+
public function get_tutor_dashboard_page_permalink($page_key = '', $page_id = 0){
|
1581 |
+
if ($page_key === 'index'){
|
1582 |
+
$page_key = '';
|
1583 |
+
}
|
1584 |
+
$page_id = $this->get_post_id($page_id);
|
1585 |
+
return trailingslashit(get_permalink($page_id)).$page_key;
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
public function input_old($input = ''){
|
1589 |
+
$value = $this->avalue_dot($input, $_REQUEST);
|
1590 |
+
if ($value){
|
1591 |
+
return $value;
|
1592 |
+
}
|
1593 |
+
return '';
|
1594 |
+
}
|
1595 |
+
|
1596 |
+
/**
|
1597 |
+
* @param int $user_id
|
1598 |
+
*
|
1599 |
+
* @return mixed
|
1600 |
+
*
|
1601 |
+
* Determine if is instructor or not
|
1602 |
+
*
|
1603 |
+
* @since v.1.0.0
|
1604 |
+
*/
|
1605 |
+
public function is_instructor($user_id = 0){
|
1606 |
+
$user_id = $this->get_user_id($user_id);
|
1607 |
+
return get_user_meta($user_id, '_is_tutor_instructor', true);
|
1608 |
+
}
|
1609 |
+
|
1610 |
+
public function instructor_status($user_id = 0, $status_name = true){
|
1611 |
+
$user_id = $this->get_user_id($user_id);
|
1612 |
+
|
1613 |
+
$instructor_status = apply_filters('tutor_instructor_statuses', array(
|
1614 |
+
'pending' => __('Pending', 'tutor'),
|
1615 |
+
'approved' => __('Approved', 'tutor'),
|
1616 |
+
'blocked' => __('Blocked', 'tutor'),
|
1617 |
+
));
|
1618 |
+
|
1619 |
+
$status = get_user_meta($user_id, '_tutor_instructor_status', true);
|
1620 |
+
|
1621 |
+
if (isset($instructor_status[$status])){
|
1622 |
+
if ( ! $status_name){
|
1623 |
+
return $status;
|
1624 |
+
}
|
1625 |
+
return $instructor_status[$status];
|
1626 |
+
}
|
1627 |
+
return false;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
|
1631 |
+
public function get_total_instructors($search_term = ''){
|
1632 |
+
$meta_key = '_is_tutor_instructor';
|
1633 |
+
|
1634 |
+
global $wpdb;
|
1635 |
+
|
1636 |
+
if ($search_term){
|
1637 |
+
$search_term = " AND ( {$wpdb->users}.display_name LIKE '%{$search_term}%' OR {$wpdb->users}.user_email LIKE '%{$search_term}%' ) ";
|
1638 |
+
}
|
1639 |
+
|
1640 |
+
$count = $wpdb->get_var("SELECT COUNT({$wpdb->users}.ID) FROM {$wpdb->users} INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = {$wpdb->usermeta}.user_id ) WHERE 1=1 AND ( {$wpdb->usermeta}.meta_key = '{$meta_key}' ) $search_term ");
|
1641 |
+
|
1642 |
+
return (int) $count;
|
1643 |
+
}
|
1644 |
+
|
1645 |
+
public function get_instructors($start = 0, $limit = 10, $search_term = ''){
|
1646 |
+
$meta_key = '_is_tutor_instructor';
|
1647 |
+
global $wpdb;
|
1648 |
+
|
1649 |
+
if ($search_term){
|
1650 |
+
$search_term = " AND ( {$wpdb->users}.display_name LIKE '%{$search_term}%' OR {$wpdb->users}.user_email LIKE '%{$search_term}%' ) ";
|
1651 |
+
}
|
1652 |
+
|
1653 |
+
$instructors = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS {$wpdb->users}.* FROM {$wpdb->users}
|
1654 |
+
INNER JOIN {$wpdb->usermeta}
|
1655 |
+
ON ( {$wpdb->users}.ID = {$wpdb->usermeta}.user_id )
|
1656 |
+
WHERE 1=1 AND ( {$wpdb->usermeta}.meta_key = '{$meta_key}' ) {$search_term}
|
1657 |
+
ORDER BY {$wpdb->usermeta}.meta_value DESC
|
1658 |
+
LIMIT {$start}, {$limit} ");
|
1659 |
+
|
1660 |
+
return $instructors;
|
1661 |
+
}
|
1662 |
+
|
1663 |
+
public function get_instructors_by_course($course_id = 0){
|
1664 |
+
global $wpdb;
|
1665 |
+
$course_id = $this->get_post_id($course_id);
|
1666 |
+
|
1667 |
+
$instructors = $wpdb->get_results("select ID, display_name,
|
1668 |
+
get_course.meta_value as taught_course_id,
|
1669 |
+
tutor_job_title.meta_value as tutor_profile_job_title,
|
1670 |
+
tutor_bio.meta_value as tutor_profile_bio,
|
1671 |
+
tutor_photo.meta_value as tutor_profile_photo
|
1672 |
+
from {$wpdb->users}
|
1673 |
+
INNER JOIN {$wpdb->usermeta} get_course ON ID = get_course.user_id AND get_course.meta_value = {$course_id}
|
1674 |
+
LEFT JOIN {$wpdb->usermeta} tutor_job_title ON ID = tutor_job_title.user_id AND tutor_job_title.meta_key = '_tutor_profile_job_title'
|
1675 |
+
LEFT JOIN {$wpdb->usermeta} tutor_bio ON ID = tutor_bio.user_id AND tutor_bio.meta_key = '_tutor_profile_bio'
|
1676 |
+
LEFT JOIN {$wpdb->usermeta} tutor_photo ON ID = tutor_photo.user_id AND tutor_photo.meta_key = '_tutor_profile_photo'
|
1677 |
+
");
|
1678 |
+
|
1679 |
+
if (is_array($instructors) && count($instructors)){
|
1680 |
+
return $instructors;
|
1681 |
+
}
|
1682 |
+
|
1683 |
+
return false;
|
1684 |
+
}
|
1685 |
+
|
1686 |
+
/**
|
1687 |
+
* @param $instructor_id
|
1688 |
+
*
|
1689 |
+
* Get total Students by instructor
|
1690 |
+
* 1 enrollment = 1 student, so total enrolled for a equivalent total students (Tricks)
|
1691 |
+
*
|
1692 |
+
* @since v.1.0.0
|
1693 |
+
*/
|
1694 |
+
public function get_total_students_by_instructor($instructor_id){
|
1695 |
+
global $wpdb;
|
1696 |
+
|
1697 |
+
$course_post_type = tutor()->course_post_type;
|
1698 |
+
$count = $wpdb->get_var("SELECT COUNT(courses.ID) from {$wpdb->posts} courses
|
1699 |
+
|
1700 |
+
INNER JOIN {$wpdb->posts} enrolled ON courses.ID = enrolled.post_parent AND enrolled.post_type = 'tutor_enrolled'
|
1701 |
+
WHERE courses.post_status = 'publish'
|
1702 |
+
AND courses.post_type = '{$course_post_type}'
|
1703 |
+
AND courses.post_author = {$instructor_id} ; ");
|
1704 |
+
return (int) $count;
|
1705 |
+
}
|
1706 |
+
|
1707 |
+
/**
|
1708 |
+
* @param float $input
|
1709 |
+
*
|
1710 |
+
* @return float|string
|
1711 |
+
*
|
1712 |
+
* Get rating format from value
|
1713 |
+
*/
|
1714 |
+
public function get_rating_value($input = 0.00){
|
1715 |
+
|
1716 |
+
if ( $input > 0){
|
1717 |
+
$input = number_format($input, 2);
|
1718 |
+
$int_value = (int) $input;
|
1719 |
+
$fraction = $input - $int_value;
|
1720 |
+
|
1721 |
+
if ($fraction == 0){
|
1722 |
+
$fraction = 0.00;
|
1723 |
+
}elseif($fraction > 0.5){
|
1724 |
+
$fraction = 1;
|
1725 |
+
}else{
|
1726 |
+
$fraction = 0.5;
|
1727 |
+
}
|
1728 |
+
|
1729 |
+
return number_format( ($int_value + $fraction), 2);
|
1730 |
+
}
|
1731 |
+
return 0.00;
|
1732 |
+
}
|
1733 |
+
|
1734 |
+
/**
|
1735 |
+
* @param float $current_rating
|
1736 |
+
* @param bool $echo
|
1737 |
+
*
|
1738 |
+
* @return string
|
1739 |
+
*
|
1740 |
+
* Generate star rating based in given rating value
|
1741 |
+
*/
|
1742 |
+
public function star_rating_generator($current_rating = 0.00, $echo = true){
|
1743 |
+
$output = '';
|
1744 |
+
|
1745 |
+
for ($i = 1; $i <=5 ; $i++){
|
1746 |
+
$intRating = (int) $current_rating;
|
1747 |
+
|
1748 |
+
if ($intRating >= $i){
|
1749 |
+
$output.= '<i class="tutor-icon-star-full" data-rating-value="'.$i.'"></i>';
|
1750 |
+
} else{
|
1751 |
+
if ( ($current_rating - $i) == -0.5){
|
1752 |
+
$output.= '<i class="tutor-icon-star-half" data-rating-value="'.$i.'"></i>';
|
1753 |
+
}else{
|
1754 |
+
$output.= '<i class="tutor-icon-star-line" data-rating-value="'.$i.'"></i>';
|
1755 |
+
}
|
1756 |
+
}
|
1757 |
+
}
|
1758 |
+
|
1759 |
+
if ($echo){
|
1760 |
+
echo $output;
|
1761 |
+
}
|
1762 |
+
return $output;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
/**
|
1766 |
+
* @param null $name
|
1767 |
+
*
|
1768 |
+
* @return string
|
1769 |
+
*
|
1770 |
+
* Generate text to avatar
|
1771 |
+
*/
|
1772 |
+
public function get_tutor_avatar($user_id = null, $size = 'thumbnail'){
|
1773 |
+
global $wpdb;
|
1774 |
+
|
1775 |
+
if ( ! $user_id){
|
1776 |
+
return '';
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
$user = $this->get_tutor_user($user_id);
|
1780 |
+
if ($user->tutor_profile_photo){
|
1781 |
+
return '<img src="'.wp_get_attachment_image_url($user->tutor_profile_photo, $size).'" class="tutor-image-avatar" alt="" /> ';
|
1782 |
+
}
|
1783 |
+
|
1784 |
+
$name = $user->display_name;
|
1785 |
+
$arr = explode(' ', trim($name));
|
1786 |
+
|
1787 |
+
if (count($arr) > 1){
|
1788 |
+
$first_char = substr($arr[0], 0, 1) ;
|
1789 |
+
$second_char = substr($arr[1], 0, 1) ;
|
1790 |
+
}else{
|
1791 |
+
$first_char = substr($arr[0], 0, 1) ;
|
1792 |
+
$second_char = substr($arr[0], 1, 1) ;
|
1793 |
+
}
|
1794 |
+
|
1795 |
+
$initial_avatar = strtoupper($first_char.$second_char);
|
1796 |
+
|
1797 |
+
$bg_color = '#'.substr(md5($initial_avatar), 0, 6);
|
1798 |
+
$initial_avatar = "<span class='tutor-text-avatar' style='background-color: {$bg_color}; color: #fff8e5'>{$initial_avatar}</span>";
|
1799 |
+
|
1800 |
+
return $initial_avatar;
|
1801 |
+
}
|
1802 |
+
|
1803 |
+
public function get_tutor_user($user_id){
|
1804 |
+
global $wpdb;
|
1805 |
+
|
1806 |
+
$user = $wpdb->get_row("select ID, display_name,
|
1807 |
+
tutor_job_title.meta_value as tutor_profile_job_title,
|
1808 |
+
tutor_bio.meta_value as tutor_profile_bio,
|
1809 |
+
tutor_photo.meta_value as tutor_profile_photo
|
1810 |
+
|
1811 |
+
from {$wpdb->users}
|
1812 |
+
LEFT JOIN {$wpdb->usermeta} tutor_job_title ON ID = tutor_job_title.user_id AND tutor_job_title.meta_key = '_tutor_profile_job_title'
|
1813 |
+
LEFT JOIN {$wpdb->usermeta} tutor_bio ON ID = tutor_bio.user_id AND tutor_bio.meta_key = '_tutor_profile_bio'
|
1814 |
+
LEFT JOIN {$wpdb->usermeta} tutor_photo ON ID = tutor_photo.user_id AND tutor_photo.meta_key = '_tutor_profile_photo'
|
1815 |
+
|
1816 |
+
WHERE ID = {$user_id} ");
|
1817 |
+
return $user;
|
1818 |
+
}
|
1819 |
+
|
1820 |
+
/**
|
1821 |
+
* @param int $course_id
|
1822 |
+
* @param int $offset
|
1823 |
+
* @param int $limit
|
1824 |
+
*
|
1825 |
+
* @return array|null|object
|
1826 |
+
*
|
1827 |
+
* get course reviews
|
1828 |
+
*
|
1829 |
+
* @since v.1.0.0
|
1830 |
+
*/
|
1831 |
+
public function get_course_reviews($course_id = 0, $offset = 0, $limit = 150){
|
1832 |
+
$course_id = $this->get_post_id($course_id);
|
1833 |
+
global $wpdb;
|
1834 |
+
|
1835 |
+
$reviews = $wpdb->get_results("select {$wpdb->comments}.comment_ID,
|
1836 |
+
{$wpdb->comments}.comment_post_ID,
|
1837 |
+
{$wpdb->comments}.comment_author,
|
1838 |
+
{$wpdb->comments}.comment_author_email,
|
1839 |
+
{$wpdb->comments}.comment_date,
|
1840 |
+
{$wpdb->comments}.comment_content,
|
1841 |
+
{$wpdb->comments}.user_id,
|
1842 |
+
{$wpdb->commentmeta}.meta_value as rating,
|
1843 |
+
{$wpdb->users}.display_name
|
1844 |
+
|
1845 |
+
from {$wpdb->comments}
|
1846 |
+
INNER JOIN {$wpdb->commentmeta}
|
1847 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
1848 |
+
INNER JOIN {$wpdb->users}
|
1849 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
1850 |
+
WHERE {$wpdb->comments}.comment_post_ID = {$course_id}
|
1851 |
+
AND meta_key = 'tutor_rating' ORDER BY comment_ID DESC LIMIT {$offset},{$limit} ;"
|
1852 |
+
);
|
1853 |
+
|
1854 |
+
return $reviews;
|
1855 |
+
}
|
1856 |
+
|
1857 |
+
/**
|
1858 |
+
* @param int $course_id
|
1859 |
+
*
|
1860 |
+
* @return object
|
1861 |
+
*
|
1862 |
+
* Get course rating
|
1863 |
+
*/
|
1864 |
+
public function get_course_rating($course_id = 0){
|
1865 |
+
$course_id = $this->get_post_id($course_id);
|
1866 |
+
|
1867 |
+
$ratings = array(
|
1868 |
+
'rating_count' => 0,
|
1869 |
+
'rating_sum' => 0,
|
1870 |
+
'rating_avg' => 0.00,
|
1871 |
+
);
|
1872 |
+
|
1873 |
+
global $wpdb;
|
1874 |
+
|
1875 |
+
$rating = $wpdb->get_row("select COUNT(meta_value) as rating_count, SUM(meta_value) as rating_sum from {$wpdb->comments}
|
1876 |
+
INNER JOIN {$wpdb->commentmeta}
|
1877 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
1878 |
+
WHERE {$wpdb->comments}.comment_post_ID = {$course_id}
|
1879 |
+
AND meta_key = 'tutor_rating' ;"
|
1880 |
+
);
|
1881 |
+
|
1882 |
+
if ($rating->rating_count){
|
1883 |
+
$avg_rating = number_format(($rating->rating_sum / $rating->rating_count), 2);
|
1884 |
+
|
1885 |
+
$ratings = array(
|
1886 |
+
'rating_count' => $rating->rating_count,
|
1887 |
+
'rating_sum' => $rating->rating_sum,
|
1888 |
+
'rating_avg' => $avg_rating,
|
1889 |
+
);
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
return (object) $ratings;
|
1893 |
+
}
|
1894 |
+
|
1895 |
+
|
1896 |
+
public function get_reviews_by_user($user_id = 0, $offset = 0, $limit = 150){
|
1897 |
+
$user_id = $this->get_user_id($user_id);
|
1898 |
+
global $wpdb;
|
1899 |
+
|
1900 |
+
$reviews = $wpdb->get_results("select {$wpdb->comments}.comment_ID,
|
1901 |
+
{$wpdb->comments}.comment_post_ID,
|
1902 |
+
{$wpdb->comments}.comment_author,
|
1903 |
+
{$wpdb->comments}.comment_author_email,
|
1904 |
+
{$wpdb->comments}.comment_date,
|
1905 |
+
{$wpdb->comments}.comment_content,
|
1906 |
+
{$wpdb->comments}.user_id,
|
1907 |
+
{$wpdb->commentmeta}.meta_value as rating,
|
1908 |
+
{$wpdb->users}.display_name
|
1909 |
+
|
1910 |
+
from {$wpdb->comments}
|
1911 |
+
INNER JOIN {$wpdb->commentmeta}
|
1912 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
1913 |
+
INNER JOIN {$wpdb->users}
|
1914 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
1915 |
+
WHERE {$wpdb->comments}.user_id = {$user_id}
|
1916 |
+
AND meta_key = 'tutor_rating' ORDER BY comment_ID DESC LIMIT {$offset},{$limit} ;"
|
1917 |
+
);
|
1918 |
+
|
1919 |
+
return $reviews;
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
/**
|
1923 |
+
* @param $instructor_id
|
1924 |
+
*
|
1925 |
+
* @return object
|
1926 |
+
*
|
1927 |
+
* Get instructors rating
|
1928 |
+
*/
|
1929 |
+
public function get_instructor_ratings($instructor_id){
|
1930 |
+
global $wpdb;
|
1931 |
+
|
1932 |
+
$ratings = array(
|
1933 |
+
'rating_count' => 0,
|
1934 |
+
'rating_sum' => 0,
|
1935 |
+
'rating_avg' => 0.00,
|
1936 |
+
);
|
1937 |
+
|
1938 |
+
$rating = $wpdb->get_row("SELECT COUNT(rating.meta_value) as rating_count, SUM(rating.meta_value) as rating_sum
|
1939 |
+
FROM {$wpdb->usermeta} courses
|
1940 |
+
INNER JOIN {$wpdb->comments} reviews ON courses.meta_value = reviews.comment_post_ID AND reviews.comment_type = 'tutor_course_rating'
|
1941 |
+
INNER JOIN {$wpdb->commentmeta} rating ON reviews.comment_ID = rating.comment_id AND rating.meta_key = 'tutor_rating'
|
1942 |
+
WHERE courses.user_id = {$instructor_id} AND courses.meta_key = '_tutor_instructor_course_id'");
|
1943 |
+
|
1944 |
+
if ($rating->rating_count){
|
1945 |
+
$avg_rating = number_format(($rating->rating_sum / $rating->rating_count), 2);
|
1946 |
+
|
1947 |
+
$ratings = array(
|
1948 |
+
'rating_count' => $rating->rating_count,
|
1949 |
+
'rating_sum' => $rating->rating_sum,
|
1950 |
+
'rating_avg' => $avg_rating,
|
1951 |
+
);
|
1952 |
+
}
|
1953 |
+
|
1954 |
+
return (object) $ratings;
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
/**
|
1958 |
+
* @param int $course_id
|
1959 |
+
* @param int $user_id
|
1960 |
+
*
|
1961 |
+
* @return object
|
1962 |
+
*
|
1963 |
+
* Get course rating by user
|
1964 |
+
*/
|
1965 |
+
public function get_course_rating_by_user($course_id = 0, $user_id = 0){
|
1966 |
+
$course_id = $this->get_post_id($course_id);
|
1967 |
+
$user_id = $this->get_user_id($user_id);
|
1968 |
+
|
1969 |
+
$ratings = array(
|
1970 |
+
'rating' => 0,
|
1971 |
+
'review' => '',
|
1972 |
+
);
|
1973 |
+
|
1974 |
+
global $wpdb;
|
1975 |
+
|
1976 |
+
$rating = $wpdb->get_row("select meta_value as rating, comment_content as review from {$wpdb->comments}
|
1977 |
+
INNER JOIN {$wpdb->commentmeta}
|
1978 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
1979 |
+
WHERE {$wpdb->comments}.comment_post_ID = {$course_id} AND user_id = {$user_id}
|
1980 |
+
AND meta_key = 'tutor_rating' ;"
|
1981 |
+
);
|
1982 |
+
|
1983 |
+
if ($rating){
|
1984 |
+
$rating_format = number_format($rating->rating, 2);
|
1985 |
+
|
1986 |
+
$ratings = array(
|
1987 |
+
'rating' => $rating_format,
|
1988 |
+
'review' => $rating->review,
|
1989 |
+
);
|
1990 |
+
}
|
1991 |
+
return (object) $ratings;
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
/**
|
1995 |
+
* @param int $user_id
|
1996 |
+
*
|
1997 |
+
* @return null|string
|
1998 |
+
*/
|
1999 |
+
public function count_reviews_wrote_by_user($user_id = 0){
|
2000 |
+
global $wpdb;
|
2001 |
+
$user_id = $this->get_user_id($user_id);
|
2002 |
+
|
2003 |
+
$count_reviews = $wpdb->get_var("SELECT COUNT(comment_ID) from {$wpdb->comments} WHERE user_id = {$user_id} AND comment_type = 'tutor_course_rating' ");
|
2004 |
+
return $count_reviews;
|
2005 |
+
}
|
2006 |
+
|
2007 |
+
/**
|
2008 |
+
* @param $size
|
2009 |
+
*
|
2010 |
+
* @return bool|int|string
|
2011 |
+
*
|
2012 |
+
* This function transforms the php.ini notation for numbers (like '2M') to an integer.
|
2013 |
+
*/
|
2014 |
+
|
2015 |
+
function let_to_num( $size ) {
|
2016 |
+
$l = substr( $size, -1 );
|
2017 |
+
$ret = substr( $size, 0, -1 );
|
2018 |
+
$byte = 1024;
|
2019 |
+
|
2020 |
+
switch ( strtoupper( $l ) ) {
|
2021 |
+
case 'P':
|
2022 |
+
$ret *= 1024;
|
2023 |
+
// No break.
|
2024 |
+
case 'T':
|
2025 |
+
$ret *= 1024;
|
2026 |
+
// No break.
|
2027 |
+
case 'G':
|
2028 |
+
$ret *= 1024;
|
2029 |
+
// No break.
|
2030 |
+
case 'M':
|
2031 |
+
$ret *= 1024;
|
2032 |
+
// No break.
|
2033 |
+
case 'K':
|
2034 |
+
$ret *= 1024;
|
2035 |
+
// No break.
|
2036 |
+
}
|
2037 |
+
return $ret;
|
2038 |
+
}
|
2039 |
+
|
2040 |
+
|
2041 |
+
|
2042 |
+
function get_db_version() {
|
2043 |
+
global $wpdb;
|
2044 |
+
|
2045 |
+
if ( empty( $wpdb->is_mysql ) ) {
|
2046 |
+
return array(
|
2047 |
+
'string' => '',
|
2048 |
+
'number' => '',
|
2049 |
+
);
|
2050 |
+
}
|
2051 |
+
|
2052 |
+
if ( $wpdb->use_mysqli ) {
|
2053 |
+
$server_info = mysqli_get_server_info( $wpdb->dbh ); // @codingStandardsIgnoreLine.
|
2054 |
+
} else {
|
2055 |
+
$server_info = mysql_get_server_info( $wpdb->dbh ); // @codingStandardsIgnoreLine.
|
2056 |
+
}
|
2057 |
+
|
2058 |
+
return array(
|
2059 |
+
'string' => $server_info,
|
2060 |
+
'number' => preg_replace( '/([^\d.]+).*/', '', $server_info ),
|
2061 |
+
);
|
2062 |
+
}
|
2063 |
+
|
2064 |
+
public function help_tip($tip = ''){
|
2065 |
+
return '<span class="tutor-help-tip" data-tip="' . $tip . '"></span>';
|
2066 |
+
}
|
2067 |
+
|
2068 |
+
|
2069 |
+
public function get_top_question($course_id = 0, $user_id = 0, $offset = 0, $limit = 20){
|
2070 |
+
$course_id = $this->get_post_id($course_id);
|
2071 |
+
$user_id = $this->get_user_id($user_id);
|
2072 |
+
|
2073 |
+
global $wpdb;
|
2074 |
+
|
2075 |
+
$questions = $wpdb->get_results("select {$wpdb->comments}.comment_ID,
|
2076 |
+
{$wpdb->comments}.comment_post_ID,
|
2077 |
+
{$wpdb->comments}.comment_author,
|
2078 |
+
{$wpdb->comments}.comment_date,
|
2079 |
+
{$wpdb->comments}.comment_content,
|
2080 |
+
{$wpdb->comments}.user_id,
|
2081 |
+
{$wpdb->commentmeta}.meta_value as question_title,
|
2082 |
+
{$wpdb->users}.display_name
|
2083 |
+
|
2084 |
+
from {$wpdb->comments}
|
2085 |
+
INNER JOIN {$wpdb->commentmeta}
|
2086 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
2087 |
+
INNER JOIN {$wpdb->users}
|
2088 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2089 |
+
WHERE {$wpdb->comments}.comment_post_ID = {$course_id}
|
2090 |
+
AND {$wpdb->comments}.user_id = {$user_id}
|
2091 |
+
AND {$wpdb->comments}.comment_type = 'tutor_q_and_a'
|
2092 |
+
AND meta_key = 'tutor_question_title' ORDER BY comment_ID DESC LIMIT {$offset},{$limit} ;"
|
2093 |
+
);
|
2094 |
+
|
2095 |
+
return $questions;
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
public function get_total_qa_question($search_term = ''){
|
2099 |
+
global $wpdb;
|
2100 |
+
|
2101 |
+
if ($search_term){
|
2102 |
+
$search_term = " AND {$wpdb->commentmeta}.meta_value LIKE '%{$search_term}%' ";
|
2103 |
+
}
|
2104 |
+
|
2105 |
+
$count = $wpdb->get_var("SELECT COUNT({$wpdb->comments}.comment_ID) FROM {$wpdb->comments}
|
2106 |
+
INNER JOIN {$wpdb->commentmeta}
|
2107 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
2108 |
+
WHERE comment_type = 'tutor_q_and_a' AND comment_parent = 0 {$search_term} ");
|
2109 |
+
|
2110 |
+
return (int) $count;
|
2111 |
+
}
|
2112 |
+
|
2113 |
+
/**
|
2114 |
+
* @param int $start
|
2115 |
+
* @param int $limit
|
2116 |
+
* @param string $search_term
|
2117 |
+
*
|
2118 |
+
* @return array|null|object
|
2119 |
+
*
|
2120 |
+
*
|
2121 |
+
* Get question and answer query
|
2122 |
+
*
|
2123 |
+
* @since v.1.0.0
|
2124 |
+
*/
|
2125 |
+
public function get_qa_questions($start = 0, $limit = 10, $search_term = '') {
|
2126 |
+
global $wpdb;
|
2127 |
+
|
2128 |
+
if ($search_term){
|
2129 |
+
$search_term = " AND {$wpdb->commentmeta}.meta_value LIKE '%{$search_term}%' ";
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
$query = $wpdb->get_results("SELECT
|
2133 |
+
{$wpdb->comments}.comment_ID,
|
2134 |
+
{$wpdb->comments}.comment_post_ID,
|
2135 |
+
{$wpdb->comments}.comment_author,
|
2136 |
+
{$wpdb->comments}.comment_date,
|
2137 |
+
{$wpdb->comments}.comment_content,
|
2138 |
+
{$wpdb->comments}.user_id,
|
2139 |
+
{$wpdb->commentmeta}.meta_value as question_title,
|
2140 |
+
{$wpdb->users}.display_name,
|
2141 |
+
{$wpdb->posts}.post_title,
|
2142 |
+
|
2143 |
+
(SELECT COUNT(answers_t.comment_ID) FROM {$wpdb->comments} answers_t
|
2144 |
+
WHERE answers_t.comment_parent = {$wpdb->comments}.comment_ID ) as answer_count
|
2145 |
+
|
2146 |
+
FROM {$wpdb->comments}
|
2147 |
+
|
2148 |
+
INNER JOIN {$wpdb->commentmeta}
|
2149 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
2150 |
+
|
2151 |
+
INNER JOIN {$wpdb->posts}
|
2152 |
+
ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID
|
2153 |
+
|
2154 |
+
INNER JOIN {$wpdb->users}
|
2155 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2156 |
+
|
2157 |
+
WHERE {$wpdb->comments}.comment_type = 'tutor_q_and_a' AND {$wpdb->comments}.comment_parent = 0 {$search_term}
|
2158 |
+
ORDER BY {$wpdb->comments}.comment_ID DESC
|
2159 |
+
LIMIT {$start},{$limit}; ");
|
2160 |
+
|
2161 |
+
return $query;
|
2162 |
+
}
|
2163 |
+
|
2164 |
+
public function get_qa_question($question_id){
|
2165 |
+
global $wpdb;
|
2166 |
+
$query = $wpdb->get_row("SELECT
|
2167 |
+
{$wpdb->comments}.comment_ID,
|
2168 |
+
{$wpdb->comments}.comment_post_ID,
|
2169 |
+
{$wpdb->comments}.comment_author,
|
2170 |
+
{$wpdb->comments}.comment_date,
|
2171 |
+
{$wpdb->comments}.comment_content,
|
2172 |
+
{$wpdb->comments}.user_id,
|
2173 |
+
{$wpdb->commentmeta}.meta_value as question_title,
|
2174 |
+
{$wpdb->users}.display_name,
|
2175 |
+
{$wpdb->posts}.post_title
|
2176 |
+
|
2177 |
+
FROM {$wpdb->comments}
|
2178 |
+
INNER JOIN {$wpdb->commentmeta}
|
2179 |
+
ON {$wpdb->comments}.comment_ID = {$wpdb->commentmeta}.comment_id
|
2180 |
+
|
2181 |
+
INNER JOIN {$wpdb->posts}
|
2182 |
+
ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID
|
2183 |
+
|
2184 |
+
INNER JOIN {$wpdb->users}
|
2185 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2186 |
+
WHERE comment_type = 'tutor_q_and_a' AND {$wpdb->comments}.comment_ID = {$question_id}");
|
2187 |
+
|
2188 |
+
return $query;
|
2189 |
+
}
|
2190 |
+
|
2191 |
+
public function get_qa_answer_by_question($question_id){
|
2192 |
+
global $wpdb;
|
2193 |
+
$query = $wpdb->get_results("SELECT
|
2194 |
+
{$wpdb->comments}.comment_ID,
|
2195 |
+
{$wpdb->comments}.comment_post_ID,
|
2196 |
+
{$wpdb->comments}.comment_author,
|
2197 |
+
{$wpdb->comments}.comment_date,
|
2198 |
+
{$wpdb->comments}.comment_content,
|
2199 |
+
{$wpdb->comments}.comment_parent,
|
2200 |
+
{$wpdb->comments}.user_id,
|
2201 |
+
{$wpdb->users}.display_name
|
2202 |
+
|
2203 |
+
FROM {$wpdb->comments}
|
2204 |
+
|
2205 |
+
INNER JOIN {$wpdb->users}
|
2206 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2207 |
+
WHERE comment_type = 'tutor_q_and_a'
|
2208 |
+
AND {$wpdb->comments}.comment_parent = {$question_id} ORDER BY {$wpdb->comments}.comment_ID ASC ");
|
2209 |
+
|
2210 |
+
return $query;
|
2211 |
+
}
|
2212 |
+
|
2213 |
+
public function unanswered_question_count(){
|
2214 |
+
global $wpdb;
|
2215 |
+
|
2216 |
+
$count = $wpdb->get_var("select COUNT({$wpdb->comments}.comment_ID)
|
2217 |
+
from {$wpdb->comments}
|
2218 |
+
WHERE {$wpdb->comments}.comment_type = 'tutor_q_and_a'
|
2219 |
+
AND {$wpdb->comments}.comment_approved = 'waiting_for_answer'
|
2220 |
+
AND {$wpdb->comments}.comment_parent = 0;");
|
2221 |
+
return (int) $count;
|
2222 |
+
}
|
2223 |
+
|
2224 |
+
/**
|
2225 |
+
* @param int $course_id
|
2226 |
+
*
|
2227 |
+
* @return array|null|object
|
2228 |
+
*
|
2229 |
+
* Return all of announcements for a course
|
2230 |
+
*
|
2231 |
+
* @since v.1.0.0
|
2232 |
+
*/
|
2233 |
+
public function get_announcements($course_id = 0){
|
2234 |
+
$course_id = $this->get_post_id($course_id);
|
2235 |
+
global $wpdb;
|
2236 |
+
|
2237 |
+
$query = $wpdb->get_results("select {$wpdb->posts}.ID, post_author, post_date, post_content, post_title, display_name
|
2238 |
+
from {$wpdb->posts}
|
2239 |
+
INNER JOIN {$wpdb->users} ON post_author = {$wpdb->users}.ID
|
2240 |
+
WHERE post_type = 'tutor_announcements'
|
2241 |
+
AND post_parent = {$course_id} ORDER BY {$wpdb->posts}.ID DESC;");
|
2242 |
+
return $query;
|
2243 |
+
}
|
2244 |
+
|
2245 |
+
public function announcement_content($content = ''){
|
2246 |
+
$search = array('{user_display_name}');
|
2247 |
+
|
2248 |
+
$user_display_name = 'User';
|
2249 |
+
if (is_user_logged_in()){
|
2250 |
+
$user = wp_get_current_user();
|
2251 |
+
$user_display_name = $user->display_name;
|
2252 |
+
}
|
2253 |
+
$replace = array($user_display_name);
|
2254 |
+
|
2255 |
+
return str_replace($search, $replace, $content);
|
2256 |
+
}
|
2257 |
+
|
2258 |
+
/**
|
2259 |
+
* @param int $post_id
|
2260 |
+
* @param string $option_key
|
2261 |
+
* @param bool $default
|
2262 |
+
*
|
2263 |
+
* @return array|bool|mixed
|
2264 |
+
*
|
2265 |
+
* Get the quiz option from meta
|
2266 |
+
*/
|
2267 |
+
public function get_quiz_option($post_id = 0, $option_key = '', $default = false){
|
2268 |
+
$post_id = $this->get_post_id($post_id);
|
2269 |
+
$get_option_meta = maybe_unserialize(get_post_meta($post_id, 'tutor_quiz_option', true));
|
2270 |
+
|
2271 |
+
$value = $this->avalue_dot($option_key, $get_option_meta);
|
2272 |
+
if ($value){
|
2273 |
+
return $value;
|
2274 |
+
}
|
2275 |
+
return $default;
|
2276 |
+
}
|
2277 |
+
|
2278 |
+
|
2279 |
+
/**
|
2280 |
+
* @param int $quiz_id
|
2281 |
+
*
|
2282 |
+
* @return array|bool|null|object
|
2283 |
+
*
|
2284 |
+
* Get the questions by quiz ID
|
2285 |
+
*/
|
2286 |
+
public function get_questions_by_quiz($quiz_id = 0){
|
2287 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2288 |
+
global $wpdb;
|
2289 |
+
|
2290 |
+
$questions = $wpdb->get_results("SELECT ID, post_content, post_title, post_parent from {$wpdb->posts} WHERE post_type = 'tutor_question' AND post_parent = {$quiz_id} ORDER BY menu_order ASC ");
|
2291 |
+
|
2292 |
+
if (is_array($questions) && count($questions)){
|
2293 |
+
return $questions;
|
2294 |
+
}
|
2295 |
+
return false;
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
public function get_question_types($type = null){
|
2299 |
+
$types = array(
|
2300 |
+
'true_false' => __('True/False', 'tutor'),
|
2301 |
+
'multiple_choice' => __('Multiple Choice', 'tutor'),
|
2302 |
+
'single_choice' => __('Single Choice', 'tutor'),
|
2303 |
+
);
|
2304 |
+
|
2305 |
+
if (isset($types[$type])){
|
2306 |
+
return $types[$type];
|
2307 |
+
}
|
2308 |
+
return $types;
|
2309 |
+
}
|
2310 |
+
|
2311 |
+
public function get_quiz_answer_options_by_question($question_id){
|
2312 |
+
global $wpdb;
|
2313 |
+
|
2314 |
+
$answer_options = $wpdb->get_results("select
|
2315 |
+
{$wpdb->comments}.comment_ID,
|
2316 |
+
{$wpdb->comments}.comment_post_ID,
|
2317 |
+
{$wpdb->comments}.comment_content
|
2318 |
+
|
2319 |
+
FROM {$wpdb->comments}
|
2320 |
+
WHERE {$wpdb->comments}.comment_post_ID = {$question_id}
|
2321 |
+
AND {$wpdb->comments}.comment_type = 'quiz_answer_option'
|
2322 |
+
ORDER BY {$wpdb->comments}.comment_karma ASC ;");
|
2323 |
+
|
2324 |
+
if (is_array($answer_options) && count($answer_options)){
|
2325 |
+
return $answer_options;
|
2326 |
+
}
|
2327 |
+
return false;
|
2328 |
+
}
|
2329 |
+
|
2330 |
+
/**
|
2331 |
+
* @param $quiz_id
|
2332 |
+
*
|
2333 |
+
* @return int
|
2334 |
+
*
|
2335 |
+
* Get the next question order ID
|
2336 |
+
*/
|
2337 |
+
|
2338 |
+
public function quiz_next_question_order_id($quiz_id){
|
2339 |
+
global $wpdb;
|
2340 |
+
|
2341 |
+
$last_order = (int) $wpdb->get_var("SELECT MAX(menu_order) FROM {$wpdb->posts} WHERE post_parent = {$quiz_id} AND post_type = 'tutor_question';");
|
2342 |
+
return $last_order + 1;
|
2343 |
+
}
|
2344 |
+
|
2345 |
+
public function get_quiz_id_by_question($question_id){
|
2346 |
+
global $wpdb;
|
2347 |
+
|
2348 |
+
$quiz_id = $wpdb->get_var("SELECT post_parent FROM {$wpdb->posts} WHERE ID = {$question_id} AND post_type = 'tutor_question' ;");
|
2349 |
+
return $quiz_id;
|
2350 |
+
}
|
2351 |
+
|
2352 |
+
public function get_unattached_quiz($config = array()){
|
2353 |
+
global $wpdb;
|
2354 |
+
|
2355 |
+
$default_attr = array(
|
2356 |
+
'search_term' => '',
|
2357 |
+
'start' => '0',
|
2358 |
+
'limit' => '10',
|
2359 |
+
'order' => 'DESC',
|
2360 |
+
'order_by' => 'ID',
|
2361 |
+
);
|
2362 |
+
$attr = array_merge($default_attr, $config);
|
2363 |
+
extract($attr);
|
2364 |
+
|
2365 |
+
$search_query = '';
|
2366 |
+
if (! empty($search_term)){
|
2367 |
+
$search_query = "AND post_title LIKE '%{$search_term}%'";
|
2368 |
+
}
|
2369 |
+
|
2370 |
+
$questions = $wpdb->get_results("SELECT ID, post_content, post_title, post_parent from {$wpdb->posts} WHERE post_type = 'tutor_quiz' AND post_status = 'publish' AND post_parent = 0 {$search_query} ORDER BY {$order_by} {$order} LIMIT {$start},{$limit} ");
|
2371 |
+
|
2372 |
+
if (is_array($questions) && count($questions)){
|
2373 |
+
return $questions;
|
2374 |
+
}
|
2375 |
+
return false;
|
2376 |
+
}
|
2377 |
+
|
2378 |
+
/**
|
2379 |
+
* @param int $post_id
|
2380 |
+
*
|
2381 |
+
* @return array|bool|null|object
|
2382 |
+
*/
|
2383 |
+
public function get_attached_quiz($post_id = 0){
|
2384 |
+
global $wpdb;
|
2385 |
+
|
2386 |
+
$post_id = $this->get_post_id($post_id);
|
2387 |
+
|
2388 |
+
$questions = $wpdb->get_results("SELECT ID, post_content, post_title, post_parent from {$wpdb->posts} WHERE post_type = 'tutor_quiz' AND post_status = 'publish' AND post_parent = {$post_id}");
|
2389 |
+
|
2390 |
+
if (is_array($questions) && count($questions)){
|
2391 |
+
return $questions;
|
2392 |
+
}
|
2393 |
+
return false;
|
2394 |
+
}
|
2395 |
+
|
2396 |
+
|
2397 |
+
public function get_course_by_quiz($quiz_id){
|
2398 |
+
global $wpdb;
|
2399 |
+
|
2400 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2401 |
+
$post = get_post($quiz_id);
|
2402 |
+
|
2403 |
+
if ($post) {
|
2404 |
+
$course_post_type = tutor()->course_post_type;
|
2405 |
+
$course = $wpdb->get_row( "select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$post->post_parent} " );
|
2406 |
+
|
2407 |
+
if ($course) {
|
2408 |
+
//Checking if this topic
|
2409 |
+
if ( $course->post_type !== $course_post_type ) {
|
2410 |
+
$course = $wpdb->get_row( "select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$course->post_parent} " );
|
2411 |
+
}
|
2412 |
+
//Checking if this lesson
|
2413 |
+
if ( $course->post_type !== $course_post_type ) {
|
2414 |
+
$course = $wpdb->get_row( "select ID, post_name, post_type, post_parent from {$wpdb->posts} where ID = {$course->post_parent} " );
|
2415 |
+
}
|
2416 |
+
|
2417 |
+
return $course;
|
2418 |
+
}
|
2419 |
+
}
|
2420 |
+
|
2421 |
+
return false;
|
2422 |
+
}
|
2423 |
+
|
2424 |
+
/**
|
2425 |
+
* @param $quiz_id
|
2426 |
+
*
|
2427 |
+
* @return int
|
2428 |
+
*/
|
2429 |
+
public function total_questions_for_student_by_quiz($quiz_id){
|
2430 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2431 |
+
global $wpdb;
|
2432 |
+
|
2433 |
+
$total_question = (int) $wpdb->get_var("select count(ID) from {$wpdb->posts} where post_parent = {$quiz_id} AND post_type = 'tutor_question' ");
|
2434 |
+
|
2435 |
+
return $total_question;
|
2436 |
+
}
|
2437 |
+
|
2438 |
+
public function is_started_quiz($quiz_id = 0){
|
2439 |
+
global $wpdb;
|
2440 |
+
|
2441 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2442 |
+
$user_id = get_current_user_id();
|
2443 |
+
|
2444 |
+
$is_started = $wpdb->get_row("SELECT
|
2445 |
+
comment_ID,
|
2446 |
+
comment_post_ID,
|
2447 |
+
comment_author,
|
2448 |
+
comment_date as quiz_started_at,
|
2449 |
+
comment_date_gmt,
|
2450 |
+
comment_approved as quiz_attempt_status,
|
2451 |
+
comment_parent,
|
2452 |
+
user_id
|
2453 |
+
|
2454 |
+
FROM {$wpdb->comments}
|
2455 |
+
WHERE user_id = {$user_id}
|
2456 |
+
AND comment_type = 'tutor_quiz_attempt'
|
2457 |
+
AND comment_approved = 'quiz_started'
|
2458 |
+
AND comment_post_ID = {$quiz_id} ; ");
|
2459 |
+
|
2460 |
+
return $is_started;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
/**
|
2464 |
+
* @param $quiz_id
|
2465 |
+
*
|
2466 |
+
* Method for get the total amount of question for a quiz
|
2467 |
+
* Student will answer this amount of question, one quiz have many question
|
2468 |
+
* but student will answer a specific amount of questions
|
2469 |
+
*
|
2470 |
+
* @return int
|
2471 |
+
*/
|
2472 |
+
|
2473 |
+
public function max_questions_for_take_quiz($quiz_id){
|
2474 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2475 |
+
global $wpdb;
|
2476 |
+
|
2477 |
+
$max_questions = (int) $wpdb->get_var("select count(ID) from {$wpdb->posts} where post_parent = {$quiz_id} AND post_type = 'tutor_question' ");
|
2478 |
+
$max_mentioned = (int) $this->get_quiz_option($quiz_id, 'max_questions_for_answer', 10);
|
2479 |
+
|
2480 |
+
if ($max_mentioned < $max_questions ){
|
2481 |
+
return $max_mentioned;
|
2482 |
+
}
|
2483 |
+
|
2484 |
+
return $max_questions;
|
2485 |
+
}
|
2486 |
+
|
2487 |
+
public function get_attempt($attempt_id = 0){
|
2488 |
+
global $wpdb;
|
2489 |
+
|
2490 |
+
$attempt = $wpdb->get_row("SELECT
|
2491 |
+
comment_ID,
|
2492 |
+
comment_post_ID,
|
2493 |
+
comment_author,
|
2494 |
+
comment_date as quiz_started_at,
|
2495 |
+
comment_date_gmt,
|
2496 |
+
comment_approved as quiz_attempt_status,
|
2497 |
+
comment_parent,
|
2498 |
+
user_id
|
2499 |
+
|
2500 |
+
FROM {$wpdb->comments}
|
2501 |
+
WHERE comment_type = 'tutor_quiz_attempt'
|
2502 |
+
AND comment_ID = {$attempt_id} ;");
|
2503 |
+
|
2504 |
+
return $attempt;
|
2505 |
+
}
|
2506 |
+
|
2507 |
+
public function quiz_attempt_info($quiz_attempt_id){
|
2508 |
+
$attempt_info = get_comment_meta($quiz_attempt_id, 'quiz_attempt_info', true);
|
2509 |
+
return $attempt_info;
|
2510 |
+
}
|
2511 |
+
|
2512 |
+
public function quiz_update_attempt_info($quiz_attempt_id, $attempt_info = array()){
|
2513 |
+
$answers = tutor_utils()->avalue_dot('answers', $attempt_info);
|
2514 |
+
$total_marks = array_sum(wp_list_pluck($answers, 'question_mark'));
|
2515 |
+
$earned_marks = tutor_utils()->avalue_dot('marks_earned', $attempt_info);
|
2516 |
+
$earned_mark_percent = $earned_marks > 0 ? ( number_format(($earned_marks * 100) / $total_marks)) : 0;
|
2517 |
+
update_comment_meta($quiz_attempt_id, 'earned_mark_percent', $earned_mark_percent);
|
2518 |
+
|
2519 |
+
return update_comment_meta($quiz_attempt_id,'quiz_attempt_info', $attempt_info);
|
2520 |
+
}
|
2521 |
+
|
2522 |
+
public function get_rand_single_question_by_quiz_for_student($quiz_id = 0){
|
2523 |
+
global $wpdb;
|
2524 |
+
|
2525 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2526 |
+
|
2527 |
+
$is_attempt = $this->is_started_quiz($quiz_id);
|
2528 |
+
$attempted_question_ids = array();
|
2529 |
+
if ($is_attempt){
|
2530 |
+
$attempt_info = $this->quiz_attempt_info($is_attempt->comment_ID);
|
2531 |
+
$attempted_question_ids = wp_list_pluck($this->avalue_dot('answers', $attempt_info),'questionID');
|
2532 |
+
}
|
2533 |
+
$attempted_question_ids_string = implode(",", $attempted_question_ids);
|
2534 |
+
|
2535 |
+
$not_in_sql = "";
|
2536 |
+
if (is_array($attempted_question_ids) && count($attempted_question_ids)){
|
2537 |
+
$not_in_sql = " AND ID NOT IN({$attempted_question_ids_string}) ";
|
2538 |
+
}
|
2539 |
+
|
2540 |
+
$question = $wpdb->get_row("SELECT ID, post_content, post_title, post_parent
|
2541 |
+
from {$wpdb->posts} WHERE post_type = 'tutor_question' AND post_parent = {$quiz_id} {$not_in_sql} ORDER BY RAND() ;");
|
2542 |
+
|
2543 |
+
return $question;
|
2544 |
+
}
|
2545 |
+
|
2546 |
+
/**
|
2547 |
+
* @param int $quiz_id
|
2548 |
+
* @param int $user_id
|
2549 |
+
*
|
2550 |
+
* @return array|bool|null|object
|
2551 |
+
*
|
2552 |
+
* Get all of the attempts by an user of a quiz
|
2553 |
+
*/
|
2554 |
+
|
2555 |
+
public function quiz_attempts($quiz_id = 0, $user_id = 0){
|
2556 |
+
global $wpdb;
|
2557 |
+
|
2558 |
+
$quiz_id = $this->get_post_id($quiz_id);
|
2559 |
+
$user_id = $this->get_user_id($user_id);
|
2560 |
+
|
2561 |
+
$attempts = $wpdb->get_results("SELECT
|
2562 |
+
{$wpdb->comments}.comment_ID,
|
2563 |
+
comment_post_ID,
|
2564 |
+
comment_author,
|
2565 |
+
comment_date as quiz_started_at,
|
2566 |
+
comment_date_gmt,
|
2567 |
+
comment_approved as quiz_attempt_status,
|
2568 |
+
comment_parent,
|
2569 |
+
user_id,
|
2570 |
+
|
2571 |
+
attempt_info.meta_value as quiz_attempt_info,
|
2572 |
+
pass_mark.meta_value as pass_mark_percent
|
2573 |
+
|
2574 |
+
FROM {$wpdb->comments}
|
2575 |
+
|
2576 |
+
LEFT JOIN {$wpdb->commentmeta} attempt_info ON {$wpdb->comments}.comment_ID = attempt_info.comment_id AND attempt_info.meta_key = 'quiz_attempt_info'
|
2577 |
+
LEFT JOIN {$wpdb->commentmeta} pass_mark ON {$wpdb->comments}.comment_ID = pass_mark.comment_id AND pass_mark.meta_key = 'pass_mark_percent'
|
2578 |
+
|
2579 |
+
WHERE user_id = {$user_id}
|
2580 |
+
AND comment_type = 'tutor_quiz_attempt'
|
2581 |
+
AND comment_approved != 'quiz_started'
|
2582 |
+
AND comment_post_ID = {$quiz_id} ; ");
|
2583 |
+
|
2584 |
+
if (is_array($attempts) && count($attempts)){
|
2585 |
+
return $attempts;
|
2586 |
+
}
|
2587 |
+
|
2588 |
+
return false;
|
2589 |
+
}
|
2590 |
+
|
2591 |
+
public function get_total_quiz_attempts($search_term = ''){
|
2592 |
+
global $wpdb;
|
2593 |
+
|
2594 |
+
if ($search_term){
|
2595 |
+
$search_term = " AND ( user_email like '%{$search_term}%' OR display_name like '%{$search_term}%' OR post_title like '%{$search_term}%' ) ";
|
2596 |
+
}
|
2597 |
+
|
2598 |
+
$count = $wpdb->get_var("SELECT COUNT({$wpdb->comments}.comment_ID) FROM {$wpdb->comments}
|
2599 |
+
INNER JOIN {$wpdb->posts}
|
2600 |
+
ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID
|
2601 |
+
|
2602 |
+
INNER JOIN {$wpdb->users}
|
2603 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2604 |
+
|
2605 |
+
WHERE comment_type = 'tutor_quiz_attempt' {$search_term} ");
|
2606 |
+
|
2607 |
+
return (int) $count;
|
2608 |
+
}
|
2609 |
+
|
2610 |
+
public function get_quiz_attempts($start = 0, $limit = 10, $search_term = '') {
|
2611 |
+
global $wpdb;
|
2612 |
+
|
2613 |
+
if ($search_term){
|
2614 |
+
$search_term = " AND ( user_email like '%{$search_term}%' OR display_name like '%{$search_term}%' OR post_title like '%{$search_term}%' ) ";
|
2615 |
+
}
|
2616 |
+
|
2617 |
+
$query = $wpdb->get_results("SELECT
|
2618 |
+
{$wpdb->comments}.comment_ID,
|
2619 |
+
{$wpdb->comments}.comment_post_ID,
|
2620 |
+
{$wpdb->comments}.comment_author,
|
2621 |
+
{$wpdb->comments}.comment_date,
|
2622 |
+
{$wpdb->comments}.comment_content,
|
2623 |
+
{$wpdb->comments}.comment_approved as attempt_status,
|
2624 |
+
{$wpdb->comments}.user_id,
|
2625 |
+
{$wpdb->users}.display_name,
|
2626 |
+
{$wpdb->users}.user_email,
|
2627 |
+
{$wpdb->posts}.post_title,
|
2628 |
+
|
2629 |
+
attempt_info.meta_value as quiz_attempt_info,
|
2630 |
+
pass_mark.meta_value as pass_mark_percent,
|
2631 |
+
|
2632 |
+
(SELECT COUNT(answers_t.comment_ID) FROM {$wpdb->comments} answers_t
|
2633 |
+
WHERE answers_t.comment_parent = {$wpdb->comments}.comment_ID ) as answer_count
|
2634 |
+
|
2635 |
+
FROM {$wpdb->comments}
|
2636 |
+
|
2637 |
+
INNER JOIN {$wpdb->posts}
|
2638 |
+
ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID
|
2639 |
+
|
2640 |
+
INNER JOIN {$wpdb->users}
|
2641 |
+
ON {$wpdb->comments}.user_id = {$wpdb->users}.ID
|
2642 |
+
|
2643 |
+
LEFT JOIN {$wpdb->commentmeta} attempt_info ON {$wpdb->comments}.comment_ID = attempt_info.comment_id AND attempt_info.meta_key = 'quiz_attempt_info'
|
2644 |
+
LEFT JOIN {$wpdb->commentmeta} pass_mark ON {$wpdb->comments}.comment_ID = pass_mark.comment_id AND pass_mark.meta_key = 'pass_mark_percent'
|
2645 |
+
|
2646 |
+
WHERE {$wpdb->comments}.comment_type = 'tutor_quiz_attempt' {$search_term}
|
2647 |
+
ORDER BY {$wpdb->comments}.comment_ID DESC
|
2648 |
+
LIMIT {$start},{$limit}; ");
|
2649 |
+
|
2650 |
+
return $query;
|
2651 |
+
}
|
2652 |
+
|
2653 |
+
public function get_quiz_answers_by_ids($ids){
|
2654 |
+
$ids = (array) $ids;
|
2655 |
+
|
2656 |
+
if (!count($ids)){
|
2657 |
+
return false;
|
2658 |
+
}
|
2659 |
+
|
2660 |
+
$in_ids = implode(",", $ids);
|
2661 |
+
|
2662 |
+
global $wpdb;
|
2663 |
+
$query = $wpdb->get_results("SELECT
|
2664 |
+
comment_ID,
|
2665 |
+
comment_content
|
2666 |
+
FROM {$wpdb->comments}
|
2667 |
+
WHERE comment_type = 'quiz_answer_option' AND comment_ID IN({$in_ids}) ");
|
2668 |
+
|
2669 |
+
if (is_array($query) && count($query)){
|
2670 |
+
return $query;
|
2671 |
+
}
|
2672 |
+
|
2673 |
+
return false;
|
2674 |
+
}
|
2675 |
+
|
2676 |
+
/**
|
2677 |
+
* @param null $level
|
2678 |
+
*
|
2679 |
+
* @return mixed
|
2680 |
+
*
|
2681 |
+
* Get the users / students / course levels
|
2682 |
+
*/
|
2683 |
+
|
2684 |
+
public function course_levels($level = null){
|
2685 |
+
$levels = apply_filters('tutor_course_level', array(
|
2686 |
+
'all_levels' => __('All Levels', 'tutor'),
|
2687 |
+
'beginner' => __('Beginner', 'tutor'),
|
2688 |
+
'intermediate' => __('Intermediate', 'tutor'),
|
2689 |
+
'expert' => __('Expert', 'tutor'),
|
2690 |
+
));
|
2691 |
+
|
2692 |
+
if ($level){
|
2693 |
+
if (isset($levels[$level])){
|
2694 |
+
return $levels[$level];
|
2695 |
+
}else{
|
2696 |
+
return '';
|
2697 |
+
}
|
2698 |
+
}
|
2699 |
+
|
2700 |
+
return $levels;
|
2701 |
+
}
|
2702 |
+
|
2703 |
+
public function user_profile_permalinks(){
|
2704 |
+
$permalinks = array(
|
2705 |
+
'enrolled_course' => __('Enrolled Course', 'tutor'),
|
2706 |
+
'courses_taken' => __('Courses Taken', 'tutor'),
|
2707 |
+
'reviews_wrote' => __('Reviews Written', 'tutor'),
|
2708 |
+
);
|
2709 |
+
|
2710 |
+
return apply_filters('tutor_public_profile/permalinks', $permalinks);
|
2711 |
+
}
|
2712 |
+
|
2713 |
+
public function student_register_url(){
|
2714 |
+
$student_register_page = (int) $this->get_option('student_register_page');
|
2715 |
+
|
2716 |
+
if ($student_register_page){
|
2717 |
+
return get_the_permalink($student_register_page);
|
2718 |
+
}
|
2719 |
+
return false;
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
public function tutor_dashboard_url(){
|
2723 |
+
$page_id = (int) tutor_utils()->get_option('student_dashboard');
|
2724 |
+
$page_id = apply_filters('tutor_dashboard_url', $page_id);
|
2725 |
+
return get_the_permalink($page_id);
|
2726 |
+
}
|
2727 |
+
|
2728 |
+
/**
|
2729 |
+
* @param int $course_id
|
2730 |
+
* @param int $user_id
|
2731 |
+
*
|
2732 |
+
* @return bool
|
2733 |
+
*
|
2734 |
+
* is_wishlisted();
|
2735 |
+
*/
|
2736 |
+
public function is_wishlisted($course_id = 0, $user_id = 0){
|
2737 |
+
$course_id = $this->get_post_id($course_id);
|
2738 |
+
$user_id = $this->get_user_id($user_id);
|
2739 |
+
if ( ! $user_id){
|
2740 |
+
return false;
|
2741 |
+
}
|
2742 |
+
|
2743 |
+
global $wpdb;
|
2744 |
+
$if_added_to_list = (bool) $wpdb->get_row("select * from {$wpdb->usermeta} WHERE user_id = {$user_id} AND meta_key = '_tutor_course_wishlist' AND meta_value = {$course_id} ;");
|
2745 |
+
|
2746 |
+
return $if_added_to_list;
|
2747 |
+
}
|
2748 |
+
|
2749 |
+
/**
|
2750 |
+
* @param int $user_id
|
2751 |
+
*
|
2752 |
+
* @return array|null|object
|
2753 |
+
*
|
2754 |
+
* Get the wish lists by an user
|
2755 |
+
*/
|
2756 |
+
public function get_wishlist($user_id = 0){
|
2757 |
+
$user_id = $this->get_user_id($user_id);
|
2758 |
+
global $wpdb;
|
2759 |
+
|
2760 |
+
$query = "SELECT $wpdb->posts.*
|
2761 |
+
FROM $wpdb->posts
|
2762 |
+
LEFT JOIN $wpdb->usermeta ON ($wpdb->posts.ID = $wpdb->usermeta.meta_value)
|
2763 |
+
WHERE $wpdb->usermeta.meta_key = '_tutor_course_wishlist'
|
2764 |
+
AND $wpdb->usermeta.user_id = {$user_id}
|
2765 |
+
ORDER BY $wpdb->usermeta.umeta_id DESC ";
|
2766 |
+
$pageposts = $wpdb->get_results($query, OBJECT);
|
2767 |
+
return $pageposts;
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
/**
|
2771 |
+
* @param int $limit
|
2772 |
+
*
|
2773 |
+
* @return array|null|object
|
2774 |
+
*
|
2775 |
+
* Getting popular courses
|
2776 |
+
*/
|
2777 |
+
public function most_popular_courses($limit = 10){
|
2778 |
+
global $wpdb;
|
2779 |
+
|
2780 |
+
$courses = $wpdb->get_results("
|
2781 |
+
SELECT COUNT(enrolled.ID) as total_enrolled,
|
2782 |
+
enrolled.post_parent as course_id,
|
2783 |
+
course.*
|
2784 |
+
from {$wpdb->posts} enrolled
|
2785 |
+
INNER JOIN {$wpdb->posts} course ON enrolled.post_parent = course.ID
|
2786 |
+
WHERE enrolled.post_type = 'tutor_enrolled' AND enrolled.post_status = 'completed'
|
2787 |
+
|
2788 |
+
GROUP BY course_id
|
2789 |
+
ORDER BY total_enrolled DESC LIMIT 0,{$limit} ;");
|
2790 |
+
|
2791 |
+
return $courses;
|
2792 |
+
}
|
2793 |
+
|
2794 |
+
/**
|
2795 |
+
* @param int $limit
|
2796 |
+
*
|
2797 |
+
* @return array|bool|null|object
|
2798 |
+
*
|
2799 |
+
* Get most rated courses lists
|
2800 |
+
*/
|
2801 |
+
public function most_rated_courses($limit = 10){
|
2802 |
+
global $wpdb;
|
2803 |
+
|
2804 |
+
$result = $wpdb->get_results("
|
2805 |
+
SELECT COUNT(comment_ID) AS total_rating,
|
2806 |
+
comment_ID,
|
2807 |
+
comment_post_ID,
|
2808 |
+
course.*
|
2809 |
+
FROM {$wpdb->comments}
|
2810 |
+
INNER JOIN {$wpdb->posts} course ON comment_post_ID = course.ID
|
2811 |
+
WHERE {$wpdb->comments}.comment_type = 'tutor_course_rating' AND {$wpdb->comments}.comment_approved = 'approved'
|
2812 |
+
GROUP BY comment_post_ID ORDER BY total_rating DESC LIMIT 0,{$limit}
|
2813 |
+
;");
|
2814 |
+
|
2815 |
+
if (is_array($result) && count($result)){
|
2816 |
+
return $result;
|
2817 |
+
}
|
2818 |
+
return false;
|
2819 |
+
}
|
2820 |
+
|
2821 |
+
|
2822 |
+
public function get_addon_config($addon_field = null){
|
2823 |
+
if ( ! $addon_field){
|
2824 |
+
return false;
|
2825 |
+
}
|
2826 |
+
|
2827 |
+
$addonsConfig = maybe_unserialize(get_option('tutor_addons_config'));
|
2828 |
+
|
2829 |
+
|
2830 |
+
if (isset($addonsConfig[$addon_field])){
|
2831 |
+
return $addonsConfig[$addon_field];
|
2832 |
+
}
|
2833 |
+
|
2834 |
+
return false;
|
2835 |
+
}
|
2836 |
+
|
2837 |
+
|
2838 |
+
}
|
classes/Video_Stream.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: mhshohel
|
5 |
+
* Date: 24/9/18
|
6 |
+
* Time: 4:03 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace TUTOR;
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Class Video_Stream
|
17 |
+
* @package TUTOR
|
18 |
+
*
|
19 |
+
* TUTOR Video Stream Class
|
20 |
+
* @since v.1.0.0
|
21 |
+
*/
|
22 |
+
|
23 |
+
class Video_Stream {
|
24 |
+
|
25 |
+
private $path = "";
|
26 |
+
private $stream = "";
|
27 |
+
private $buffer = 102400;
|
28 |
+
private $start = -1;
|
29 |
+
private $end = -1;
|
30 |
+
private $size = 0;
|
31 |
+
|
32 |
+
private $videoFormats;
|
33 |
+
|
34 |
+
function __construct($filePath) {
|
35 |
+
$this->videoFormats = apply_filters('tutor_video_types', array("mp4"=>"video/mp4", "webm"=>"video/webm", "ogg"=>"video/ogg")) ;
|
36 |
+
$this->path = $filePath;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Open stream
|
41 |
+
*/
|
42 |
+
private function open() {
|
43 |
+
if (!($this->stream = fopen($this->path, 'rb'))) {
|
44 |
+
die('Could not open stream for reading');
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Set proper header to serve the video content
|
50 |
+
*/
|
51 |
+
private function setHeader() {
|
52 |
+
ob_get_clean();
|
53 |
+
|
54 |
+
header("Content-Type: {$this->videoFormats[strtolower(pathinfo($this->path, PATHINFO_EXTENSION))]}");
|
55 |
+
header("Cache-Control: max-age=2592000, public");
|
56 |
+
header("Expires: ".gmdate('D, d M Y H:i:s', time()+2592000) . ' GMT');
|
57 |
+
header("Last-Modified: ".gmdate('D, d M Y H:i:s', @filemtime($this->path)) . ' GMT' );
|
58 |
+
$this->start = 0;
|
59 |
+
$this->size = filesize($this->path);
|
60 |
+
$this->end = $this->size - 1;
|
61 |
+
header("Accept-Ranges: 0-".$this->end);
|
62 |
+
|
63 |
+
if (isset($_SERVER['HTTP_RANGE'])) {
|
64 |
+
$c_end = $this->end;
|
65 |
+
list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
|
66 |
+
|
67 |
+
if ($range == '-') {
|
68 |
+
$c_start = $this->size - substr($range, 1);
|
69 |
+
}else{
|
70 |
+
$range = explode('-', $range);
|
71 |
+
$c_start = $range[0];
|
72 |
+
|
73 |
+
$c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;
|
74 |
+
}
|
75 |
+
$c_end = ($c_end > $this->end) ? $this->end : $c_end;
|
76 |
+
if ($c_start > $c_end || $c_start > $this->size - 1 || $c_end >= $this->size) {
|
77 |
+
header('HTTP/1.1 416 Requested Range Not Satisfiable');
|
78 |
+
header("Content-Range: bytes $this->start-$this->end/$this->size");
|
79 |
+
exit;
|
80 |
+
}
|
81 |
+
$this->start = $c_start;
|
82 |
+
$this->end = $c_end;
|
83 |
+
$length = $this->end - $this->start + 1;
|
84 |
+
header('HTTP/1.1 206 Partial Content');
|
85 |
+
header("Content-Length: ".$length);
|
86 |
+
header("Content-Range: bytes $this->start-$this->end/".$this->size);
|
87 |
+
header("Accept-Ranges: bytes");
|
88 |
+
}
|
89 |
+
else {
|
90 |
+
header("Content-Length: ".$this->size);
|
91 |
+
}
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* close curretly opened stream
|
97 |
+
*/
|
98 |
+
private function end() {
|
99 |
+
fclose($this->stream);
|
100 |
+
exit;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* perform the streaming of calculated range
|
105 |
+
*/
|
106 |
+
private function stream() {
|
107 |
+
$i = $this->start;
|
108 |
+
set_time_limit(0);
|
109 |
+
while(!feof($this->stream) && $i <= $this->end) {
|
110 |
+
$bytesToRead = $this->buffer;
|
111 |
+
if(($i+$bytesToRead) > $this->end) {
|
112 |
+
$bytesToRead = $this->end - $i + 1;
|
113 |
+
}
|
114 |
+
//$data = fread($this->stream, $bytesToRead);
|
115 |
+
$data = @stream_get_contents($this->stream, $bytesToRead, $i);
|
116 |
+
echo $data;
|
117 |
+
flush();
|
118 |
+
$i += $bytesToRead;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Start streaming tutor video content
|
124 |
+
*/
|
125 |
+
function start() {
|
126 |
+
$this->open();
|
127 |
+
$this->setHeader();
|
128 |
+
$this->stream();
|
129 |
+
$this->end();
|
130 |
+
}
|
131 |
+
}
|
classes/init.php
ADDED
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace TUTOR;
|
3 |
+
|
4 |
+
if ( ! defined( 'ABSPATH' ) )
|
5 |
+
exit;
|
6 |
+
|
7 |
+
class init{
|
8 |
+
public $version = TUTOR_VERSION;
|
9 |
+
public $path;
|
10 |
+
public $url;
|
11 |
+
public $basename;
|
12 |
+
|
13 |
+
//Components
|
14 |
+
public $utils;
|
15 |
+
public $admin;
|
16 |
+
public $ajax;
|
17 |
+
public $options;
|
18 |
+
public $shortcode;
|
19 |
+
|
20 |
+
private $post_types;
|
21 |
+
private $assets;
|
22 |
+
private $course;
|
23 |
+
private $lesson;
|
24 |
+
private $rewrite_rules;
|
25 |
+
private $template;
|
26 |
+
private $instructor;
|
27 |
+
private $student;
|
28 |
+
private $q_and_a;
|
29 |
+
private $quiz;
|
30 |
+
private $question;
|
31 |
+
private $tools;
|
32 |
+
private $user;
|
33 |
+
private $theme_compatibility;
|
34 |
+
private $gutenberg;
|
35 |
+
|
36 |
+
function __construct() {
|
37 |
+
|
38 |
+
$this->path = plugin_dir_path(TUTOR_FILE);
|
39 |
+
$this->url = plugin_dir_url(TUTOR_FILE);
|
40 |
+
$this->basename = plugin_basename(TUTOR_FILE);
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Include Files
|
44 |
+
*/
|
45 |
+
add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 );
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Loading Autoloader
|
49 |
+
*/
|
50 |
+
|
51 |
+
spl_autoload_register(array($this, 'loader'));
|
52 |
+
|
53 |
+
do_action('tutor_before_load');
|
54 |
+
|
55 |
+
$this->post_types = new Post_types();
|
56 |
+
$this->assets = new Assets();
|
57 |
+
$this->admin = new Admin();
|
58 |
+
$this->ajax = new Ajax();
|
59 |
+
$this->options = new Options();
|
60 |
+
$this->shortcode = new Shortcode();
|
61 |
+
$this->course = new Course();
|
62 |
+
$this->lesson = new Lesson();
|
63 |
+
$this->rewrite_rules = new Rewrite_Rules();
|
64 |
+
$this->template = new Template();
|
65 |
+
$this->instructor = new Instructor();
|
66 |
+
$this->student = new Student();
|
67 |
+
$this->q_and_a = new Q_and_A();
|
68 |
+
$this->quiz = new Quiz();
|
69 |
+
$this->question = new Question();
|
70 |
+
$this->tools = new Tools();
|
71 |
+
$this->user = new User();
|
72 |
+
$this->theme_compatibility = new Theme_Compatibility();
|
73 |
+
$this->gutenberg = new Gutenberg();
|
74 |
+
|
75 |
+
do_action('tutor_loaded');
|
76 |
+
}
|
77 |
+
/**
|
78 |
+
* @param $className
|
79 |
+
*
|
80 |
+
* Auto Load class and the files
|
81 |
+
*/
|
82 |
+
private function loader($className) {
|
83 |
+
if ( ! class_exists($className)){
|
84 |
+
$className = preg_replace(
|
85 |
+
array('/([a-z])([A-Z])/', '/\\\/'),
|
86 |
+
array('$1-$2', DIRECTORY_SEPARATOR),
|
87 |
+
$className
|
88 |
+
);
|
89 |
+
|
90 |
+
$className = str_replace('TUTOR/', 'classes/', $className);
|
91 |
+
$file_name = $this->path.$className.'.php';
|
92 |
+
|
93 |
+
if (file_exists($file_name) && is_readable( $file_name ) ) {
|
94 |
+
require_once $file_name;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
public function include_template_functions(){
|
100 |
+
include tutor()->path.'includes/tutor-template-functions.php';
|
101 |
+
include tutor()->path.'includes/tutor-template-hook.php';
|
102 |
+
}
|
103 |
+
|
104 |
+
//Run the TUTOR right now
|
105 |
+
public function run(){
|
106 |
+
do_action('tutor_before_run');
|
107 |
+
|
108 |
+
register_activation_hook( TUTOR_FILE, array( $this, 'tutor_activate' ) );
|
109 |
+
register_deactivation_hook(TUTOR_FILE, array($this, 'tutor_deactivation'));
|
110 |
+
|
111 |
+
do_action('tutor_after_run');
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Do some task during plugin activation
|
116 |
+
*/
|
117 |
+
public function tutor_activate(){
|
118 |
+
$version = get_option('tutor_version');
|
119 |
+
//Save Option
|
120 |
+
if ( ! $version){
|
121 |
+
$options = self::default_options();
|
122 |
+
update_option('tutor_option', $options);
|
123 |
+
|
124 |
+
//Rewrite Flush
|
125 |
+
update_option('required_rewrite_flush', time());
|
126 |
+
self::manage_tutor_roles_and_permissions();
|
127 |
+
|
128 |
+
self::save_data();//Save initial Page
|
129 |
+
update_option('tutor_version', TUTOR_VERSION);
|
130 |
+
}
|
131 |
+
|
132 |
+
//Set Schedule
|
133 |
+
if (! wp_next_scheduled ( 'tutor_once_in_day_run_schedule' )) {
|
134 |
+
wp_schedule_event(time(), 'twicedaily', 'tutor_once_in_day_run_schedule');
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
//Run task on deactivation
|
139 |
+
public function tutor_deactivation() {
|
140 |
+
wp_clear_scheduled_hook('tutor_once_in_day_run_schedule');
|
141 |
+
}
|
142 |
+
|
143 |
+
|
144 |
+
public static function manage_tutor_roles_and_permissions(){
|
145 |
+
/**
|
146 |
+
* Add role for instructor
|
147 |
+
*/
|
148 |
+
$instructor_role = tutor()->instructor_role;
|
149 |
+
|
150 |
+
remove_role($instructor_role);
|
151 |
+
add_role( $instructor_role, __('Tutor Instructor', 'tutor'), array() );
|
152 |
+
|
153 |
+
$custom_post_type_permission = array(
|
154 |
+
//Manage Instructor
|
155 |
+
'manage_tutor_instructor',
|
156 |
+
|
157 |
+
//Tutor Posts Type Permission
|
158 |
+
'edit_tutor_course',
|
159 |
+
'read_tutor_course',
|
160 |
+
'delete_tutor_course',
|
161 |
+
'delete_tutor_courses',
|
162 |
+
'edit_tutor_courses',
|
163 |
+
'edit_others_tutor_courses',
|
164 |
+
'read_private_tutor_courses',
|
165 |
+
'edit_tutor_courses',
|
166 |
+
|
167 |
+
'edit_tutor_lesson',
|
168 |
+
'read_tutor_lesson',
|
169 |
+
'delete_tutor_lesson',
|
170 |
+
'delete_tutor_lessons',
|
171 |
+
'edit_tutor_lessons',
|
172 |
+
'edit_others_tutor_lessons',
|
173 |
+
'read_private_tutor_lessons',
|
174 |
+
'edit_tutor_lessons',
|
175 |
+
'publish_tutor_lessons',
|
176 |
+
|
177 |
+
'edit_tutor_quiz',
|
178 |
+
'read_tutor_quiz',
|
179 |
+
'delete_tutor_quiz',
|
180 |
+
'delete_tutor_quizzes',
|
181 |
+
'edit_tutor_quizzes',
|
182 |
+
'edit_others_tutor_quizzes',
|
183 |
+
'read_private_tutor_quizzes',
|
184 |
+
'edit_tutor_quizzes',
|
185 |
+
'publish_tutor_quizzes',
|
186 |
+
|
187 |
+
'edit_tutor_question',
|
188 |
+
'read_tutor_question',
|
189 |
+
'delete_tutor_question',
|
190 |
+
'delete_tutor_questions',
|
191 |
+
'edit_tutor_questions',
|
192 |
+
'edit_others_tutor_questions',
|
193 |
+
'publish_tutor_questions',
|
194 |
+
'read_private_tutor_questions',
|
195 |
+
'edit_tutor_questions',
|
196 |
+
);
|
197 |
+
|
198 |
+
$instructor = get_role( $instructor_role );
|
199 |
+
if ( $instructor ) {
|
200 |
+
$instructor_cap = array (
|
201 |
+
'edit_posts',
|
202 |
+
'read',
|
203 |
+
'upload_files',
|
204 |
+
);
|
205 |
+
|
206 |
+
$instructor_cap = array_merge($instructor_cap, $custom_post_type_permission);
|
207 |
+
|
208 |
+
$can_publish_course = (bool) tutor_utils()->get_option('instructor_can_publish_course');
|
209 |
+
if ($can_publish_course){
|
210 |
+
$instructor_cap[] = 'publish_tutor_courses';
|
211 |
+
}
|
212 |
+
|
213 |
+
foreach ($instructor_cap as $cap){
|
214 |
+
$instructor->add_cap( $cap );
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
$administrator = get_role( 'administrator' );
|
219 |
+
if ( $administrator ) {
|
220 |
+
$administrator_cap = array (
|
221 |
+
'manage_tutor',
|
222 |
+
);
|
223 |
+
$administrator_cap = array_merge($administrator_cap, $custom_post_type_permission);
|
224 |
+
$administrator_cap[] = 'publish_tutor_courses';
|
225 |
+
|
226 |
+
foreach ($administrator_cap as $cap){
|
227 |
+
$administrator->add_cap( $cap );
|
228 |
+
}
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Save data like page
|
234 |
+
*/
|
235 |
+
public static function save_data(){
|
236 |
+
$student_dashboard_args = array(
|
237 |
+
'post_title' => __('Student Dashboard', 'tutor'),
|
238 |
+
'post_content' => '[tutor_student_dashboard]',
|
239 |
+
'post_type' => 'page',
|
240 |
+
'post_status' => 'publish',
|
241 |
+
);
|
242 |
+
$student_dashboard_page_id = wp_insert_post( $student_dashboard_args );
|
243 |
+
tutor_utils()->update_option('student_dashboard', $student_dashboard_page_id);
|
244 |
+
|
245 |
+
$student_registration_args = array(
|
246 |
+
'post_title' => __('Student Registration', 'tutor'),
|
247 |
+
'post_content' => '[tutor_student_registration_form]',
|
248 |
+
'post_type' => 'page',
|
249 |
+
'post_status' => 'publish',
|
250 |
+
);
|
251 |
+
$student_register_page_id = wp_insert_post( $student_registration_args );
|
252 |
+
tutor_utils()->update_option('student_register_page', $student_register_page_id);
|
253 |
+
|
254 |
+
$instructor_registration_args = array(
|
255 |
+
'post_title' => __('Instructor Registration', 'tutor'),
|
256 |
+
'post_content' => '[tutor_instructor_registration_form]',
|
257 |
+
'post_type' => 'page',
|
258 |
+
'post_status' => 'publish',
|
259 |
+
);
|
260 |
+
$instructor_registration_id = wp_insert_post( $instructor_registration_args );
|
261 |
+
tutor_utils()->update_option('instructor_register_page', $instructor_registration_id);
|
262 |
+
}
|
263 |
+
|
264 |
+
public static function default_options(){
|
265 |
+
$options = array (
|
266 |
+
'load_tutor_css' => '1',
|
267 |
+
'load_tutor_js' => '1',
|
268 |
+
'course_allow_upload_private_files' => '1',
|
269 |
+
'display_course_instructors' => '1',
|
270 |
+
'enable_q_and_a_on_course' => '1',
|
271 |
+
'courses_col_per_row' => '3',
|
272 |
+
'courses_per_page' => '3',
|
273 |
+
'lesson_permalink_base' => 'lesson',
|
274 |
+
'quiz_time_limit' =>
|
275 |
+
array (
|
276 |
+
'value' => '0',
|
277 |
+
'time' => 'minutes',
|
278 |
+
),
|
279 |
+
'quiz_when_time_expires' => 'autosubmit',
|
280 |
+
'quiz_attempts_allowed' => '10',
|
281 |
+
'quiz_grade_method' => 'highest_grade',
|
282 |
+
'enable_public_profile' => '1',
|
283 |
+
'email_to_students' =>
|
284 |
+
array (
|
285 |
+
'quiz_completed' => '1',
|
286 |
+
'completed_course' => '1',
|
287 |
+
),
|
288 |
+
'email_to_instructors' =>
|
289 |
+
array (
|
290 |
+
'a_student_enrolled_in_course' => '1',
|
291 |
+
'a_student_completed_course' => '1',
|
292 |
+
'a_student_completed_lesson' => '1',
|
293 |
+
'a_student_placed_question' => '1',
|
294 |
+
),
|
295 |
+
'email_from_name' => get_option('blogname'),
|
296 |
+
'email_from_address' => get_option('admin_email'),
|
297 |
+
'email_footer_text' => '',
|
298 |
+
'enable_course_sell_by_woocommerce' => '1',
|
299 |
+
);
|
300 |
+
return $options;
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
}
|
includes/theme-compatibility/twentyfifteen/assets/css/style.css
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.tutor-wrap{
|
2 |
+
padding: 8% !important;
|
3 |
+
}
|
4 |
+
|
5 |
+
.site-content{
|
6 |
+
padding: 8% 0;
|
7 |
+
}
|
8 |
+
|
9 |
+
.tutor-wrap .tutor-topics-lesson-list .tutor-topics-in-single-lesson .tutor-lessons-under-topic p{
|
10 |
+
font-size: 1.4rem;
|
11 |
+
}
|
includes/theme-compatibility/twentyfifteen/functions.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) )
|
3 |
+
exit;
|
4 |
+
|
5 |
+
|
6 |
+
add_action('wp_enqueue_scripts', 'tutor_twentyfifteen_scripts');
|
7 |
+
|
8 |
+
if ( ! function_exists('tutor_twentyfifteen_scripts')){
|
9 |
+
function tutor_twentyfifteen_scripts(){
|
10 |
+
$dir_url = plugin_dir_url(__FILE__);
|
11 |
+
wp_enqueue_style('tutor_twentyfifteen', $dir_url.'assets/css/style.css');
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
includes/theme-compatibility/twentyseventeen/assets/css/style.css
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.tutor-wrap {
|
2 |
+
margin-left: auto;
|
3 |
+
margin-right: auto;
|
4 |
+
max-width: 700px;
|
5 |
+
padding-left: 2em;
|
6 |
+
padding-right: 2em;
|
7 |
+
}
|
8 |
+
.tutor-wrap:after {
|
9 |
+
clear: both;
|
10 |
+
content: "";
|
11 |
+
display: block;
|
12 |
+
}
|
13 |
+
.tutor-course-lesson h5{
|
14 |
+
letter-spacing: 0;
|
15 |
+
text-transform: none;
|
16 |
+
}
|
17 |
+
.site-content .tutor-wrap{
|
18 |
+
margin-top: 30px;
|
19 |
+
}
|
20 |
+
.tutor-full-width-student-profile .tutor-wrap{
|
21 |
+
margin: 0;
|
22 |
+
}
|
23 |
+
.tutor-dashboard-student.tutor-wrap{
|
24 |
+
margin-top: 30px;
|
25 |
+
}
|
26 |
+
.tutor-price-preview-box ins{
|
27 |
+
background: none;
|
28 |
+
}
|
29 |
+
@media screen and (min-width: 48em) {
|
30 |
+
.tutor-wrap {
|
31 |
+
max-width: 1000px;
|
32 |
+
padding-left: 3em;
|
33 |
+
padding-right: 3em;
|
34 |
+
}
|
35 |
+
.tutor-full-width-student-profile .tutor-wrap{
|
36 |
+
padding: 0;
|
37 |
+
}
|
38 |
+
}
|
includes/theme-compatibility/twentyseventeen/functions.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) )
|
3 |
+
exit;
|
4 |
+
|
5 |
+
|
6 |
+
add_action('wp_enqueue_scripts', 'tutor_twentyseventeen_scripts');
|
7 |
+
|
8 |
+
if ( ! function_exists('tutor_twentyseventeen_scripts')){
|
9 |
+
function tutor_twentyseventeen_scripts(){
|
10 |
+
$dir_url = plugin_dir_url(__FILE__);
|
11 |
+
wp_enqueue_style('tutor_twentyseventeen', $dir_url.'assets/css/style.css');
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
includes/tutor-template-functions.php
ADDED
@@ -0,0 +1,1160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) )
|
4 |
+
exit;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @param null $template
|
8 |
+
*
|
9 |
+
* @return bool|string
|
10 |
+
*
|
11 |
+
* Load template with override file system
|
12 |
+
*
|
13 |
+
* @since v.1.0.0
|
14 |
+
*/
|
15 |
+
|
16 |
+
if ( ! function_exists('tutor_get_template')) {
|
17 |
+
function tutor_get_template( $template = null ) {
|
18 |
+
if ( ! $template ) {
|
19 |
+
return false;
|
20 |
+
}
|
21 |
+
$template = str_replace( '.', DIRECTORY_SEPARATOR, $template );
|
22 |
+
|
23 |
+
$template_location = trailingslashit( get_template_directory() ) . "tutor/{$template}.php";
|
24 |
+
$file_in_theme = $template_location;
|
25 |
+
if ( ! file_exists( $template_location ) ) {
|
26 |
+
$template_location = trailingslashit( tutor()->path ) . "templates/{$template}.php";
|
27 |
+
|
28 |
+
if ( ! file_exists($template_location)){
|
29 |
+
echo '<div class="tutor-notice-warning"> '.__(sprintf('The file you are trying to load is not exists in your theme or tutor plugins location, if you are a developer and extending tutor plugin, please create a php file at location %s ', "<code>{$file_in_theme}</code>"), 'tutor').' </div>';
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
return $template_location;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @param null $template
|
39 |
+
*
|
40 |
+
* Load template for TUTOR
|
41 |
+
*
|
42 |
+
* @since v.1.0.0
|
43 |
+
*/
|
44 |
+
|
45 |
+
if ( ! function_exists('tutor_load_template')) {
|
46 |
+
function tutor_load_template( $template = null ) {
|
47 |
+
include tutor_get_template( $template );
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( ! function_exists('tutor_course_loop_start')){
|
52 |
+
function tutor_course_loop_start($echo = true ){
|
53 |
+
ob_start();
|
54 |
+
tutor_load_template('loop.loop-start');
|
55 |
+
$output = apply_filters('tutor_course_loop_start', ob_get_clean());
|
56 |
+
|
57 |
+
if ( $echo ) {
|
58 |
+
echo $output;
|
59 |
+
}
|
60 |
+
return $output;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( ! function_exists('tutor_course_loop_end')) {
|
65 |
+
function tutor_course_loop_end( $echo = true ) {
|
66 |
+
ob_start();
|
67 |
+
tutor_load_template( 'loop.loop-end' );
|
68 |
+
|
69 |
+
$output = apply_filters( 'tutor_course_loop_end', ob_get_clean() );
|
70 |
+
if ( $echo ) {
|
71 |
+
echo $output;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $output;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( ! function_exists('tutor_course_archive_pagination')) {
|
79 |
+
function tutor_course_archive_pagination( $echo = true ) {
|
80 |
+
ob_start();
|
81 |
+
tutor_load_template( 'loop.tutor-pagination' );
|
82 |
+
|
83 |
+
$output = apply_filters( 'tutor_course_archive_pagination', ob_get_clean() );
|
84 |
+
if ( $echo ) {
|
85 |
+
echo $output;
|
86 |
+
}
|
87 |
+
|
88 |
+
return $output;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
function tutor_course_loop_before_content(){
|
93 |
+
ob_start();
|
94 |
+
tutor_load_template( 'loop.loop-before-content' );
|
95 |
+
|
96 |
+
$output = apply_filters( 'tutor_course_loop_before_content', ob_get_clean() );
|
97 |
+
echo $output;
|
98 |
+
}
|
99 |
+
|
100 |
+
function tutor_course_loop_after_content(){
|
101 |
+
ob_start();
|
102 |
+
tutor_load_template( 'loop.loop-after-content' );
|
103 |
+
|
104 |
+
$output = apply_filters( 'tutor_course_loop_after_content', ob_get_clean() );
|
105 |
+
echo $output;
|
106 |
+
}
|
107 |
+
|
108 |
+
if ( ! function_exists('tutor_course_loop_title')) {
|
109 |
+
function tutor_course_loop_title() {
|
110 |
+
ob_start();
|
111 |
+
tutor_load_template( 'loop.title' );
|
112 |
+
$output = apply_filters( 'tutor_course_loop_title', ob_get_clean() );
|
113 |
+
|
114 |
+
echo $output;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
if ( ! function_exists('tutor_course_loop_header')) {
|
120 |
+
function tutor_course_loop_header() {
|
121 |
+
ob_start();
|
122 |
+
tutor_load_template( 'loop.header' );
|
123 |
+
$output = apply_filters( 'tutor_course_loop_header', ob_get_clean() );
|
124 |
+
|
125 |
+
echo $output;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( ! function_exists('tutor_course_loop_footer')) {
|
130 |
+
function tutor_course_loop_footer() {
|
131 |
+
ob_start();
|
132 |
+
tutor_load_template( 'loop.footer' );
|
133 |
+
$output = apply_filters( 'tutor_course_loop_footer', ob_get_clean() );
|
134 |
+
|
135 |
+
echo $output;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
//tutor_course_loop_footer
|
140 |
+
|
141 |
+
|
142 |
+
if ( ! function_exists('tutor_course_loop_start_content_wrap')) {
|
143 |
+
function tutor_course_loop_start_content_wrap() {
|
144 |
+
ob_start();
|
145 |
+
tutor_load_template( 'loop.start_content_wrap' );
|
146 |
+
$output = apply_filters( 'tutor_course_loop_start_content_wrap', ob_get_clean() );
|
147 |
+
|
148 |
+
echo $output;
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( ! function_exists('tutor_course_loop_end_content_wrap')) {
|
153 |
+
function tutor_course_loop_end_content_wrap() {
|
154 |
+
ob_start();
|
155 |
+
tutor_load_template( 'loop.end_content_wrap' );
|
156 |
+
$output = apply_filters( 'tutor_course_loop_end_content_wrap', ob_get_clean() );
|
157 |
+
|
158 |
+
echo $output;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( ! function_exists('tutor_course_loop_thumbnail')) {
|
163 |
+
function tutor_course_loop_thumbnail() {
|
164 |
+
ob_start();
|
165 |
+
tutor_load_template( 'loop.thumbnail' );
|
166 |
+
$output = apply_filters( 'tutor_course_loop_thumbnail', ob_get_clean() );
|
167 |
+
|
168 |
+
echo $output;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
if( ! function_exists('tutor_course_loop_wrap_classes')) {
|
173 |
+
function tutor_course_loop_wrap_classes( $echo = true ) {
|
174 |
+
$courseID = get_the_ID();
|
175 |
+
$classes = apply_filters( 'tutor_course_loop_wrap_classes', array(
|
176 |
+
'tutor-course',
|
177 |
+
'tutor-course-loop',
|
178 |
+
'tutor-course-loop-' . $courseID,
|
179 |
+
) );
|
180 |
+
|
181 |
+
$class = implode( ' ', $classes );
|
182 |
+
if ( $echo ) {
|
183 |
+
echo $class;
|
184 |
+
}
|
185 |
+
|
186 |
+
return $class;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
if( ! function_exists('tutor_course_loop_col_classes')) {
|
191 |
+
function tutor_course_loop_col_classes( $echo = true ) {
|
192 |
+
$courseCols = tutor_utils()->get_option( 'courses_col_per_row', 4 );
|
193 |
+
$classes = apply_filters( 'tutor_course_loop_col_classes', array(
|
194 |
+
'tutor-course-col-' . $courseCols,
|
195 |
+
) );
|
196 |
+
|
197 |
+
$class = implode( ' ', $classes );
|
198 |
+
if ( $echo ) {
|
199 |
+
echo $class;
|
200 |
+
}
|
201 |
+
|
202 |
+
return $class;
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
if ( ! function_exists('tutor_container_classes')) {
|
208 |
+
function tutor_container_classes( $echo = true ) {
|
209 |
+
|
210 |
+
$classes = apply_filters( 'tutor_container_classes', array(
|
211 |
+
'tutor-wrap tutor-courses-wrap',
|
212 |
+
'tutor-container'
|
213 |
+
) );
|
214 |
+
|
215 |
+
$class = implode( ' ', $classes );
|
216 |
+
|
217 |
+
if ( $echo ) {
|
218 |
+
echo $class;
|
219 |
+
}
|
220 |
+
|
221 |
+
return $class;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
if ( ! function_exists('tutor_post_class')) {
|
225 |
+
function tutor_post_class($default = '') {
|
226 |
+
$classes = apply_filters( 'tutor_post_class', array(
|
227 |
+
'tutor-wrap',
|
228 |
+
$default
|
229 |
+
) );
|
230 |
+
|
231 |
+
post_class( $classes );
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
if ( ! function_exists('tutor_course_archive_filter_bar')) {
|
236 |
+
function tutor_course_archive_filter_bar() {
|
237 |
+
ob_start();
|
238 |
+
tutor_load_template( 'global.course-archive-filter-bar' );
|
239 |
+
$output = apply_filters( 'tutor_course_archive_filter_bar', ob_get_clean() );
|
240 |
+
|
241 |
+
echo $output;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Get the post thumbnail
|
247 |
+
*/
|
248 |
+
if ( ! function_exists('get_tutor_course_thumbnail')) {
|
249 |
+
function get_tutor_course_thumbnail() {
|
250 |
+
$post_id = get_the_ID();
|
251 |
+
$post_thumbnail_id = (int) get_post_thumbnail_id( $post_id );
|
252 |
+
|
253 |
+
if ( $post_thumbnail_id ) {
|
254 |
+
$size = 'post-thumbnail';
|
255 |
+
$size = apply_filters( 'post_thumbnail_size', $size, $post_id );
|
256 |
+
$html = wp_get_attachment_image( $post_thumbnail_id, $size, false );
|
257 |
+
} else {
|
258 |
+
$placeHolderUrl = tutor()->url . 'assets/images/placeholder.jpg';
|
259 |
+
$html = '<img src="' . $placeHolderUrl . '" />';
|
260 |
+
}
|
261 |
+
|
262 |
+
echo $html;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
/**
|
266 |
+
* Get the course/post thumbnail src
|
267 |
+
*/
|
268 |
+
if ( ! function_exists('get_tutor_course_thumbnail_src')) {
|
269 |
+
function get_tutor_course_thumbnail_src() {
|
270 |
+
$post_id = get_the_ID();
|
271 |
+
$post_thumbnail_id = (int) get_post_thumbnail_id( $post_id );
|
272 |
+
|
273 |
+
if ( $post_thumbnail_id ) {
|
274 |
+
$size = 'post-thumbnail';
|
275 |
+
$size = apply_filters( 'post_thumbnail_size', $size, $post_id );
|
276 |
+
$src = wp_get_attachment_image_url( $post_thumbnail_id, $size, false );
|
277 |
+
} else {
|
278 |
+
$src = tutor()->url . 'assets/images/placeholder.jpg';
|
279 |
+
}
|
280 |
+
|
281 |
+
return $src;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
if ( ! function_exists('tutor_course_loop_meta')) {
|
286 |
+
function tutor_course_loop_meta() {
|
287 |
+
ob_start();
|
288 |
+
tutor_load_template( 'loop.meta' );
|
289 |
+
$output = apply_filters( 'tutor_course_loop_meta', ob_get_clean() );
|
290 |
+
|
291 |
+
echo $output;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Get course author name in loop
|
297 |
+
*
|
298 |
+
* @since: v.1.0.0
|
299 |
+
*/
|
300 |
+
|
301 |
+
if ( ! function_exists('tutor_course_loop_author')) {
|
302 |
+
function tutor_course_loop_author() {
|
303 |
+
ob_start();
|
304 |
+
tutor_load_template( 'loop.course-author' );
|
305 |
+
$output = apply_filters( 'tutor_course_loop_author', ob_get_clean() );
|
306 |
+
|
307 |
+
echo $output;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
if ( ! function_exists('tutor_course_loop_price')) {
|
312 |
+
function tutor_course_loop_price() {
|
313 |
+
ob_start();
|
314 |
+
|
315 |
+
$tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
|
316 |
+
if ($tutor_course_sell_by){
|
317 |
+
tutor_load_template( 'loop.course-price-'.$tutor_course_sell_by );
|
318 |
+
}
|
319 |
+
$output = apply_filters( 'tutor_course_loop_price', ob_get_clean() );
|
320 |
+
|
321 |
+
echo $output;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
if ( ! function_exists('tutor_course_loop_rating')) {
|
326 |
+
function tutor_course_loop_rating() {
|
327 |
+
ob_start();
|
328 |
+
tutor_load_template( 'loop.rating' );
|
329 |
+
$output = apply_filters( 'tutor_course_loop_rating', ob_get_clean() );
|
330 |
+
|
331 |
+
echo $output;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
if ( ! function_exists('tutor_course_loop_add_to_cart')) {
|
336 |
+
function tutor_course_loop_add_to_cart($echo = true) {
|
337 |
+
ob_start();
|
338 |
+
$tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
|
339 |
+
|
340 |
+
if ($tutor_course_sell_by){
|
341 |
+
tutor_load_template( 'loop.add-to-cart-'.$tutor_course_sell_by );
|
342 |
+
}
|
343 |
+
|
344 |
+
$output = apply_filters( 'tutor_course_loop_add_to_cart_link', ob_get_clean() );
|
345 |
+
|
346 |
+
if ($echo){
|
347 |
+
echo $output;
|
348 |
+
}
|
349 |
+
return $output;
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
+
if ( ! function_exists('tutor_course_price')) {
|
356 |
+
function tutor_course_price() {
|
357 |
+
ob_start();
|
358 |
+
tutor_load_template( 'single.course.wc-price-html' );
|
359 |
+
$output = apply_filters( 'tutor_course_price', ob_get_clean() );
|
360 |
+
|
361 |
+
echo $output;
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
|
366 |
+
/**
|
367 |
+
* @param int $post_id
|
368 |
+
*
|
369 |
+
* echo the excerpt of TUTOR post type
|
370 |
+
*
|
371 |
+
* @since: v.1.0.0
|
372 |
+
*/
|
373 |
+
if ( ! function_exists('tutor_the_excerpt')) {
|
374 |
+
function tutor_the_excerpt( $post_id = 0 ) {
|
375 |
+
if ( ! $post_id ) {
|
376 |
+
$post_id = get_the_ID();
|
377 |
+
}
|
378 |
+
echo tutor_get_the_excerpt( $post_id );
|
379 |
+
}
|
380 |
+
}
|
381 |
+
/**
|
382 |
+
* @param int $post_id
|
383 |
+
*
|
384 |
+
* @return mixed
|
385 |
+
*
|
386 |
+
* Return excerpt of TUTOR post type
|
387 |
+
*
|
388 |
+
* @since: v.1.0.0
|
389 |
+
*/
|
390 |
+
if ( ! function_exists('tutor_get_the_excerpt')) {
|
391 |
+
function tutor_get_the_excerpt( $post_id = 0 ) {
|
392 |
+
if ( ! $post_id ) {
|
393 |
+
$post_id = get_the_ID();
|
394 |
+
}
|
395 |
+
|
396 |
+
$get_post = get_post($post_id);
|
397 |
+
return apply_filters( 'tutor_get_the_excerpt', $get_post->post_excerpt );
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
/**
|
402 |
+
* @return mixed
|
403 |
+
*
|
404 |
+
* return course author
|
405 |
+
*
|
406 |
+
* @since: v.1.0.0
|
407 |
+
*/
|
408 |
+
|
409 |
+
if ( ! function_exists('get_tutor_course_author')) {
|
410 |
+
function get_tutor_course_author() {
|
411 |
+
global $post;
|
412 |
+
return apply_filters( 'get_tutor_course_author', get_the_author_meta( 'display_name', $post->post_author ) );
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
function get_tutor_course_author_id(){
|
417 |
+
global $post;
|
418 |
+
return $post->post_author;
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* @param int $course_id
|
423 |
+
*
|
424 |
+
* @return mixed
|
425 |
+
* Course benefits return array
|
426 |
+
*
|
427 |
+
* @since: v.1.0.0
|
428 |
+
*/
|
429 |
+
|
430 |
+
if ( ! function_exists('tutor_course_benefits')) {
|
431 |
+
function tutor_course_benefits( $course_id = 0 ) {
|
432 |
+
if ( ! $course_id ) {
|
433 |
+
$course_id = get_the_ID();
|
434 |
+
}
|
435 |
+
$benefits = get_post_meta( $course_id, '_tutor_course_benefits', true );
|
436 |
+
|
437 |
+
$benefits_array = array();
|
438 |
+
if ($benefits){
|
439 |
+
$benefits_array = explode("\n", $benefits);
|
440 |
+
}
|
441 |
+
|
442 |
+
$array = array_filter(array_map('trim', $benefits_array));
|
443 |
+
|
444 |
+
return apply_filters( 'tutor_course/single/benefits', $array, $course_id );
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* @param bool $echo
|
450 |
+
*
|
451 |
+
* @return mixed
|
452 |
+
*
|
453 |
+
* Course single page benefits
|
454 |
+
*
|
455 |
+
* @since: v.1.0.0
|
456 |
+
*/
|
457 |
+
|
458 |
+
if ( ! function_exists('tutor_course_benefits_html')) {
|
459 |
+
function tutor_course_benefits_html($echo = true) {
|
460 |
+
ob_start();
|
461 |
+
tutor_load_template( 'single.course.course-benefits' );
|
462 |
+
$output = apply_filters( 'tutor_course/single/benefits_html', ob_get_clean() );
|
463 |
+
|
464 |
+
if ($echo){
|
465 |
+
echo $output;
|
466 |
+
}
|
467 |
+
return $output;
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* @param bool $echo
|
473 |
+
*
|
474 |
+
* @return mixed|void
|
475 |
+
*
|
476 |
+
* Return Topics HTML
|
477 |
+
*
|
478 |
+
* @since: v.1.0.0
|
479 |
+
*/
|
480 |
+
if ( ! function_exists('tutor_course_topics')) {
|
481 |
+
function tutor_course_topics( $echo = true ) {
|
482 |
+
ob_start();
|
483 |
+
tutor_load_template( 'single.course.course-topics' );
|
484 |
+
$output = apply_filters( 'tutor_course/single/topics', ob_get_clean() );
|
485 |
+
wp_reset_postdata();
|
486 |
+
|
487 |
+
if ( $echo ) {
|
488 |
+
echo $output;
|
489 |
+
}
|
490 |
+
|
491 |
+
return $output;
|
492 |
+
}
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* @param int $course_id
|
497 |
+
*
|
498 |
+
* @return mixed|void
|
499 |
+
*
|
500 |
+
* return course requirements in array
|
501 |
+
*
|
502 |
+
* @since: v.1.0.0
|
503 |
+
*/
|
504 |
+
if ( ! function_exists('tutor_course_requirements')) {
|
505 |
+
function tutor_course_requirements( $course_id = 0 ) {
|
506 |
+
if ( ! $course_id ) {
|
507 |
+
$course_id = get_the_ID();
|
508 |
+
}
|
509 |
+
$requirements = get_post_meta( $course_id, '_tutor_course_requirements', true );
|
510 |
+
|
511 |
+
$requirements_array = array();
|
512 |
+
if ($requirements){
|
513 |
+
$requirements_array = explode("\n", $requirements);
|
514 |
+
}
|
515 |
+
|
516 |
+
$array = array_filter(array_map('trim', $requirements_array));
|
517 |
+
return apply_filters( 'tutor_course/single/requirements', $array, $course_id );
|
518 |
+
}
|
519 |
+
}
|
520 |
+
|
521 |
+
/**
|
522 |
+
* @param bool $echo
|
523 |
+
*
|
524 |
+
* @return mixed|void
|
525 |
+
*
|
526 |
+
* Return course requirements in course single page
|
527 |
+
*
|
528 |
+
* @since: v.1.0.0
|
529 |
+
*/
|
530 |
+
if ( ! function_exists('tutor_course_requirements_html')) {
|
531 |
+
function tutor_course_requirements_html($echo = true) {
|
532 |
+
ob_start();
|
533 |
+
tutor_load_template( 'single.course.course-requirements' );
|
534 |
+
$output = apply_filters( 'tutor_course/single/requirements_html', ob_get_clean() );
|
535 |
+
|
536 |
+
if ($echo){
|
537 |
+
echo $output;
|
538 |
+
}
|
539 |
+
return $output;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
|
543 |
+
|
544 |
+
/**
|
545 |
+
* @param int $course_id
|
546 |
+
*
|
547 |
+
* @return mixed|void
|
548 |
+
*
|
549 |
+
* Return target audience in course single page
|
550 |
+
*
|
551 |
+
* @since: v.1.0.0
|
552 |
+
*/
|
553 |
+
if ( ! function_exists('tutor_course_target_audience')) {
|
554 |
+
function tutor_course_target_audience( $course_id = 0 ) {
|
555 |
+
if ( ! $course_id ) {
|
556 |
+
$course_id = get_the_ID();
|
557 |
+
}
|
558 |
+
$target_audience = get_post_meta( $course_id, '_tutor_course_target_audience', true );
|
559 |
+
|
560 |
+
$target_audience_array = array();
|
561 |
+
if ($target_audience){
|
562 |
+
$target_audience_array = explode("\n", $target_audience);
|
563 |
+
}
|
564 |
+
|
565 |
+
$array = array_filter(array_map('trim', $target_audience_array));
|
566 |
+
return apply_filters( 'tutor_course/single/target_audience', $array, $course_id );
|
567 |
+
}
|
568 |
+
}
|
569 |
+
|
570 |
+
/**
|
571 |
+
* @param bool $echo
|
572 |
+
*
|
573 |
+
* @return mixed|void
|
574 |
+
*
|
575 |
+
* Return target audience in course single page
|
576 |
+
*
|
577 |
+
* @since: v.1.0.0
|
578 |
+
*/
|
579 |
+
if ( ! function_exists('tutor_course_target_audience_html')) {
|
580 |
+
function tutor_course_target_audience_html($echo = true) {
|
581 |
+
ob_start();
|
582 |
+
tutor_load_template( 'single.course.course-target-audience' );
|
583 |
+
$output = apply_filters( 'tutor_course/single/audience_html', ob_get_clean() );
|
584 |
+
|
585 |
+
if ($echo){
|
586 |
+
echo $output;
|
587 |
+
}
|
588 |
+
return $output;
|
589 |
+
}
|
590 |
+
}
|
591 |
+
|
592 |
+
|
593 |
+
if ( ! function_exists('tutor_course_material_includes')) {
|
594 |
+
function tutor_course_material_includes( $course_id = 0 ) {
|
595 |
+
if ( ! $course_id ) {
|
596 |
+
$course_id = get_the_ID();
|
597 |
+
}
|
598 |
+
$target_audience = get_post_meta( $course_id, '_tutor_course_material_includes', true );
|
599 |
+
|
600 |
+
$target_audience_array = array();
|
601 |
+
if ($target_audience){
|
602 |
+
$target_audience_array = explode("\n", $target_audience);
|
603 |
+
}
|
604 |
+
|
605 |
+
$array = array_filter(array_map('trim', $target_audience_array));
|
606 |
+
return apply_filters( 'tutor_course/single/material_includes', $array, $course_id );
|
607 |
+
}
|
608 |
+
}
|
609 |
+
|
610 |
+
if ( ! function_exists('tutor_course_material_includes_html')) {
|
611 |
+
function tutor_course_material_includes_html($echo = true) {
|
612 |
+
ob_start();
|
613 |
+
tutor_load_template( 'single.course.material-includes' );
|
614 |
+
$output = apply_filters( 'tutor_course/single/material_includes', ob_get_clean() );
|
615 |
+
|
616 |
+
if ($echo){
|
617 |
+
echo $output;
|
618 |
+
}
|
619 |
+
return $output;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
|
623 |
+
//tutor_course_material_includes_html
|
624 |
+
|
625 |
+
|
626 |
+
if ( ! function_exists('tutor_course_instructors_html')) {
|
627 |
+
function tutor_course_instructors_html($echo = true) {
|
628 |
+
$display_course_instructors = tutor_utils()->get_option('display_course_instructors');
|
629 |
+
if ( ! $display_course_instructors){
|
630 |
+
return null;
|
631 |
+
}
|
632 |
+
|
633 |
+
ob_start();
|
634 |
+
tutor_load_template( 'single.course.instructors' );
|
635 |
+
$output = apply_filters( 'tutor_course/single/instructors_html', ob_get_clean() );
|
636 |
+
|
637 |
+
if ($echo){
|
638 |
+
echo $output;
|
639 |
+
}
|
640 |
+
return $output;
|
641 |
+
}
|
642 |
+
}
|
643 |
+
|
644 |
+
if ( ! function_exists('tutor_course_target_reviews_html')) {
|
645 |
+
function tutor_course_target_reviews_html($echo = true) {
|
646 |
+
ob_start();
|
647 |
+
tutor_load_template( 'single.course.reviews' );
|
648 |
+
$output = apply_filters( 'tutor_course/single/reviews_html', ob_get_clean() );
|
649 |
+
|
650 |
+
if ($echo){
|
651 |
+
echo $output;
|
652 |
+
}
|
653 |
+
return $output;
|
654 |
+
}
|
655 |
+
}
|
656 |
+
|
657 |
+
if ( ! function_exists('tutor_course_target_review_form_html')) {
|
658 |
+
function tutor_course_target_review_form_html($echo = true) {
|
659 |
+
ob_start();
|
660 |
+
tutor_load_template( 'single.course.review-form' );
|
661 |
+
$output = apply_filters( 'tutor_course/single/reviews_form', ob_get_clean() );
|
662 |
+
|
663 |
+
if ($echo){
|
664 |
+
echo $output;
|
665 |
+
}
|
666 |
+
|
667 |
+
return $output;
|
668 |
+
|
669 |
+
}
|
670 |
+
}
|
671 |
+
|
672 |
+
/**
|
673 |
+
* @param bool $echo
|
674 |
+
*
|
675 |
+
* @return mixed
|
676 |
+
*
|
677 |
+
* Course single page main content / description
|
678 |
+
*
|
679 |
+
* @since: v.1.0.0
|
680 |
+
*/
|
681 |
+
if ( ! function_exists('tutor_course_content')) {
|
682 |
+
function tutor_course_content( $echo = true ) {
|
683 |
+
ob_start();
|
684 |
+
tutor_load_template( 'single.course.course-content' );
|
685 |
+
$output = apply_filters( 'tutor_course/single/content', ob_get_clean() );
|
686 |
+
|
687 |
+
if ( $echo ) {
|
688 |
+
echo $output;
|
689 |
+
}
|
690 |
+
|
691 |
+
return $output;
|
692 |
+
}
|
693 |
+
}
|
694 |
+
|
695 |
+
/**
|
696 |
+
* Course single page lead info
|
697 |
+
*
|
698 |
+
* @since: v.1.0.0
|
699 |
+
*/
|
700 |
+
if ( ! function_exists('tutor_course_lead_info')) {
|
701 |
+
function tutor_course_lead_info( $echo = true ) {
|
702 |
+
ob_start();
|
703 |
+
|
704 |
+
$course_id = get_the_ID();
|
705 |
+
$course_post_type = tutor()->course_post_type;
|
706 |
+
$queryCourse = new WP_Query(array('p' => $course_id, 'post_type' => $course_post_type));
|
707 |
+
|
708 |
+
if ($queryCourse->have_posts()){
|
709 |
+
while ($queryCourse->have_posts()){
|
710 |
+
$queryCourse->the_post();
|
711 |
+
tutor_load_template( 'single.course.lead-info' );
|
712 |
+
}
|
713 |
+
wp_reset_postdata();
|
714 |
+
}
|
715 |
+
|
716 |
+
$output = apply_filters( 'tutor_course/single/lead_info', ob_get_clean() );
|
717 |
+
|
718 |
+
if ( $echo ) {
|
719 |
+
echo $output;
|
720 |
+
}
|
721 |
+
return $output;
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
/**
|
726 |
+
* @param bool $echo
|
727 |
+
*
|
728 |
+
* @return mixed|void
|
729 |
+
*/
|
730 |
+
|
731 |
+
if ( ! function_exists('tutor_course_enrolled_lead_info')) {
|
732 |
+
function tutor_course_enrolled_lead_info( $echo = true ) {
|
733 |
+
ob_start();
|
734 |
+
|
735 |
+
$course_id = get_the_ID();
|
736 |
+
$course_post_type = tutor()->course_post_type;
|
737 |
+
$queryCourse = new WP_Query( array( 'p' => $course_id, 'post_type' => $course_post_type ) );
|
738 |
+
|
739 |
+
if ( $queryCourse->have_posts() ) {
|
740 |
+
while ( $queryCourse->have_posts() ) {
|
741 |
+
$queryCourse->the_post();
|
742 |
+
tutor_load_template( 'single.course.enrolled.lead-info' );
|
743 |
+
}
|
744 |
+
wp_reset_postdata();
|
745 |
+
}
|
746 |
+
|
747 |
+
$output = apply_filters( 'tutor_course/single/enrolled/lead_info', ob_get_clean() );
|
748 |
+
|
749 |
+
if ( $echo ) {
|
750 |
+
echo $output;
|
751 |
+
}
|
752 |
+
|
753 |
+
return $output;
|
754 |
+
}
|
755 |
+
}
|
756 |
+
|
757 |
+
if ( ! function_exists('tutor_lesson_lead_info')) {
|
758 |
+
function tutor_lesson_lead_info( $lesson_id = 0, $echo = true ) {
|
759 |
+
if ( ! $lesson_id ) {
|
760 |
+
$lesson_id = get_the_ID();
|
761 |
+
}
|
762 |
+
|
763 |
+
ob_start();
|
764 |
+
$course_id = tutor_utils()->get_course_id_by_lesson( $lesson_id );
|
765 |
+
$course_post_type = tutor()->course_post_type;
|
766 |
+
$queryCourse = new WP_Query( array( 'p' => $course_id, 'post_type' => $course_post_type ) );
|
767 |
+
|
768 |
+
if ( $queryCourse->have_posts() ) {
|
769 |
+
while ( $queryCourse->have_posts() ) {
|
770 |
+
$queryCourse->the_post();
|
771 |
+
tutor_load_template( 'single.course.enrolled.lead-info' );
|
772 |
+
}
|
773 |
+
wp_reset_postdata();
|
774 |
+
}
|
775 |
+
$output = apply_filters( 'tutor_course/single/enrolled/lead_info', ob_get_clean() );
|
776 |
+
|
777 |
+
if ( $echo ) {
|
778 |
+
echo $output;
|
779 |
+
}
|
780 |
+
|
781 |
+
return $output;
|
782 |
+
|
783 |
+
}
|
784 |
+
}
|
785 |
+
/**
|
786 |
+
* @param bool $echo
|
787 |
+
*
|
788 |
+
* @return mixed
|
789 |
+
*
|
790 |
+
* Return enroll box in single course
|
791 |
+
*
|
792 |
+
* @since: v.1.0.0
|
793 |
+
*/
|
794 |
+
|
795 |
+
if ( ! function_exists('tutor_course_enroll_box')) {
|
796 |
+
function tutor_course_enroll_box( $echo = true ) {
|
797 |
+
$isLoggedIn = is_user_logged_in();
|
798 |
+
$enrolled = tutor_utils()->is_enrolled();
|
799 |
+
|
800 |
+
ob_start();
|
801 |
+
|
802 |
+
if ( $enrolled ) {
|
803 |
+
tutor_load_template( 'single.course.course-enrolled-box' );
|
804 |
+
$output = apply_filters( 'tutor_course/single/enrolled', ob_get_clean() );
|
805 |
+
} else {
|
806 |
+
tutor_load_template( 'single.course.course-enroll-box' );
|
807 |
+
$output = apply_filters( 'tutor_course/single/enroll', ob_get_clean() );
|
808 |
+
}
|
809 |
+
|
810 |
+
if ( $echo ) {
|
811 |
+
echo $output;
|
812 |
+
}
|
813 |
+
|
814 |
+
return $output;
|
815 |
+
}
|
816 |
+
}
|
817 |
+
|
818 |
+
function tutor_single_course_add_to_cart($echo = true){
|
819 |
+
ob_start();
|
820 |
+
|
821 |
+
$isLoggedIn = is_user_logged_in();
|
822 |
+
|
823 |
+
if ($isLoggedIn) {
|
824 |
+
tutor_load_template( 'single.course.add-to-cart' );
|
825 |
+
$output = apply_filters( 'tutor_course/single/add-to-cart', ob_get_clean() );
|
826 |
+
|
827 |
+
}else{
|
828 |
+
tutor_load_template( 'single.course.login' );
|
829 |
+
$output = apply_filters( 'tutor_course/global/login', ob_get_clean() );
|
830 |
+
}
|
831 |
+
|
832 |
+
if ( $echo ) {
|
833 |
+
echo $output;
|
834 |
+
}
|
835 |
+
|
836 |
+
return $output;
|
837 |
+
}
|
838 |
+
|
839 |
+
if ( ! function_exists('tutor_course_enrolled_nav')) {
|
840 |
+
function tutor_course_enrolled_nav($echo = true) {
|
841 |
+
$course_post_type = tutor()->course_post_type;
|
842 |
+
$lesson_post_type = tutor()->lesson_post_type;
|
843 |
+
|
844 |
+
ob_start();
|
845 |
+
global $post;
|
846 |
+
|
847 |
+
if ( ! empty($post->post_type) && $post->post_type === $course_post_type){
|
848 |
+
tutor_load_template( 'single.course.enrolled.nav' );
|
849 |
+
}elseif(! empty($post->post_type) && $post->post_type === $lesson_post_type){
|
850 |
+
$lesson_id = get_the_ID();
|
851 |
+
$course_id = tutor_utils()->get_course_id_by_lesson($lesson_id);
|
852 |
+
|
853 |
+
$course_post_type = tutor()->course_post_type;
|
854 |
+
$queryCourse = new WP_Query(array('p' => $course_id, 'post_type' => $course_post_type));
|
855 |
+
|
856 |
+
if ($queryCourse->have_posts()){
|
857 |
+
while ($queryCourse->have_posts()){
|
858 |
+
$queryCourse->the_post();
|
859 |
+
tutor_load_template( 'single.course.enrolled.nav' );
|
860 |
+
}
|
861 |
+
wp_reset_postdata();
|
862 |
+
}
|
863 |
+
}
|
864 |
+
$output = apply_filters( 'tutor_course/single/enrolled/nav', ob_get_clean() );
|
865 |
+
|
866 |
+
if ( $echo ) {
|
867 |
+
echo $output;
|
868 |
+
}
|
869 |
+
return $output;
|
870 |
+
}
|
871 |
+
}
|
872 |
+
|
873 |
+
if ( ! function_exists('tutor_course_video')){
|
874 |
+
function tutor_course_video($echo = true){
|
875 |
+
ob_start();
|
876 |
+
tutor_load_template( 'single.video.video' );
|
877 |
+
$output = apply_filters( 'tutor_course/single/video', ob_get_clean() );
|
878 |
+
|
879 |
+
if ( $echo ) {
|
880 |
+
echo $output;
|
881 |
+
}
|
882 |
+
return $output;
|
883 |
+
}
|
884 |
+
}
|
885 |
+
|
886 |
+
if ( ! function_exists('tutor_lesson_video')){
|
887 |
+
function tutor_lesson_video($echo = true){
|
888 |
+
ob_start();
|
889 |
+
tutor_load_template( 'single.video.video' );
|
890 |
+
$output = apply_filters( 'tutor_lesson/single/video', ob_get_clean() );
|
891 |
+
|
892 |
+
if ( $echo ) {
|
893 |
+
echo $output;
|
894 |
+
}
|
895 |
+
return $output;
|
896 |
+
}
|
897 |
+
}
|
898 |
+
|
899 |
+
/**
|
900 |
+
*
|
901 |
+
* Get all lessons attachments
|
902 |
+
*
|
903 |
+
* @param bool $echo
|
904 |
+
*
|
905 |
+
* @return mixed
|
906 |
+
*
|
907 |
+
* @since v.1.0.0
|
908 |
+
*/
|
909 |
+
if ( ! function_exists('get_tutor_posts_attachments')){
|
910 |
+
function get_tutor_posts_attachments($echo = true){
|
911 |
+
ob_start();
|
912 |
+
tutor_load_template( 'global.attachments' );
|
913 |
+
$output = apply_filters( 'tutor_lesson/single/attachments', ob_get_clean() );
|
914 |
+
|
915 |
+
if ( $echo ) {
|
916 |
+
echo $output;
|
917 |
+
}
|
918 |
+
return $output;
|
919 |
+
}
|
920 |
+
}
|
921 |
+
|
922 |
+
/**
|
923 |
+
* @param bool $echo
|
924 |
+
*
|
925 |
+
* @return mixed
|
926 |
+
*
|
927 |
+
* Get the lessons with topics
|
928 |
+
*
|
929 |
+
* @since v.1.0.0
|
930 |
+
*/
|
931 |
+
if ( ! function_exists('tutor_lessons_sidebar')) {
|
932 |
+
function tutor_lessons_sidebar( $echo = true ) {
|
933 |
+
ob_start();
|
934 |
+
tutor_load_template( 'single.lesson.lesson_sidebar' );
|
935 |
+
$output = apply_filters( 'tutor_lesson/single/lesson_sidebar', ob_get_clean() );
|
936 |
+
|
937 |
+
if ( $echo ) {
|
938 |
+
echo $output;
|
939 |
+
}
|
940 |
+
|
941 |
+
return $output;
|
942 |
+
}
|
943 |
+
}
|
944 |
+
|
945 |
+
/**
|
946 |
+
* @param bool $echo
|
947 |
+
*
|
948 |
+
* @return mixed
|
949 |
+
*
|
950 |
+
* Render Lesson Main Content
|
951 |
+
* @since v.1.0.0
|
952 |
+
*/
|
953 |
+
if ( ! function_exists('tutor_lesson_content')) {
|
954 |
+
function tutor_lesson_content( $echo = true ) {
|
955 |
+
ob_start();
|
956 |
+
tutor_load_template( 'single.lesson.content' );
|
957 |
+
$output = apply_filters( 'tutor_lesson/single/content', ob_get_clean() );
|
958 |
+
|
959 |
+
if ( $echo ) {
|
960 |
+
echo $output;
|
961 |
+
}
|
962 |
+
|
963 |
+
return $output;
|
964 |
+
}
|
965 |
+
}
|
966 |
+
|
967 |
+
if ( ! function_exists('tutor_lesson_mark_complete_html')) {
|
968 |
+
function tutor_lesson_mark_complete_html( $echo = true ) {
|
969 |
+
ob_start();
|
970 |
+
tutor_load_template( 'single.lesson.complete_form' );
|
971 |
+
$output = apply_filters( 'tutor_lesson/single/complete_form', ob_get_clean() );
|
972 |
+
|
973 |
+
if ( $echo ) {
|
974 |
+
echo $output;
|
975 |
+
}
|
976 |
+
|
977 |
+
return $output;
|
978 |
+
}
|
979 |
+
}
|
980 |
+
|
981 |
+
if ( ! function_exists('tutor_course_mark_complete_html')) {
|
982 |
+
function tutor_course_mark_complete_html( $echo = true ) {
|
983 |
+
ob_start();
|
984 |
+
tutor_load_template( 'single.course.complete_form' );
|
985 |
+
$output = apply_filters( 'tutor_course/single/complete_form', ob_get_clean() );
|
986 |
+
|
987 |
+
if ( $echo ) {
|
988 |
+
echo $output;
|
989 |
+
}
|
990 |
+
|
991 |
+
return $output;
|
992 |
+
}
|
993 |
+
}
|
994 |
+
|
995 |
+
|
996 |
+
/**
|
997 |
+
* @param bool $echo
|
998 |
+
*
|
999 |
+
* @return mixed
|
1000 |
+
*
|
1001 |
+
* @show progress bar about course complete
|
1002 |
+
*
|
1003 |
+
* @since v.1.0.0
|
1004 |
+
*/
|
1005 |
+
|
1006 |
+
if ( ! function_exists('tutor_course_completing_progress_bar')) {
|
1007 |
+
function tutor_course_completing_progress_bar( $echo = true ) {
|
1008 |
+
ob_start();
|
1009 |
+
tutor_load_template( 'single.course.enrolled.completing-progress' );
|
1010 |
+
$output = apply_filters( 'tutor_course/single/completing-progress-bar', ob_get_clean() );
|
1011 |
+
|
1012 |
+
if ( $echo ) {
|
1013 |
+
echo $output;
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
return $output;
|
1017 |
+
}
|
1018 |
+
}
|
1019 |
+
|
1020 |
+
function tutor_course_question_and_answer($echo = true){
|
1021 |
+
ob_start();
|
1022 |
+
tutor_load_template( 'single.course.enrolled.question_and_answer' );
|
1023 |
+
$output = apply_filters( 'tutor_course/single/question_and_answer', ob_get_clean() );
|
1024 |
+
|
1025 |
+
if ( $echo ) {
|
1026 |
+
echo $output;
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
return $output;
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
|
1033 |
+
function tutor_course_announcements($echo = true){
|
1034 |
+
ob_start();
|
1035 |
+
tutor_load_template( 'single.course.enrolled.announcements' );
|
1036 |
+
$output = apply_filters( 'tutor_course/single/announcements', ob_get_clean() );
|
1037 |
+
|
1038 |
+
if ( $echo ) {
|
1039 |
+
echo $output;
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
return $output;
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
function tutor_single_quiz_top($echo = true){
|
1046 |
+
ob_start();
|
1047 |
+
tutor_load_template( 'single.quiz.top' );
|
1048 |
+
$output = apply_filters( 'tutor_single_quiz/top', ob_get_clean() );
|
1049 |
+
|
1050 |
+
if ( $echo ) {
|
1051 |
+
echo $output;
|
1052 |
+
}
|
1053 |
+
return $output;
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
function tutor_single_quiz_body($echo = true){
|
1057 |
+
ob_start();
|
1058 |
+
tutor_load_template( 'single.quiz.body' );
|
1059 |
+
$output = apply_filters( 'tutor_single_quiz/body', ob_get_clean() );
|
1060 |
+
|
1061 |
+
if ( $echo ) {
|
1062 |
+
echo $output;
|
1063 |
+
}
|
1064 |
+
return $output;
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
function tutor_single_quiz_no_course_belongs($echo = true){
|
1068 |
+
ob_start();
|
1069 |
+
tutor_load_template( 'single.quiz.no_course_belongs' );
|
1070 |
+
$output = apply_filters( 'tutor_single_quiz/no_course_belongs', ob_get_clean() );
|
1071 |
+
|
1072 |
+
if ( $echo ) {
|
1073 |
+
echo $output;
|
1074 |
+
}
|
1075 |
+
return $output;
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
function get_tutor_course_level($course_id = 0){
|
1079 |
+
if ( ! $course_id){
|
1080 |
+
$course_id = get_the_ID();
|
1081 |
+
}
|
1082 |
+
if ( ! $course_id){
|
1083 |
+
return '';
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
$course_level = get_post_meta($course_id, '_tutor_course_level', true);
|
1087 |
+
|
1088 |
+
if ($course_level){
|
1089 |
+
return tutor_utils()->course_levels($course_level);
|
1090 |
+
}
|
1091 |
+
return false;
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
if ( ! function_exists('get_tutor_course_duration_context')) {
|
1095 |
+
function get_tutor_course_duration_context( $course_id = 0 ) {
|
1096 |
+
if ( ! $course_id ) {
|
1097 |
+
$course_id = get_the_ID();
|
1098 |
+
}
|
1099 |
+
if ( ! $course_id ) {
|
1100 |
+
return '';
|
1101 |
+
}
|
1102 |
+
$duration = get_post_meta( $course_id, '_course_duration', true );
|
1103 |
+
$durationHours = tutor_utils()->avalue_dot( 'hours', $duration );
|
1104 |
+
$durationMinutes = tutor_utils()->avalue_dot( 'minutes', $duration );
|
1105 |
+
$durationSeconds = tutor_utils()->avalue_dot( 'seconds', $duration );
|
1106 |
+
|
1107 |
+
if ( $duration ) {
|
1108 |
+
$output = '';
|
1109 |
+
if ( $durationHours > 0 ) {
|
1110 |
+
$output .= $durationHours . "h ";
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
if ( $durationMinutes > 0 ) {
|
1114 |
+
$output .= $durationMinutes . "m ";
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
if ( $durationSeconds > 0 ) {
|
1118 |
+
$output .= $durationSeconds ."s ";
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
return $output;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
return false;
|
1125 |
+
}
|
1126 |
+
}
|
1127 |
+
if ( ! function_exists('get_tutor_course_categories')){
|
1128 |
+
function get_tutor_course_categories($course_id = 0){
|
1129 |
+
if ( ! $course_id ) {
|
1130 |
+
$course_id = get_the_ID();
|
1131 |
+
}
|
1132 |
+
$terms = get_the_terms( $course_id, 'course-category' );
|
1133 |
+
|
1134 |
+
return $terms;
|
1135 |
+
}
|
1136 |
+
}
|
1137 |
+
if ( ! function_exists('get_tutor_course_tags')){
|
1138 |
+
function get_tutor_course_tags($course_id = 0){
|
1139 |
+
if ( ! $course_id ) {
|
1140 |
+
$course_id = get_the_ID();
|
1141 |
+
}
|
1142 |
+
$terms = get_the_terms( $course_id, 'course-tag' );
|
1143 |
+
|
1144 |
+
return $terms;
|
1145 |
+
}
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
if ( ! function_exists('tutor_course_tags_html')) {
|
1149 |
+
function tutor_course_tags_html( $echo = true ) {
|
1150 |
+
ob_start();
|
1151 |
+
tutor_load_template( 'single.course.tags' );
|
1152 |
+
$output = apply_filters( 'tutor_course/single/tags_html', ob_get_clean() );
|
1153 |
+
|
1154 |
+
if ( $echo ) {
|
1155 |
+
echo $output;
|
1156 |
+
}
|
1157 |
+
|
1158 |
+
return $output;
|
1159 |
+
}
|
1160 |
+
}
|
includes/tutor-template-hook.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* TUTOR hook
|
5 |
+
*/
|
6 |
+
|
7 |
+
add_action('tutor_course/archive/before_loop', 'tutor_course_archive_filter_bar');
|
8 |
+
|
9 |
+
add_action('tutor_course/archive/before_loop_course', 'tutor_course_loop_before_content');
|
10 |
+
add_action('tutor_course/archive/after_loop_course', 'tutor_course_loop_after_content');
|
11 |
+
|
12 |
+
add_action('tutor_course/loop/header', 'tutor_course_loop_header');
|
13 |
+
|
14 |
+
add_action('tutor_course/loop/start_content_wrap', 'tutor_course_loop_start_content_wrap');
|
15 |
+
add_action('tutor_course/loop/title', 'tutor_course_loop_title');
|
16 |
+
add_action('tutor_course/loop/meta', 'tutor_course_loop_meta');
|
17 |
+
|
18 |
+
add_action('tutor_course/loop/rating', 'tutor_course_loop_rating');
|
19 |
+
add_action('tutor_course/loop/end_content_wrap', 'tutor_course_loop_end_content_wrap');
|
20 |
+
|
21 |
+
add_action('tutor_course/loop/footer', 'tutor_course_loop_footer');
|
22 |
+
|
23 |
+
if (function_exists('wc_print_notices')){
|
24 |
+
add_action( 'tutor_course/single/before/inner-wrap', 'wc_print_notices', 10 );
|
25 |
+
add_action( 'tutor_course/single/enrolled/before/inner-wrap', 'wc_print_notices', 10 );
|
26 |
+
}
|
readme.txt
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Tutor - Ultimate WordPress LMS plugin ===
|
2 |
+
Contributors: themeum
|
3 |
+
Donate link: https://www.themeum.com
|
4 |
+
Tags: lms, education, wp-lms, education management system
|
5 |
+
Requires at least: 4.5
|
6 |
+
Tested up to: 5.0
|
7 |
+
Requires PHP: 5.4.0
|
8 |
+
Stable tag: 1.0.0-alpha
|
9 |
+
License: GPLv3
|
10 |
+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
|
12 |
+
A complete WordPress LMS plugin to create any e-learning website easily.
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
|
16 |
+
Tutor is an all-in-one, feature-rich, and robust WordPress LMS plugin to create & sell courses online. With powerful features like quiz & question system, frontend student dashboard, Tutor can be the best free LMS plugin for WordPress.
|
17 |
+
|
18 |
+
Want to create an e-learning platform like Udemy, Lynda, Coursera, and Edx? Get Tutor, the most advanced and powerful WordPress online course plugin. Any educational institution, training center, and individual can easily build their e-learning platform with this WordPress LMS plugin in the quickest possible time.
|
19 |
+
|
20 |
+
Create, customize, manage, and sell online courses by building a functional e-learning website with this free LMS plugin for WordPress.
|
21 |
+
|
22 |
+
= Features =
|
23 |
+
|
24 |
+
Here are the most notable features of Tutor LMS plugin. If you need any further information, please feel free to contact us. Below are the best offerings of Tutor LMS.
|
25 |
+
|
26 |
+
* Unlimited courses and lessons
|
27 |
+
* Frontend student dashboard
|
28 |
+
* Video lessons
|
29 |
+
* Multiple video sources (self-hosted, YouTube, Vimeo)
|
30 |
+
* Teacher profiles and panels
|
31 |
+
* Lesson management
|
32 |
+
* Course requirement & instruction
|
33 |
+
* WooCommerce integration to sell courses
|
34 |
+
* Quizzes and Questions under course
|
35 |
+
* Teacher registration form
|
36 |
+
* Course review and rating system
|
37 |
+
* Q&A for students with course teacher
|
38 |
+
* Video Poster (trailer/teaser)
|
39 |
+
* Lesson attachments
|
40 |
+
* Tracking course progress
|
41 |
+
* Lesson download option
|
42 |
+
* Email notification
|
43 |
+
|
44 |
+
= Intuitive Course Builder =
|
45 |
+
Create courses with their details like videos, attachments, excerpt, additional data, benefit of the course, requirement, topic, summary, announcement, and video banners. Have lessons under course and attach video and other attachments to each lesson. Tutor, the advanced WordPress LMS plugin lets you present courses on an intuitive user interface with all required options to offer a top notch learning system.
|
46 |
+
|
47 |
+
= Smart Course and Lesson Manager =
|
48 |
+
With tons of awesome features inside this WordPress course plugin, it is easy to setup, control, and manage teachers, students, courses & lessons. There’s rich Tutor Settings to define, select, and limit options for Course, Lesson, Quiz, Teacher, Student, and Email Notification.
|
49 |
+
|
50 |
+
= Frontend Student Dashboard =
|
51 |
+
Each student registered on your WordPress learning management system will have a frontend dashboard to see their course status, progress, notifications, announcements, and any other thing an admin or a course teacher sets from the backend.
|
52 |
+
|
53 |
+
= Quiz Creator =
|
54 |
+
Create quizzes with this WordPress course plugin. Add questions while setting up quizzes or add them from preset questions from Question section. Set up the time limit and restrict the number of attempts, passing grades and so on. This WordPress LMS plugin also lets you limit the number of questions available for students to answer.
|
55 |
+
|
56 |
+
= Question System =
|
57 |
+
With this free LMS plugin for WordPress, you create questions that are supposed to be added to the Quizzes. Create questions by defining question type (True/False, Multiple Choice, Single Choice), marks for each question (if answered right), answer type, descriptions and answer hints for the students to attempt the right answer.
|
58 |
+
|
59 |
+
= Email Notifications =
|
60 |
+
Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically.
|
61 |
+
|
62 |
+
= WooCommerce Integration to Sell Course =
|
63 |
+
Being integrated with WooCommerce, Tutor, the WordPress LMS plugin offers eCommerce functionalities and enables you to sell courses on your website.
|
64 |
+
|
65 |
+
Looking for the best LMS for WordPress? Get Tutor and start your e-learning website immediately.
|
66 |
+
|
67 |
+
|
68 |
+
== Installation ==
|
69 |
+
|
70 |
+
= Minimum Requirements =
|
71 |
+
|
72 |
+
* PHP version 5.6.0 or greater (PHP 7.1 or greater is recommended)
|
73 |
+
* MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended)
|
74 |
+
|
75 |
+
= Automatic installation =
|
76 |
+
|
77 |
+
The automatic installation is the easiest way to install any plugin in WordPress. You can perform an automatic installation of Tutor by logging in to your WordPress dashboard, navigating to the “Plugins” menu and click on the “Add New” button.
|
78 |
+
|
79 |
+
This will open up a page showing all the available plugins in WordPress. In the search field, type Tutor. The search result will show you our Tutor plugin, you can then see the detailed info by clicking on “More Details” and to install just click on the “Install Now” button.
|
80 |
+
|
81 |
+
= Manual installation =
|
82 |
+
|
83 |
+
To install Tutor manually, you need to download the plugin and upload it to your webserver via any FTP application.
|
84 |
+
|
85 |
+
The WordPress codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
|
86 |
+
|
87 |
+
== Frequently Asked Questions ==
|
88 |
+
|
89 |
+
= Can I use Tutor with my existing theme? =
|
90 |
+
|
91 |
+
Yes. Tutor can be used with your existing theme or any theme you wish to use it with.
|
92 |
+
|
93 |
+
= Where can I get support? =
|
94 |
+
|
95 |
+
You can get support by posting your issues on the support section of this plugin on WordPress plugins directory or directly place your question to Themeum Forums.
|
96 |
+
|
97 |
+
|
98 |
+
= Where can I report a bug? =
|
99 |
+
|
100 |
+
If any bug is found, please let us know by posting on the support section of this plugin on WordPress plugin directory or directly on our support forums: https://www.themeum.com/support/ 🙂
|
101 |
+
|
102 |
+
== Screenshots ==
|
103 |
+
|
104 |
+
1. Course Builder
|
105 |
+
2. Multi Instructors
|
106 |
+
3. Lesson Add to course
|
107 |
+
|
108 |
+
== Changelog ==
|
109 |
+
|
110 |
+
= 1.0.0-alpha - 06 Feb, 2019 =
|
111 |
+
|
112 |
+
* Alpha Release
|
113 |
+
|
114 |
+
== Upgrade Notice ==
|
115 |
+
|
116 |
+
Nothing here
|
templates/archive-course.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying courses
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header(); ?>
|
12 |
+
|
13 |
+
<div class="<?php tutor_container_classes() ?>">
|
14 |
+
<?php
|
15 |
+
do_action('tutor_course/archive/before_loop');
|
16 |
+
|
17 |
+
if ( have_posts() ) :
|
18 |
+
/* Start the Loop */
|
19 |
+
|
20 |
+
tutor_course_loop_start();
|
21 |
+
|
22 |
+
while ( have_posts() ) : the_post();
|
23 |
+
/**
|
24 |
+
* @hook tutor_course/archive/before_loop_course
|
25 |
+
* @type action
|
26 |
+
* Usage Idea, you may keep a loop within a wrap, such as bootstrap col
|
27 |
+
*/
|
28 |
+
do_action('tutor_course/archive/before_loop_course');
|
29 |
+
|
30 |
+
tutor_load_template('loop.course');
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @hook tutor_course/archive/after_loop_course
|
34 |
+
* @type action
|
35 |
+
* Usage Idea, If you start any div before course loop, you can end it here, such as </div>
|
36 |
+
*/
|
37 |
+
do_action('tutor_course/archive/after_loop_course');
|
38 |
+
endwhile;
|
39 |
+
|
40 |
+
tutor_course_loop_end();
|
41 |
+
|
42 |
+
else :
|
43 |
+
|
44 |
+
/**
|
45 |
+
* No course found
|
46 |
+
*/
|
47 |
+
tutor_load_template('course-none');
|
48 |
+
|
49 |
+
endif;
|
50 |
+
|
51 |
+
tutor_course_archive_pagination();
|
52 |
+
|
53 |
+
do_action('tutor_course/archive/after_loop');
|
54 |
+
?>
|
55 |
+
</div><!-- .wrap -->
|
56 |
+
|
57 |
+
<?php get_footer();
|
templates/course-none.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* TUTOR Course None
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
|
13 |
+
<h3>There is no course</h3>
|
templates/dashboard/instructor/apply_for_instructor.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<form method="post" enctype="multipart/form-data">
|
2 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
3 |
+
<input type="hidden" value="tutor_apply_instructor" name="tutor_action"/>
|
4 |
+
|
5 |
+
<div class="tutor-form-row">
|
6 |
+
<div class="tutor-form-col-12">
|
7 |
+
<div class="tutor-form-group">
|
8 |
+
<button type="submit" name="tutor_register_instructor_btn" value="apply"><?php _e('Apply for become instructor', 'tutor'); ?></button>
|
9 |
+
</div>
|
10 |
+
</div>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
</form>
|
templates/dashboard/instructor/logged-in.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$is_instructor = tutor_utils()->is_instructor();
|
3 |
+
if ($is_instructor){
|
4 |
+
?>
|
5 |
+
|
6 |
+
<div class="tutor-alert-warning">
|
7 |
+
<h2><?php _e("You are instructor", 'tutor'); ?></h2>
|
8 |
+
|
9 |
+
<p>
|
10 |
+
<?php _e(sprintf("Registered at : %s %s", date_i18n(get_option('date_format'), $is_instructor), date_i18n(get_option('time_format'), $is_instructor) ), 'tutor'); ?>
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<p>
|
14 |
+
<?php _e(sprintf('Status : %s', tutor_utils()->instructor_status()), 'tutor'); ?>
|
15 |
+
</p>
|
16 |
+
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<?php }else{
|
20 |
+
tutor_load_template('dashboard.instructor.apply_for_instructor');
|
21 |
+
} ?>
|
templates/dashboard/instructor/registration.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<form method="post" enctype="multipart/form-data">
|
2 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
3 |
+
<input type="hidden" value="tutor_register_instructor" name="tutor_action"/>
|
4 |
+
|
5 |
+
<?php
|
6 |
+
$errors = apply_filters('tutor_instructor_register_validation_errors', array());
|
7 |
+
if (is_array($errors) && count($errors)){
|
8 |
+
echo '<div class="tutor-alert-warning"><ul class="tutor-required-fields">';
|
9 |
+
foreach ($errors as $error_key => $error_value){
|
10 |
+
echo "<li>{$error_value}</li>";
|
11 |
+
}
|
12 |
+
echo '</ul></div>';
|
13 |
+
}
|
14 |
+
?>
|
15 |
+
|
16 |
+
<div class="tutor-form-row">
|
17 |
+
<div class="tutor-form-col-4">
|
18 |
+
<div class="tutor-form-group">
|
19 |
+
<label>
|
20 |
+
<?php _e('First Name', 'tutor'); ?>
|
21 |
+
</label>
|
22 |
+
|
23 |
+
<input type="text" name="first_name" value="<?php echo tutor_utils()->input_old('first_name'); ?>" placeholder="<?php _e('First Name', 'tutor'); ?>">
|
24 |
+
</div>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div class="tutor-form-col-4">
|
28 |
+
<div class="tutor-form-group">
|
29 |
+
<label>
|
30 |
+
<?php _e('Last Name', 'tutor'); ?>
|
31 |
+
</label>
|
32 |
+
|
33 |
+
<input type="text" name="last_name" value="<?php echo tutor_utils()->input_old('last_name'); ?>" placeholder="<?php _e('Last Name', 'tutor'); ?>">
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="tutor-form-col-4">
|
38 |
+
<div class="tutor-form-group">
|
39 |
+
<label>
|
40 |
+
<?php _e('User Name', 'tutor'); ?>
|
41 |
+
</label>
|
42 |
+
|
43 |
+
<input type="text" name="user_login" class="tutor_user_name" value="<?php echo tutor_utils()->input_old('user_login'); ?>" placeholder="<?php _e('User Name', 'tutor'); ?>">
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div class="tutor-form-row">
|
49 |
+
<div class="tutor-form-col-6">
|
50 |
+
<div class="tutor-form-group">
|
51 |
+
<label>
|
52 |
+
<?php _e('E-Mail', 'tutor'); ?>
|
53 |
+
</label>
|
54 |
+
|
55 |
+
<input type="text" name="email" value="<?php echo tutor_utils()->input_old('email'); ?>" placeholder="<?php _e('E-Mail', 'tutor'); ?>">
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
|
60 |
+
<div class="tutor-form-col-6">
|
61 |
+
<div class="tutor-form-group">
|
62 |
+
<label>
|
63 |
+
<?php _e('Phone Number', 'tutor'); ?>
|
64 |
+
</label>
|
65 |
+
|
66 |
+
<input type="text" name="phone_number" value="<?php echo tutor_utils()->input_old('phone_number'); ?>" placeholder="<?php _e('Phone Number', 'tutor'); ?>">
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div class="tutor-form-row">
|
73 |
+
<div class="tutor-form-col-6">
|
74 |
+
<div class="tutor-form-group">
|
75 |
+
<label>
|
76 |
+
<?php _e('Password', 'tutor'); ?>
|
77 |
+
</label>
|
78 |
+
|
79 |
+
<input type="password" name="password" value="<?php echo tutor_utils()->input_old('password'); ?>" placeholder="<?php _e('Password', 'tutor'); ?>">
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div class="tutor-form-col-6">
|
84 |
+
<div class="tutor-form-group">
|
85 |
+
<label>
|
86 |
+
<?php _e('Password confirmation', 'tutor'); ?>
|
87 |
+
</label>
|
88 |
+
|
89 |
+
<input type="password" name="password_confirmation" value="<?php echo tutor_utils()->input_old('password_confirmation'); ?>" placeholder="<?php _e('Password Confirmation', 'tutor'); ?>">
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
<div class="tutor-form-row">
|
95 |
+
<div class="tutor-form-col-12">
|
96 |
+
<div class="tutor-form-group">
|
97 |
+
<label>
|
98 |
+
<?php _e('Bio', 'tutor'); ?>
|
99 |
+
</label>
|
100 |
+
|
101 |
+
<textarea name="tutor_profile_bio"><?php echo tutor_utils()->input_old('tutor_profile_bio'); ?></textarea>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<div class="tutor-form-row">
|
107 |
+
<div class="tutor-form-col-12">
|
108 |
+
<div class="tutor-form-group tutor-reg-form-btn-wrap">
|
109 |
+
<button type="submit" name="tutor_register_instructor_btn" value="register" class="tutor-button"><?php _e('Become a instructor', 'tutor'); ?></button>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
|
114 |
+
</form>
|
templates/dashboard/student/active-courses.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1><?php _e('Active Course', 'tutor'); ?></h1>
|
2 |
+
<div class="tutor-dashboard-content-inner">
|
3 |
+
<?php
|
4 |
+
$active_courses = tutor_utils()->get_active_courses_by_user();
|
5 |
+
|
6 |
+
if ($active_courses && $active_courses->have_posts()):
|
7 |
+
while ($active_courses->have_posts()):
|
8 |
+
$active_courses->the_post();
|
9 |
+
?>
|
10 |
+
<div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
|
11 |
+
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
|
12 |
+
<div class="tutor-meta tutor-course-metadata">
|
13 |
+
<?php
|
14 |
+
$total_lessons = tutor_utils()->get_lesson_count_by_course();
|
15 |
+
$completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
|
16 |
+
?>
|
17 |
+
<ul>
|
18 |
+
<li>
|
19 |
+
<?php
|
20 |
+
_e('Total Lessons:', 'tutor');
|
21 |
+
echo "<span>$total_lessons</span>";
|
22 |
+
?>
|
23 |
+
</li>
|
24 |
+
<li>
|
25 |
+
<?php
|
26 |
+
_e('Completed Lessons:', 'tutor');
|
27 |
+
echo "<span>$completed_lessons / $total_lessons</span>";
|
28 |
+
?>
|
29 |
+
</li>
|
30 |
+
</ul>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<?php tutor_course_completing_progress_bar(); ?>
|
34 |
+
<?php the_excerpt(); ?>
|
35 |
+
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<?php
|
39 |
+
endwhile;
|
40 |
+
wp_reset_postdata();
|
41 |
+
else:
|
42 |
+
echo "<div class='tutor-mycourse-wrap'>". esc_html__('There\'s no active course', 'tutor') ."</div>";
|
43 |
+
endif;
|
44 |
+
|
45 |
+
?>
|
46 |
+
</div>
|
templates/dashboard/student/completed-courses.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1><?php _e('Completed Course', 'tutor'); ?></h1>
|
2 |
+
<div class="tutor-dashboard-content-inner">
|
3 |
+
|
4 |
+
<?php
|
5 |
+
$completed_courses = tutor_utils()->get_courses_by_user();
|
6 |
+
|
7 |
+
if ($completed_courses && $completed_courses->have_posts()):
|
8 |
+
while ($completed_courses->have_posts()):
|
9 |
+
$completed_courses->the_post();
|
10 |
+
?>
|
11 |
+
<div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
|
12 |
+
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
|
13 |
+
<div class="tutor-meta tutor-course-metadata">
|
14 |
+
<?php
|
15 |
+
$total_lessons = tutor_utils()->get_lesson_count_by_course();
|
16 |
+
$completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
|
17 |
+
?>
|
18 |
+
<ul>
|
19 |
+
<li>
|
20 |
+
<?php
|
21 |
+
_e('Total Lessons:', 'tutor');
|
22 |
+
echo "<span>$total_lessons</span>";
|
23 |
+
?>
|
24 |
+
</li>
|
25 |
+
<li>
|
26 |
+
<?php
|
27 |
+
_e('Completed Lessons:', 'tutor');
|
28 |
+
echo "<span>$completed_lessons / $total_lessons</span>";
|
29 |
+
?>
|
30 |
+
</li>
|
31 |
+
</ul>
|
32 |
+
</div>
|
33 |
+
<?php tutor_course_completing_progress_bar(); ?>
|
34 |
+
<?php the_excerpt(); ?>
|
35 |
+
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<?php
|
39 |
+
endwhile;
|
40 |
+
|
41 |
+
wp_reset_postdata();
|
42 |
+
|
43 |
+
else:
|
44 |
+
echo "<div class='tutor-mycourse-wrap'>". esc_html__('There\'s no active course', 'tutor') ."</div>";
|
45 |
+
endif;
|
46 |
+
|
47 |
+
?>
|
48 |
+
</div>
|
templates/dashboard/student/dashboard.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1>Dashboard</h1>
|
2 |
+
|
3 |
+
<div class="tutor-dashboard-content-inner">
|
4 |
+
<div class='tutor-mycourse-wrap'>
|
5 |
+
<?php
|
6 |
+
$completed_courses = tutor_utils()->get_completed_courses_ids_by_user();
|
7 |
+
$my_courses = tutor_utils()->get_enrolled_courses_by_user();
|
8 |
+
|
9 |
+
$completed_courses_count = count($completed_courses);
|
10 |
+
$my_courses_count = $my_courses? $my_courses->post_count : 0;
|
11 |
+
$active_course_count = ($my_courses_count - $completed_courses_count);
|
12 |
+
|
13 |
+
|
14 |
+
echo __('My Course : ', 'tutor') . $my_courses_count . "<br />";
|
15 |
+
echo __('Active Course : ', 'tutor') . $active_course_count . "<br />";
|
16 |
+
echo __('Complete Course : ', 'tutor') . $completed_courses_count . "<br />";
|
17 |
+
|
18 |
+
|
19 |
+
?>
|
20 |
+
|
21 |
+
</div>
|
22 |
+
</div>
|
templates/dashboard/student/index.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying student dashboard
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
global $wp_query;
|
12 |
+
|
13 |
+
$dashboard_page_slug = '';
|
14 |
+
if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) {
|
15 |
+
$dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class="tutor-wrap tutor-dashboard tutor-dashboard-student">
|
20 |
+
<div class="tutor-container">
|
21 |
+
<div class="tutor-row">
|
22 |
+
<div class="tutor-col-3">
|
23 |
+
<ul class="tutor-dashboard-permalinks">
|
24 |
+
<?php
|
25 |
+
$dashboard_pages = tutor_utils()->tutor_student_dashboard_pages();
|
26 |
+
foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
|
27 |
+
if ($dashboard_key === 'index')
|
28 |
+
$dashboard_key = '';
|
29 |
+
$active_class = $dashboard_key == $dashboard_page_slug ? 'active' : '';
|
30 |
+
echo "<li class='{$active_class}'><a href='".tutor_utils()->get_tutor_dashboard_page_permalink($dashboard_key)."'> {$dashboard_page} </a> </li>";
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
</ul>
|
34 |
+
</div>
|
35 |
+
<div class="tutor-col-9">
|
36 |
+
<div class="tutor-dashboard-content">
|
37 |
+
<?php
|
38 |
+
if ($dashboard_page_slug){
|
39 |
+
tutor_load_template("dashboard.student.".$wp_query->query_vars['tutor_dashboard_page']);
|
40 |
+
}else{
|
41 |
+
tutor_load_template("dashboard.student.dashboard");
|
42 |
+
}
|
43 |
+
?>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
</div>
|
templates/dashboard/student/logged-in.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<h2>You are already logged in</h2>
|
templates/dashboard/student/my-courses.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1><?php _e('My Courses', 'tutor'); ?></h1>
|
2 |
+
|
3 |
+
<div class="tutor-dashboard-content-inner">
|
4 |
+
<?php
|
5 |
+
$my_courses = tutor_utils()->get_enrolled_courses_by_user();
|
6 |
+
|
7 |
+
if ($my_courses && $my_courses->have_posts()):
|
8 |
+
while ($my_courses->have_posts()):
|
9 |
+
$my_courses->the_post();
|
10 |
+
$avg_rating = tutor_utils()->get_course_rating()->rating_avg;
|
11 |
+
?>
|
12 |
+
<div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
|
13 |
+
<div class="tutor-mycourse-rating">
|
14 |
+
<?php
|
15 |
+
tutor_utils()->star_rating_generator($avg_rating);
|
16 |
+
?>
|
17 |
+
</div>
|
18 |
+
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
|
19 |
+
<div class="tutor-meta tutor-course-metadata">
|
20 |
+
<?php
|
21 |
+
$total_lessons = tutor_utils()->get_lesson_count_by_course();
|
22 |
+
$completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
|
23 |
+
?>
|
24 |
+
<ul>
|
25 |
+
<li>
|
26 |
+
<?php
|
27 |
+
_e('Total Lessons:', 'tutor');
|
28 |
+
echo "<span>$total_lessons</span>";
|
29 |
+
?>
|
30 |
+
</li>
|
31 |
+
<li>
|
32 |
+
<?php
|
33 |
+
_e('Completed Lessons:', 'tutor');
|
34 |
+
echo "<span>$completed_lessons / $total_lessons</span>";
|
35 |
+
?>
|
36 |
+
</li>
|
37 |
+
</ul>
|
38 |
+
</div>
|
39 |
+
<?php tutor_course_completing_progress_bar(); ?>
|
40 |
+
<?php the_excerpt(); ?>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<?php
|
44 |
+
endwhile;
|
45 |
+
|
46 |
+
wp_reset_postdata();
|
47 |
+
else:
|
48 |
+
echo "<div class='tutor-mycourse-wrap'>You didn't purchased any course</div>";
|
49 |
+
endif;
|
50 |
+
|
51 |
+
?>
|
52 |
+
|
53 |
+
</div>
|
templates/dashboard/student/registration.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<form method="post" enctype="multipart/form-data">
|
2 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
3 |
+
<input type="hidden" value="tutor_register_student" name="tutor_action"/>
|
4 |
+
|
5 |
+
<?php
|
6 |
+
$errors = apply_filters('tutor_student_register_validation_errors', array());
|
7 |
+
if (is_array($errors) && count($errors)){
|
8 |
+
echo '<div class="tutor-alert-warning tutor-mb-10"><ul class="tutor-required-fields">';
|
9 |
+
foreach ($errors as $error_key => $error_value){
|
10 |
+
echo "<li>{$error_value}</li>";
|
11 |
+
}
|
12 |
+
echo '</ul></div>';
|
13 |
+
}
|
14 |
+
?>
|
15 |
+
|
16 |
+
<div class="tutor-form-row">
|
17 |
+
<div class="tutor-form-col-4">
|
18 |
+
<div class="tutor-form-group">
|
19 |
+
<label>
|
20 |
+
<?php _e('First Name', 'tutor'); ?>
|
21 |
+
</label>
|
22 |
+
|
23 |
+
<input type="text" name="first_name" value="<?php echo tutor_utils()->input_old('first_name'); ?>" placeholder="<?php _e('First Name', 'tutor'); ?>">
|
24 |
+
</div>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div class="tutor-form-col-4">
|
28 |
+
<div class="tutor-form-group">
|
29 |
+
<label>
|
30 |
+
<?php _e('Last Name', 'tutor'); ?>
|
31 |
+
</label>
|
32 |
+
|
33 |
+
<input type="text" name="last_name" value="<?php echo tutor_utils()->input_old('last_name'); ?>" placeholder="<?php _e('Last Name', 'tutor'); ?>">
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="tutor-form-col-4">
|
38 |
+
<div class="tutor-form-group">
|
39 |
+
<label>
|
40 |
+
<?php _e('User Name', 'tutor'); ?>
|
41 |
+
</label>
|
42 |
+
|
43 |
+
<input type="text" name="user_login" class="tutor_user_name" value="<?php echo tutor_utils()->input_old('user_login'); ?>" placeholder="<?php _e('User Name', 'tutor'); ?>">
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div class="tutor-form-row">
|
49 |
+
<div class="tutor-form-col-6">
|
50 |
+
<div class="tutor-form-group">
|
51 |
+
<label>
|
52 |
+
<?php _e('E-Mail', 'tutor'); ?>
|
53 |
+
</label>
|
54 |
+
|
55 |
+
<input type="text" name="email" value="<?php echo tutor_utils()->input_old('email'); ?>" placeholder="<?php _e('E-Mail', 'tutor'); ?>">
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
|
60 |
+
<div class="tutor-form-col-6">
|
61 |
+
<div class="tutor-form-group">
|
62 |
+
<label>
|
63 |
+
<?php _e('Phone Number', 'tutor'); ?>
|
64 |
+
</label>
|
65 |
+
|
66 |
+
<input type="text" name="phone_number" value="<?php echo tutor_utils()->input_old('phone_number'); ?>" placeholder="<?php _e('Phone Number', 'tutor'); ?>">
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div class="tutor-form-row">
|
73 |
+
<div class="tutor-form-col-6">
|
74 |
+
<div class="tutor-form-group">
|
75 |
+
<label>
|
76 |
+
<?php _e('Password', 'tutor'); ?>
|
77 |
+
</label>
|
78 |
+
|
79 |
+
<input type="password" name="password" value="<?php echo tutor_utils()->input_old('password'); ?>" placeholder="<?php _e('Password', 'tutor'); ?>">
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div class="tutor-form-col-6">
|
84 |
+
<div class="tutor-form-group">
|
85 |
+
<label>
|
86 |
+
<?php _e('Password confirmation', 'tutor'); ?>
|
87 |
+
</label>
|
88 |
+
|
89 |
+
<input type="password" name="password_confirmation" value="<?php echo tutor_utils()->input_old('password_confirmation'); ?>" placeholder="<?php _e('Password Confirmation', 'tutor'); ?>">
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
<div class="tutor-form-row">
|
95 |
+
<div class="tutor-form-col-12">
|
96 |
+
<div class="tutor-form-group">
|
97 |
+
<label>
|
98 |
+
<?php _e('Bio', 'tutor'); ?>
|
99 |
+
</label>
|
100 |
+
|
101 |
+
<textarea name="tutor_profile_bio"><?php echo tutor_utils()->input_old('tutor_profile_bio'); ?></textarea>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<div class="tutor-form-row">
|
107 |
+
<div class="tutor-form-col-12">
|
108 |
+
<div class="tutor-form-group tutor-reg-form-btn-wrap">
|
109 |
+
<button type="submit" name="tutor_register_student_btn" value="register" class="tutor-button"><?php _e('Register', 'tutor'); ?></button>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
|
114 |
+
</form>
|
templates/dashboard/student/wishlist.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php global $post; ?>
|
2 |
+
|
3 |
+
|
4 |
+
<h1><?php _e('WishList', 'tutor'); ?></h1>
|
5 |
+
<div class="tutor-dashboard-content-inner">
|
6 |
+
|
7 |
+
<?php
|
8 |
+
$wishlists = tutor_utils()->get_wishlist();
|
9 |
+
|
10 |
+
|
11 |
+
if (is_array($wishlists) && count($wishlists)):
|
12 |
+
foreach ($wishlists as $post):
|
13 |
+
setup_postdata($post);
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @hook tutor_course/archive/before_loop_course
|
17 |
+
* @type action
|
18 |
+
* Usage Idea, you may keep a loop within a wrap, such as bootstrap col
|
19 |
+
*/
|
20 |
+
do_action('tutor_course/archive/before_loop_course');
|
21 |
+
|
22 |
+
tutor_load_template('loop.course');
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @hook tutor_course/archive/after_loop_course
|
26 |
+
* @type action
|
27 |
+
* Usage Idea, If you start any div before course loop, you can end it here, such as </div>
|
28 |
+
*/
|
29 |
+
do_action('tutor_course/archive/after_loop_course');
|
30 |
+
|
31 |
+
endforeach;
|
32 |
+
|
33 |
+
wp_reset_postdata();
|
34 |
+
|
35 |
+
else:
|
36 |
+
echo "There's no active course";
|
37 |
+
endif;
|
38 |
+
|
39 |
+
?>
|
40 |
+
</div>
|
templates/email/to_instructor_asked_question_by_student.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {instructor_username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Mr. {student_username} asked a question on <strong>{course_name}</strong> at <strong>{enroll_time}</strong>. The course URL is: <strong>{course_url}</strong>. You will find the question below.
|
5 |
+
</p>
|
6 |
+
|
7 |
+
<br />
|
8 |
+
<p>{question_title}</p>
|
9 |
+
<p>{question}</p>
|
templates/email/to_instructor_course_completed.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {instructor_username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Mr. {student_username} has recently completed <strong>{course_name}</strong> at <strong>{completion_time}</strong>. The completed course URL is: <strong>{course_url}</strong>.
|
5 |
+
</p>
|
templates/email/to_instructor_course_enrolled.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {instructor_username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Mr. {student_username} has enrolled on <strong>{course_name}</strong> at <strong>{enroll_time}</strong>. The enrolled course URL is: <strong>{course_url}</strong>.
|
5 |
+
</p>
|
templates/email/to_instructor_lesson_completed.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {instructor_username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Mr. <strong>{student_username}</strong> has recently completed the lesson <strong>{lesson_name}</strong> of <strong>{course_name}</strong> at <strong>{completion_time}</strong>. The completed lesson URL is: <strong>{lesson_url}</strong>.
|
5 |
+
</p>
|
templates/email/to_student_course_completed.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {student_username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Thank you for completing <strong>{course_name}</strong> on <strong>{completion_time}</strong>. This message is to confirm that you have successfully completed the mentioned course. For future access, the course will be available on <strong>{course_url}</strong>.
|
5 |
+
</p>
|
templates/email/to_student_quiz_completed.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p> Dear {username}, </p>
|
2 |
+
|
3 |
+
<p>
|
4 |
+
Thank you for submitting your answers for <strong>{quiz_name}</strong> in course <strong>{course_name}</strong> at <strong>{submission_time}</strong>. This message is to confirm that we have received your answers. You can access this quiz on: <strong>{quiz_url}</strong>.
|
5 |
+
</p>
|
6 |
+
|
7 |
+
|
8 |
+
|
templates/global/attachments.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Display attachments
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
$attachments = tutor_utils()->get_attachments();
|
14 |
+
do_action('tutor_global/before/attachments');
|
15 |
+
|
16 |
+
if (is_array($attachments) && count($attachments)){
|
17 |
+
?>
|
18 |
+
<div class="tutor-page-segment tutor-attachments-wrap">
|
19 |
+
<h3><?php _e('Attachments', 'tutor'); ?></h3>
|
20 |
+
<?php
|
21 |
+
foreach ($attachments as $attachment){
|
22 |
+
?>
|
23 |
+
<a href="<?php echo $attachment->url; ?>" class="tutor-lesson-attachment clearfix">
|
24 |
+
<div class="tutor-attachment-icon">
|
25 |
+
<i class="tutor-icon-<?php echo $attachment->icon; ?>"></i>
|
26 |
+
</div>
|
27 |
+
<div class="tutor-attachment-info">
|
28 |
+
<span><?php echo $attachment->name; ?></span>
|
29 |
+
<span><?php echo $attachment->size; ?></span>
|
30 |
+
</div>
|
31 |
+
</a>
|
32 |
+
<?php
|
33 |
+
}
|
34 |
+
?>
|
35 |
+
</div>
|
36 |
+
<?php }
|
37 |
+
|
38 |
+
do_action('tutor_global/after/attachments'); ?>
|
templates/global/course-archive-filter-bar.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="tutor-course-filter-wrap">
|
2 |
+
<div class="tutor-course-archive-results-wrap">
|
3 |
+
<?php
|
4 |
+
$courseCount = tutor_utils()->get_archive_page_course_count();
|
5 |
+
_e(sprintf("%s Courses", "<strong>{$courseCount}</strong>"), "tutor");
|
6 |
+
?>
|
7 |
+
</div>
|
8 |
+
|
9 |
+
<div class="tutor-course-archive-filters-wrap">
|
10 |
+
<form class="tutor-course-filter-form" method="get">
|
11 |
+
<select name="tutor_course_filter">
|
12 |
+
<option value="newest_first" <?php if (isset($_GET["tutor_course_filter"]) ? selected("newest_first",$_GET["tutor_course_filter"]) : "" ); ?> ><?php _e("Release Date (newest first)", "tutor");
|
13 |
+
?></option>
|
14 |
+
<option value="oldest_first" <?php if (isset($_GET["tutor_course_filter"]) ? selected("oldest_first",$_GET["tutor_course_filter"]) : "" ); ?>><?php _e("Release Date (oldest first)", "tutor"); ?></option>
|
15 |
+
<option value="course_title_az" <?php if (isset($_GET["tutor_course_filter"]) ? selected("course_title_az",$_GET["tutor_course_filter"]) : "" ); ?>><?php _e("Course Title (a-z)", "tutor"); ?></option>
|
16 |
+
<option value="course_title_za" <?php if (isset($_GET["tutor_course_filter"]) ? selected("course_title_za",$_GET["tutor_course_filter"]) : "" ); ?>><?php _e("Course Title (z-a)", "tutor"); ?></option>
|
17 |
+
</select>
|
18 |
+
</form>
|
19 |
+
</div>
|
20 |
+
|
21 |
+
<div style="clear: both;"></div>
|
22 |
+
</div>
|
templates/global/login.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display global login
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) )
|
13 |
+
exit;
|
14 |
+
?>
|
15 |
+
|
16 |
+
<div class="tutor-login-form-wrap">
|
17 |
+
<?php //wp_login_form(); ?>
|
18 |
+
|
19 |
+
<?php
|
20 |
+
$args = array(
|
21 |
+
'echo' => true,
|
22 |
+
// Default 'redirect' value takes the user back to the request URI.
|
23 |
+
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
|
24 |
+
'form_id' => 'loginform',
|
25 |
+
'label_username' => __( 'Username or Email Address' ),
|
26 |
+
'label_password' => __( 'Password' ),
|
27 |
+
'label_remember' => __( 'Remember Me' ),
|
28 |
+
'label_log_in' => __( 'Log In' ),
|
29 |
+
'id_username' => 'user_login',
|
30 |
+
'id_password' => 'user_pass',
|
31 |
+
'id_remember' => 'rememberme',
|
32 |
+
'id_submit' => 'wp-submit',
|
33 |
+
'remember' => true,
|
34 |
+
'value_username' => '',
|
35 |
+
// Set 'value_remember' to true to default the "Remember me" checkbox to checked.
|
36 |
+
'value_remember' => false,
|
37 |
+
'wp_lostpassword_url' => wp_lostpassword_url(),
|
38 |
+
'wp_lostpassword_label' => __('Forgot Password?'),
|
39 |
+
);
|
40 |
+
|
41 |
+
$form = '
|
42 |
+
<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '" method="post">
|
43 |
+
<p class="login-username">
|
44 |
+
<input type="text" placeholder="'.esc_html( $args['label_username'] ).'" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" />
|
45 |
+
</p>
|
46 |
+
<p class="login-password">
|
47 |
+
<input type="password" placeholder="'.esc_html( $args['label_password'] ).'" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" />
|
48 |
+
</p>
|
49 |
+
<div class="tutor-login-rememeber-wrap">
|
50 |
+
' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '
|
51 |
+
|
52 |
+
<a href="'.$args['wp_lostpassword_url'].'">'.$args['wp_lostpassword_label'].'</a>
|
53 |
+
</div>
|
54 |
+
<p class="login-submit">
|
55 |
+
<input type="submit" name="wp-submit" id="' . esc_attr( $args['id_submit'] ) . '" class="button button-primary" value="' . esc_attr( $args['label_log_in'] ) . '" />
|
56 |
+
<input type="hidden" name="redirect_to" value="' . esc_url( $args['redirect'] ) . '" />
|
57 |
+
</p>
|
58 |
+
<p class="tutor-form-register-wrap">
|
59 |
+
<a href="'. esc_url(tutor_utils()->student_register_url()). '">'.esc_html('Create a new account').'</a>
|
60 |
+
</p>
|
61 |
+
</form>';
|
62 |
+
echo $form;
|
63 |
+
|
64 |
+
#@TODO: student_register_url() return false, it must be an valid url.
|
65 |
+
|
66 |
+
?>
|
67 |
+
</div>
|
templates/login.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display single login
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
get_header();
|
15 |
+
|
16 |
+
?>
|
17 |
+
|
18 |
+
<?php do_action('tutor/template/login/before/wrap'); ?>
|
19 |
+
<div <?php tutor_post_class('tutor-page-wrap'); ?>>
|
20 |
+
|
21 |
+
<div class="tutor-template-segment tutor-login-wrap">
|
22 |
+
<div class="tutor-login-title">
|
23 |
+
<h4><?php _e('Please Sign-In to view this section', 'tutor'); ?></h4>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div class="tutor-template-login-form">
|
27 |
+
<?php tutor_load_template( 'global.login' ); ?>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
</div><!-- .wrap -->
|
31 |
+
|
32 |
+
<?php do_action('tutor/template/login/after/wrap'); ?>
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
<?php
|
37 |
+
get_footer();
|
templates/loop/add-to-cart-edd.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$product_id = tutor_utils()->get_course_product_id();
|
3 |
+
$download = new EDD_Download( $product_id );
|
4 |
+
|
5 |
+
if ($download->ID) {
|
6 |
+
echo edd_get_purchase_link( array( 'download_id' => $download->ID ) );
|
7 |
+
}
|
templates/loop/add-to-cart-woocommerce.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* A single course loop add to cart
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
$product_id = tutor_utils()->get_course_product_id();
|
15 |
+
$product = wc_get_product($product_id);
|
16 |
+
|
17 |
+
if (! $product_id || ! $product){
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
|
21 |
+
$args = array();
|
22 |
+
$defaults = array(
|
23 |
+
'quantity' => 1,
|
24 |
+
'class' => implode( ' ', array_filter( array(
|
25 |
+
'button',
|
26 |
+
'product_type_' . $product->get_type(),
|
27 |
+
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
|
28 |
+
$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',
|
29 |
+
) ) ),
|
30 |
+
'attributes' => array(
|
31 |
+
'data-product_id' => $product->get_id(),
|
32 |
+
'data-product_sku' => $product->get_sku(),
|
33 |
+
'aria-label' => $product->add_to_cart_description(),
|
34 |
+
'rel' => 'nofollow',
|
35 |
+
),
|
36 |
+
);
|
37 |
+
|
38 |
+
$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );
|
39 |
+
|
40 |
+
if ( isset( $args['attributes']['aria-label'] ) ) {
|
41 |
+
$args['attributes']['aria-label'] = strip_tags( $args['attributes']['aria-label'] );
|
42 |
+
}
|
43 |
+
|
44 |
+
?>
|
45 |
+
|
46 |
+
<div class="tutor-loop-cart-btn-wrap">
|
47 |
+
<?php
|
48 |
+
echo apply_filters( 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
|
49 |
+
sprintf( '<a href="%s" data-quantity="%s" class="%s" %s>%s</a>',
|
50 |
+
esc_url( $product->add_to_cart_url() ),
|
51 |
+
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
|
52 |
+
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
|
53 |
+
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
|
54 |
+
esc_html( $product->add_to_cart_text() )
|
55 |
+
),
|
56 |
+
$product, $args );
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
|
templates/loop/course-author.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display loop thumbnail
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
global $post;
|
12 |
+
?>
|
13 |
+
|
14 |
+
<div class="tutor-loop-author">
|
15 |
+
<?php
|
16 |
+
global $authordata;
|
17 |
+
?>
|
18 |
+
<p> <a href="<?php echo tutor_utils()->profile_url($authordata->ID); ?>"><?php echo get_the_author(); ?></a> </p>
|
19 |
+
</div>
|
templates/loop/course-price-edd.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Course loop price
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<div class="tutor-course-loop-price">
|
13 |
+
<?php
|
14 |
+
$course_id = get_the_ID();
|
15 |
+
$enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
|
16 |
+
$price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
|
17 |
+
if (tutor_utils()->is_course_purchasable()) {
|
18 |
+
$enroll_btn = tutor_course_loop_add_to_cart(false);
|
19 |
+
|
20 |
+
$product_id = tutor_utils()->get_course_product_id($course_id);
|
21 |
+
$price_html = '<p class="price"> '.$enroll_btn.' </p>';
|
22 |
+
}
|
23 |
+
|
24 |
+
echo $price_html;
|
25 |
+
?>
|
26 |
+
</div>
|
templates/loop/course-price-woocommerce.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Course loop price
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<div class="tutor-course-loop-price">
|
13 |
+
<?php
|
14 |
+
$course_id = get_the_ID();
|
15 |
+
$enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
|
16 |
+
$price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
|
17 |
+
if (tutor_utils()->is_course_purchasable()) {
|
18 |
+
$enroll_btn = tutor_course_loop_add_to_cart(false);
|
19 |
+
|
20 |
+
$product_id = tutor_utils()->get_course_product_id($course_id);
|
21 |
+
$product = wc_get_product( $product_id );
|
22 |
+
|
23 |
+
if ( $product ) {
|
24 |
+
$price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
echo $price_html;
|
29 |
+
?>
|
30 |
+
</div>
|
templates/loop/course-price.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Course loop price
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<div class="tutor-course-loop-price">
|
13 |
+
<?php
|
14 |
+
$course_id = get_the_ID();
|
15 |
+
$enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
|
16 |
+
$price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
|
17 |
+
if (tutor_utils()->is_course_purchasable()) {
|
18 |
+
$enroll_btn = tutor_course_loop_add_to_cart(false);
|
19 |
+
|
20 |
+
$product_id = tutor_utils()->get_course_product_id($course_id);
|
21 |
+
$product = wc_get_product( $product_id );
|
22 |
+
|
23 |
+
if ( $product ) {
|
24 |
+
$price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
echo $price_html;
|
29 |
+
?>
|
30 |
+
</div>
|
templates/loop/course.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* A single course loop
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
do_action('tutor_course/loop/before_content');
|
13 |
+
|
14 |
+
do_action('tutor_course/loop/badge');
|
15 |
+
|
16 |
+
|
17 |
+
do_action('tutor_course/loop/before_header');
|
18 |
+
do_action('tutor_course/loop/header');
|
19 |
+
do_action('tutor_course/loop/after_header');
|
20 |
+
|
21 |
+
|
22 |
+
do_action('tutor_course/loop/start_content_wrap');
|
23 |
+
|
24 |
+
do_action('tutor_course/loop/before_rating');
|
25 |
+
do_action('tutor_course/loop/rating');
|
26 |
+
do_action('tutor_course/loop/after_rating');
|
27 |
+
|
28 |
+
do_action('tutor_course/loop/before_title');
|
29 |
+
do_action('tutor_course/loop/title');
|
30 |
+
do_action('tutor_course/loop/after_title');
|
31 |
+
|
32 |
+
|
33 |
+
do_action('tutor_course/loop/before_meta');
|
34 |
+
do_action('tutor_course/loop/meta');
|
35 |
+
do_action('tutor_course/loop/after_meta');
|
36 |
+
|
37 |
+
|
38 |
+
do_action('tutor_course/loop/before_excerpt');
|
39 |
+
do_action('tutor_course/loop/excerpt');
|
40 |
+
do_action('tutor_course/loop/after_excerpt');
|
41 |
+
|
42 |
+
do_action('tutor_course/loop/end_content_wrap');
|
43 |
+
|
44 |
+
do_action('tutor_course/loop/before_footer');
|
45 |
+
do_action('tutor_course/loop/footer');
|
46 |
+
do_action('tutor_course/loop/after_footer');
|
47 |
+
|
48 |
+
do_action('tutor_course/loop/after_content');
|
49 |
+
|
50 |
+
?>
|
templates/loop/end_content_wrap.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
</div>
|
templates/loop/footer.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="tutor-loop-course-footer">
|
2 |
+
<?php
|
3 |
+
$course_duration = get_tutor_course_duration_context();
|
4 |
+
$course_students = tutor_utils()->count_enrolled_users_by_course();
|
5 |
+
if(!empty($course_duration)) echo "<i class='tutor-icon-clock'></i> <span>$course_duration</span>";
|
6 |
+
if(!empty($course_students)) echo "<i class='tutor-icon-user'></i> <span>$course_students</span>";
|
7 |
+
tutor_course_loop_price();
|
8 |
+
?>
|
9 |
+
</div>
|
templates/loop/header.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="tutor-course-header">
|
2 |
+
<?php
|
3 |
+
tutor_course_loop_thumbnail();
|
4 |
+
|
5 |
+
$course_id = get_the_ID();
|
6 |
+
?>
|
7 |
+
<div class="tutor-course-loop-header-meta">
|
8 |
+
<?php
|
9 |
+
$is_wishlisted = tutor_utils()->is_wishlisted($course_id);
|
10 |
+
$has_wish_list = '';
|
11 |
+
if ($is_wishlisted){
|
12 |
+
$has_wish_list = 'has-wish-listed';
|
13 |
+
}
|
14 |
+
|
15 |
+
echo '<span class="tutor-course-loop-level">'.get_tutor_course_level().'</span>';
|
16 |
+
echo '<span class="tutor-course-wishlist"><a href="javascript:;" class="tutor-icon-fav-line tutor-course-wishlist-btn '.$has_wish_list.' " data-course-id="'.$course_id.'"></a> </span>';
|
17 |
+
?>
|
18 |
+
</div>
|
19 |
+
</div>
|
templates/loop/loop-after-content.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Course Loop End
|
4 |
+
*
|
5 |
+
* This template can be overridden by copying it to yourtheme/woocommerce/loop/loop-end.php.
|
6 |
+
*
|
7 |
+
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
8 |
+
* (the theme developer) will need to copy the new files to your theme to
|
9 |
+
* maintain compatibility. We try to do this as little as possible, but it does
|
10 |
+
* happen. When this occurs the version of the template file will be bumped and
|
11 |
+
* the readme will list any important changes.
|
12 |
+
*
|
13 |
+
* @see https://docs.woocommerce.com/document/template-structure/
|
14 |
+
* @author WooThemes
|
15 |
+
* @package WooCommerce/Templates
|
16 |
+
* @version 2.0.0
|
17 |
+
*/
|
18 |
+
|
19 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
20 |
+
exit;
|
21 |
+
}
|
22 |
+
?>
|
23 |
+
</div>
|
24 |
+
</div>
|
templates/loop/loop-before-content.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Course Loop End
|
4 |
+
*
|
5 |
+
* This template can be overridden by copying it to yourtheme/woocommerce/loop/loop-end.php.
|
6 |
+
*
|
7 |
+
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
8 |
+
* (the theme developer) will need to copy the new files to your theme to
|
9 |
+
* maintain compatibility. We try to do this as little as possible, but it does
|
10 |
+
* happen. When this occurs the version of the template file will be bumped and
|
11 |
+
* the readme will list any important changes.
|
12 |
+
*
|
13 |
+
* @see https://docs.woocommerce.com/document/template-structure/
|
14 |
+
* @author WooThemes
|
15 |
+
* @package WooCommerce/Templates
|
16 |
+
* @version 2.0.0
|
17 |
+
*/
|
18 |
+
|
19 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
20 |
+
exit;
|
21 |
+
}
|
22 |
+
?>
|
23 |
+
<div class="<?php tutor_course_loop_col_classes(); ?>">
|
24 |
+
<div class="<?php tutor_course_loop_wrap_classes(); ?>">
|
templates/loop/loop-end.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Course Loop End
|
4 |
+
*
|
5 |
+
* This template can be overridden by copying it to yourtheme/woocommerce/loop/loop-end.php.
|
6 |
+
*
|
7 |
+
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
8 |
+
* (the theme developer) will need to copy the new files to your theme to
|
9 |
+
* maintain compatibility. We try to do this as little as possible, but it does
|
10 |
+
* happen. When this occurs the version of the template file will be bumped and
|
11 |
+
* the readme will list any important changes.
|
12 |
+
*
|
13 |
+
* @see https://docs.woocommerce.com/document/template-structure/
|
14 |
+
* @author WooThemes
|
15 |
+
* @package WooCommerce/Templates
|
16 |
+
* @version 2.0.0
|
17 |
+
*/
|
18 |
+
|
19 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
20 |
+
exit;
|
21 |
+
}
|
22 |
+
?>
|
23 |
+
</div>
|
templates/loop/loop-start.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Course Loop Start
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
$courseCols = tutor_utils()->get_option( 'courses_col_per_row', 4 );
|
15 |
+
|
16 |
+
?>
|
17 |
+
|
18 |
+
<div class="tutor-courses tutor-courses-loop-wrap tutor-courses-layout-<?php echo $courseCols; ?>">
|
templates/loop/meta.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
global $post, $authordata;
|
3 |
+
|
4 |
+
$profile_url = tutor_utils()->profile_url($authordata->ID);
|
5 |
+
?>
|
6 |
+
<div class="tutor-loop-author">
|
7 |
+
<div class="tutor-single-course-avatar">
|
8 |
+
<a href="<?php echo $profile_url; ?>"> <?php echo tutor_utils()->get_tutor_avatar($post->post_author); ?></a>
|
9 |
+
</div>
|
10 |
+
|
11 |
+
<div class="tutor-single-course-author-name">
|
12 |
+
<strong><?php _e('by', 'tutor'); ?></strong>
|
13 |
+
<a href="<?php echo $profile_url; ?>"><?php echo get_the_author(); ?></a>
|
14 |
+
</div>
|
15 |
+
|
16 |
+
<div class="tutor-course-lising-category">
|
17 |
+
<?php
|
18 |
+
$course_categories = get_tutor_course_categories();
|
19 |
+
if(!empty($course_categories) && is_array($course_categories ) && count($course_categories)){
|
20 |
+
?>
|
21 |
+
<strong><?php esc_html_e('In', 'tutor') ?></strong>
|
22 |
+
<?php
|
23 |
+
foreach ($course_categories as $course_category){
|
24 |
+
$category_name = $course_category->name;
|
25 |
+
$category_link = get_term_link($course_category->term_id);
|
26 |
+
echo "<a href='$category_link'>$category_name</a>";
|
27 |
+
}
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
</div>
|
31 |
+
</div>
|
templates/loop/rating.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* A single course loop rating
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
?>
|
15 |
+
|
16 |
+
<div class="tutor-loop-rating-wrap">
|
17 |
+
<?php
|
18 |
+
$course_rating = tutor_utils()->get_course_rating();
|
19 |
+
tutor_utils()->star_rating_generator($course_rating->rating_avg);
|
20 |
+
?>
|
21 |
+
</div>
|
templates/loop/start_content_wrap.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<div class="tutor-loop-course-container">
|
templates/loop/thumbnail.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display loop thumbnail
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<a href="<?php the_permalink(); ?>"> <?php get_tutor_course_thumbnail(); ?> </a>
|
templates/loop/title.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Course loop title
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<div class="tutor-course-loop-title">
|
13 |
+
<a href="<?php echo get_the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
|
14 |
+
</div>
|
templates/loop/tutor-pagination.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* A single course loop pagination
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
?>
|
15 |
+
|
16 |
+
<?php do_action('tutor_course/archive/pagination/before'); ?>
|
17 |
+
|
18 |
+
<div class="tutor-pagination-wrap">
|
19 |
+
<?php
|
20 |
+
global $wp_query;
|
21 |
+
$big = 999999999; // need an unlikely integer
|
22 |
+
|
23 |
+
echo paginate_links( array(
|
24 |
+
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
|
25 |
+
'format' => '?paged=%#%',
|
26 |
+
'current' => max( 1, get_query_var('paged') ),
|
27 |
+
'total' => $wp_query->max_num_pages
|
28 |
+
) );
|
29 |
+
?>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<?php do_action('tutor_course/archive/pagination/after'); ?>
|
templates/profile/bio.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$user_name = sanitize_text_field(get_query_var('tutor_student_username'));
|
3 |
+
$get_user = tutor_utils()->get_user_by_login($user_name);
|
4 |
+
$user_id = $get_user->ID;
|
5 |
+
|
6 |
+
|
7 |
+
$profile_bio = get_user_meta($user_id, '_tutor_profile_bio', true);
|
8 |
+
if ($profile_bio){
|
9 |
+
?>
|
10 |
+
<h3><?php _e('About Me:', 'tutor'); ?></h3>
|
11 |
+
<?php echo wpautop($profile_bio) ?>
|
12 |
+
<?php } else{
|
13 |
+
_e('Bio data is empty', 'tutor');
|
14 |
+
} ?>
|
templates/profile/courses_taken.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$user_name = sanitize_text_field(get_query_var('tutor_student_username'));
|
3 |
+
$get_user = tutor_utils()->get_user_by_login($user_name);
|
4 |
+
$user_id = $get_user->ID;
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
$pageposts = tutor_utils()->get_courses_by_instructor($user_id);
|
9 |
+
?>
|
10 |
+
|
11 |
+
|
12 |
+
<div class="tutor-courses <?php tutor_container_classes() ?>">
|
13 |
+
<?php if ($pageposts):
|
14 |
+
global $post;
|
15 |
+
foreach ($pageposts as $post):
|
16 |
+
setup_postdata($post);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @hook tutor_course/archive/before_loop_course
|
20 |
+
* @type action
|
21 |
+
* Usage Idea, you may keep a loop within a wrap, such as bootstrap col
|
22 |
+
*/
|
23 |
+
do_action('tutor_course/archive/before_loop_course');
|
24 |
+
|
25 |
+
tutor_load_template('loop.course');
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @hook tutor_course/archive/after_loop_course
|
29 |
+
* @type action
|
30 |
+
* Usage Idea, If you start any div before course loop, you can end it here, such as </div>
|
31 |
+
*/
|
32 |
+
do_action('tutor_course/archive/after_loop_course');
|
33 |
+
|
34 |
+
endforeach;
|
35 |
+
else : ?>
|
36 |
+
<div>
|
37 |
+
<h2><?php _e("Not Found" , 'tutor'); ?></h2>
|
38 |
+
<p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p>
|
39 |
+
</div>
|
40 |
+
<?php endif; ?>
|
41 |
+
</div>
|
templates/profile/enrolled_course.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$user_name = sanitize_text_field(get_query_var('tutor_student_username'));
|
3 |
+
$get_user = tutor_utils()->get_user_by_login($user_name);
|
4 |
+
$user_id = $get_user->ID;
|
5 |
+
|
6 |
+
$my_courses = tutor_utils()->get_enrolled_courses_by_user($user_id);
|
7 |
+
?>
|
8 |
+
|
9 |
+
<div class="tutor-courses <?php tutor_container_classes() ?>">
|
10 |
+
<?php
|
11 |
+
if ($my_courses && $my_courses->have_posts()):
|
12 |
+
while ($my_courses->have_posts()):
|
13 |
+
$my_courses->the_post();
|
14 |
+
/**
|
15 |
+
* @hook tutor_course/archive/before_loop_course
|
16 |
+
* @type action
|
17 |
+
* Usage Idea, you may keep a loop within a wrap, such as bootstrap col
|
18 |
+
*/
|
19 |
+
do_action('tutor_course/archive/before_loop_course');
|
20 |
+
|
21 |
+
tutor_load_template('loop.course');
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @hook tutor_course/archive/after_loop_course
|
25 |
+
* @type action
|
26 |
+
* Usage Idea, If you start any div before course loop, you can end it here, such as </div>
|
27 |
+
*/
|
28 |
+
do_action('tutor_course/archive/after_loop_course');
|
29 |
+
|
30 |
+
endwhile;
|
31 |
+
wp_reset_postdata();
|
32 |
+
else : ?>
|
33 |
+
<div>
|
34 |
+
<h2><?php _e("Not Found" , 'tutor'); ?></h2>
|
35 |
+
<p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p>
|
36 |
+
</div>
|
37 |
+
<?php endif; ?>
|
38 |
+
</div>
|
39 |
+
|
templates/profile/reviews_wrote.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$user_name = sanitize_text_field(get_query_var('tutor_student_username'));
|
3 |
+
$get_user = tutor_utils()->get_user_by_login($user_name);
|
4 |
+
$user_id = $get_user->ID;
|
5 |
+
|
6 |
+
|
7 |
+
$reviews = tutor_utils()->get_reviews_by_user($user_id);
|
8 |
+
|
9 |
+
if ( ! is_array($reviews) || ! count($reviews)){ ?>
|
10 |
+
<div>
|
11 |
+
<h2><?php _e("Not Found" , 'tutor'); ?></h2>
|
12 |
+
<p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p>
|
13 |
+
</div>
|
14 |
+
<?php
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class=" tutor-course-reviews-wrap">
|
20 |
+
<div class="course-target-reviews-title">
|
21 |
+
<h4><?php _e(sprintf('Reviews wrote by %s ', $get_user->display_name), 'tutor'); ?></h4>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="tutor-reviews-list">
|
25 |
+
<?php
|
26 |
+
foreach ($reviews as $review){
|
27 |
+
$profile_url = tutor_utils()->profile_url($review->user_id);
|
28 |
+
?>
|
29 |
+
<div class="tutor-review-individual-item tutor-review-<?php echo $review->comment_ID; ?>">
|
30 |
+
<div class="review-left">
|
31 |
+
<div class="review-avatar">
|
32 |
+
<a href="<?php echo $profile_url; ?>">
|
33 |
+
<?php echo tutor_utils()->get_tutor_avatar($review->user_id); ?>
|
34 |
+
</a>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="review-time-name">
|
38 |
+
|
39 |
+
<p> <a href="<?php echo $profile_url; ?>"> <?php echo $review->display_name; ?> </a> </p>
|
40 |
+
<p class="review-meta">
|
41 |
+
<?php _e(sprintf('%s ago', human_time_diff(strtotime($review->comment_date))), 'tutor'); ?>
|
42 |
+
</p>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div class="review-content review-right">
|
47 |
+
|
48 |
+
<div class="individual-review-course-name">
|
49 |
+
<?php _e('On', 'tutor'); ?>
|
50 |
+
<a href="<?php echo get_the_permalink($review->comment_post_ID); ?>"><?php echo get_the_title
|
51 |
+
($review->comment_post_ID);
|
52 |
+
?></a>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<div class="individual-review-rating-wrap">
|
56 |
+
<?php tutor_utils()->star_rating_generator($review->rating); ?>
|
57 |
+
</div>
|
58 |
+
<?php echo wpautop($review->comment_content); ?>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
?>
|
64 |
+
</div>
|
65 |
+
</div>
|
templates/single-course-enrolled-announcements.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
do_action('tutor_course/single/enrolled/before/wrap');
|
14 |
+
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div <?php tutor_post_class('tutor-single-anouncement-wrap tutor-page-wrap'); ?>>
|
18 |
+
<div class="tutor-container">
|
19 |
+
<div class="tutor-row">
|
20 |
+
<div class="tutor-col-8">
|
21 |
+
<?php do_action('tutor_course/single/enrolled/before/wrap'); ?>
|
22 |
+
<?php tutor_course_enrolled_lead_info(); ?>
|
23 |
+
<?php tutor_course_enrolled_nav(); ?>
|
24 |
+
<?php tutor_course_announcements(); ?>
|
25 |
+
<?php do_action('tutor_course/single/enrolled/after/wrap'); ?>
|
26 |
+
</div>
|
27 |
+
<div class="tutor-col-4">
|
28 |
+
<div class="tutor-single-course-sidebar">
|
29 |
+
<?php tutor_course_enroll_box(); ?>
|
30 |
+
<?php tutor_course_requirements_html(); ?>
|
31 |
+
<?php tutor_course_tags_html(); ?>
|
32 |
+
<?php tutor_course_target_audience_html(); ?>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<?php
|
39 |
+
do_action('tutor_course/single/enrolled/after/wrap');
|
40 |
+
get_footer();
|
templates/single-course-enrolled-overview.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
do_action('tutor_course/single/enrolled/before/wrap');
|
14 |
+
|
15 |
+
?>
|
16 |
+
<div <?php tutor_post_class('tutor-single-overview-wrap tutor-page-wrap'); ?>>
|
17 |
+
<div class="tutor-container">
|
18 |
+
<div class="tutor-row">
|
19 |
+
<div class="tutor-col-8">
|
20 |
+
<?php tutor_course_enrolled_lead_info(); ?>
|
21 |
+
<?php tutor_course_enrolled_nav(); ?>
|
22 |
+
<?php tutor_course_content(); ?>
|
23 |
+
<?php get_tutor_posts_attachments(); ?>
|
24 |
+
</div>
|
25 |
+
<div class="tutor-col-4">
|
26 |
+
<div class="tutor-single-course-sidebar">
|
27 |
+
<?php tutor_course_enroll_box(); ?>
|
28 |
+
<?php tutor_course_requirements_html(); ?>
|
29 |
+
<?php tutor_course_tags_html(); ?>
|
30 |
+
<?php tutor_course_target_audience_html(); ?>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div><!-- .wrap -->
|
36 |
+
<?php
|
37 |
+
do_action('tutor_course/single/enrolled/after/wrap');
|
38 |
+
get_footer();
|
templates/single-course-enrolled-questions.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
?>
|
14 |
+
|
15 |
+
<?php do_action( 'tutor_course/single/enrolled/before/wrap' ); ?>
|
16 |
+
|
17 |
+
<div <?php tutor_post_class('tutor-question-answare-wrap tutor-page-wrap'); ?>>
|
18 |
+
<div class="tutor-container">
|
19 |
+
<div class="tutor-row">
|
20 |
+
<div class="tutor-col-8">
|
21 |
+
<?php tutor_course_enrolled_lead_info(); ?>
|
22 |
+
<?php tutor_course_enrolled_nav(); ?>
|
23 |
+
<?php tutor_course_question_and_answer(); ?>
|
24 |
+
</div>
|
25 |
+
<div class="tutor-col-4">
|
26 |
+
<div class="tutor-single-course-sidebar">
|
27 |
+
<?php tutor_course_enroll_box(); ?>
|
28 |
+
<?php tutor_course_requirements_html(); ?>
|
29 |
+
<?php tutor_course_tags_html(); ?>
|
30 |
+
<?php tutor_course_target_audience_html(); ?>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div><!-- .wrap -->
|
36 |
+
|
37 |
+
<?php
|
38 |
+
do_action('tutor_course/single/enrolled/after/wrap');
|
39 |
+
get_footer();
|
templates/single-course-enrolled.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
|
14 |
+
do_action('tutor_course/single/enrolled/before/wrap');
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div <?php tutor_post_class('tutor-full-width-course-top tutor-course-top-info tutor-page-wrap'); ?>>
|
18 |
+
<div class="tutor-container">
|
19 |
+
<div class="tutor-row">
|
20 |
+
<div class="tutor-col-8">
|
21 |
+
<?php do_action('tutor_course/single/enrolled/before/inner-wrap'); ?>
|
22 |
+
<?php tutor_course_enrolled_lead_info(); ?>
|
23 |
+
<?php tutor_course_enrolled_nav(); ?>
|
24 |
+
<?php tutor_course_topics(); ?>
|
25 |
+
<?php tutor_course_instructors_html(); ?>
|
26 |
+
<?php tutor_course_target_reviews_html(); ?>
|
27 |
+
<?php tutor_course_target_review_form_html(); ?>
|
28 |
+
<?php do_action('tutor_course/single/enrolled/after/inner-wrap'); ?>
|
29 |
+
</div>
|
30 |
+
<div class="tutor-col-4">
|
31 |
+
<div class="tutor-single-course-sidebar">
|
32 |
+
<?php tutor_course_enroll_box(); ?>
|
33 |
+
<?php tutor_course_requirements_html(); ?>
|
34 |
+
<?php tutor_course_tags_html(); ?>
|
35 |
+
<?php tutor_course_target_audience_html(); ?>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
|
43 |
+
<?php do_action('tutor_course/single/enrolled/after/wrap'); ?>
|
44 |
+
|
45 |
+
<?php
|
46 |
+
get_footer();
|
templates/single-course.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
?>
|
13 |
+
|
14 |
+
|
15 |
+
<?php do_action('tutor_course/single/before/wrap'); ?>
|
16 |
+
|
17 |
+
|
18 |
+
<div <?php tutor_post_class('tutor-full-width-course-top tutor-course-top-info tutor-page-wrap'); ?>>
|
19 |
+
<div class="tutor-container">
|
20 |
+
<div class="tutor-row">
|
21 |
+
<div class="tutor-col-8">
|
22 |
+
|
23 |
+
<?php do_action('tutor_course/single/before/inner-wrap'); ?>
|
24 |
+
|
25 |
+
<?php tutor_course_lead_info(); ?>
|
26 |
+
<?php tutor_course_benefits_html(); ?>
|
27 |
+
<?php tutor_course_topics(); ?>
|
28 |
+
<?php tutor_course_content(); ?>
|
29 |
+
<?php tutor_course_instructors_html(); ?>
|
30 |
+
<?php tutor_course_target_reviews_html(); ?>
|
31 |
+
|
32 |
+
<?php do_action('tutor_course/single/after/inner-wrap'); ?>
|
33 |
+
|
34 |
+
</div> <!-- .tutor-col-8 -->
|
35 |
+
|
36 |
+
<div class="tutor-col-4">
|
37 |
+
<div class="tutor-single-course-sidebar">
|
38 |
+
<?php tutor_course_enroll_box(); ?>
|
39 |
+
<?php tutor_course_requirements_html(); ?>
|
40 |
+
<?php tutor_course_tags_html(); ?>
|
41 |
+
<?php tutor_course_target_audience_html(); ?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<?php do_action('tutor_course/single/after/wrap'); ?>
|
49 |
+
|
50 |
+
<?php
|
51 |
+
get_footer();
|
templates/single-lesson.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single lesson
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
global $post;
|
14 |
+
$currentPost = $post;
|
15 |
+
?>
|
16 |
+
|
17 |
+
<?php do_action('tutor_lesson/single/before/wrap'); ?>
|
18 |
+
<div class="tutor-single-lesson-wrap ">
|
19 |
+
|
20 |
+
<div class="tutor-lesson-sidebar">
|
21 |
+
<?php tutor_lessons_sidebar(); ?>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div id="tutor-single-lesson-entry-content" class="tutor-lesson-content tutor-single-lesson-entry-content-<?php the_ID(); ?>">
|
25 |
+
<?php tutor_lesson_content(); ?>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
</div>
|
29 |
+
<?php do_action('tutor_lesson/single/after/wrap');
|
30 |
+
|
31 |
+
get_footer();
|
templates/single-preview-lesson.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single lesson
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
global $post;
|
14 |
+
$currentPost = $post;
|
15 |
+
?>
|
16 |
+
|
17 |
+
<?php do_action('tutor_lesson/single/before/wrap'); ?>
|
18 |
+
<div <?php tutor_post_class('tutor-single-lesson-wrap tutor-page-wrap'); ?>>
|
19 |
+
<div class="tutor-container">
|
20 |
+
<div class="tutor-row">
|
21 |
+
<div class="tutor-col-12">
|
22 |
+
<?php tutor_lesson_video(); ?>
|
23 |
+
<?php the_content(); ?>
|
24 |
+
<?php get_tutor_posts_attachments(); ?>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<?php do_action('tutor_lesson/single/after/wrap');
|
31 |
+
|
32 |
+
get_footer();
|
templates/single-quiz.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single quiz
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
get_header();
|
12 |
+
|
13 |
+
$course = tutor_utils()->get_course_by_quiz(get_the_ID());
|
14 |
+
?>
|
15 |
+
|
16 |
+
<?php do_action('tutor_quiz/single/before/wrap'); ?>
|
17 |
+
|
18 |
+
<div <?php tutor_post_class('tutor-page-wrap'); ?>>
|
19 |
+
<div class="tutor-quiz-single-wrap tutor-container">
|
20 |
+
<input type="hidden" name="tutor_quiz_id" id="tutor_quiz_id" value="<?php the_ID(); ?>">
|
21 |
+
|
22 |
+
<?php
|
23 |
+
if ($course){
|
24 |
+
tutor_single_quiz_top();
|
25 |
+
tutor_single_quiz_body();
|
26 |
+
}else{
|
27 |
+
tutor_single_quiz_no_course_belongs();
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
|
31 |
+
</div>
|
32 |
+
</div><!-- .wrap -->
|
33 |
+
|
34 |
+
<?php do_action('tutor_quiz/single/after/wrap');
|
35 |
+
|
36 |
+
get_footer();
|
templates/single/course/add-to-cart-edd.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$product_id = tutor_utils()->get_course_product_id();
|
3 |
+
$download = new EDD_Download( $product_id );
|
4 |
+
|
5 |
+
if ($download->ID) {
|
6 |
+
?>
|
7 |
+
<div class="tutor-course-purchase-box">
|
8 |
+
<?php
|
9 |
+
echo edd_get_purchase_link( array( 'download_id' => $download->ID ) );
|
10 |
+
?>
|
11 |
+
</div>
|
12 |
+
<?php
|
13 |
+
}else{
|
14 |
+
?>
|
15 |
+
<p class="tutor-alert-warning">
|
16 |
+
<?php _e('Please make sure that your EDD product exists and valid for this course', 'tutor'); ?>
|
17 |
+
</p>
|
18 |
+
<?php
|
19 |
+
}
|
templates/single/course/add-to-cart-woocommerce.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$product_id = tutor_utils()->get_course_product_id();
|
4 |
+
$product = wc_get_product( $product_id );
|
5 |
+
if ($product) {
|
6 |
+
?>
|
7 |
+
|
8 |
+
<div class="tutor-course-purchase-box">
|
9 |
+
|
10 |
+
<form class="cart"
|
11 |
+
action="<?php echo esc_url( apply_filters( 'tutor_course_add_to_cart_form_action', get_permalink( get_the_ID() ) ) ); ?>"
|
12 |
+
method="post" enctype='multipart/form-data'>
|
13 |
+
|
14 |
+
<?php do_action( 'tutor_before_add_to_cart_button' ); ?>
|
15 |
+
|
16 |
+
<button type="submit" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" class="single_add_to_cart_button button alt"> <i class="tutor-icon-shopping-cart"></i> <?php echo esc_html( $product->single_add_to_cart_text() ); ?>
|
17 |
+
</button>
|
18 |
+
|
19 |
+
<?php do_action( 'tutor_after_add_to_cart_button' ); ?>
|
20 |
+
</form>
|
21 |
+
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<?php
|
25 |
+
}else{
|
26 |
+
?>
|
27 |
+
<p class="tutor-alert-warning">
|
28 |
+
<?php _e('Please make sure that your product exists and valid for this course', 'tutor'); ?>
|
29 |
+
</p>
|
30 |
+
<?php
|
31 |
+
}
|
templates/single/course/add-to-cart.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display single course add to cart
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
$tutor_form_class = apply_filters( 'tutor_enroll_form_classes', array(
|
15 |
+
'tutor-enroll-form',
|
16 |
+
) );
|
17 |
+
|
18 |
+
$is_purchasable = tutor_utils()->is_course_purchasable();
|
19 |
+
$tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
|
20 |
+
|
21 |
+
do_action('tutor_course/single/add-to-cart/before');
|
22 |
+
?>
|
23 |
+
|
24 |
+
<div class="tutor-single-add-to-cart-box">
|
25 |
+
<?php
|
26 |
+
if ($is_purchasable && $tutor_course_sell_by){
|
27 |
+
tutor_load_template('single.course.add-to-cart-'.$tutor_course_sell_by);
|
28 |
+
}else{
|
29 |
+
?>
|
30 |
+
<form class="<?php echo implode( ' ', $tutor_form_class ); ?>" method="post">
|
31 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
32 |
+
<input type="hidden" name="tutor_course_id" value="<?php echo get_the_ID(); ?>">
|
33 |
+
<input type="hidden" name="tutor_course_action" value="_tutor_course_enroll_now">
|
34 |
+
|
35 |
+
<div class=" tutor-course-enroll-wrap">
|
36 |
+
<button type="submit" class="tutor-btn-enroll tutor-btn tutor-course-purchase-btn">
|
37 |
+
<?php _e('Enroll Now', 'tutor'); ?>
|
38 |
+
</button>
|
39 |
+
</div>
|
40 |
+
</form>
|
41 |
+
|
42 |
+
<?php } ?>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<?php do_action('tutor_course/single/add-to-cart/after'); ?>
|
templates/single/course/complete_form.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Display attachments
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
|
14 |
+
do_action('tutor_course/single/before/complete_form');
|
15 |
+
|
16 |
+
$is_completed_course = tutor_utils()->is_completed_course();
|
17 |
+
if ( ! $is_completed_course) {
|
18 |
+
?>
|
19 |
+
<div class="tutor-course-compelte-form-wrap">
|
20 |
+
|
21 |
+
<form method="post">
|
22 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
23 |
+
|
24 |
+
<input type="hidden" value="<?php echo get_the_ID(); ?>" name="course_id"/>
|
25 |
+
<input type="hidden" value="tutor_complete_course" name="tutor_action"/>
|
26 |
+
|
27 |
+
<button type="submit" class="course-complete-button" name="complete_course_btn" value="complete_course"><?php _e( 'Complete Course', 'tutor' ); ?></button>
|
28 |
+
</form>
|
29 |
+
</div>
|
30 |
+
<?php
|
31 |
+
}
|
32 |
+
do_action('tutor_course/single/after/complete_form'); ?>
|
templates/single/course/course-benefits.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course benefits
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
do_action('tutor_course/single/before/benefits');
|
14 |
+
|
15 |
+
|
16 |
+
$course_benefits = tutor_course_benefits();
|
17 |
+
if ( empty($course_benefits)){
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
|
21 |
+
if (is_array($course_benefits) && count($course_benefits)){
|
22 |
+
?>
|
23 |
+
|
24 |
+
<div class="tutor-single-course-segment tutor-course-benefits-wrap">
|
25 |
+
|
26 |
+
<div class="course-benefits-title">
|
27 |
+
<h4 class="tutor-segment-title"><?php _e('What Will I Learn?', 'tutor'); ?></h4>
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<div class="tutor-course-benefits-content">
|
31 |
+
<ul class="tutor-course-benefits-items tutor-custom-list-style">
|
32 |
+
<?php
|
33 |
+
foreach ($course_benefits as $benefit){
|
34 |
+
echo "<li>{$benefit}</li>";
|
35 |
+
}
|
36 |
+
?>
|
37 |
+
</ul>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<?php } ?>
|
42 |
+
|
43 |
+
<?php do_action('tutor_course/single/after/benefits'); ?>
|
44 |
+
|
templates/single/course/course-content.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course content
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
do_action('tutor_course/single/before/content');
|
14 |
+
|
15 |
+
global $post;
|
16 |
+
$content = get_the_content();
|
17 |
+
if ( empty($content)){
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
?>
|
21 |
+
|
22 |
+
<div class="tutor-single-course-segment tutor-course-content-wrap">
|
23 |
+
<div class="course-content-title">
|
24 |
+
<h4 class="tutor-segment-title"><?php _e('Description', 'tutor'); ?></h4>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div class="tutor-course-content-content">
|
28 |
+
<?php echo wpautop($content); ?>
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
|
33 |
+
<?php do_action('tutor_course/single/after/content'); ?>
|
templates/single/course/course-enroll-box.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course content
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="tutor-price-preview-box">
|
16 |
+
<div class="tutor-price-box-thumbnail">
|
17 |
+
<?php
|
18 |
+
if(tutor_utils()->has_video_in_single()){
|
19 |
+
tutor_course_video();
|
20 |
+
} else{
|
21 |
+
get_tutor_course_thumbnail();
|
22 |
+
}
|
23 |
+
?>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<?php do_action('tutor_course/single/enroll_box/after_thumbnail'); ?>
|
27 |
+
|
28 |
+
<?php tutor_course_price(); ?>
|
29 |
+
<?php tutor_course_material_includes_html(); ?>
|
30 |
+
<?php tutor_single_course_add_to_cart(); ?>
|
31 |
+
|
32 |
+
</div> <!-- tutor-price-preview-box -->
|
templates/single/course/course-enrolled-box.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course content
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="tutor-price-preview-box">
|
16 |
+
<div class="tutor-price-box-thumbnail">
|
17 |
+
<?php
|
18 |
+
if(tutor_utils()->has_video_in_single()){
|
19 |
+
tutor_course_video();
|
20 |
+
} else{
|
21 |
+
get_tutor_course_thumbnail();
|
22 |
+
}
|
23 |
+
?>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<?php tutor_course_price(); ?>
|
27 |
+
<?php tutor_course_material_includes_html(); ?>
|
28 |
+
|
29 |
+
<div class="tutor-single-course-segment tutor-course-enrolled-wrap">
|
30 |
+
<h><?php _e('Enrolled', 'tutor'); ?></h>
|
31 |
+
<p>
|
32 |
+
<?php
|
33 |
+
$enrolled = tutor_utils()->is_enrolled();
|
34 |
+
_e(sprintf("Enrolled at : %s", date(get_option('date_format'), strtotime($enrolled->post_date)) ), 'tutor');
|
35 |
+
?>
|
36 |
+
</p>
|
37 |
+
<?php
|
38 |
+
$lesson_url = tutor_utils()->get_course_first_lesson();
|
39 |
+
if ($lesson_url){
|
40 |
+
?>
|
41 |
+
<a href="<?php echo $lesson_url; ?>" class="tutor-button"><?php _e('Start Course', 'tutor'); ?></a>
|
42 |
+
<?php } ?>
|
43 |
+
|
44 |
+
<?php do_action('tutor_enrolled_box_after') ?>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
|
48 |
+
</div> <!-- tutor-price-preview-box -->
|
49 |
+
|
templates/single/course/course-requirements.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course requirements
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
do_action('tutor_course/single/before/requirements');
|
13 |
+
|
14 |
+
$course_requirements = tutor_course_requirements();
|
15 |
+
|
16 |
+
if ( empty($course_requirements)){
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
if (is_array($course_requirements) && count($course_requirements)){
|
21 |
+
?>
|
22 |
+
|
23 |
+
<div class="tutor-single-course-segment tutor-course-requirements-wrap">
|
24 |
+
|
25 |
+
<div class="course-requirements-title">
|
26 |
+
<h4 class="tutor-segment-title"><?php _e('Requirements', 'tutor'); ?></h4>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<div class="tutor-course-requirements-content">
|
30 |
+
<ul class="tutor-course-requirements-items tutor-custom-list-style">
|
31 |
+
<?php
|
32 |
+
foreach ($course_requirements as $requirement){
|
33 |
+
echo "<li>{$requirement}</li>";
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
</ul>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<?php } ?>
|
41 |
+
|
42 |
+
<?php do_action('tutor_course/single/after/requirements'); ?>
|
templates/single/course/course-target-audience.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course audience
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
do_action('tutor_course/single/before/audience');
|
13 |
+
|
14 |
+
$target_audience = tutor_course_target_audience();
|
15 |
+
|
16 |
+
if ( empty($target_audience)){
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
if (is_array($target_audience) && count($target_audience)){
|
21 |
+
?>
|
22 |
+
|
23 |
+
<div class="tutor-single-course-segment tutor-course-target-audience-wrap">
|
24 |
+
|
25 |
+
<h4 class="tutor-segment-title"><?php _e('Target Audience', 'tutor'); ?></h4>
|
26 |
+
|
27 |
+
<div class="tutor-course-target-audience-content">
|
28 |
+
<ul class="tutor-course-target-audience-items tutor-custom-list-style">
|
29 |
+
<?php
|
30 |
+
foreach ($target_audience as $audience){
|
31 |
+
echo "<li>{$audience}</li>";
|
32 |
+
}
|
33 |
+
?>
|
34 |
+
</ul>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<?php } ?>
|
39 |
+
|
40 |
+
<?php do_action('tutor_course/single/after/audience'); ?>
|
41 |
+
|
templates/single/course/course-topics.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying single course
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
$topics = tutor_utils()->get_topics();
|
15 |
+
$course_id = get_the_ID();
|
16 |
+
|
17 |
+
?>
|
18 |
+
|
19 |
+
|
20 |
+
<?php do_action('tutor_course/single/before/topics'); ?>
|
21 |
+
|
22 |
+
<?php if($topics->have_posts()) { ?>
|
23 |
+
<div class="tutor-single-course-segment tutor-course-topics-wrap">
|
24 |
+
<div class="tutor-course-topics-header">
|
25 |
+
<div class="tutor-course-topics-header-left">
|
26 |
+
<h4 class="tutor-segment-title"><?php _e('Topics for this course', 'tutor'); ?></h4>
|
27 |
+
</div>
|
28 |
+
<div class="tutor-course-topics-header-right">
|
29 |
+
<?php
|
30 |
+
$tutor_lesson_count = tutor_utils()->get_lesson()->post_count;
|
31 |
+
$tutor_course_duration = get_tutor_course_duration_context($course_id);
|
32 |
+
|
33 |
+
if($tutor_lesson_count) {
|
34 |
+
echo "<span> $tutor_lesson_count";
|
35 |
+
_e(' Lessons', 'tutor');
|
36 |
+
echo "</span>";
|
37 |
+
}
|
38 |
+
if($tutor_course_duration){
|
39 |
+
echo "<span>$tutor_course_duration</span>";
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<div class="tutor-course-topics-contents">
|
45 |
+
<?php
|
46 |
+
|
47 |
+
$index = 0;
|
48 |
+
|
49 |
+
if ($topics->have_posts()){
|
50 |
+
while ($topics->have_posts()){ $topics->the_post();
|
51 |
+
$index++;
|
52 |
+
?>
|
53 |
+
|
54 |
+
<div class="tutor-course-topic <?php if($index == 1) echo "tutor-active"; ?>">
|
55 |
+
<div class="tutor-course-title">
|
56 |
+
<h4> <i class="tutor-icon-plus"></i> <?php the_title(); ?></h4>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
|
60 |
+
<div class="tutor-course-lessons">
|
61 |
+
|
62 |
+
<?php
|
63 |
+
$lessons = tutor_utils()->get_lessons_by_topic(get_the_ID());
|
64 |
+
if ($lessons->have_posts()){
|
65 |
+
while ($lessons->have_posts()){ $lessons->the_post();
|
66 |
+
|
67 |
+
$video = tutor_utils()->get_video_info();
|
68 |
+
|
69 |
+
$play_time = false;
|
70 |
+
if ($video){
|
71 |
+
$play_time = $video->playtime;
|
72 |
+
}
|
73 |
+
|
74 |
+
$lesson_icon = $play_time ? 'tutor-icon-youtube' : 'tutor-icon-document-alt';
|
75 |
+
?>
|
76 |
+
|
77 |
+
<div class="tutor-course-lesson">
|
78 |
+
<h5>
|
79 |
+
<?php
|
80 |
+
|
81 |
+
$lesson_title = "<i class='$lesson_icon'></i>";
|
82 |
+
$lesson_title .= get_the_title();
|
83 |
+
|
84 |
+
echo apply_filters('tutor_course/contents/lesson/title', $lesson_title, get_the_ID());
|
85 |
+
?>
|
86 |
+
</h5>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<?php
|
90 |
+
}
|
91 |
+
$lessons->reset_postdata();
|
92 |
+
}
|
93 |
+
?>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
<?php
|
97 |
+
}
|
98 |
+
$topics->reset_postdata();
|
99 |
+
}
|
100 |
+
?>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<?php } ?>
|
104 |
+
|
105 |
+
|
106 |
+
<?php do_action('tutor_course/single/after/topics'); ?>
|
templates/single/course/enrolled/announcements.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Announcements
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
$announcements = tutor_utils()->get_announcements(get_the_ID());
|
12 |
+
?>
|
13 |
+
|
14 |
+
<?php do_action('tutor_course/announcements/before'); ?>
|
15 |
+
<div class="tutor-announcements-wrap">
|
16 |
+
<?php
|
17 |
+
if (is_array($announcements) && count($announcements)){
|
18 |
+
?>
|
19 |
+
<?php
|
20 |
+
foreach ($announcements as $announcement){
|
21 |
+
?>
|
22 |
+
<div class="tutor-announcement">
|
23 |
+
<div class="tutor-announcement-title-wrap">
|
24 |
+
<h3><?php echo $announcement->post_title; ?></h3>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div class="tutor-announcement-meta tutor-text-mute">
|
28 |
+
<?php _e( sprintf("Posted by %s, at %s ago", 'admin', human_time_diff(strtotime($announcement->post_date)) ) , 'tutor' ); ?>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div class="tutor-announcement-content">
|
32 |
+
<?php echo tutor_utils()->announcement_content(wpautop(stripslashes($announcement->post_content))); ?>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
<?php
|
36 |
+
}
|
37 |
+
?>
|
38 |
+
<?php
|
39 |
+
}else{
|
40 |
+
?>
|
41 |
+
<div class="tutor-no-announcements">
|
42 |
+
<h2><?php _e('No announcements posted yet.', 'tutor'); ?></h2>
|
43 |
+
<p>
|
44 |
+
<?php _e('The instructor hasn’t added any announcements to this course yet. Announcements are used to inform you of updates or additions to the course.', 'tutor'); ?>
|
45 |
+
</p>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<?php
|
49 |
+
}
|
50 |
+
?>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<?php do_action('tutor_course/announcements/after'); ?>
|
templates/single/course/enrolled/completing-progress.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Progress bar
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
$completed_count = tutor_utils()->get_course_completed_percent();
|
11 |
+
|
12 |
+
do_action('tutor_course/single/enrolled/before/lead_info/progress_bar');
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="tutor-course-status">
|
16 |
+
<h4 class="tutor-segment-title"><?php _e('Course Status', 'tutor'); ?></h4>
|
17 |
+
<div class="tutor-progress-bar-wrap">
|
18 |
+
<div class="tutor-progress-bar">
|
19 |
+
<div class="tutor-progress-filled" style="--tutor-progress-left: <?php echo $completed_count.'%;'; ?>"></div>
|
20 |
+
</div>
|
21 |
+
<span class="tutor-progress-percent"><?php echo $completed_count; ?>% <?php _e(' Complete', 'tutor')?></span>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<?php
|
26 |
+
do_action('tutor_course/single/enrolled/after/lead_info/progress_bar');
|
27 |
+
?>
|
28 |
+
|
templates/single/course/enrolled/lead-info.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying lead info
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
global $wp_query;
|
15 |
+
global $post, $authordata;
|
16 |
+
|
17 |
+
$profile_url = tutor_utils()->profile_url($authordata->ID);
|
18 |
+
?>
|
19 |
+
<div class="tutor-single-course-segment tutor-single-course-lead-info">
|
20 |
+
<div class="tutor-leadinfo-top-meta">
|
21 |
+
<span class="tutor-single-course-rating">
|
22 |
+
<?php
|
23 |
+
$course_rating = tutor_utils()->get_course_rating();
|
24 |
+
tutor_utils()->star_rating_generator($course_rating->rating_avg);
|
25 |
+
?>
|
26 |
+
<span class="tutor-single-rating-count">
|
27 |
+
<?php
|
28 |
+
echo $course_rating->rating_avg;
|
29 |
+
echo '<i>('.$course_rating->rating_count.')</i>';
|
30 |
+
?>
|
31 |
+
</span>
|
32 |
+
</span>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<h1 class="tutor-course-header-h1"><?php the_title(); ?></h1>
|
36 |
+
|
37 |
+
<?php do_action('tutor_course/single/title/after'); ?>
|
38 |
+
<?php do_action('tutor_course/single/lead_meta/before'); ?>
|
39 |
+
|
40 |
+
<div class="tutor-single-course-meta tutor-meta-top">
|
41 |
+
<ul>
|
42 |
+
<li class="tutor-single-course-author-meta">
|
43 |
+
<div class="tutor-single-course-avatar">
|
44 |
+
<a href="<?php echo $profile_url; ?>"> <?php echo tutor_utils()->get_tutor_avatar($post->post_author); ?></a>
|
45 |
+
</div>
|
46 |
+
<div class="tutor-single-course-author-name">
|
47 |
+
<strong><?php _e('by', 'tutor'); ?></strong>
|
48 |
+
<a href="<?php echo tutor_utils()->profile_url($authordata->ID); ?>"><?php echo get_the_author(); ?></a>
|
49 |
+
</div>
|
50 |
+
</li>
|
51 |
+
<li class="tutor-course-level">
|
52 |
+
<strong><?php _e('Course level:', 'tutor'); ?></strong>
|
53 |
+
<?php echo get_tutor_course_level(); ?>
|
54 |
+
</li>
|
55 |
+
</ul>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
|
59 |
+
<div class="tutor-single-course-meta tutor-lead-meta">
|
60 |
+
<ul>
|
61 |
+
<?php
|
62 |
+
$course_categories = get_tutor_course_categories();
|
63 |
+
if(is_array($course_categories) && count($course_categories)){
|
64 |
+
?>
|
65 |
+
<li>
|
66 |
+
<strong><?php esc_html_e('Categories', 'tutor') ?></strong>
|
67 |
+
<?php
|
68 |
+
foreach ($course_categories as $course_category){
|
69 |
+
$category_name = $course_category->name;
|
70 |
+
$category_link = get_term_link($course_category->term_id);
|
71 |
+
echo "<a href='$category_link'>$category_name</a>";
|
72 |
+
}
|
73 |
+
?>
|
74 |
+
</li>
|
75 |
+
<?php } ?>
|
76 |
+
|
77 |
+
<?php
|
78 |
+
$course_duration = get_tutor_course_duration_context();
|
79 |
+
if(!empty($course_duration)){
|
80 |
+
?>
|
81 |
+
<li>
|
82 |
+
<strong><?php esc_html_e('Total Hour', 'tutor') ?></strong>
|
83 |
+
<span><?php echo $course_duration; ?></span>
|
84 |
+
</li>
|
85 |
+
<?php } ?>
|
86 |
+
<li>
|
87 |
+
<strong><?php esc_html_e('Total Enrolled', 'tutor') ?></strong>
|
88 |
+
<span>
|
89 |
+
<?php
|
90 |
+
$get_total_student = tutor_utils()->get_total_students();
|
91 |
+
$total_students = $get_total_student ? $get_total_student : 0;
|
92 |
+
echo $total_students;
|
93 |
+
?>
|
94 |
+
</span>
|
95 |
+
</li>
|
96 |
+
<li>
|
97 |
+
<strong><?php esc_html_e('Last Update', 'tutor') ?></strong>
|
98 |
+
<?php echo esc_html(get_the_modified_date()); ?>
|
99 |
+
</li>
|
100 |
+
</ul>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div class="tutor-course-enrolled-info">
|
104 |
+
<?php $count_completed_lesson = tutor_course_completing_progress_bar(); ?>
|
105 |
+
|
106 |
+
<div class="tutor-lead-info-btn-group">
|
107 |
+
<?php
|
108 |
+
if ( $wp_query->query['post_type'] !== 'lesson') {
|
109 |
+
$lesson_url = tutor_utils()->get_course_first_lesson();
|
110 |
+
if ( $lesson_url ) {
|
111 |
+
?>
|
112 |
+
<a href="<?php echo $lesson_url; ?>" class="tutor-button"><?php _e( 'Continue to lesson', 'tutor' ); ?></a>
|
113 |
+
<?php }
|
114 |
+
}
|
115 |
+
?>
|
116 |
+
<?php tutor_course_mark_complete_html(); ?>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
|
120 |
+
<?php do_action('tutor_course/single/lead_meta/after'); ?>
|
121 |
+
<?php do_action('tutor_course/single/excerpt/before'); ?>
|
122 |
+
|
123 |
+
<?php
|
124 |
+
$excerpt = tutor_get_the_excerpt();
|
125 |
+
if (! empty($excerpt)){
|
126 |
+
?>
|
127 |
+
<div class="tutor-course-summery">
|
128 |
+
<h4 class="tutor-segment-title"><?php esc_html_e('About Course', 'tutor') ?></h4>
|
129 |
+
<?php echo $excerpt; ?>
|
130 |
+
</div>
|
131 |
+
<?php
|
132 |
+
}
|
133 |
+
?>
|
134 |
+
|
135 |
+
<?php do_action('tutor_course/single/excerpt/after'); ?>
|
136 |
+
|
137 |
+
</div>
|
templates/single/course/enrolled/nav.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying enrolled course view nav menu
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) )
|
13 |
+
exit;
|
14 |
+
|
15 |
+
$course_nav_item = tutor_utils()->course_sub_pages();
|
16 |
+
?>
|
17 |
+
|
18 |
+
<?php do_action('tutor_course/single/enrolled/nav/before'); ?>
|
19 |
+
|
20 |
+
<div id="course-enrolled-nav-wrap-<?php echo get_the_ID(); ?>" class="course-enrolled-nav-wrap course-enrolled-nav-wrap-<?php the_ID(); ?>">
|
21 |
+
<nav id="course-enrolled-nav-<?php echo get_the_ID(); ?>" class="course-enrolled-nav course-enrolled-nav-<?php the_ID(); ?>">
|
22 |
+
<ul>
|
23 |
+
<li class="<?php echo get_query_var('course_subpage') === '' ? 'active' : ''; ?>"><a href="<?php echo get_permalink(); ?>"><?php _e('Course Page', 'tutor'); ?></a> </li>
|
24 |
+
<?php
|
25 |
+
foreach ($course_nav_item as $nav_key => $nav_item){
|
26 |
+
$active_class = get_query_var('course_subpage') === $nav_key? 'active' : '';
|
27 |
+
$url = trailingslashit(get_permalink()).$nav_key;
|
28 |
+
echo "<li class='{$active_class}'><a href='{$url}'>{$nav_item}</a> </li>";
|
29 |
+
}
|
30 |
+
?>
|
31 |
+
</ul>
|
32 |
+
</nav>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<?php do_action('tutor_course/single/enrolled/nav/after'); ?>
|
templates/single/course/enrolled/question_and_answer.php
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Question and answer
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
$enable_q_and_a_on_course = tutor_utils()->get_option('enable_q_and_a_on_course');
|
11 |
+
if ( ! $enable_q_and_a_on_course) {
|
12 |
+
tutor_load_template( 'single.course.q_and_a_turned_off' );
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
?>
|
16 |
+
<?php do_action('tutor_course/question_and_answer/before'); ?>
|
17 |
+
<div class="tutor-queston-and-answer-wrap">
|
18 |
+
|
19 |
+
<div class="tutor-question-top">
|
20 |
+
<div class="tutor-ask-question-btn-wrap">
|
21 |
+
<a href="javascript:;" class="tutor-ask-question-btn tutor-btn"> <?php _e('Ask a new question', 'tutor'); ?> </a>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<div class="tutor-add-question-wrap" style="display: none;">
|
26 |
+
<form method="post" id="tutor-ask-question-form">
|
27 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
28 |
+
<input type="hidden" value="add_question" name="tutor_action"/>
|
29 |
+
<input type="hidden" value="<?php echo get_the_ID(); ?>" name="tutor_course_id"/>
|
30 |
+
|
31 |
+
<div class="tutor-form-group">
|
32 |
+
<input type="text" name="question_title" value="" placeholder="<?php _e('Question Title', 'tutor'); ?>">
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div class="tutor-form-group">
|
36 |
+
<?php
|
37 |
+
$editor_settings = array(
|
38 |
+
'teeny' => true,
|
39 |
+
'media_buttons' => false,
|
40 |
+
'quicktags' => false,
|
41 |
+
'editor_height' => 100,
|
42 |
+
);
|
43 |
+
wp_editor(null, 'question', $editor_settings);
|
44 |
+
?>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<div class="tutor-form-group">
|
48 |
+
<a href="javascript:;" class="tutor_question_cancel tutor-button tutor-danger"><?php _e('Cancel', 'tutor'); ?></a>
|
49 |
+
<button type="submit" class="tutor-button tutor-success tutor_ask_question_btn" name="tutor_question_search_btn"><?php _e('Post Question', 'tutor'); ?> </button>
|
50 |
+
</div>
|
51 |
+
</form>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<div class="tutor_question_answer_wrap">
|
55 |
+
<?php
|
56 |
+
$questions = tutor_utils()->get_top_question();
|
57 |
+
|
58 |
+
if (is_array($questions) && count($questions)){
|
59 |
+
foreach ($questions as $question){
|
60 |
+
$answers = tutor_utils()->get_qa_answer_by_question($question->comment_ID);
|
61 |
+
$profile_url = tutor_utils()->profile_url($question->user_id);
|
62 |
+
?>
|
63 |
+
<div class="tutor_original_question">
|
64 |
+
<div class="tutor-question-wrap">
|
65 |
+
<div class="question-top-meta">
|
66 |
+
<div class="tutor-question-avater">
|
67 |
+
<a href="<?php echo $profile_url; ?>"> <?php echo tutor_utils()->get_tutor_avatar($question->user_id); ?></a>
|
68 |
+
</div>
|
69 |
+
<p class="review-meta">
|
70 |
+
<a href="<?php echo $profile_url; ?>"><?php echo $question->display_name; ?></a>
|
71 |
+
<span class="tutor-text-mute"><?php _e(sprintf('%s ago', human_time_diff(strtotime($question->comment_date))), 'tutor'); ?></span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
|
75 |
+
<div class="tutor_question_area">
|
76 |
+
<p><strong><?php echo $question->question_title; ?> </strong></p>
|
77 |
+
<?php echo wpautop(stripslashes($question->comment_content)); ?>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
|
82 |
+
|
83 |
+
<?php
|
84 |
+
if (is_array($answers) && count($answers)){ ?>
|
85 |
+
<div class="tutor_admin_answers_list_wrap">
|
86 |
+
<?php
|
87 |
+
foreach ($answers as $answer){
|
88 |
+
$answer_profile = tutor_utils()->profile_url($answer->user_id);
|
89 |
+
?>
|
90 |
+
<div class="tutor_individual_answer <?php echo ($question->user_id == $answer->user_id) ? 'tutor-bg-white' : 'tutor-bg-light'
|
91 |
+
?> ">
|
92 |
+
<div class="tutor-question-wrap">
|
93 |
+
<div class="question-top-meta">
|
94 |
+
<div class="tutor-question-avater">
|
95 |
+
<a href="<?php echo $answer_profile; ?>"> <?php echo tutor_utils()->get_tutor_avatar($answer->user_id); ?></a>
|
96 |
+
</div>
|
97 |
+
<p class="review-meta">
|
98 |
+
<a href="<?php echo $answer_profile; ?>"><?php echo $answer->display_name; ?></a>
|
99 |
+
<span class="tutor-text-mute">
|
100 |
+
<?php _e(sprintf('%s ago', human_time_diff(strtotime($answer->comment_date))), 'tutor'); ?>
|
101 |
+
</span>
|
102 |
+
</p>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div class="tutor_question_area">
|
106 |
+
<?php echo wpautop(stripslashes($answer->comment_content)); ?>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
<?php
|
111 |
+
}
|
112 |
+
?>
|
113 |
+
</div>
|
114 |
+
<?php
|
115 |
+
} ?>
|
116 |
+
<div class="tutor_add_answer_row">
|
117 |
+
<div class="tutor_add_answer_wrap " data-question-id="<?php echo $question->comment_ID; ?>">
|
118 |
+
<div class="tutor_wp_editor_show_btn_wrap">
|
119 |
+
<a href="javascript:;" class="tutor_wp_editor_show_btn tutor-button tutor-success"><?php _e('Add an answer', 'tutor'); ?></a>
|
120 |
+
</div>
|
121 |
+
<div class="tutor_wp_editor_wrap" style="display: none;">
|
122 |
+
<form method="post" class="tutor-add-answer-form">
|
123 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
124 |
+
<input type="hidden" value="tutor_add_answer" name="tutor_action"/>
|
125 |
+
<input type="hidden" value="<?php echo $question->comment_ID; ?>" name="question_id"/>
|
126 |
+
|
127 |
+
<div class="tutor-form-group">
|
128 |
+
<textarea id="tutor_answer_<?php echo $question->comment_ID; ?>" name="answer" class="tutor_add_answer_textarea" placeholder="<?php _e('Write your answer here...', 'tutor'); ?>"></textarea>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<div class="tutor-form-group">
|
132 |
+
<a href="javascript:;" class="tutor_cancel_wp_editor tutor-button tutor-danger"><?php _e('Cancel', 'tutor'); ?></a>
|
133 |
+
<button type="submit" class="tutor-button tutor_add_answer_btn tutor-success" name="tutor_answer_search_btn">
|
134 |
+
<?php _e('Add Answer', 'tutor'); ?>
|
135 |
+
</button>
|
136 |
+
</div>
|
137 |
+
</form>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
}
|
145 |
+
?>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
</div>
|
149 |
+
<?php do_action('tutor_course/question_and_answer/after'); ?>
|
templates/single/course/instructors.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course instructors/ instructor
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
do_action('tutor_course/single/enrolled/before/instructors');
|
14 |
+
|
15 |
+
$instructors = tutor_utils()->get_instructors_by_course();
|
16 |
+
if ($instructors){
|
17 |
+
?>
|
18 |
+
<h4 class="tutor-segment-title"><?php _e('About the instructors', 'tutor'); ?></h4>
|
19 |
+
|
20 |
+
<div class="tutor-course-instructors-wrap tutor-single-course-segment">
|
21 |
+
<?php
|
22 |
+
foreach ($instructors as $instructor){
|
23 |
+
$profile_url = tutor_utils()->profile_url($instructor->ID);
|
24 |
+
?>
|
25 |
+
<div class="single-instructor-wrap">
|
26 |
+
<div class="single-instructor-top">
|
27 |
+
<div class="tutor-instructor-left">
|
28 |
+
<div class="instructor-avatar">
|
29 |
+
<a href="<?php echo $profile_url; ?>">
|
30 |
+
<?php echo tutor_utils()->get_tutor_avatar($instructor->ID); ?>
|
31 |
+
</a>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<div class="instructor-name">
|
35 |
+
<h3><a href="<?php echo $profile_url; ?>"><?php echo $instructor->display_name; ?></a> </h3>
|
36 |
+
<h4><?php echo $instructor->tutor_profile_job_title; ?></h4>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
<div class="instructor-bio">
|
40 |
+
<?php echo $instructor->tutor_profile_bio ?>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<?php
|
45 |
+
$instructor_rating = tutor_utils()->get_instructor_ratings($instructor->ID);
|
46 |
+
?>
|
47 |
+
|
48 |
+
<div class="single-instructor-bottom">
|
49 |
+
<div class="ratings">
|
50 |
+
<span class="rating-generated">
|
51 |
+
<?php tutor_utils()->star_rating_generator($instructor_rating->rating_avg); ?>
|
52 |
+
</span>
|
53 |
+
|
54 |
+
<?php
|
55 |
+
echo " <span class='rating-digits'>{$instructor_rating->rating_avg}</span> ";
|
56 |
+
echo " <span class='rating-total-meta'>({$instructor_rating->rating_count} ".__('ratings', 'tutor').")</span> ";
|
57 |
+
?>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div class="courses">
|
61 |
+
<p>
|
62 |
+
<i class='tutor-icon-mortarboard'></i>
|
63 |
+
<?php echo tutor_utils()->get_course_count_by_instructor($instructor->ID); ?> <span class="tutor-text-mute"> <?php _e('Courses', 'tutor'); ?></span>
|
64 |
+
</p>
|
65 |
+
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div class="students">
|
69 |
+
<?php
|
70 |
+
$total_students = tutor_utils()->get_total_students_by_instructor($instructor->ID);
|
71 |
+
?>
|
72 |
+
|
73 |
+
<p>
|
74 |
+
<i class='tutor-icon-user'></i>
|
75 |
+
<?php echo $total_students; ?>
|
76 |
+
<span class="tutor-text-mute"> <?php _e('students', 'tutor'); ?></span>
|
77 |
+
</p>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
<?php
|
82 |
+
}
|
83 |
+
?>
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
|
88 |
+
do_action('tutor_course/single/enrolled/after/instructors');
|
templates/single/course/lead-info.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying lead info
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
global $post, $authordata;
|
15 |
+
$profile_url = tutor_utils()->profile_url($authordata->ID);
|
16 |
+
?>
|
17 |
+
|
18 |
+
<div class="tutor-single-course-segment tutor-single-course-lead-info">
|
19 |
+
<div class="tutor-leadinfo-top-meta">
|
20 |
+
<span class="tutor-single-course-rating">
|
21 |
+
<?php
|
22 |
+
$course_rating = tutor_utils()->get_course_rating();
|
23 |
+
tutor_utils()->star_rating_generator($course_rating->rating_avg);
|
24 |
+
?>
|
25 |
+
<span class="tutor-single-rating-count">
|
26 |
+
<?php
|
27 |
+
echo $course_rating->rating_avg;
|
28 |
+
echo '<i>('.$course_rating->rating_count.')</i>';
|
29 |
+
?>
|
30 |
+
</span>
|
31 |
+
</span>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<?php do_action('tutor_course/single/title/before'); ?>
|
35 |
+
<h1 class="tutor-course-header-h1"><?php the_title(); ?></h1>
|
36 |
+
|
37 |
+
<?php do_action('tutor_course/single/title/after'); ?>
|
38 |
+
<?php do_action('tutor_course/single/lead_meta/before'); ?>
|
39 |
+
|
40 |
+
<div class="tutor-single-course-meta tutor-meta-top">
|
41 |
+
<ul>
|
42 |
+
<li class="tutor-single-course-author-meta">
|
43 |
+
<div class="tutor-single-course-avatar">
|
44 |
+
<a href="<?php echo $profile_url; ?>"> <?php echo tutor_utils()->get_tutor_avatar($post->post_author); ?></a>
|
45 |
+
</div>
|
46 |
+
<div class="tutor-single-course-author-name">
|
47 |
+
<strong><?php _e('by', 'tutor'); ?></strong>
|
48 |
+
<a href="<?php echo tutor_utils()->profile_url($authordata->ID); ?>"><?php echo get_the_author(); ?></a>
|
49 |
+
</div>
|
50 |
+
</li>
|
51 |
+
<li class="tutor-course-level">
|
52 |
+
<strong><?php _e('Course level:', 'tutor'); ?></strong>
|
53 |
+
<?php echo get_tutor_course_level(); ?>
|
54 |
+
</li>
|
55 |
+
</ul>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="tutor-single-course-meta tutor-lead-meta">
|
59 |
+
<ul>
|
60 |
+
<?php
|
61 |
+
$course_categories = get_tutor_course_categories();
|
62 |
+
if(is_array($course_categories) && count($course_categories)){
|
63 |
+
?>
|
64 |
+
<li>
|
65 |
+
<strong><?php esc_html_e('Categories', 'tutor') ?></strong>
|
66 |
+
<?php
|
67 |
+
foreach ($course_categories as $course_category){
|
68 |
+
$category_name = $course_category->name;
|
69 |
+
$category_link = get_term_link($course_category->term_id);
|
70 |
+
echo "<a href='$category_link'>$category_name</a>";
|
71 |
+
}
|
72 |
+
?>
|
73 |
+
</li>
|
74 |
+
<?php } ?>
|
75 |
+
|
76 |
+
<?php
|
77 |
+
$course_duration = get_tutor_course_duration_context();
|
78 |
+
if(!empty($course_duration)){
|
79 |
+
?>
|
80 |
+
<li>
|
81 |
+
<strong><?php esc_html_e('Total Hour', 'tutor') ?></strong>
|
82 |
+
<span><?php echo $course_duration; ?></span>
|
83 |
+
</li>
|
84 |
+
<?php } ?>
|
85 |
+
<li>
|
86 |
+
<strong><?php esc_html_e('Total Enrolled', 'tutor') ?></strong>
|
87 |
+
<span>
|
88 |
+
<?php
|
89 |
+
$get_total_student = tutor_utils()->get_total_students();
|
90 |
+
$total_students = $get_total_student ? $get_total_student : 0;
|
91 |
+
echo $total_students;
|
92 |
+
?>
|
93 |
+
</span>
|
94 |
+
</li>
|
95 |
+
<li>
|
96 |
+
<strong><?php esc_html_e('Last Update', 'tutor') ?></strong>
|
97 |
+
<?php echo esc_html(get_the_modified_date()); ?>
|
98 |
+
</li>
|
99 |
+
</ul>
|
100 |
+
</div>
|
101 |
+
|
102 |
+
<?php do_action('tutor_course/single/lead_meta/after'); ?>
|
103 |
+
<?php do_action('tutor_course/single/excerpt/before'); ?>
|
104 |
+
|
105 |
+
<?php
|
106 |
+
$excerpt = tutor_get_the_excerpt();
|
107 |
+
|
108 |
+
if (! empty($excerpt)){
|
109 |
+
?>
|
110 |
+
<div class="tutor-course-summery">
|
111 |
+
<h4 class="tutor-segment-title"><?php esc_html_e('About Course', 'tutor') ?></h4>
|
112 |
+
<?php echo $excerpt; ?>
|
113 |
+
</div>
|
114 |
+
<?php
|
115 |
+
}
|
116 |
+
?>
|
117 |
+
|
118 |
+
<?php do_action('tutor_course/single/excerpt/after'); ?>
|
119 |
+
|
120 |
+
</div>
|
templates/single/course/login.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display single login
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="tutor-single-course-segment tutor-course-login-wrap">
|
16 |
+
<div class="course-login-title">
|
17 |
+
<h4><?php _e('Please Sign-In to view this section', 'tutor'); ?></h4>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="tutor-single-course-login-form">
|
21 |
+
<?php tutor_load_template( 'global.login' ); ?>
|
22 |
+
</div>
|
23 |
+
</div>
|
templates/single/course/material-includes.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course Material Includes assets
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
do_action('tutor_course/single/before/material_includes');
|
13 |
+
|
14 |
+
$materials = tutor_course_material_includes();
|
15 |
+
|
16 |
+
if ( empty($materials)){
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
if (is_array($materials) && count($materials)){
|
21 |
+
?>
|
22 |
+
|
23 |
+
<div class="tutor-single-course-segment tutor-course-material-includes-wrap">
|
24 |
+
<h4 class="tutor-segment-title"><?php _e('Material Includes', 'tutor'); ?></h4>
|
25 |
+
<div class="tutor-course-target-audience-content">
|
26 |
+
<ul class="tutor-course-target-audience-items tutor-custom-list-style">
|
27 |
+
<?php
|
28 |
+
foreach ($materials as $material){
|
29 |
+
echo "<li>{$material}</li>";
|
30 |
+
}
|
31 |
+
?>
|
32 |
+
</ul>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<?php } ?>
|
37 |
+
|
38 |
+
<?php do_action('tutor_course/single/after/material_includes'); ?>
|
39 |
+
|
templates/single/course/q_and_a_turned_off.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying if Q&A feature goes turn off
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
?>
|
14 |
+
|
15 |
+
<h1><?php _e('This feature has been disabled by the administrator', 'tutor'); ?></h1>
|
templates/single/course/review-form.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$isLoggedIn = is_user_logged_in();
|
3 |
+
$rating = $isLoggedIn ? tutor_utils()->get_course_rating_by_user() : '';
|
4 |
+
?>
|
5 |
+
|
6 |
+
<div class="tutor-course-enrolled-review-wrap">
|
7 |
+
<a href="javascript:;" class="write-course-review-link-btn">
|
8 |
+
<?php
|
9 |
+
if($isLoggedIn && (!empty($rating->rating) || !empty($rating->review))){
|
10 |
+
_e('Edit review', 'tutor');
|
11 |
+
}else{
|
12 |
+
_e('Write a review', 'tutor');
|
13 |
+
}
|
14 |
+
?>
|
15 |
+
</a>
|
16 |
+
<div class="tutor-write-review-form" style="display: none;">
|
17 |
+
<?php
|
18 |
+
if($isLoggedIn) {
|
19 |
+
?>
|
20 |
+
<form method="post">
|
21 |
+
<input type="hidden" name="tutor_course_id" value="<?php echo get_the_ID(); ?>">
|
22 |
+
<div class="tutor-write-review-box">
|
23 |
+
<div class="tutor-form-group">
|
24 |
+
<span class="tutor-ratings-wrap">
|
25 |
+
<?php
|
26 |
+
tutor_utils()->star_rating_generator(tutor_utils()->get_rating_value($rating->rating));
|
27 |
+
?>
|
28 |
+
</span>
|
29 |
+
</div>
|
30 |
+
<div class="tutor-form-group">
|
31 |
+
<textarea name="review" placeholder="<?php _e('write a review', 'tutor'); ?>"><?php echo stripslashes($rating->review); ?></textarea>
|
32 |
+
</div>
|
33 |
+
<div class="tutor-form-group">
|
34 |
+
<button type="submit" class="tutor_submit_review_btn tutor-button tutor-success"><?php _e('Submit Review', 'tutor'); ?></button>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</form>
|
38 |
+
<?php
|
39 |
+
}else{
|
40 |
+
ob_start();
|
41 |
+
tutor_load_template( 'single.course.login' );
|
42 |
+
$output = apply_filters( 'tutor_course/global/login', ob_get_clean());
|
43 |
+
echo $output;
|
44 |
+
}
|
45 |
+
?>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
|
templates/single/course/reviews.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying course reviews
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
*
|
7 |
+
* @author Themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
do_action('tutor_course/single/enrolled/before/reviews');
|
13 |
+
|
14 |
+
|
15 |
+
$reviews = tutor_utils()->get_course_reviews();
|
16 |
+
if ( ! is_array($reviews) || ! count($reviews)){
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="tutor-single-course-segment">
|
22 |
+
|
23 |
+
<div class="course-student-rating-title">
|
24 |
+
<h4 class="tutor-segment-title"><?php _e('Student Feedback', 'tutor'); ?></h4>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div class="tutor-course-reviews-wrap">
|
28 |
+
<div class="tutor-course-student-rating-wrap">
|
29 |
+
<div class="course-avg-rating-wrap">
|
30 |
+
<p class="course-avg-rating">
|
31 |
+
<?php
|
32 |
+
$rating = tutor_utils()->get_course_rating();
|
33 |
+
echo number_format($rating->rating_avg, 1);
|
34 |
+
?>
|
35 |
+
</p>
|
36 |
+
<p class="course-avg-rating-html">
|
37 |
+
<?php tutor_utils()->star_rating_generator($rating->rating_avg);?>
|
38 |
+
</p>
|
39 |
+
<p class="tutor-course-avg-rating-total">Total <span><?php echo $rating->rating_count;?></span> Ratings</p>
|
40 |
+
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
|
45 |
+
<div class="tutor-course-reviews-list">
|
46 |
+
<?php
|
47 |
+
foreach ($reviews as $review){
|
48 |
+
$profile_url = tutor_utils()->profile_url($review->user_id);
|
49 |
+
?>
|
50 |
+
<div class="tutor-review-individual-item tutor-review-<?php echo $review->comment_ID; ?>">
|
51 |
+
<div class="review-left">
|
52 |
+
<div class="review-avatar">
|
53 |
+
<a href="<?php echo $profile_url; ?>"> <?php echo tutor_utils()->get_tutor_avatar($review->user_id); ?> </a>
|
54 |
+
</div>
|
55 |
+
<div class="tutor-review-user-info">
|
56 |
+
<div class="review-time-name">
|
57 |
+
<p> <a href="<?php echo $profile_url; ?>"> <?php echo $review->display_name; ?> </a> </p>
|
58 |
+
<p class="review-meta">
|
59 |
+
<?php _e(sprintf('%s ago', human_time_diff(strtotime($review->comment_date))), 'tutor'); ?>
|
60 |
+
</p>
|
61 |
+
</div>
|
62 |
+
<div class="individual-review-rating-wrap">
|
63 |
+
<?php tutor_utils()->star_rating_generator($review->rating); ?>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<div class="review-content review-right">
|
70 |
+
<?php echo wpautop(stripslashes($review->comment_content)); ?>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
<?php
|
74 |
+
}
|
75 |
+
?>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<?php do_action('tutor_course/single/enrolled/after/reviews'); ?>
|
templates/single/course/tags.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Template for displaying course tags
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
*
|
8 |
+
* @author Themeum
|
9 |
+
* @url https://themeum.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
do_action('tutor_course/single/before/tags');
|
13 |
+
|
14 |
+
?>
|
15 |
+
<?php
|
16 |
+
$course_tags = get_tutor_course_tags();
|
17 |
+
if(is_array($course_tags) && count($course_tags)){ ?>
|
18 |
+
<div class="tutor-single-course-segment">
|
19 |
+
<div class="course-benefits-title">
|
20 |
+
<h4 class="tutor-segment-title"><?php esc_html_e('Skills', 'tutor') ?></h4>
|
21 |
+
</div>
|
22 |
+
<div class="tutor-course-tags">
|
23 |
+
<?php
|
24 |
+
foreach ($course_tags as $course_tag){
|
25 |
+
$tag_link = get_term_link($course_tag->term_id);
|
26 |
+
echo "<a href='$tag_link'> $course_tag->name </a>";
|
27 |
+
}
|
28 |
+
?>
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
<?php
|
32 |
+
}
|
33 |
+
?>
|
34 |
+
<?php do_action('tutor_course/single/after/tags'); ?>
|
templates/single/course/wc-price-html.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
/**
|
4 |
+
* Template for displaying price
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
*
|
8 |
+
* @author Themeum
|
9 |
+
* @url https://themeum.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
$is_purchasable = tutor_utils()->is_course_purchasable();
|
14 |
+
$price = apply_filters('get_tutor_course_price', null, get_the_ID());
|
15 |
+
|
16 |
+
if ($is_purchasable && $price){
|
17 |
+
echo '<p class="price">'.$price.'</p>';
|
18 |
+
}else{
|
19 |
+
?>
|
20 |
+
<p class="price">
|
21 |
+
<?php _e('Free', 'tutor'); ?>
|
22 |
+
</p>
|
23 |
+
<?php
|
24 |
+
}
|
25 |
+
?>
|
templates/single/lesson/complete_form.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Display attachments
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
|
14 |
+
do_action('tutor_lesson/single/before/complete_form');
|
15 |
+
|
16 |
+
$is_completed_lesson = tutor_utils()->is_completed_lesson();
|
17 |
+
if ( ! $is_completed_lesson) {
|
18 |
+
?>
|
19 |
+
<div class="tutor-single-lesson-segment tutor-lesson-compelte-form-wrap">
|
20 |
+
|
21 |
+
<form method="post">
|
22 |
+
<?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
|
23 |
+
|
24 |
+
<input type="hidden" value="<?php echo get_the_ID(); ?>" name="lesson_id"/>
|
25 |
+
<input type="hidden" value="tutor_complete_lesson" name="tutor_action"/>
|
26 |
+
|
27 |
+
<button type="submit" class="course-complete-button tutor-button" name="complete_lesson_btn" value="complete_lesson"><?php _e( 'Complete Lesson', 'tutor' ); ?></button>
|
28 |
+
</form>
|
29 |
+
</div>
|
30 |
+
<?php
|
31 |
+
}
|
32 |
+
do_action('tutor_lesson/single/after/complete_form'); ?>
|
templates/single/lesson/content.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Display the content
|
4 |
+
*
|
5 |
+
* @since v.1.0.0
|
6 |
+
* @author themeum
|
7 |
+
* @url https://themeum.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit;
|
12 |
+
|
13 |
+
do_action('tutor_lesson/single/before/content');
|
14 |
+
|
15 |
+
$jsonData = array();
|
16 |
+
$jsonData['post_id'] = get_the_ID();
|
17 |
+
$jsonData['best_watch_time'] = 0;
|
18 |
+
|
19 |
+
$best_watch_time = tutor_utils()->get_lesson_reading_info(get_the_ID(), 0, 'video_best_watched_time');
|
20 |
+
if ($best_watch_time > 0){
|
21 |
+
$jsonData['best_watch_time'] = $best_watch_time;
|
22 |
+
}
|
23 |
+
?>
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
<div class="tutor-single-page-top-bar">
|
29 |
+
<div class="tutor-topbar-item tutor-hide-sidebar-bar">
|
30 |
+
<a href="javascript:;" class="tutor-lesson-sidebar-hide-bar">=</a>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="tutor-topbar-item tutor-topbar-content-title-wrap">
|
34 |
+
<?php
|
35 |
+
tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
|
36 |
+
|
37 |
+
the_title(); ?>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="tutor-topbar-item tutor-topbar-back-to-curse-wrap">
|
41 |
+
<?php
|
42 |
+
$course_id = get_post_meta(get_the_ID(), '_tutor_course_id_for_lesson', true);
|
43 |
+
?>
|
44 |
+
<a href="<?php echo get_the_permalink($course_id); ?>">← Go to <strong>Course Home</strong></a>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
</div>
|
48 |
+
|
49 |
+
|
50 |
+
<div class="tutor-lesson-content-area">
|
51 |
+
|
52 |
+
<input type="hidden" id="tutor_video_tracking_information" value="<?php echo esc_attr(json_encode($jsonData)); ?>">
|
53 |
+
<?php tutor_lesson_video(); ?>
|
54 |
+
<?php the_content(); ?>
|
55 |
+
<?php get_tutor_posts_attachments(); ?>
|
56 |
+
<?php tutor_lesson_mark_complete_html(); ?>
|
57 |
+
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<?php
|
61 |
+
do_action('tutor_lesson/single/after/content'); ?>
|
templates/single/lesson/lesson_sidebar.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Display Topics and Lesson lists for learn
|
5 |
+
*
|
6 |
+
* @since v.1.0.0
|
7 |
+
* @author themeum
|
8 |
+
* @url https://themeum.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
global $post;
|
15 |
+
$currentPost = $post;
|
16 |
+
|
17 |
+
$course_id = get_post_meta($post->ID, '_tutor_course_id_for_lesson', true);
|
18 |
+
?>
|
19 |
+
|
20 |
+
<?php do_action('tutor_lesson/single/before/lesson_sidebar'); ?>
|
21 |
+
|
22 |
+
<div class="tutor-sidebar-tabs-wrap">
|
23 |
+
<div class="tutor-tabs-btn-group">
|
24 |
+
<a href="#tutor-lesson-sidebar-tab-content" class="active">Lesson List</a>
|
25 |
+
<!--<a href="#tutor-lesson-sidebar-qa-tab-content">Browse Q&A</a>-->
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div class="tutor-sidebar-tabs-content">
|
29 |
+
|
30 |
+
<div id="tutor-lesson-sidebar-qa-tab-content" class="tutor-lesson-sidebar-tab-item" style="display: none;">
|
31 |
+
<h3>No questions yet</h3>
|
32 |
+
<p>Perhaps you can make a try by search</p>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div id="tutor-lesson-sidebar-tab-content" class="tutor-lesson-sidebar-tab-item">
|
36 |
+
<?php
|
37 |
+
$topics = tutor_utils()->get_topics($course_id);
|
38 |
+
if ($topics->have_posts()){
|
39 |
+
while ($topics->have_posts()){ $topics->the_post();
|
40 |
+
$topic_id = get_the_ID();
|
41 |
+
$topic_summery = get_the_content();
|
42 |
+
?>
|
43 |
+
|
44 |
+
<div class="tutor-topics-in-single-lesson tutor-topics-<?php echo $topic_id; ?>">
|
45 |
+
<div class="tutor-topics-title <?php echo $topic_summery ? 'has-summery' : ''; ?>">
|
46 |
+
<h3>
|
47 |
+
<?php
|
48 |
+
the_title();
|
49 |
+
if($topic_summery) {
|
50 |
+
echo "<i class='tutor-icon-angle-down'></i>";
|
51 |
+
}
|
52 |
+
?>
|
53 |
+
</h3>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<?php
|
57 |
+
if ($topic_summery){
|
58 |
+
?>
|
59 |
+
<div class="tutor-topics-summery">
|
60 |
+
<?php echo $topic_summery; ?>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
}
|
64 |
+
?>
|
65 |
+
|
66 |
+
<div class="tutor-lessons-under-topic">
|
67 |
+
<?php
|
68 |
+
do_action('tutor/lesson_list/before/topic', $topic_id);
|
69 |
+
|
70 |
+
$lessons = tutor_utils()->get_lessons_by_topic(get_the_ID());
|
71 |
+
if ($lessons->have_posts()){
|
72 |
+
while ($lessons->have_posts()){
|
73 |
+
$lessons->the_post();
|
74 |
+
$video = tutor_utils()->get_video_info();
|
75 |
+
|
76 |
+
$play_time = false;
|
77 |
+
if ($video){
|
78 |
+
$play_time = $video->playtime;
|
79 |
+
}
|
80 |
+
$is_completed_lesson = tutor_utils()->is_completed_lesson();
|
81 |
+
?>
|
82 |
+
|
83 |
+
<div class="tutor-single-lesson-items <?php echo ($currentPost->ID === get_the_ID()) ? 'active' : ''; ?>">
|
84 |
+
<a href="<?php the_permalink(); ?>" class="tutor-single-lesson-a" data-lesson-id="<?php the_ID(); ?>">
|
85 |
+
|
86 |
+
<?php
|
87 |
+
$tutor_lesson_type_icon = $play_time ? 'youtube' : 'document';
|
88 |
+
echo "<i class='tutor-icon-$tutor_lesson_type_icon'></i>";
|
89 |
+
?>
|
90 |
+
<span class="lesson_title"><?php the_title(); ?></span>
|
91 |
+
<span class="tutor-lesson-right-icons">
|
92 |
+
<?php
|
93 |
+
if ($play_time){
|
94 |
+
echo "<i class='tutor-play-duration'>$play_time</i>";
|
95 |
+
}
|
96 |
+
$lesson_complete_icon = $is_completed_lesson ? 'tutor-icon-mark tutor-done' : '';
|
97 |
+
echo "<i class='tutor-lesson-complete $lesson_complete_icon'></i>";
|
98 |
+
?>
|
99 |
+
</span>
|
100 |
+
</a>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<?php
|
104 |
+
}
|
105 |
+
$lessons->reset_postdata();
|
106 |
+
}
|
107 |
+
|
108 |
+
#quizzes
|
109 |
+
$quizzes = tutor_utils()->get_attached_quiz($topic_id);
|
110 |
+
if ($quizzes){
|
111 |
+
?>
|
112 |
+
<?php
|
113 |
+
foreach ($quizzes as $quiz){
|
114 |
+
?>
|
115 |
+
<div class="tutor-single-lesson-items quiz-single-item-<?php echo $quiz->ID; ?>">
|
116 |
+
<a href="<?php echo get_permalink($quiz->ID); ?>">
|
117 |
+
<i class="tutor-icon-doubt"></i>
|
118 |
+
<span class="lesson_title"><?php echo $quiz->post_title; ?></span>
|
119 |
+
<span c
|