LearnPress – WordPress LMS Plugin - Version 2.1.2

Version Description

  • Fixed Assign course's items to user when assigning course
  • Fixed Options to change key 'lessons' and 'quizzes' when viewing a lesson/quiz in a course.
  • Fixed Course pagination issue in some case
  • Fixed Can not add to cart for non-loggedin user (woocommerce addon)
  • Fixed Broken cert when previewing to print in single course (Certificate)
  • Fixed Paid memberships show user as deleted after buying course (Paid membership)
  • Fixed overwrite templates issue (Paid membership)
  • Fixed "page isnt working" when creating a new post type (conflict with metabox in the-7 theme)
Download this release

Release Info

Developer tunnhn
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

assets/css/admin/admin-compressed.css ADDED
@@ -0,0 +1 @@
1
+ .rwmb-field{margin:20px 0 20px 0;}.rwmb-field .rwmb-input .rwmb-label{margin-top:0;}.lp-nav-tab-wrapper{border-bottom:1px solid #ccc;margin:0;padding:9px 15px 0 0;line-height:inherit;}.learn-press-quick-add-page-inline{display:inline-block;vertical-align:top;margin:0 !important;}.learn-press-quick-add-page-inline > *{vertical-align:top;}.post-type-lp_course .column-price,.post-type-lp_course .column-students{width:10%;}.post-type-lp_course #course_curriculum .curriculum-section-items .lp-item-empty td.section-item-input{padding-left:40px;}.post-type-lp_course #course_curriculum .curriculum-section-items .lp-item-empty td.section-item-input.hover{padding-left:0;}.post-type-lp_course .type-lp_course.status-pending .row-actions .view{display:none;}#learn-press-admin-settings{}#learn-press-admin-settings #learn_press_email_formats{margin-bottom:10px;}#learn-press-admin-settings .learn-press-email-variables{margin-left:0;margin-top:5px;}#learn-press-admin-settings .learn-press-email-variables li{display:inline-block;cursor:pointer;}#learn-press-admin-settings .learn-press-email-variables li:hover{color:#0085ba;}#learn-press-admin-settings .nav-tab-wrapper{margin-bottom:20px;}#learn-press-admin-settings .subsubsub{float:left;width:240px;position:relative;z-index:10;margin:0 -260px 0 20px;padding-top:11px;}#learn-press-admin-settings .subsubsub li{display:block;}#learn-press-admin-settings .subsubsub li a{display:block;outline:none;box-shadow:none;}#learn-press-admin-settings .learn-press-settings-wrap{float:left;padding:1px 0 15px 300px;background:#FFF;z-index:0;position:relative;width:100%;box-sizing:border-box;opacity:0;}#learn-press-admin-settings .learn-press-settings-wrap:before{content:'';position:absolute;top:0;bottom:0;border-left:1px solid #DDD;margin-left:-30px;}#learn-press-admin-settings .learn-press-settings-wrap:after{content:'';display:block;clear:both;}#learn-press-admin-settings .learn-press-settings-wrap.ready{opacity:1;}#learn-press-admin-settings.no-subtabs .learn-press-settings-wrap{float:none;margin-left:0;padding-left:25px;}#learn-press-admin-settings.no-subtabs .learn-press-settings-wrap:before{display:none;}#learn-press-admin-settings.no-subtabs .subsubsub{display:none;}#learn-press-admin-settings input[type="radio"]{margin:0 !important;}#learn-press-admin-settings label{line-height:1;}#learn-press-admin-settings input[name="learn_press_course_base"]{margin-top:3px;margin-right:3px;}#learn-press-admin-settings .lp-group-title{padding:0 0 10px;border-bottom:3px solid #563d7c;display:inline-block;margin:0;}#learn-press-admin-settings input[type="text"],#learn-press-admin-settings input[type="email"],#learn-press-admin-settings input[type="number"],#learn-press-admin-settings input[type="tel"],#learn-press-admin-settings input[type="password"],#learn-press-admin-settings select{vertical-align:top;}#learn-press-admin-settings input[type="checkbox"]{opacity:1;}#learn-press-admin-settings .lp-setting-field span{vertical-align:top;line-height:24px;}#learn-press-admin-settings .lp-setting-field .lp-sign-times{font-size:19px;}#learn-press-message-box-block{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;z-index:99999;opacity:0.8;}#learn-press-message-box-window{position:fixed;top:0;bottom:0;left:0;right:0;z-index:100000;color:#FFF;text-align:center;}#message-box-wrap{margin:0 auto;display:inline-block;text-align:left;max-width:70%;}.message-box-title{color:#FFF;margin:0 0 40px 0;font-size:34px;}.message-box-content{font-size:16px;line-height:1.5;}.message-box-animation{background-image:url("../../images/animation.gif");width:220px;height:20px;margin:20px 0 0;}.message-box-buttons{margin:20px 0 0;border-top:1px solid #929292;padding-top:20px;}.message-box-button{margin-right:10px !important;}.post-type-lp_lesson .column-format .lp-label{font-size:100%;}.hide{display:none;}.handle.dashicons{cursor:move;margin-right:0;}.meta_box_remove .dashicons{text-decoration:initial;}.meta_box_course_lesson_quiz li input,.meta_box_course_lesson_quiz li select{min-width:250px;}.description{margin-top:5px;}.dashed-placeholder{border:2px dashed #999;padding:10px;}.learn-press-message{position:relative;}.learn-press-message .learn-press-admin-notice-dismiss{position:absolute;display:inline-block;background-color:#FFFFFF;border-radius:50%;box-shadow:0px 0px 1px 1px #F1F1F1;width:20px;height:20px;text-align:center;line-height:20px;text-decoration:none;top:50%;right:10px;margin-top:-10px;padding:0;}.learn-press-message .learn-press-admin-notice-dismiss:before{font-family:dashicons;content:'\f335';text-align:center;font-size:18px;text-decoration:none;}li.quiz,li.lesson,li.quick_lesson,li.quick_quiz{margin-left:30px;}.wp-core-ui .meta_box_add_section,.wp-core-ui .meta_box_add_lesson,.wp-core-ui .meta_box_add_quiz,.wp-core-ui .meta_box_quick_add_lesson,.wp-core-ui .meta_box_quick_add_quiz{margin-right:10px;}.column-taxonomy-course_category{width:15%;}.learnpress-advertis-admin{margin-left:160px;padding:10px 20px;position:relative;}.learnpress-advertis-admin > .item{display:none;}.learnpress-advertis-admin > .item:first-child{display:block;}.learnpress-advertis-admin .learnpress-wrap-items{position:relative;overflow:hidden;-webkit-transition:visibility 1s, opacity 1s;transition:visibility 1s, opacity 1s;padding:20px;background-color:#fff;border:1px solid #ddd;margin-bottom:30px;}.learnpress-advertis-admin .theme-thumbnail{float:left;width:35%;}.learnpress-advertis-admin .theme-detail{margin-left:35%;padding-left:20px;}.learnpress-advertis-admin .learnpress-item{position:relative;float:left;margin-right:-100%;width:100%;box-sizing:border-box;visibility:hidden;opacity:0;-webkit-transition:visibility 0.5s linear, opacity 0.5s linear;transition:visibility 0.5s linear, opacity 0.5s linear;}.learnpress-advertis-admin img{width:100%;height:auto;float:none;}.learnpress-advertis-admin .learnpress-active{visibility:visible;opacity:1;}.learnpress-advertis-admin .learnpress-controls{position:absolute;bottom:30px;right:0;height:50px;-ms-transform:translateY(-50%);-webkit-transform:translateY(-50%);transform:translateY(-50%);}.learnpress-advertis-admin .learnpress-controls:after{content:'';clear:both;display:block;}.learnpress-advertis-admin .learnpress-controls .prev-item,.learnpress-advertis-admin .learnpress-controls .next-item{position:absolute;top:0;font-family:'dashicons';width:40px;height:40px;border:1px solid #000;line-height:40px;font-size:16px;color:#000;cursor:pointer;}.learnpress-advertis-admin .learnpress-controls .prev-item{right:95px;}.learnpress-advertis-admin .learnpress-controls .prev-item:before{content:"\f341";display:block;text-align:center;}.learnpress-advertis-admin .learnpress-controls .next-item{right:45px;}.learnpress-advertis-admin .learnpress-controls .next-item:before{content:"\f345";display:block;text-align:center;}@media only screen and (max-width: 1200px) {.learnpress-advertis-admin .theme-thumbnail{width:50%;}.learnpress-advertis-admin .theme-detail{margin-left:25%;width:50%;}}@media only screen and (max-width: 960px) {.learnpress-advertis-admin{margin-left:36px;}.learnpress-advertis-admin .theme-thumbnail{float:none;width:100%;}.learnpress-advertis-admin .theme-detail{margin-top:20px;margin-left:0;padding-left:0;}}@media screen and (max-width: 782px) {.learnpress-advertis-admin{margin-left:0;}}.lpr-add-ons-wrapper .add-on-info{width:65%;display:inline-block;}.lpr-add-ons-wrapper .add-on-action{float:right;}.lpr-add-ons-wrapper .add-on-action a{text-decoration:none;padding:20px;height:80px;width:100px;background:#EBEBEB;margin-right:100px;}.lpr-add-ons-wrapper .add-on-action .add-on-enabled{text-align:center;margin:40px;}.lpr-add-ons-wrapper .add-on-action .add-on-disabled{text-align:center;margin:40px;}.lpr-add-ons-wrapper .add-on-action a:hover{text-decoration:none;content:attr(data-text-disable);}.lp-search-addon{margin:0;width:280px;font-size:16px;font-weight:300;line-height:1.5;padding:3px 5px;height:32px;}.learn-press-add-ons{margin:20px 0 0;}.learn-press-add-ons .lp-addon-hidden{display:none !important;}.learn-press-add-ons .lp-active:nth-of-type(2n+1){clear:none;margin-right:0;margin-left:8px;}.learn-press-add-ons .lp-active:nth-of-type(2n){clear:both;margin-right:8px;margin-left:0;}.learn-press-add-ons.learnpress-premium-plugin .column-description{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-height:1.6em;max-height:6.4em;}.learn-press-add-ons.learnpress-premium-plugin .column-description p{margin:0;line-height:inherit;}.learn-press-add-ons:after{display:block;clear:both;content:'';}.learn-press-add-ons > li{}.learn-press-add-ons > li .add-on-inner{margin:0 20px 40px 20px;border:1px solid #DDD;border-radius:10px;overflow:hidden;}.learn-press-add-ons > li .add-on-thumbnail{position:relative;overflow:hidden;border-bottom:1px solid #E3E3E3;}.learn-press-add-ons > li .add-on-thumbnail img{width:100%;height:auto;vertical-align:top;}.learn-press-add-ons > li .add-on-thumbnail .add-on-overlay{position:absolute;left:0;right:0;height:100%;top:0;-webkit-transition:all 0.25s;background-color:#ADE6FF;opacity:0;}.learn-press-add-ons > li .add-on-thumbnail .add-on-description{position:absolute;left:20px;right:20px;bottom:0;-webkit-transition:all 0.25s;color:#444;opacity:0;}.learn-press-add-ons > li:hover .add-on-overlay{opacity:0.3;}.learn-press-add-ons > li:hover .add-on-description{opacity:1;}.learn-press-add-ons > li .add-on-info{min-height:80px;padding:20px;background-color:#F5F5F5;border-top:1px solid #FFF;}.learn-press-add-ons > li .add-on-info > h3{margin-top:0;}.learn-press-add-ons > li .add-on-actions{position:absolute;bottom:43px;}.learn-press-add-ons > li .add-on-actions .add-on-state{font-size:36px;vertical-align:top;display:none;margin-top:-8px;color:#05B3FF;margin-left:-9px;}.learn-press-add-ons > li .add-on-actions .add-on-state.change{display:inline-block;}.learn-press-add-ons .plugin-card-top{min-height:180px;}.premium_add_ons.active .column-description p{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;line-height:1.6em;max-height:8em;}.learn-press-add-ons .button.spinner{background:url(../../images/spinner.gif) no-repeat 4px !important;padding-left:30px;visibility:visible;width:auto;}.learn-press-add-ons .action-links > span{display:block;text-align:right;font-style:italic;}.learn-press-add-ons .action-links > span.enabled{color:#7ad03a;}.learn-press-add-ons .action-links > span.disabled{color:#FF0000;}.learn-press-add-ons .action-links .price{color:#439fdf;font-weight:700;font-size:15px;line-height:1.6em;}.learn-press-add-ons .action-links .price del{font-weight:400;color:#aaa;padding-right:5px;}.learn-press-add-ons .plugin-icon img{max-width:100%;}#learn-press-bundle-activate-add-ons.spinner{float:left !important;}.learn-press-add-ons .plugin-version{font-weight:bold;}#learn-press-add-ons-wrap #name{width:30%;}.learn-press-add-ons p:before{content:'';}#learn-press-add-ons-wrap .theme{padding:20px;background-color:#fff;border:1px solid #ddd;overflow:hidden;margin-bottom:30px;}#learn-press-add-ons-wrap .theme-controls{margin-top:20px;margin-bottom:0;}#learn-press-add-ons-wrap .theme h2{margin:0 0 20px 0;line-height:1.4;}#learn-press-add-ons-wrap .theme img{width:400px;height:auto;max-height:100%;float:left;margin:0 20px 0 0;}.related_themes .plugin-card-top{padding-bottom:0;}.related_themes .theme-content{position:relative;}.related_themes .image-thumbnail img{width:100%;}.related_themes .theme-description{margin:0 0 25px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;line-height:1.6em;max-height:9.6em;}.related_themes .theme-title{margin-right:100px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:22px;line-height:1.6em;margin-bottom:0;min-height:3.2em;}.related_themes .theme-title a{color:#545454;}.related_themes .theme-rating{float:right;display:inline-block;}.related_themes .star-rating{display:inline-block;}.related_themes .count-rating{font-size:15px;position:relative;top:2px;}.related_themes .theme-detail{position:absolute;right:3px;top:0;text-align:right;line-height:1.6em;}.related_themes .theme-detail:after{content:'';display:block;clear:both;}.related_themes .theme-detail .theme-price{display:inline-block;font-size:24px;color:#545454;font-weight:700;line-height:1.6em;}.related_themes .theme-footer{clear:both;margin-left:-20px;margin-right:-20px;padding:20px;background-color:#fafafa;border-top:1px solid #ddd;overflow:hidden;}@media (max-width: 1280px) {.learn-press-add-ons > li{}}@media screen and (max-width: 782px) {.learn-press-add-ons .enable-now{padding:5px;}.learn-press-add-ons .enable-now:before{margin:0 !important;}#learn-press-add-ons-wrap .theme img{width:50%;}}@media (max-width: 768px) {.learn-press-add-ons > li{}.learn-press-add-ons > li .column-name{margin-right:150px;}}@media (max-width: 480px) {.learn-press-add-ons > li{width:100%;}#learn-press-add-ons-wrap .theme img{width:100%;margin:0 0 20px 0;}}#lpr-add-ons-wrapper .lpr-add-on-block{border-bottom:1px dashed #DDD;padding-bottom:20px;width:50%;float:left;margin-top:20px;}#lpr-add-ons-wrapper .lpr-add-on-block:after{content:'';display:block;clear:both;}#lpr-add-ons-wrapper .lpr-admin-thumbnail{float:left;width:200px;}#lpr-add-ons-wrapper .lpr-admin-thumbnail img{vertical-align:top;}#lpr-add-ons-wrapper .lpr-add-on-info{margin-left:220px;margin-right:20px;}#lpr-add-ons-wrapper .lpr-add-on-info > h3{margin-top:0;}#lpr-add-ons-wrapper .lpr-add-on-info > h3 > span{display:inline-block;padding:0 5px;background-color:#7AD3FA;color:#FFF;border-radius:3px;margin-left:10px;font-size:12px;vertical-align:top;font-weight:normal;}#lpr-add-ons-wrapper .lpr-add-on-action{float:right;width:100px;}input.lpr-fancy-checkbox{display:none;}.lpr-fancy-checkbox.tog{border-radius:20px;box-shadow:inset 0 0 4px rgba(0, 0, 0, 0.6);margin:0 auto;height:19px;width:50px;position:relative;cursor:pointer;font:11px/18px arial;background:#ccc;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;display:inline-block !important;}.lpr-fancy-checkbox.tog:after{content:'';box-shadow:0 2px 2px rgba(0, 0, 0, 0.6);border-radius:20px;display:block;height:15px;width:15px;background:#fff;position:absolute;top:2px;left:2px;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;}.lpr-fancy-checkbox.tog:before{content:'OFF';position:absolute;right:7px;top:1px;color:#fff;}.lpr-fancy-checkbox.tog:hover:after{left:5px;}.lpr-fancy-checkbox.tog.on:before{content:'ON';right:28px;}.lpr-fancy-checkbox.tog.on{background:#05B3FF;}.lpr-fancy-checkbox.tog.on:after{left:33px;}.lpr-fancy-checkbox.tog.on:hover:after{left:30px;}.lp-list-options{border:1px solid #DDD;border-collapse:collapse;width:100%;}.lp-list-option.lp-list-option-empty td,.lp-list-option.lp-list-option-empty th{background-color:#FBE9E9;}.lp-list-option.lp-list-option-empty .lp-answer-check input,.lp-list-option.lp-list-option-empty .lp-list-option-actions i{display:none;}.lp-list-options thead th{border:1px solid #FFF;background-color:#EAEAEA;padding:10px;text-align:left;color:#00A0D2;}.lp-list-options tbody th,.lp-list-options tbody td{border:1px solid #FFF;padding:10px 10px;text-align:left;background-color:#F5F5F5;}.lp-list-options .lp-answer-check{width:100px;}.lp-list-options tbody th input[type="text"],.lp-list-options tbody td input[type="text"]{width:100%;}.lp-list-options .ui-sortable-placeholder{visibility:visible !important;}.lp-list-options .ui-sortable-placeholder td{background-image:url("../../images/stripe.png");}.lp-list-option .lp-answer-text{color:#777;background-color:transparent;border-color:transparent;box-shadow:none;}.lp-list-option .lp-answer-text:after{font-family:dashicons;content:'\f464';}.lp-list-option .lp-answer-text:focus,.lp-list-option:hover .lp-answer-text{box-shadow:none;outline:none;background-color:transparent;border-color:transparent;}.lp-list-option:hover .lp-answer-text{border-style:dashed;}.lp-list-option-actions{cursor:pointer;color:#00A0D2;}.lp-list-option-actions.lp-move-list-option{cursor:move;}.lp-list-option-actions:hover{color:#156077;}#question_answer .rwmb-question-wrapper{margin:12px 0 0 0;}.question-bottom-actions > *{vertical-align:baseline !important;}body.post-type-lp_quiz #questions,body.post-type-lp_question #question_answer_{border:none;box-shadow:none;background-color:transparent;}body.post-type-lp_quiz #questions .handlediv,body.post-type-lp_question #question_answer_ .handlediv{display:none;}body.post-type-lp_quiz #questions .hndle,body.post-type-lp_question #question_answer_ .hndle{display:none;}body.post-type-lp_quiz #questions .inside,body.post-type-lp_question #question_answer_ .inside{padding:0;}#questions .quiz-questions-heading .questions-toggle{float:right;margin:0;line-height:1;}#questions .quiz-questions-heading .questions-toggle a:hover{color:#00a0d2;}#questions #learn-press-dropdown-questions{display:inline-block;position:relative;}#questions #learn-press-dropdown-questions > ul{position:absolute;top:100%;margin:0;padding:0;background-color:#FFF;left:0;right:0;border:1px solid #EEE;border-top:none;display:none;z-index:50;}#questions #learn-press-dropdown-questions > ul > li{margin:0;}#questions #learn-press-dropdown-questions > ul li > a{display:block;padding:5px;outline:none;box-shadow:none;}#questions #learn-press-question-name{font-size:18px;min-width:350px;margin:0;box-shadow:none;border-color:#EEE;color:#BBB;vertical-align:middle;}#questions #learn-press-toggle-questions{height:32px;vertical-align:top;background-color:#FFF;border:1px solid #EEE;width:32px;margin-left:-4px;text-align:center;font-size:30px;padding:0;color:#CCC;border-left:none;outline:none;cursor:pointer;}#questions #learn-press-toggle-questions:hover{color:#AAAAAA;}#questions #learn-press-button-add-question{_vertical-align:middle;}#questions .question-actions{background-color:#FFF;border:1px solid #DDD;padding:10px;display:inline-block;margin-top:20px;position:relative;z-index:999;}#questions .quiz-question-head .quiz-question-actions{float:right;margin:1px 0;visibility:hidden;padding-top:2px;}#questions .quiz-question-head .quiz-question-actions a{margin:0 3px;color:#666666;vertical-align:middle;box-shadow:none;}#questions .quiz-question-head .quiz-question-actions a:hover{color:#00a0d2;}#questions .quiz-question-head:hover .quiz-question-actions{visibility:visible;}#questions .quiz-question.ui-sortable-placeholder{visibility:visible !important;background-image:url("../../images/stripe.png");border:1px solid #DDD;border-bottom:none;}#questions .question-name{border:none;box-shadow:none;padding-left:0;width:70%;color:#777;vertical-align:middle;}#questions .quiz-question-icon img{max-width:100%;height:auto;}#questions #learn-press-dropdown-questions .added{display:none;}.lpr-curriculum-section > h3{padding:0 !important;}.lpr-curriculum-section > h3 .lpr-action{top:0;right:0;}.lpr-curriculum-section.lpr-empty > h3{cursor:default !important;}.lpr-curriculum-section.lpr-empty .lpr-action{display:none !important;}.lpr-course-curriculum button span{text-decoration:underline;}#learn-press-statistic{margin-top:20px;}.learn-press-chart{position:relative;}.learn-press-chart canvas{height:70vh;width:100vw;}.chart-buttons form{display:inline-block;vertical-align:top;}.chart-buttons form input[type="text"]{width:105px;font-size:14px;vertical-align:top;margin:0;text-align:center;font-weight:bold;padding:4px;}.chart-buttons form span{display:inline-block;vertical-align:middle;font-weight:bold;padding:5px;}.learn-press-chart.loading:after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:10;background:#FFF;opacity:0.5;}.chart-description li{display:inline-block;margin-right:15px;}.chart-description li:before{content:'';display:inline-block;width:10px;height:10px;vertical-align:middle;margin-right:5px;}.chart-description li span{display:inline-block;vertical-align:middle;font-weight:bold;}.chart-description li.all:before{background:#2FA7FF;}.chart-description li.instructors:before{background:#EAC79B;}.chart-description li.students:before{background:#D4D0CB;}.lpr-stats-time{text-align:center;}.lpr-hidden{display:none;}#lpr-custom-time{position:relative;top:4px;}#lpr-page-block{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0.5;display:none;z-index:9999;}#form-quick-add-lesson-link{position:absolute;}#_lpr_course_price_description > span{font-weight:bold;font-size:15px;}.lpr-ignore,.lpr-ignore:hover{color:#dd3d36;}.lpr-ignore:hover{cursor:pointer;}.lpr-quick-add-page-inline,.lpr-quick-actions-inline{display:inline-block;vertical-align:middle;margin:0 !important;}#lpr-toggle-quiz-mode{background-color:#0077FF;padding:3px;margin-left:5px;display:inline-block;border-radius:3px;text-decoration:none;color:#FFF;}.column-num_of_question{width:150px;}.lp-search-items input[name="lp-item-name"]{width:500px;}.lp-button-dropdown{padding-left:0 !important;padding-right:28px !important;position:relative;z-index:99998;}.lp-button-dropdown .lp-dropdown-label{padding-left:10px;}.lp-button-dropdown .lp-dropdown-arrow{display:inline-block;text-align:center;padding:0 10px;position:absolute;top:-1px;bottom:-1px;}.lp-button-dropdown .lp-dropdown-items{position:absolute;margin:0;background-color:#FFF;top:100%;margin-top:1px;border:1px solid #DDD;right:-1px;width:200px;z-index:9999999;display:none;}.lp-button-dropdown .lp-dropdown-items li{margin:0;}.lp-button-dropdown .lp-dropdown-items li a{display:block;padding:10px;line-height:1;text-decoration:none;outline:none;box-shadow:none;}.lp-button-dropdown .lp-dropdown-items li a:hover{background-color:#F5F5F5;}.lp-button-dropdown:not(.disabled):hover ul,.lp-button-dropdown:not(.disabled) ul:hover{display:block;}.curriculum-section .lp-check-items,.curriculum-section .lp-check-items:hover{padding-left:5px;padding-right:34px;border-color:transparent;background:transparent;box-shadow:none;}.column-format,.column-is_previewable,.column-taxonomy-question-tag{width:10%;}.learn-press-add-ons .plugin-card .install-now:before,.learn-press-add-ons .plugin-card .disable-now:before,.learn-press-add-ons .plugin-card .enable-now:before{margin:3px 5px 0 -2px;display:inline-block;font:400 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;}.learn-press-add-ons .plugin-card .install-now:before{content:'\f106';color:#0073aa;}.learn-press-add-ons .plugin-card .disable-now:before{content:'\f147';color:#0073aa;}.learn-press-add-ons .plugin-card .enable-now:before{content:'\f335';color:#d54e21;}.learn-press-add-ons .plugin-card .disable-now:hover:before{content:'\f335';color:#d54e21;}.learn-press-add-ons .plugin-card .enable-now:hover:before{content:'\f147';color:#0073aa;}.learn-press-add-ons .plugin-card .button-working:before{content:'\f463' !important;-webkit-animation:lp-spinner 2s infinite linear;animation:lp-spinner 2s infinite linear;margin-right:0;}.learn-press-add-ons .plugin-card .button-working span{display:none;}.lp-button-actions a{text-decoration:none;margin-left:5px;}.learn-press-quick-confirm{position:absolute;z-index:9999;color:#ffffff;padding:2px 8px;display:block;white-space:nowrap;left:-39.625px;top:24px;background-color:#C90202;cursor:pointer;}.learn-press-quick-confirm:hover,.learn-press-quick-confirm:hover:before{background-color:#d73b00;}.learn-press-quick-confirm:before{content:'';display:block;position:absolute;transform:rotate(45deg);width:7px;height:7px;top:-3px;background-color:#C90202;right:7px;}.wp-core-ui .meta_box_add_section,.wp-core-ui .meta_box_add_lesson{margin-right:10px;}.rwmb-meta-box label{color:#222;font-weight:bold;display:block;margin:0 0 16px 0;}.post-type-lp_order #post-body-content,.post-type-lp_order #order_details .handlediv,.post-type-lp_order #order_details .hndle{display:none;}.post-type-lp_order #submitpost .misc-pub-section label{display:block;font-weight:bold;}#learn-press-order{margin:15px;}#learn-press-order .order-data-number{font-size:36px;padding:0;margin-bottom:20px;}#learn-press-order > h3{margin:0 0 10px 0;padding:0;}#learn-press-order .order-data-date,#learn-press-order .order-data-status,#learn-press-order .order-data-payment-method{font-size:18px;padding:0 0 10px 0;}#learn-press-order .user-display-name,#learn-press-order .user-email,#learn-press-order .user-ip-address{padding:0;margin:0 0 10px 0;}#learn-press-order .order-items table{border:1px solid #DDD;border-collapse:collapse;width:100%;}#learn-press-order .order-items table th,#learn-press-order .order-items table td{text-align:left;padding:10px 15px;border:1px solid #DDD;}#learn-press-install-sample-data-notice .install-sample-data-loading{display:none;}#learn_press_dashboard_widget .subsubsub{float:none;}.learn-press-checkbox{display:none !important;}input.regular-text[id^="learn-press-emails"]{width:97%;}.ios-ui-select{background:#dddddd;border:none !important;height:18px;-webkit-border-radius:9px;border-radius:9px;width:30px;-webkit-transition:all 0.3s ease-in-out;-moz-transition:all 0.3s ease-in-out;-ms-transition:all 0.3s ease-in-out;-o-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;position:relative;display:inline-block;}.ios-ui-select.checked{-webkit-box-shadow:inset 0 0 0 18px #6ddc5f;box-shadow:inset 0 0 0 18px #6ddc5f;}.ios-ui-select.checked .inner{left:13px;}.ios-ui-select .inner{width:16px;height:16px;position:absolute;top:1px;left:1px;-webkit-border-radius:100%;border-radius:100%;background:white;-webkit-transition:all 350ms cubic-bezier(0, 0.89, 0.44, 1);-moz-transition:all 350ms cubic-bezier(0, 0.89, 0.44, 1);-o-transition:all 350ms cubic-bezier(0, 0.89, 0.44, 1);transition:all 350ms cubic-bezier(0, 0.89, 0.44, 1);-webkit-box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);}.lp-label-counter{display:inline-block;background-color:#0073AA;border-radius:10px;height:21px;line-height:20px;text-align:center;min-width:21px;color:#FFF;padding:0 5px;}.column-num_of_question,.column-preview,.column-duration,.column-type,.column-taxonomy-question_tag{width:100px;text-align:left;}#learn_press_dashboard_widget .rss-widget ul li{margin-bottom:10px !important;}#learn_press_dashboard_widget .rss-date{margin-left:0;}#learn_press_dashboard_widget_status .inside{padding:0;margin-top:0;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status{margin-top:0;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li{width:50%;float:left;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li > a,#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li > span{padding:8px 12px;display:block;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li.full-width{width:100%;float:none;clear:both;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li.full-width:first-child{border-bottom:1px solid #ececec;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li.full-width:first-child a{padding:10px 12px;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li.full-width:last-child{border-top:1px solid #ececec;margin:0 12px;}#learn_press_dashboard_widget_status .inside .learnpress-statistic-status li.full-width > a{display:inline-block;}.lp-template-overrides{margin-top:20px;}.lp-template-overrides thead th h4{margin:0;}.lp-template-overrides tbody th{font-weight:bold;}.lp-template-overrides tbody th p{margin:0 0 0 10px;display:inline-block;}.lp-template-overrides tbody th p a{font-weight:normal;outline:none;border:none;box-shadow:none;margin:0;padding:2px 8px;border-radius:3px;}.lp-template-overrides tbody th p a.current{background:#00aadc;color:#FFF;}.lp-template-overrides .lp-template-version{width:100px;}.lp-template-overrides .lp-template-version.outdated{color:#FF0000;}.lp-template-overrides .lp-template-version.up-to-date{color:#1859ff;}.lp-template-overrides .lp-template-version,.lp-template-overrides .lp-core-version{font-weight:bold;}.lp-template-overrides .lp-template-file{width:50%;}.lp-template-overrides #learn-press-no-templates td p{color:#0073aa;}@-webkit-keyframes lp-spinner{0% {-webkit-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg);}}@keyframes lp-spinner{0% {-webkit-transform:rotate(0deg);transform:rotate(0deg);}}.rwmb-quiz_questions-wrapper{background:#FFF;}.rwmb-quiz_questions-wrapper .quiz-questions-heading{border:1px solid #DDD;background-color:#F9F9F9;border-bottom:none;margin:0;color:#777;padding:15px 20px 20px;font-size:24px;}.rwmb-quiz_questions-wrapper .quiz-questions-heading a{font-size:32px;color:#0073aa;box-shadow:none;}.rwmb-quiz_questions-wrapper .quiz-questions-heading a.dashicons-arrow-down::before{margin-left:-10px;}.rwmb-quiz_questions-wrapper .quiz-questions-heading a:hover{color:#00a0d2;}.rwmb-quiz_questions-wrapper #learn-press-list-questions{padding:20px;border:1px solid #DDD;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question{background:#FFF;border:1px dashed #DDD;margin:-1px 0 0 0;padding:5px 0;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question:nth-child(2n+1){background-color:#FCFCFC;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question:nth-child(2n+1) .question-name{background-color:#FCFCFC;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head{padding:0 20px;position:relative;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head .quiz-question-icon{width:20px;height:20px;display:inline-block;vertical-align:middle;margin-right:10px;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head .question-name{font-size:16px;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head .move{color:#666;cursor:url("../../images/openhand.cur") 7 5, default;position:absolute;right:14px;height:50px;top:5px;width:12px;box-shadow:none;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head .move:hover{color:#00a0d2;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head:hover .quiz-question-actions{margin-right:20px;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-head:hover .quiz-question-actions .dashicons-admin-page::before{margin-top:2px;}.rwmb-quiz_questions-wrapper #learn-press-list-questions .quiz-question .quiz-question-content{padding:0 20px;}.post-type-lp_quiz #general-settings a{font-size:14px;font-weight:400;margin-left:10px;}
assets/css/admin/admin.css CHANGED
@@ -333,6 +333,7 @@ li.quick_quiz {
333
margin-left: 160px;
334
padding: 10px 20px;
335
position: relative;
336
}
337
.learnpress-advertis-admin > .item {
338
display: none;
@@ -1590,7 +1591,8 @@ input.regular-text[id^="learn-press-emails"] {
1590
width: 50%;
1591
float: left;
1592
}
1593
- #learn_press_dashboard_widget_status .inside .learnpress-statistic-status li > a {
1594
padding: 8px 12px;
1595
display: block;
1596
}
333
margin-left: 160px;
334
padding: 10px 20px;
335
position: relative;
336
+ overflow: hidden;
337
}
338
.learnpress-advertis-admin > .item {
339
display: none;
1591
width: 50%;
1592
float: left;
1593
}
1594
+ #learn_press_dashboard_widget_status .inside .learnpress-statistic-status li > a,
1595
+ #learn_press_dashboard_widget_status .inside .learnpress-statistic-status li > span {
1596
padding: 8px 12px;
1597
display: block;
1598
}
assets/css/admin/admin.less CHANGED
@@ -384,6 +384,7 @@ li.quiz, li.lesson, li.quick_lesson, li.quick_quiz {
384
margin-left: 160px;
385
padding: 10px 20px;
386
position: relative;
387
388
> .item {
389
display: none;
@@ -1903,7 +1904,7 @@ input.regular-text[id^="learn-press-emails"] {
1903
li {
1904
width: 50%;
1905
float: left;
1906
- > a {
1907
padding: 8px 12px;
1908
display: block;
1909
}
384
margin-left: 160px;
385
padding: 10px 20px;
386
position: relative;
387
+ overflow: hidden;
388
389
> .item {
390
display: none;
1904
li {
1905
width: 50%;
1906
float: left;
1907
+ > a, > span {
1908
padding: 8px 12px;
1909
display: block;
1910
}
assets/css/learnpress-compressed.css ADDED
@@ -0,0 +1 @@
1
+ @font-face{font-family:'lp-icons';src:url('../fonts/lp-icons.eot?f41nl#iefix') format('embedded-opentype'), url('../fonts/lp-icons.ttf?f41nl') format('truetype'), url('../fonts/lp-icons.woff?f41nl') format('woff'), url('../fonts/lp-icons.svg?f41nl#lp-icons') format('svg');font-weight:normal;font-style:normal;}[class^="lp-icon-"],[class*=" lp-icon-"]{font-family:'lp-icons' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.lp-icon-file-text2:before{content:"\e926";}.lp-icon-file-picture:before{content:"\e927";}.lp-icon-file-music:before{content:"\e928";}.lp-icon-file-video:before{content:"\e92a";}.lp-icon-file-zip:before{content:"\e92b";}.lp-icon-paste:before{content:"\e92d";}.lp-icon-alarm:before{content:"\e950";}.lp-icon-cross:before{content:"\ea0f";}.lp-icon-checkmark:before{content:"\ea10";}.lp-icon-spinner2:before{content:"\e97b";}.lp-icon-plus:before{content:"\ea0a";}.lp-icon-minus:before{content:"\ea0b";}.clearfix:after{display:block;content:'';clear:both;}.overlay-processing:before,.overlay-processing:after{content:'';display:block;position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;}.overlay-processing:before{background:#000;opacity:0.5;}.overlay-processing:after{background:#FFF;}.hide-if-js{display:none !important;}.learn-press-courses{list-style:none;clear:both;margin:0 -30px 0 0;padding:0;}.learn-press-courses:after{display:block;content:'';clear:both;}.learn-press-courses li.course{list-style-type:none;float:left;width:23%;margin:0 2% 30px 0;padding:0;box-sizing:border-box;border:1px solid #DDD;background:#FFF;}.learn-press-courses li.course .view-more{padding:0 15px;text-decoration:none;box-shadow:none;}.learn-press-courses li.course h3{padding:15px;margin:0;font-size:18px;line-height:1.5;}.learn-press-courses li.course .course-thumbnail{position:relative;}.learn-press-courses li.course .course-thumbnail img{max-width:100%;height:auto;}.learn-press-courses li.course .course-thumbnail:after{content:'';position:absolute;width:100%;height:100%;left:0;top:0;}.learn-press-courses li.course .course-info{padding:0 15px 15px;font-size:14px;overflow:hidden;}.learn-press-courses li.course .course-students{float:left;}.learn-press-courses li.course .course-instructor{margin-bottom:20px;}.learn-press-courses li.course .course-origin-price{float:right;text-decoration:line-through;padding-right:5px;}.learn-press-courses li.course .course-price{float:right;color:#54b551;}.learn-press-courses li.course .course-info > *{display:block;}.learn-press-notice .button{float:right;}.learn-press-form{margin-bottom:20px;}#learn-press-course-curriculum ul.curriculum-sections,#learn-press-course-curriculum ul.section-content{list-style:none;margin:0;padding:0;background-color:#F5F5F5;}#learn-press-course-curriculum ul.curriculum-sections li.section,#learn-press-course-curriculum ul.section-content li.section{list-style-type:none;}#learn-press-course-curriculum .section-header{background-color:#EEE;margin:0;padding:20px 15px;border-top:1px solid #FFF;position:relative;}#learn-press-course-curriculum .section-header p{display:inline-block;font-weight:normal;font-style:italic;color:#999999;font-size:14px;margin:0;padding:10px 0;text-transform:none;}#learn-press-course-curriculum .section-header:hover{background:#DDD;}#learn-press-course-curriculum .section-header .meta{font-size:smaller;font-weight:normal;position:absolute;right:15px;top:20px;}#learn-press-course-curriculum .section-header .meta .collapse{display:inline-block;position:relative;font-family:'lp-icons';background:#95e6f9;width:24px;height:24px;line-height:24px;text-align:center;color:#FFF;border-radius:5px;vertical-align:middle;margin-left:5px;}#learn-press-course-curriculum .section-header .meta .collapse:before{content:"\ea0b";margin:0 auto;}#learn-press-course-curriculum .section-header .meta .collapse:hover{cursor:pointer;}#learn-press-course-curriculum .section-header .meta .collapse.plus:before{content:"\ea0a";}#learn-press-course-curriculum .course-item{margin:0;list-style:none;padding:10px 15px;border-top:1px solid #ffffff;position:relative;-webkit-transition:background linear 0.5s;-khtml-transition:background linear 0.5s;-moz-transition:background linear 0.5s;-ms-transition:background linear 0.5s;-o-transition:background linear 0.5s;transition:background linear 0.5s;}#learn-press-course-curriculum .course-item .lp-label-viewing,#learn-press-course-curriculum .course-item .lp-label-completed{display:none;}#learn-press-course-curriculum .course-item .course-item-title{display:block;box-shadow:none;text-align:justify;float:left;}#learn-press-course-curriculum .course-item .course-item-title:before{display:inline-block;font-size:16px;margin-right:10px;font-family:'lp-icons';}#learn-press-course-curriculum .course-item .lp-icon{display:none;}#learn-press-course-curriculum .course-item.viewable{cursor:pointer;}#learn-press-course-curriculum .course-item.viewable:hover{background:#e7ecfb;-webkit-transition:background linear 0s;-khtml-transition:background linear 0s;-moz-transition:background linear 0s;-ms-transition:background linear 0s;-o-transition:background linear 0s;transition:background linear 0s;}#learn-press-course-curriculum .course-item.course-lesson .course-item-title:before{content:'\e926';}#learn-press-course-curriculum .course-item.course-quiz .course-item-title:before{content:'\e950';}#learn-press-course-curriculum .course-item.item-current{background:#FFF;}#learn-press-course-curriculum .course-item.item-current:before{display:block;width:3px;background:#95e6f9;position:absolute;left:0;top:0;height:100%;content:'';}#learn-press-course-curriculum .course-item.item-has-status .item-status{display:inline-block;background:#d6d6d6;margin-left:5px;}#learn-press-course-curriculum .course-item.item-has-status .item-status:before{content:'\ea10';color:#FFF;}#learn-press-course-curriculum .course-item.item-has-status.item-completed .item-status{background:#95e6f9;}#learn-press-course-curriculum .course-item.focus{background:#ffb710;}#learn-press-course-curriculum .course-item.focus.off{-webkit-transition:none;-khtml-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}#learn-press-course-curriculum .course-item:after{display:block;clear:both;content:'';}#learn-press-course-curriculum .course-item-meta{display:block;line-height:1;__position:absolute;top:15px;right:15px;float:right;margin-top:5px;}.lp-icon{display:inline-block;font-family:'lp-icons';background:#95e6f9;width:24px;height:24px;line-height:24px;text-align:center;color:#FFF;border-radius:5px;vertical-align:middle;}.lp-icon:before{width:32px;height:32px;}.lp-label{display:inline-block;line-height:24px;font-size:78%;vertical-align:middle;color:#ffffff;padding:0 10px;background:#DDD;height:24px;-webkit-border-radius:4px;-khtml-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.lp-label.lp-label-viewing{background-color:#39afff;}.lp-label.lp-label-completed{background-color:#39c7ce;}.lp-label.lp-label-lesson{background-color:#337ab7;}.lp-label.lp-label-quiz{background-color:#53658c;}.lp-label.lp-label-preview{background-color:#02a7ce;}.learn-press-content-protected-message{border:3px solid #ff8484;background:#FFF;padding:20px;color:#ff8484;margin:10px 0;border-radius:6px;}.learn-press-content-protected-message .icon{position:relative;display:inline-block;width:30px;height:30px;margin-right:10px;vertical-align:middle;}.learn-press-content-protected-message .icon:before,.learn-press-content-protected-message .icon:after{width:3px;background:#ff8484;height:30px;content:'';display:inline-block;position:absolute;top:0;left:13.5px;}.learn-press-content-protected-message .icon:before{-webkit-transform:rotate(-45deg);-khtml-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);}.learn-press-content-protected-message .icon:after{-webkit-transform:rotate(45deg);-khtml-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);}.learn-press-breadcrumb{margin-bottom:20px;}.single-lp_course .learn-press-course-results-progress{margin-bottom:40px;}.single-lp_course .learn-press-course-results-progress .items-progress{float:left;width:68%;margin-right:2%;clear:left;margin-bottom:50px;}.single-lp_course .learn-press-course-results-progress .lp-course-progress-heading{margin-bottom:10px;}.single-lp_course .learn-press-course-results-progress .course-progress{float:left;width:30%;}.single-lp_course .learn-press-course-results-progress .number,.single-lp_course .learn-press-course-results-progress .percentage-sign{display:inline-block;vertical-align:bottom;line-height:1;font-size:25px;}.single-lp_course .learn-press-course-results-progress .percentage-sign{margin-left:5px;}.single-lp_course .learn-press-course-results-progress:after{display:block;content:'';clear:both;}.lp-course-progress{position:relative;}.lp-course-progress .lp-progress-bar{height:15px;background:#DDD;margin:10px 0 15px 0;overflow:hidden;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;}.lp-course-progress .lp-progress-bar .lp-progress-value{width:50%;height:15px;background:#95e6f9;}.lp-course-progress .lp-passing-conditional{left:0%;position:absolute;height:25px;top:-5px;margin-left:-5px;cursor:pointer;}.lp-course-progress .lp-passing-conditional:before,.lp-course-progress .lp-passing-conditional:after{content:'';display:inline-block;border:5px solid transparent;left:0;position:absolute;}.lp-course-progress .lp-passing-conditional:before{border-top-color:#DDD;}.lp-course-progress .lp-passing-conditional:after{border-bottom-color:#DDD;bottom:0;}#learn-press-content-item{border:1px solid #DDD;display:none;}.learn-press-tabs .learn-press-nav-tabs{list-style:none;padding:0;margin:0 0 20px 0;border-bottom:1px solid #DDD;}.learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab{list-style-type:none;float:left;margin-bottom:-1px;position:relative;}.learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab a{display:inline-block;padding:10px 15px;outline:none;box-shadow:none;color:#686868;border-bottom:1px solid #DDD;}.learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab.active{border-bottom:4px solid #007acc;}.learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab.active a{color:#007acc;border-bottom:none;margin-bottom:-4px;}.learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab.active:after{position:absolute;width:100%;border-bottom:1px solid #FFF;bottom:-1px;content:'';}.learn-press-tabs .learn-press-nav-tabs:after{content:'';display:block;clear:both;}.learn-press-tabs .learn-press-tab-panel{display:none;margin-bottom:20px;}.learn-press-tabs .learn-press-tab-panel.active{display:block;}#popup_overlay{z-index:10000000 !important;}#popup_container{z-index:10000001 !important;background:#FFF;}body.course-has-popup{overflow:hidden;}#course-curriculum-popup{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;z-index:999999;}#course-curriculum-popup *{box-sizing:border-box;}#course-curriculum-popup #popup-sidebar{float:left;width:350px;position:absolute;top:60px;bottom:0;overflow:auto;background:#FFF;border-right:1px solid #DDD;}#course-curriculum-popup #popup-sidebar .course-curriculum-title{display:none;}#course-curriculum-popup #popup-sidebar .curriculum-sections{margin:0;font-size:smaller;}#course-curriculum-popup #popup-sidebar .learn-press-course-results-progress{padding:15px 20px;margin-bottom:0;}#course-curriculum-popup #popup-sidebar .learn-press-course-results-progress .items-progress,#course-curriculum-popup #popup-sidebar .learn-press-course-results-progress .course-progress{width:100%;margin:0 !important;}#course-curriculum-popup #popup-main{position:absolute;top:0;left:350px;right:0;bottom:0;background:#FFF;}#course-curriculum-popup #popup-main #popup-header{position:absolute;top:0;left:-350px;right:0;height:60px;background:#cc540d;border-bottom:1px solid #ab4a10;}#course-curriculum-popup #popup-main #popup-header .popup-menu{position:absolute;height:60px;width:350px;border-right:1px solid #ab4a10;}#course-curriculum-popup #popup-main #popup-header .popup-close,#course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn,#course-curriculum-popup #popup-main #popup-header .sidebar-show-btn{width:59px;height:59px;position:absolute;top:0;cursor:pointer;font-size:34px;line-height:60px;text-align:center;color:#FFF;}#course-curriculum-popup #popup-main #popup-header .popup-close:hover,#course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn:hover,#course-curriculum-popup #popup-main #popup-header .sidebar-show-btn:hover{background:#b34c10;}#course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn{left:0;}#course-curriculum-popup #popup-main #popup-header .sidebar-show-btn{position:relative;margin-left:-20px;margin-right:20px;}#course-curriculum-popup #popup-main #popup-header .popup-close{right:0px;}#course-curriculum-popup #popup-main #popup-header .popup-close:before,#course-curriculum-popup #popup-main #popup-header .popup-close:after{content:'';border-top:3px solid #FFF;width:30px;display:inline-block;position:absolute;top:29px;left:17px;}#course-curriculum-popup #popup-main #popup-header .popup-close:before{-webkit-transform:rotate(45deg);}#course-curriculum-popup #popup-main #popup-header .popup-close:after{-webkit-transform:rotate(-45deg);}#course-curriculum-popup #popup-main #popup-header .popup-close:hover{background:#b34c10;}#course-curriculum-popup #popup-main #popup-header .popup-close:hover:before,#course-curriculum-popup #popup-main #popup-header .popup-close:hover:after{border-color:#FFF;}#course-curriculum-popup #popup-main #popup-header .popup-title{margin:0 0 0 350px;height:60px;line-height:60px;padding:0 20px;color:#FFF;position:relative;}#course-curriculum-popup #popup-main #popup-content{position:absolute;top:60px;bottom:50px;left:0;right:0;overflow:auto;transition:top linear 0.25s, bottom linear 0.25s;}#course-curriculum-popup #popup-main #popup-content #popup-content-inner{margin:20px 40px;}#course-curriculum-popup #popup-main #popup-footer{position:absolute;bottom:0;left:0;right:0;height:50px;background:#F5F5F5;border-top:1px solid #DDD;}#course-curriculum-popup #popup-main #popup-footer .footer-control{display:block;height:50px;line-height:50px;padding:0 20px;background:#FFF;}#course-curriculum-popup #popup-main #popup-footer .footer-control.prev-item{float:left;}#course-curriculum-popup #popup-main #popup-footer .footer-control.next-item{float:right;}#course-curriculum-popup #popup-main #popup-header,#course-curriculum-popup #popup-main #popup-footer{transition:opacity linear 0.25s;}#course-curriculum-popup #popup-main.expand{position:fixed;left:0;padding:0 20%;top:0;bottom:0;}#course-curriculum-popup #popup-main.expand #popup-header,#course-curriculum-popup #popup-main.expand #popup-footer{opacity:0;}#course-curriculum-popup #popup-main.expand #popup-content{top:0;bottom:0;}#course-curriculum-popup iframe{position:absolute;top:0;left:0;height:100%;width:100%;border:none;margin:0;background:#FFF;}.learn-press-content-item-title{margin-bottom:20px;border-bottom:2px solid #DDD;padding-bottom:20px;}.learn-press-content-item-title.content-item-quiz-title{display:block;content:'';clear:both;}.learn-press-content-item-title.content-item-quiz-title h4{float:left;font-size:24px;margin-bottom:0;}.learn-press-content-item-title.content-item-quiz-title .quiz-countdown{float:right;position:relative;min-width:100px;background:#F5F5F5;text-align:center;font-size:18px;}.learn-press-content-item-title.content-item-quiz-title .quiz-countdown:after,.learn-press-content-item-title.content-item-quiz-title .quiz-countdown:before{padding:0 10px;height:3px;position:absolute;bottom:-3px;background:#000;content:'';left:0;}.learn-press-content-item-title.content-item-quiz-title .quiz-countdown:before{width:100%;}.learn-press-content-item-title.content-item-quiz-title .quiz-countdown:after{background:#00adff;padding:0;}.learn-press-content-item-title.content-item-quiz-title .quiz-countdown.warning-time-over:after{background:#FF0000;}.learn-press-content-item-title.content-item-quiz-title:after{content:'';display:block;clear:both;}.learn-press-content-item-title .lp-expand{float:right;width:43px;height:43px;line-height:43px;background:#F5F5F5;margin:0 10px;border:1px solid #DDD;outline:none;}.learn-press-content-item-summary{margin-bottom:30px;}.learn-press-content-item-summary .quiz-question-title{margin-bottom:20px;}.learn-press-content-item-summary .learn-press-question-explanation,.learn-press-content-item-summary .learn-press-question-hint{background:#F5F5F5;padding:15px 20px;font-style:italic;margin-bottom:20px;}.learn-press-content-item-summary .learn-press-question-explanation .hint-title,.learn-press-content-item-summary .learn-press-question-hint .hint-title,.learn-press-content-item-summary .learn-press-question-explanation .explanation-title,.learn-press-content-item-summary .learn-press-question-hint .explanation-title{font-style:normal;}.button-finish-quiz{float:right;}.learnpress form.purchase-course{margin-bottom:20px;}#learn-press-block-content{display:none;width:100%;height:100%;background:rgba(255, 255, 255, 0.25);position:fixed;z-index:99999999;top:0;left:0;}#learn-press-block-content:before,#learn-press-block-content:after,#learn-press-block-content span{position:absolute;-webkit-border-radius:50%;-khtml-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;left:50%;top:50%;box-sizing:border-box;}#learn-press-block-content:before{content:'';border:2px solid #000;z-index:10;-webkit-animation:spin-13 1.5s infinite;-moz-animation:spin-13 1.5s infinite;animation:spin-13 1.5s infinite;width:80px;height:80px;margin-left:-40px;margin-top:-40px;-webkit-clip-path:polygon(0px 80px, 80px 80px, 80px 40px, 40px 40px, 40px 0, 0 0);}#learn-press-block-content:after{z-index:0;content:'';border:10px solid #000000;margin-left:-80px;margin-top:-80px;width:160px;height:160px;opacity:0;}#learn-press-block-content span{z-index:20;-webkit-animation:spin-12 1.5s infinite;-moz-animation:spin-12 1.5s infinite;animation:spin-12 1.5s infinite;clip:rect(0, 84px, 42px, 42px);width:84px;height:84px;margin-left:-42px;margin-top:-42px;clip:rect(0, 64px, 32px, 32px);width:64px;height:64px;margin-left:-32px;margin-top:-32px;}#learn-press-block-content span:before{content:'';border:6px solid #95e6f9;position:absolute;-webkit-border-radius:50%;-khtml-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;box-sizing:border-box;width:84px;height:84px;width:64px;height:64px;}body.block-content #learn-press-block-content{display:block;}.quiz-buttons{margin-bottom:20px;clear:both;}.quiz-intro{list-style:none;padding:0;}.quiz-questions-list{margin:0 0 20px 0;padding:0;list-style-position:inside;}.quiz-questions-list li{margin:0 0 10px 0;}.quiz-questions-list .question-title{margin:0 0 5px 0;}.quiz-questions-list .current .question-title{font-weight:bold;}.quiz-description .learn-press-question-title,.question-content .learn-press-question-title{margin-bottom:20px;}.quiz-countdown{float:right;position:relative;min-width:150px;background:#F5F5F5;text-align:center;font-size:18px;padding:5px 0;}#quiz-countdown .progress-circle{overflow:hidden;box-shadow:0 0 3px #bdbdbd inset;}#quiz-countdown .progress-circle .inside{line-height:1;}#quiz-countdown .progress-circle .inside .countdown{font-size:48px;color:#087998;_text-shadow:1px 1px #8ee5fd;margin-top:110px;}#quiz-countdown .progress-circle .inside p{margin:10px 0 0 0;color:#DDD;}#quiz-countdown .progress-circle:after{background:#00b9eb;box-shadow:0 0 6px #097a98;}#quiz-progress .progress-circle{width:200px;height:200px;border-radius:50%;background-color:#DDD;position:relative;}#quiz-progress .progress-circle .background{content:"";position:absolute;border-radius:50%;width:200px;height:200px;clip:rect(0, 200px, 200px, 100px);}#quiz-progress .progress-circle .background .fill{content:"";position:absolute;border-radius:50%;width:200px;height:200px;clip:rect(0, 100px, 200px, 0);background:#FF0000;transform:rotate(0deg);}#quiz-progress .progress-circle:after{content:'';width:170px;height:170px;background:#FFF;-webkit-border-radius:50%;-khtml-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;position:absolute;top:50%;left:50%;margin-top:-85px;margin-left:-85px;pointer-events:none;}#quiz-progress .progress-circle .inside{position:absolute;width:100%;height:100%;line-height:200px;text-align:center;z-index:10;}#quiz-progress .progress-circle.gt-50{background-color:#FF0000;}#quiz-progress .progress-circle.gt-50 .background{clip:rect(0, 100px, 200px, 0);}#quiz-progress .progress-circle.gt-50 .fill{clip:rect(0, 200px, 200px, 100px);background:#DDD;}.quiz-result .quiz-result-mark{margin-bottom:20px;}.quiz-result .quiz-result-mark .progress-circle{width:200px;height:200px;border-radius:50%;background-color:#DDD;position:relative;}.quiz-result .quiz-result-mark .progress-circle .background{content:"";position:absolute;border-radius:50%;width:200px;height:200px;clip:rect(0, 200px, 200px, 100px);}.quiz-result .quiz-result-mark .progress-circle .background .fill{content:"";position:absolute;border-radius:50%;width:200px;height:200px;clip:rect(0, 100px, 200px, 0);background:#95e6f9;transform:rotate(0deg);}.quiz-result .quiz-result-mark .progress-circle:after{content:'';width:170px;height:170px;background:#FFF;-webkit-border-radius:50%;-khtml-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;position:absolute;top:50%;left:50%;margin-top:-85px;margin-left:-85px;pointer-events:none;}.quiz-result .quiz-result-mark .progress-circle .inside{position:absolute;width:100%;height:100%;line-height:200px;text-align:center;z-index:10;}.quiz-result .quiz-result-mark .progress-circle.gt-50{background-color:#95e6f9;}.quiz-result .quiz-result-mark .progress-circle.gt-50 .background{clip:rect(0, 100px, 200px, 0);}.quiz-result .quiz-result-mark .progress-circle.gt-50 .fill{clip:rect(0, 200px, 200px, 100px);background:#DDD;}.quiz-result .quiz-result-summary{margin-bottom:20px;max-width:500px;}.quiz-result .quiz-result-summary .quiz-result-field{position:relative;background:#F5F5F5;color:#fff;margin:0 0 8px 0;font-size:12px;padding:5px 10px;-webkit-border-radius:4px;-khtml-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;overflow:hidden;}.quiz-result .quiz-result-summary .quiz-result-field span,.quiz-result .quiz-result-summary .quiz-result-field span:after,.quiz-result .quiz-result-summary .quiz-result-field:before{display:block;position:absolute;top:0;left:0;height:100%;content:attr(data-text);color:#FFF;white-space:nowrap;overflow:hidden;padding:3px 10px;background:transparent;transition:width 0.5s;}.quiz-result .quiz-result-summary .quiz-result-field:before{content:'';padding:0;}.quiz-result .quiz-result-summary .quiz-result-field span{padding:0;}.quiz-result .quiz-result-summary .quiz-result-field span:after{margin:3px 10px;padding:0;width:100%;}.quiz-result .quiz-result-summary .quiz-result-field.correct{background:#22b4ff;}.quiz-result .quiz-result-summary .quiz-result-field.wrong{background:#ff5425;}.quiz-result .quiz-result-summary .quiz-result-field.empty{color:#656D6D;}.quiz-result p.quiz-result-time{margin:0 0 10px 0;}.quiz-result .quiz-grade p{margin:0 0 10px 0;}.quiz-result .quiz-grade p span{font-weight:bold;}.quiz-result .quiz-grade p span.passed{color:#22b4ff;}.quiz-result .quiz-grade p span.failed{color:#ff5425;}.single-quiz .quiz-result-field[data-value="0"]:before,.single-quiz .quiz-result-field[data-value="0"] span,#quiz-countdown[data-value="0"]:after{width:0%;}.single-quiz .quiz-result-field[data-value="1"]:before,.single-quiz .quiz-result-field[data-value="1"] span,#quiz-countdown[data-value="1"]:after{width:1%;}.single-quiz .quiz-result-field[data-value="2"]:before,.single-quiz .quiz-result-field[data-value="2"] span,#quiz-countdown[data-value="2"]:after{width:2%;}.single-quiz .quiz-result-field[data-value="3"]:before,.single-quiz .quiz-result-field[data-value="3"] span,#quiz-countdown[data-value="3"]:after{width:3%;}.single-quiz .quiz-result-field[data-value="4"]:before,.single-quiz .quiz-result-field[data-value="4"] span,#quiz-countdown[data-value="4"]:after{width:4%;}.single-quiz .quiz-result-field[data-value="5"]:before,.single-quiz .quiz-result-field[data-value="5"] span,#quiz-countdown[data-value="5"]:after{width:5%;}.single-quiz .quiz-result-field[data-value="6"]:before,.single-quiz .quiz-result-field[data-value="6"] span,#quiz-countdown[data-value="6"]:after{width:6%;}.single-quiz .quiz-result-field[data-value="7"]:before,.single-quiz .quiz-result-field[data-value="7"] span,#quiz-countdown[data-value="7"]:after{width:7%;}.single-quiz .quiz-result-field[data-value="8"]:before,.single-quiz .quiz-result-field[data-value="8"] span,#quiz-countdown[data-value="8"]:after{width:8%;}.single-quiz .quiz-result-field[data-value="9"]:before,.single-quiz .quiz-result-field[data-value="9"] span,#quiz-countdown[data-value="9"]:after{width:9%;}.single-quiz .quiz-result-field[data-value="10"]:before,.single-quiz .quiz-result-field[data-value="10"] span,#quiz-countdown[data-value="10"]:after{width:10%;}.single-quiz .quiz-result-field[data-value="11"]:before,.single-quiz .quiz-result-field[data-value="11"] span,#quiz-countdown[data-value="11"]:after{width:11%;}.single-quiz .quiz-result-field[data-value="12"]:before,.single-quiz .quiz-result-field[data-value="12"] span,#quiz-countdown[data-value="12"]:after{width:12%;}.single-quiz .quiz-result-field[data-value="13"]:before,.single-quiz .quiz-result-field[data-value="13"] span,#quiz-countdown[data-value="13"]:after{width:13%;}.single-quiz .quiz-result-field[data-value="14"]:before,.single-quiz .quiz-result-field[data-value="14"] span,#quiz-countdown[data-value="14"]:after{width:14%;}.single-quiz .quiz-result-field[data-value="15"]:before,.single-quiz .quiz-result-field[data-value="15"] span,#quiz-countdown[data-value="15"]:after{width:15%;}.single-quiz .quiz-result-field[data-value="16"]:before,.single-quiz .quiz-result-field[data-value="16"] span,#quiz-countdown[data-value="16"]:after{width:16%;}.single-quiz .quiz-result-field[data-value="17"]:before,.single-quiz .quiz-result-field[data-value="17"] span,#quiz-countdown[data-value="17"]:after{width:17%;}.single-quiz .quiz-result-field[data-value="18"]:before,.single-quiz .quiz-result-field[data-value="18"] span,#quiz-countdown[data-value="18"]:after{width:18%;}.single-quiz .quiz-result-field[data-value="19"]:before,.single-quiz .quiz-result-field[data-value="19"] span,#quiz-countdown[data-value="19"]:after{width:19%;}.single-quiz .quiz-result-field[data-value="20"]:before,.single-quiz .quiz-result-field[data-value="20"] span,#quiz-countdown[data-value="20"]:after{width:20%;}.single-quiz .quiz-result-field[data-value="21"]:before,.single-quiz .quiz-result-field[data-value="21"] span,#quiz-countdown[data-value="21"]:after{width:21%;}.single-quiz .quiz-result-field[data-value="22"]:before,.single-quiz .quiz-result-field[data-value="22"] span,#quiz-countdown[data-value="22"]:after{width:22%;}.single-quiz .quiz-result-field[data-value="23"]:before,.single-quiz .quiz-result-field[data-value="23"] span,#quiz-countdown[data-value="23"]:after{width:23%;}.single-quiz .quiz-result-field[data-value="24"]:before,.single-quiz .quiz-result-field[data-value="24"] span,#quiz-countdown[data-value="24"]:after{width:24%;}.single-quiz .quiz-result-field[data-value="25"]:before,.single-quiz .quiz-result-field[data-value="25"] span,#quiz-countdown[data-value="25"]:after{width:25%;}.single-quiz .quiz-result-field[data-value="26"]:before,.single-quiz .quiz-result-field[data-value="26"] span,#quiz-countdown[data-value="26"]:after{width:26%;}.single-quiz .quiz-result-field[data-value="27"]:before,.single-quiz .quiz-result-field[data-value="27"] span,#quiz-countdown[data-value="27"]:after{width:27%;}.single-quiz .quiz-result-field[data-value="28"]:before,.single-quiz .quiz-result-field[data-value="28"] span,#quiz-countdown[data-value="28"]:after{width:28%;}.single-quiz .quiz-result-field[data-value="29"]:before,.single-quiz .quiz-result-field[data-value="29"] span,#quiz-countdown[data-value="29"]:after{width:29%;}.single-quiz .quiz-result-field[data-value="30"]:before,.single-quiz .quiz-result-field[data-value="30"] span,#quiz-countdown[data-value="30"]:after{width:30%;}.single-quiz .quiz-result-field[data-value="31"]:before,.single-quiz .quiz-result-field[data-value="31"] span,#quiz-countdown[data-value="31"]:after{width:31%;}.single-quiz .quiz-result-field[data-value="32"]:before,.single-quiz .quiz-result-field[data-value="32"] span,#quiz-countdown[data-value="32"]:after{width:32%;}.single-quiz .quiz-result-field[data-value="33"]:before,.single-quiz .quiz-result-field[data-value="33"] span,#quiz-countdown[data-value="33"]:after{width:33%;}.single-quiz .quiz-result-field[data-value="34"]:before,.single-quiz .quiz-result-field[data-value="34"] span,#quiz-countdown[data-value="34"]:after{width:34%;}.single-quiz .quiz-result-field[data-value="35"]:before,.single-quiz .quiz-result-field[data-value="35"] span,#quiz-countdown[data-value="35"]:after{width:35%;}.single-quiz .quiz-result-field[data-value="36"]:before,.single-quiz .quiz-result-field[data-value="36"] span,#quiz-countdown[data-value="36"]:after{width:36%;}.single-quiz .quiz-result-field[data-value="37"]:before,.single-quiz .quiz-result-field[data-value="37"] span,#quiz-countdown[data-value="37"]:after{width:37%;}.single-quiz .quiz-result-field[data-value="38"]:before,.single-quiz .quiz-result-field[data-value="38"] span,#quiz-countdown[data-value="38"]:after{width:38%;}.single-quiz .quiz-result-field[data-value="39"]:before,.single-quiz .quiz-result-field[data-value="39"] span,#quiz-countdown[data-value="39"]:after{width:39%;}.single-quiz .quiz-result-field[data-value="40"]:before,.single-quiz .quiz-result-field[data-value="40"] span,#quiz-countdown[data-value="40"]:after{width:40%;}.single-quiz .quiz-result-field[data-value="41"]:before,.single-quiz .quiz-result-field[data-value="41"] span,#quiz-countdown[data-value="41"]:after{width:41%;}.single-quiz .quiz-result-field[data-value="42"]:before,.single-quiz .quiz-result-field[data-value="42"] span,#quiz-countdown[data-value="42"]:after{width:42%;}.single-quiz .quiz-result-field[data-value="43"]:before,.single-quiz .quiz-result-field[data-value="43"] span,#quiz-countdown[data-value="43"]:after{width:43%;}.single-quiz .quiz-result-field[data-value="44"]:before,.single-quiz .quiz-result-field[data-value="44"] span,#quiz-countdown[data-value="44"]:after{width:44%;}.single-quiz .quiz-result-field[data-value="45"]:before,.single-quiz .quiz-result-field[data-value="45"] span,#quiz-countdown[data-value="45"]:after{width:45%;}.single-quiz .quiz-result-field[data-value="46"]:before,.single-quiz .quiz-result-field[data-value="46"] span,#quiz-countdown[data-value="46"]:after{width:46%;}.single-quiz .quiz-result-field[data-value="47"]:before,.single-quiz .quiz-result-field[data-value="47"] span,#quiz-countdown[data-value="47"]:after{width:47%;}.single-quiz .quiz-result-field[data-value="48"]:before,.single-quiz .quiz-result-field[data-value="48"] span,#quiz-countdown[data-value="48"]:after{width:48%;}.single-quiz .quiz-result-field[data-value="49"]:before,.single-quiz .quiz-result-field[data-value="49"] span,#quiz-countdown[data-value="49"]:after{width:49%;}.single-quiz .quiz-result-field[data-value="50"]:before,.single-quiz .quiz-result-field[data-value="50"] span,#quiz-countdown[data-value="50"]:after{width:50%;}.single-quiz .quiz-result-field[data-value="51"]:before,.single-quiz .quiz-result-field[data-value="51"] span,#quiz-countdown[data-value="51"]:after{width:51%;}.single-quiz .quiz-result-field[data-value="52"]:before,.single-quiz .quiz-result-field[data-value="52"] span,#quiz-countdown[data-value="52"]:after{width:52%;}.single-quiz .quiz-result-field[data-value="53"]:before,.single-quiz .quiz-result-field[data-value="53"] span,#quiz-countdown[data-value="53"]:after{width:53%;}.single-quiz .quiz-result-field[data-value="54"]:before,.single-quiz .quiz-result-field[data-value="54"] span,#quiz-countdown[data-value="54"]:after{width:54%;}.single-quiz .quiz-result-field[data-value="55"]:before,.single-quiz .quiz-result-field[data-value="55"] span,#quiz-countdown[data-value="55"]:after{width:55%;}.single-quiz .quiz-result-field[data-value="56"]:before,.single-quiz .quiz-result-field[data-value="56"] span,#quiz-countdown[data-value="56"]:after{width:56%;}.single-quiz .quiz-result-field[data-value="57"]:before,.single-quiz .quiz-result-field[data-value="57"] span,#quiz-countdown[data-value="57"]:after{width:57%;}.single-quiz .quiz-result-field[data-value="58"]:before,.single-quiz .quiz-result-field[data-value="58"] span,#quiz-countdown[data-value="58"]:after{width:58%;}.single-quiz .quiz-result-field[data-value="59"]:before,.single-quiz .quiz-result-field[data-value="59"] span,#quiz-countdown[data-value="59"]:after{width:59%;}.single-quiz .quiz-result-field[data-value="60"]:before,.single-quiz .quiz-result-field[data-value="60"] span,#quiz-countdown[data-value="60"]:after{width:60%;}.single-quiz .quiz-result-field[data-value="61"]:before,.single-quiz .quiz-result-field[data-value="61"] span,#quiz-countdown[data-value="61"]:after{width:61%;}.single-quiz .quiz-result-field[data-value="62"]:before,.single-quiz .quiz-result-field[data-value="62"] span,#quiz-countdown[data-value="62"]:after{width:62%;}.single-quiz .quiz-result-field[data-value="63"]:before,.single-quiz .quiz-result-field[data-value="63"] span,#quiz-countdown[data-value="63"]:after{width:63%;}.single-quiz .quiz-result-field[data-value="64"]:before,.single-quiz .quiz-result-field[data-value="64"] span,#quiz-countdown[data-value="64"]:after{width:64%;}.single-quiz .quiz-result-field[data-value="65"]:before,.single-quiz .quiz-result-field[data-value="65"] span,#quiz-countdown[data-value="65"]:after{width:65%;}.single-quiz .quiz-result-field[data-value="66"]:before,.single-quiz .quiz-result-field[data-value="66"] span,#quiz-countdown[data-value="66"]:after{width:66%;}.single-quiz .quiz-result-field[data-value="67"]:before,.single-quiz .quiz-result-field[data-value="67"] span,#quiz-countdown[data-value="67"]:after{width:67%;}.single-quiz .quiz-result-field[data-value="68"]:before,.single-quiz .quiz-result-field[data-value="68"] span,#quiz-countdown[data-value="68"]:after{width:68%;}.single-quiz .quiz-result-field[data-value="69"]:before,.single-quiz .quiz-result-field[data-value="69"] span,#quiz-countdown[data-value="69"]:after{width:69%;}.single-quiz .quiz-result-field[data-value="70"]:before,.single-quiz .quiz-result-field[data-value="70"] span,#quiz-countdown[data-value="70"]:after{width:70%;}.single-quiz .quiz-result-field[data-value="71"]:before,.single-quiz .quiz-result-field[data-value="71"] span,#quiz-countdown[data-value="71"]:after{width:71%;}.single-quiz .quiz-result-field[data-value="72"]:before,.single-quiz .quiz-result-field[data-value="72"] span,#quiz-countdown[data-value="72"]:after{width:72%;}.single-quiz .quiz-result-field[data-value="73"]:before,.single-quiz .quiz-result-field[data-value="73"] span,#quiz-countdown[data-value="73"]:after{width:73%;}.single-quiz .quiz-result-field[data-value="74"]:before,.single-quiz .quiz-result-field[data-value="74"] span,#quiz-countdown[data-value="74"]:after{width:74%;}.single-quiz .quiz-result-field[data-value="75"]:before,.single-quiz .quiz-result-field[data-value="75"] span,#quiz-countdown[data-value="75"]:after{width:75%;}.single-quiz .quiz-result-field[data-value="76"]:before,.single-quiz .quiz-result-field[data-value="76"] span,#quiz-countdown[data-value="76"]:after{width:76%;}.single-quiz .quiz-result-field[data-value="77"]:before,.single-quiz .quiz-result-field[data-value="77"] span,#quiz-countdown[data-value="77"]:after{width:77%;}.single-quiz .quiz-result-field[data-value="78"]:before,.single-quiz .quiz-result-field[data-value="78"] span,#quiz-countdown[data-value="78"]:after{width:78%;}.single-quiz .quiz-result-field[data-value="79"]:before,.single-quiz .quiz-result-field[data-value="79"] span,#quiz-countdown[data-value="79"]:after{width:79%;}.single-quiz .quiz-result-field[data-value="80"]:before,.single-quiz .quiz-result-field[data-value="80"] span,#quiz-countdown[data-value="80"]:after{width:80%;}.single-quiz .quiz-result-field[data-value="81"]:before,.single-quiz .quiz-result-field[data-value="81"] span,#quiz-countdown[data-value="81"]:after{width:81%;}.single-quiz .quiz-result-field[data-value="82"]:before,.single-quiz .quiz-result-field[data-value="82"] span,#quiz-countdown[data-value="82"]:after{width:82%;}.single-quiz .quiz-result-field[data-value="83"]:before,.single-quiz .quiz-result-field[data-value="83"] span,#quiz-countdown[data-value="83"]:after{width:83%;}.single-quiz .quiz-result-field[data-value="84"]:before,.single-quiz .quiz-result-field[data-value="84"] span,#quiz-countdown[data-value="84"]:after{width:84%;}.single-quiz .quiz-result-field[data-value="85"]:before,.single-quiz .quiz-result-field[data-value="85"] span,#quiz-countdown[data-value="85"]:after{width:85%;}.single-quiz .quiz-result-field[data-value="86"]:before,.single-quiz .quiz-result-field[data-value="86"] span,#quiz-countdown[data-value="86"]:after{width:86%;}.single-quiz .quiz-result-field[data-value="87"]:before,.single-quiz .quiz-result-field[data-value="87"] span,#quiz-countdown[data-value="87"]:after{width:87%;}.single-quiz .quiz-result-field[data-value="88"]:before,.single-quiz .quiz-result-field[data-value="88"] span,#quiz-countdown[data-value="88"]:after{width:88%;}.single-quiz .quiz-result-field[data-value="89"]:before,.single-quiz .quiz-result-field[data-value="89"] span,#quiz-countdown[data-value="89"]:after{width:89%;}.single-quiz .quiz-result-field[data-value="90"]:before,.single-quiz .quiz-result-field[data-value="90"] span,#quiz-countdown[data-value="90"]:after{width:90%;}.single-quiz .quiz-result-field[data-value="91"]:before,.single-quiz .quiz-result-field[data-value="91"] span,#quiz-countdown[data-value="91"]:after{width:91%;}.single-quiz .quiz-result-field[data-value="92"]:before,.single-quiz .quiz-result-field[data-value="92"] span,#quiz-countdown[data-value="92"]:after{width:92%;}.single-quiz .quiz-result-field[data-value="93"]:before,.single-quiz .quiz-result-field[data-value="93"] span,#quiz-countdown[data-value="93"]:after{width:93%;}.single-quiz .quiz-result-field[data-value="94"]:before,.single-quiz .quiz-result-field[data-value="94"] span,#quiz-countdown[data-value="94"]:after{width:94%;}.single-quiz .quiz-result-field[data-value="95"]:before,.single-quiz .quiz-result-field[data-value="95"] span,#quiz-countdown[data-value="95"]:after{width:95%;}.single-quiz .quiz-result-field[data-value="96"]:before,.single-quiz .quiz-result-field[data-value="96"] span,#quiz-countdown[data-value="96"]:after{width:96%;}.single-quiz .quiz-result-field[data-value="97"]:before,.single-quiz .quiz-result-field[data-value="97"] span,#quiz-countdown[data-value="97"]:after{width:97%;}.single-quiz .quiz-result-field[data-value="98"]:before,.single-quiz .quiz-result-field[data-value="98"] span,#quiz-countdown[data-value="98"]:after{width:98%;}.single-quiz .quiz-result-field[data-value="99"]:before,.single-quiz .quiz-result-field[data-value="99"] span,#quiz-countdown[data-value="99"]:after{width:99%;}.single-quiz .quiz-result-field[data-value="100"]:before,.single-quiz .quiz-result-field[data-value="100"] span,#quiz-countdown[data-value="100"]:after{width:100%;}.learn-press-question-options{list-style:none;margin:0 0 20px 0;padding:0;}.learn-press-question-options > li.answer-option{font-size:16px;background:#F5F5F5;margin-bottom:20px;position:relative;-webkit-border-radius:4px;-khtml-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.learn-press-question-options > li.answer-option > label{display:block;}.learn-press-question-options > li.answer-option > label input[type="checkbox"],.learn-press-question-options > li.answer-option > label input[type="radio"]{border:0;-webkit-appearance:initial;width:30px;height:30px;background:#fff;border-radius:4px;outline:none;position:absolute;top:10px;left:15px;margin:0;}.learn-press-question-options > li.answer-option > label input[type="checkbox"]:checked:before,.learn-press-question-options > li.answer-option > label input[type="radio"]:checked:before{content:'';border:4px solid #00b9eb;display:inline-block;width:10px;height:15px;border-top:none;border-left:none;position:absolute;top:3px;left:8px;box-sizing:content-box;-webkit-transform:rotate(36deg);-khtml-transform:rotate(36deg);-moz-transform:rotate(36deg);-ms-transform:rotate(36deg);-o-transform:rotate(36deg);transform:rotate(36deg);}.learn-press-question-options > li.answer-option > label input[type="checkbox"]:checked + p,.learn-press-question-options > li.answer-option > label input[type="radio"]:checked + p{font-weight:bold;background:#00b9eb;color:#FFF;}.learn-press-question-options > li.answer-option > label input[type="checkbox"][disabled],.learn-press-question-options > li.answer-option > label input[type="radio"][disabled]{opacity:1;}.learn-press-question-options > li.answer-option > label input[type="radio"]{-webkit-border-radius:50%;-khtml-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;}.learn-press-question-options > li.answer-option > label p{min-height:50px;padding:5px 20px 5px 60px;margin:0;box-sizing:border-box;line-height:1.5;}.learn-press-question-options > li.answer-option > label p.single-lines{padding:0 20px 0 60px;line-height:50px;}.learn-press-question-options > li.answer-option label p{-webkit-border-radius:4px;-khtml-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.learn-press-question-options > li.answer-option.answer-true label p{background:#00b9eb;color:#FFF;}.learn-press-question-options > li.answer-option:hover label p{background:#D4D4D4;cursor:pointer;}.learn-press-question-options > li.answer-option.user-answer-false{background:#F5F5F5;}.learn-press-question-options > li.answer-option.user-answer-false > label input[type="checkbox"] + p,.learn-press-question-options > li.answer-option.user-answer-false > label input[type="radio"] + p{text-decoration:line-through;color:#FF0000;background:#F5F5F5;}.learn-press-question-options .answer-option-result label p{display:inline-block;margin:0;font-size:smaller;}.learn-press-question-options .answer-option-result label input[disabled]{opacity:1;}.learnpress-content{margin-bottom:20px;}.course-meta{margin-bottom:20px;}.course-meta .course-origin-price{padding-right:5px;text-decoration:line-through;}.course-meta .course-price{font-weight:bold;}.learn-press-message{background:#F5F5F5;border-left:5px solid #00A0D2;padding:10px 20px 1px 20px;margin-bottom:20px;}.learn-press-message button{float:right;}.learn-press-message p{margin-bottom:10px;}.learn-press-message:after{clear:both;content:'';display:block;}.learn-press-message.notice{border-left-color:#b3d20a;}.learn-press-message.error{border-left-color:#b81c23;}.learn-press-message ul{list-style-type:none;}.learn-press-checkout-comment,.learn-press-checkout-payment{margin-bottom:20px;}.learn-press-checkout-payment .payment-methods{list-style:none;margin:0;}.single-quiz .quiz-questions-list{padding:0;}.single-quiz .quiz-intro{list-style:none;padding:10px 20px;background:#F5F5F5;margin:0 0 20px 0;}.single-quiz h4{margin-bottom:10px;font-size:18px;}.learn-press-tooltip{font-size:20px;display:inline-block;vertical-align:middle;background:#0f4956;cursor:pointer;line-height:1;width:10px;height:10px;border-radius:50%;font-weight:700;position:relative;}.learn-press-tooltip:before{content:"?";font-size:7px;color:white;position:absolute;top:2px;left:3px;}.lp-form-field-wrap{list-style:none;margin:0 0 20px 0;}.lp-form-field-wrap .lp-form-field{list-style:none;margin:0 0 20px 0;}.lp-form-field-wrap .lp-form-field .lp-form-field-label{display:block;font-weight:bold;margin-bottom:5px;}.lp-form-field-wrap .lp-form-field .lp-form-field-input .description{font-size:smaller;font-style:italic;margin-top:5px;}.lp-form-field-wrap .lp-form-field .lp-field-error-message{color:#FF0000;}.learn-press-user-profile .lp-edit-profile:after{display:block;content:'';clear:both;}.learn-press-user-profile .lp-edit-profile:after:after{content:'';display:block;clear:both;}.learn-press-user-profile .user-basic-info p{margin-top:10px;}.learn-press-user-profile .learn-press-tabs{list-style:none;margin:30px 0 20px;border-bottom:1px solid #DDD;}.learn-press-user-profile .learn-press-tabs > li{float:left;list-style-type:none;margin-bottom:-1px;}.learn-press-user-profile .learn-press-tabs > li > a{display:inline-block;padding:10px 15px;outline:none;box-shadow:none;color:#686868;border-bottom:1px solid #DDD;}.learn-press-user-profile .learn-press-tabs > li.current{border-bottom:4px solid #007acc;}.learn-press-user-profile .learn-press-tabs > li.current a{color:#007acc;margin-bottom:-4px;}.learn-press-user-profile .learn-press-subtabs > li{display:inline-block;margin-right:10px;}.learn-press-user-profile .learn-press-subtabs > li.current{font-weight:bold;}.learn-press-user-profile .learn-press-subtab-content{display:block;margin-bottom:20px;}.learn-press-user-profile .learn-press-subtab-content.current{display:block;}.learn-press-user-profile .learn-press-subtab-content li.course h3{padding-bottom:10px;}.learn-press-user-profile .learn-press-subtab-content .profile-courses{list-style-type:none;}.learn-press-user-profile .learn-press-subtab-content .profile-courses .learn-press-course-results-progress{padding:0 15px 15px 15px;margin:0;}.learn-press-user-profile button.learn-press-course-wishlist{display:block;}.learn-press-user-profile .user-profile-edit-form .info-field{margin-bottom:20px;}.learn-press-user-profile .user-profile-edit-form .description{margin-top:5px;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture{clear:both;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture .picture,.learn-press-user-profile .user-profile-edit-form .user-profile-picture .change-picture{display:inline-block;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture .change-picture .description{margin:0 0 10px 0;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture img{float:left;margin-right:20px;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture:after{display:block;content:'';clear:both;}.learn-press-user-profile .user-profile-edit-form .user-profile-picture:after:after{content:'';display:block;clear:both;}.learn-press-user-profile .user-profile-edit-form .profile-field-name{font-weight:bold;margin-bottom:10px;}.learn-press-user-profile .user-profile-edit-form .change-password{margin-bottom:10px;}.learn-press-user-profile .user-profile-edit-form #user_profile_password_form input{margin-bottom:20px;}.learn-press-user-profile .user-profile-edit-form #user_profile_password_form .description{margin-top:-15px;}.learn-press-user-profile .update-profile{border-top:2px solid #DDD;padding-top:20px;}.learn-press-user-profile #lp-user-edit-avatar .moxie-shim{display:none;}.learn-press-user-profile #lp-user-edit-avatar .lp-form-field-avatar{float:left;}.learn-press-user-profile #lp-user-edit-avatar #lp-avatar-actions{margin:20px 0;}.learn-press-user-profile .lp-avatar-preview{position:relative;float:left;background-color:#DDD;}.learn-press-user-profile .lp-avatar-preview .profile-picture{float:left;margin-right:-100%;width:100%;}.learn-press-user-profile .lp-avatar-preview .profile-picture img{width:100%;height:100%;border-radius:0;}.learn-press-user-profile .lp-avatar-preview .profile-picture.profile-avatar-hidden{display:none;}.learn-press-user-profile .lp-avatar-preview .lp-avatar-preview-actions{position:absolute;top:50%;width:100%;margin-top:-14px;text-align:center;display:none;}.learn-press-user-profile .lp-avatar-preview .lp-avatar-preview-actions a{text-decoration:none;font-size:12px;background:#FFF;display:inline-block;box-shadow:none;padding:5px 10px;}.learn-press-user-profile .lp-avatar-preview .lp-avatar-upload-progress{position:absolute;height:10px;background:#FFF;top:50%;margin-top:-5px;left:10px;right:10px;display:none;}.learn-press-user-profile .lp-avatar-preview .lp-avatar-upload-progress .lp-avatar-upload-progress-value{width:0;height:10px;background:#563d7c;}.learn-press-user-profile .lp-avatar-preview .lp-avatar-upload-error{display:none;}.learn-press-user-profile .lp-avatar-preview:hover .lp-avatar-preview-actions{display:block;}.learn-press-user-profile .lp-avatar-preview.uploading .lp-avatar-preview-actions,.learn-press-user-profile .lp-avatar-preview.upload-error .lp-avatar-preview-actions{display:none;}.learn-press-user-profile .lp-avatar-preview.uploading .lp-avatar-upload-progress,.learn-press-user-profile .lp-avatar-preview.upload-error .lp-avatar-upload-progress{display:block;}.learn-press-user-profile .lp-avatar-preview.uploading:before,.learn-press-user-profile .lp-avatar-preview.upload-error:before{position:absolute;width:100%;height:100%;background:#FFF;opacity:0.4;content:'';}.learn-press-user-profile .lp-avatar-preview.upload-error .lp-avatar-upload-error{display:block;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-preview-actions{display:none;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;overflow:hidden;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image img{max-width:inherit;cursor:move;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls{position:absolute;bottom:0;width:100%;height:30px;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls .lp-zoom{position:absolute;height:10px;bottom:10px;left:10px;right:30px;background:#563d7a;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls .lp-zoom .ui-slider{position:absolute;left:0;right:10px;height:100%;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls .lp-zoom .ui-slider .ui-slider-handle{display:inline-block;width:10px;height:14px;background:#FFF;position:absolute;margin-top:-2px;border:1px solid #563d7a;box-shadow:none;outline:none;cursor:ew-resize;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls .lp-cancel-upload{text-decoration:none;position:absolute;bottom:5px;right:5px;box-shadow:none;}.learn-press-user-profile .lp-avatar-preview.croping .lp-avatar-crop-image .lp-crop-controls:before{position:absolute;height:30px;width:100%;content:'';background:#FFF;opacity:0.4;}.learn-press-user-profile .lp-avatar-preview:after{display:block;content:'';clear:both;}.learn-press-user-profile .lp-avatar-preview:after:after{content:'';display:block;clear:both;}body.profile-dragging{cursor:move !important;}body.profile-resizing{cursor:ew-resize !important;}.learn-press-pagination{text-align:center;}.learn-press-pagination ul{list-style:disc;}.learn-press-pagination ul > li{display:inline-block;}.learn-press-pagination ul > li span{display:inline-block;padding:0 10px;border:1px solid #DDD;background-color:#F5F5F5;}.learn-press-pagination ul > li a{display:inline-block;padding:0 10px;border:1px solid #DDD;background-color:#FFF;}.learn-press-become-teacher-form ul{list-style:none;padding:0;}.learn-press-become-teacher-form ul li{margin-bottom:20px;}#popup_container #popup_title{padding:10px 20px;background:#18B6C7;color:#FFF;font-size:18px;margin:0;}#popup_container #popup_content{padding:20px;}#popup_container #popup_content #popup_message{margin-bottom:20px;}#popup_container #popup_panel{text-align:center;}.single-lp_course .course-summary .lp_course .entry-footer{display:none;}.single-lp_course .learn-press-message{clear:both;margin-top:25px;}.learn-press-tooltip-bubble{position:absolute;background:rgba(26, 26, 26, 0.9);color:#ffffff;padding:8px 10px;font-size:12px;z-index:9999999;line-height:1;border-radius:3px;}input.blank-fill-correct{width:auto;}body.content-item-only{background:#FFF;opacity:0;}body.content-item-only .learn-press-content-item-only{position:fixed;z-index:9999999;left:0;top:0;width:100%;height:100%;background:#FFF;overflow:auto;padding:20px;margin:0;}body.content-item-only #learn-press-content-item{border:none;display:block;transition:max-width linear 0.25s;margin:0 auto;max-width:1000px;width:90%;}body.content-item-only #learn-press-content-item.expand{max-width:1200px;}.lp-group-heading-title.toggle-off,.lp-group-heading-title.toggle-on{cursor:pointer;}.lp-group-heading-title.toggle-off .toggle-icon,.lp-group-heading-title.toggle-on .toggle-icon{display:inline-block;font-size:larger;line-height:1;font-weight:bold;margin-left:5px;}.lp-group-heading-title.toggle-off .toggle-icon:before,.lp-group-heading-title.toggle-on .toggle-icon:before{content:'+';}.lp-group-heading-title.toggle-on .toggle-icon:before{content:'-';}.payment-method-form.payment_method_authorizenet{background:#f7f7f7;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;padding-top:25px;}.payment-method-form.payment_method_authorizenet .row-fluid{clear:both;padding-bottom:25px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child{width:50%;float:left;width:100%;margin-bottom:15px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child label{margin-left:17px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child select,.payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child input{margin-left:10px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6 select,.payment-method-form.payment_method_authorizenet .row-fluid .span6 input{padding:8px 0;}.payment-method-form.payment_method_authorizenet .row-fluid .span6 select.required{color:#000;color:#000;}.place-order-action{margin-top:20px;}.woocommerce form .form-row.validate-email,.woocommerce form .form-row.validate-phone{width:100% !important;}.woocommerce .checkout_coupon .form-row-last input.button{padding:13px 10px !important;}.learn-press-search-course-form{margin-bottom:20px;}.learn-press-search-course-form input.search-course-input[name="s"]{margin-right:-200px;width:100%;}.learn-press-search-course-form .search-course-button{vertical-align:middle;float:right;z-index:10;position:relative;}.recent-courses-widget .course-meta-data > div,.popular-courses-widget .course-meta-data > div,.featured-courses-widget .course-meta-data > div{display:inline-block;}.recent-courses-widget .course-meta-data > div:after,.popular-courses-widget .course-meta-data > div:after,.featured-courses-widget .course-meta-data > div:after{content:'/';}.recent-courses-widget .course-meta-data > div:last-child:after,.popular-courses-widget .course-meta-data > div:last-child:after,.featured-courses-widget .course-meta-data > div:last-child:after{content:'';}.recent-courses-widget .course-title,.popular-courses-widget .course-title,.featured-courses-widget .course-title{margin:5px 0;}.recent-courses-widget .course-entry,.popular-courses-widget .course-entry,.featured-courses-widget .course-entry{margin-bottom:20px;}@-moz-keyframes spin-12{0% { -moz-transform:rotate(0deg) translate(0px);}100%{-moz-transform:rotate(360deg) translate(0px);-webkit-transform:rotate(360deg) translate(0px);transform:rotate(360deg) translate(0px);}}@-webkit-keyframes spin-12{0% { -webkit-transform:rotate(0deg) translate(0px);}}@keyframes spin-12{0% { -webkit-transform:rotate(0deg) translate(0px);transform:rotate(0deg) translate(0px);}}@-moz-keyframes spin-13{100% { -moz-transform:rotate(0deg) translate(0px);}0%{-moz-transform:rotate(360deg) translate(0px);-webkit-transform:rotate(360deg) translate(0px);transform:rotate(360deg) translate(0px);}}@-webkit-keyframes spin-13{0% { -webkit-transform:rotate(0deg) translate(0px);}}@keyframes spin-13{100% { -webkit-transform:rotate(0deg) translate(0px);transform:rotate(0deg) translate(0px);}}@media screen and (max-width: 1250px){.single-lp_course .learn-press-course-results-progress .items-progress, .single-lp_course .learn-press-course-results-progress .course-progress { float:none;width:100%;}}@media screen and (max-width: 768px){#learn-press-block-content:before { width: 60px;height:60px;margin-left:-30px;margin-top:-30px;-webkit-clip-path:polygon(0px 60px, 60px 60px, 60px 30px, 30px 30px, 30px 0, 0 0);}.learn-press-course-results-progress .items-progress, .learn-press-course-results-progress .course-progress{width:100%;margin-right:0;}}@media (min-width: 992px){.learn-press-courses li.course:nth-child(4n+1) { clear: left;}}@media (max-width: 992px){.learn-press-courses { margin:0;}}@media (max-width: 992px) and (min-width: 600px){.learn-press-courses li.course { width:31.33%;margin:0 2% 30px 0;}.learn-press-courses li.course:nth-child(3n+1){clear:left;margin-left:0;}}@media (max-width: 600px) and (min-width: 400px){.learn-press-courses li.course { width:48%;margin:0 2% 30px 0;}.learn-press-courses li.course:nth-child(2n+1){clear:left;margin-left:0;}}@media (max-width: 480px){.woocommerce .checkout_coupon .form-row { width:100%;}}@media (max-width: 400px){.learn-press-courses li.course { width:100%;margin:0 0 30px 0;clear:left;}}@media (max-width: 350px){#course-curriculum-popup #popup-sidebar { width:100%;}}@media screen and (min-width: 61.5625em){body.single-lp_course article.lp_course .entry-content { width:100%;}body.single-lp_course article.lp_course .entry-footer{display:none;}}@media screen and (max-width: 615px){.payment-method-form.payment_method_authorizenet .row-fluid { padding-bottom:15px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6 label{margin-left:17px;}.payment-method-form.payment_method_authorizenet .row-fluid .span6 select, .payment-method-form.payment_method_authorizenet .row-fluid .span6 input{margin-left:10px;padding:8px 0;}.payment-method-form.payment_method_authorizenet .row-fluid .span6 #learn-press-authorizenet-payment-expmonth{margin-bottom:10px;}
assets/css/learnpress.css CHANGED
@@ -1796,7 +1796,7 @@ body.block-content #learn-press-block-content {
1796
.learn-press-message {
1797
background: #F5F5F5;
1798
border-left: 5px solid #00A0D2;
1799
- padding: 10px 20px 1px 20px;
1800
margin-bottom: 20px;
1801
}
1802
.learn-press-message button {
1796
.learn-press-message {
1797
background: #F5F5F5;
1798
border-left: 5px solid #00A0D2;
1799
+ padding: 10px 20px 10px 20px;
1800
margin-bottom: 20px;
1801
}
1802
.learn-press-message button {
assets/css/learnpress.less CHANGED
@@ -1309,7 +1309,7 @@ body.block-content {
1309
.learn-press-message {
1310
background: #F5F5F5;
1311
border-left: 5px solid #00A0D2;
1312
- padding: 10px 20px 1px 20px;
1313
margin-bottom: 20px;
1314
button {
1315
float: right;
1309
.learn-press-message {
1310
background: #F5F5F5;
1311
border-left: 5px solid #00A0D2;
1312
+ padding: 10px 20px 10px 20px;
1313
margin-bottom: 20px;
1314
button {
1315
float: right;
inc/admin/dashboard-statistics/class-lp-statistic-status.php CHANGED
@@ -12,10 +12,15 @@ if ( !class_exists( 'LP_Statistic_Status' ) ) :
12
* @since 2.0
13
*/
14
public static function render() {
15
- global $lp_order_statuses;
16
- $eduma_data = self::get_eduma_info( 14058034 );
17
- // $total_orders = learn_press_get_orders( array( 'post_status' => array_keys( $lp_order_statuses ) ) );
18
$specific_statuses = array( 'lp-completed', 'lp-failed', 'lp-on-hold' );
19
?>
20
<ul class="learnpress-statistic-status">
21
<li class="full-width">
@@ -26,31 +31,38 @@ if ( !class_exists( 'LP_Statistic_Status' ) ) :
26
</span>
27
</a>
28
</li>
29
- <?php foreach ( $specific_statuses as $status ) : $count = count( learn_press_get_orders( array( 'post_status' => $status ) ) ); ?>
30
- <li>
31
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_status=' . LP_ORDER_CPT . '&post_type=' . $status ) ); ?>" class="<?php echo esc_attr( $status ) ?>">
32
- <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
33
- <?php printf( '%s', get_post_status_object( $status )->label ) ?>
34
- </a>
35
- </li>
36
- <?php endforeach; ?>
37
- <?php foreach ( $lp_order_statuses as $status => $args ) : if ( in_array( $status, $specific_statuses ) ) continue;
38
- $count = count( learn_press_get_orders( array( 'post_status' => $status ) ) ); ?>
39
<li>
40
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_status=' . LP_ORDER_CPT . '&post_type=' . $status ) ); ?>" class="<?php echo esc_attr( $status ) ?>">
41
- <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
42
- <?php printf( '%s', get_post_status_object( $status )->label ) ?>
43
- </a>
44
</li>
45
<?php endforeach; ?>
46
<li class="full-width featured-theme">
47
- <span><?php _e( 'Featured: ', 'learnpress' ); ?></span>
48
- <a href="<?php echo esc_url( $eduma_data['item']['url'] ) ?>">
49
- <?php echo esc_html( $eduma_data['item']['item'] ) ?>
50
- </a>-
51
- <span class="price"><?php printf( '%s%s', '#x27;, $eduma_data['item']['cost'] ) ?></span>
52
- <span><?php _e( 'Created by: ', 'learnpress' ) ?></span>
53
- <a href="https://thimpress.com/" class="author"><?php echo esc_html( $eduma_data['item']['user'] ); ?></a>
54
</li>
55
</ul>
56
<?php
12
* @since 2.0
13
*/
14
public static function render() {
15
+ $order_statuses = learn_press_get_register_order_statuses();
16
+ $eduma_data = self::get_eduma_info( 14058034 );
17
+ $xx = array_keys( $order_statuses );
18
$specific_statuses = array( 'lp-completed', 'lp-failed', 'lp-on-hold' );
19
+ foreach ( $xx as $status ) {
20
+ if ( !in_array( $status, $specific_statuses ) ) {
21
+ $specific_statuses[] = $status;
22
+ }
23
+ }
24
?>
25
<ul class="learnpress-statistic-status">
26
<li class="full-width">
31
</span>
32
</a>
33
</li>
34
+ <?php foreach ( $specific_statuses as $status ) : ?>
35
+ <?php
36
+ $status_object = get_post_status_object( $status );
37
+ if ( !$status_object ) {
38
+ continue;
39
+ }
40
+ $count = count( learn_press_get_orders( array( 'post_status' => $status ) ) );
41
+ ?>
42
<li>
43
+ <?php if ( $count ): ?>
44
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_status=' . LP_ORDER_CPT . '&post_type=' . $status ) ); ?>" class="<?php echo esc_attr( $status ) ?>">
45
+ <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
46
+ <?php printf( '%s', $status_object->label ); ?>
47
+ </a>
48
+ <?php else: ?>
49
+ <span class="<?php echo esc_attr( $status ) ?>">
50
+ <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
51
+ <?php printf( '%s', $status_object->label ); ?>
52
+ </span>
53
+ <?php endif; ?>
54
</li>
55
<?php endforeach; ?>
56
<li class="full-width featured-theme">
57
+ <p>
58
+ <a href="<?php echo esc_url( $eduma_data['item']['url'] ) ?>">
59
+ <?php echo esc_html( $eduma_data['item']['item'] ) ?>
60
+ </a> - <?php printf( '%s%s', '#x27;, $eduma_data['item']['cost'] ) ?>
61
+ </p>
62
+ <p>
63
+ <?php _e( 'Created by: ', 'learnpress' ) ?>
64
+ <a href="https://thimpress.com/" class="author"><?php echo esc_html( $eduma_data['item']['user'] ); ?></a>
65
+ </p>
66
</li>
67
</ul>
68
<?php
inc/admin/settings/class-lp-settings-courses.php CHANGED
@@ -1,165 +1,176 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Settings_Courses
5
- */
6
- class LP_Settings_Courses extends LP_Settings_Base {
7
- public function __construct() {
8
- $this->id = 'courses';
9
- $this->text = __( 'Courses', 'learnpress' );
10
-
11
- parent::__construct();
12
- }
13
-
14
- public function _get_sections() {
15
- $sections = array(
16
- 'general' => array(
17
- 'id' => 'general',
18
- 'title' => __( 'General', 'learnpress' )
19
- )
20
- );
21
- return $sections = apply_filters( 'learn_press_settings_sections_' . $this->id, $sections );
22
- }
23
-
24
- public function save() {
25
- parent::save();
26
- $course_permalink = $_POST['learn_press_course_base'];
27
- update_option( 'learn_press_course_base_type', $course_permalink );
28
- if ( $course_permalink == 'custom' ) {
29
- $course_permalink = trim( $_POST['course_permalink_structure'], '/' );
30
-
31
- if ( '%course_category%' == $course_permalink ) {
32
- $course_permalink = _x( 'courses', 'slug', 'learnpress' ) . '/' . $course_permalink;
33
- }
34
-
35
- $course_permalink = '/' . $course_permalink;
36
- } elseif ( empty( $course_permalink ) ) {
37
- $course_permalink = false;
38
- }
39
-
40
- $course_base = untrailingslashit( $course_permalink );
41
-
42
- update_option( 'learn_press_course_base', $course_base );
43
-
44
- $courses_page_id = learn_press_get_page_id( 'courses' );
45
- $courses_permalink = ( $courses_page_id > 0 && get_post( $courses_page_id ) ) ? get_page_uri( $courses_page_id ) : _x( 'courses', 'default-slug', 'learnpress' );
46
-
47
- if ( $courses_page_id && trim( $course_base, '/' ) === $courses_permalink ) {
48
- update_option( 'learn_press_use_verbose_page_rules', 'yes' );
49
- } else {
50
- delete_option( 'learn_press_use_verbose_page_rules' );
51
- }
52
- }
53
-
54
- public function output() {
55
- $view = learn_press_get_admin_view( 'settings/courses.php' );
56
- require_once $view;
57
- }
58
-
59
- public function get_settings() {
60
-
61
- $generate_course_thumbnail = get_option( 'learn_press_generate_course_thumbnail' ) ? get_option( 'learn_press_generate_course_thumbnail' ) : 'no';
62
-
63
- return apply_filters(
64
- 'learn_press_courses_settings',
65
- array(
66
- array(
67
- 'title' => __( 'Courses Page', 'learnpress' ),
68
- 'id' => $this->get_field_name( 'courses_page_id' ),
69
- 'default' => '',
70
- 'type' => 'pages-dropdown'
71
- ),
72
- array(
73
- 'title' => __( 'Course category base', 'learnpress' ),
74
- 'id' => $this->get_field_name( 'course_category_base' ),
75
- 'default' => 'course-category',
76
- 'type' => 'text'
77
- ),
78
- array(
79
- 'title' => __( 'Course tag base', 'learnpress' ),
80
- 'id' => $this->get_field_name( 'course_tag_base' ),
81
- 'default' => 'course-tag',
82
- 'type' => 'text'
83
- ),
84
- array(
85
- 'title' => __( 'Review course before publish', 'learnpress' ),
86
- 'desc' => __( 'The course needs to be reviewed by admin before it can be published.', 'learnpress' ),
87
- 'id' => $this->get_field_name( 'required_review' ),
88
- 'default' => 'yes',
89
- 'type' => 'checkbox'
90
- ),
91
- array(
92
- 'title' => __( 'Enable edit published course', 'learnpress' ),
93
- 'desc' => __( 'Allow instructors to edit the course that are published without review.<br /> If this option is disabled, the course status will be changed to Pending Review when the instructor update course.', 'learnpress' ),
94
- 'id' => $this->get_field_name( 'enable_edit_published' ),
95
- 'default' => 'yes',
96
- 'type' => 'checkbox'
97
- ),
98
- array(
99
- 'title' => __( 'Show list of question in quiz', 'learnpress' ),
100
- 'desc' => __( 'Show/Hide list questions in quiz.', 'learnpress' ),
101
- 'id' => $this->get_field_name( 'disable_question_in_quiz' ),
102
- 'default' => 'yes',
103
- 'type' => 'checkbox'
104
- ),
105
- array(
106
- 'title' => __( 'Archive', 'learnpress' ),
107
- 'type' => 'title'
108
- ),
109
- array(
110
- 'title' => __( 'Courses limit', 'learnpress' ),
111
- 'desc' => __( 'Number of courses displayed per page.', 'learnpress' ),
112
- 'id' => $this->get_field_name( 'archive_course_limit' ),
113
- 'default' => '10',
114
- 'type' => 'number',
115
- 'custom_attributes' => array(
116
- 'min' => '1'
117
- )
118
- ),
119
- array(
120
- 'title' => __( 'Course thumbnail', 'learnpress' ),
121
- 'type' => 'title'
122
- ),
123
- array(
124
- 'title' => __( 'Extra thumbnail', 'learnpress' ),
125
- 'id' => $this->get_field_name( 'generate_course_thumbnail' ),
126
- 'default' => 'yes',
127
- 'type' => 'checkbox',
128
- 'desc' => __( 'Turn on/off courses extra thumbnail', 'learnpress' ),
129
- ),
130
- array(
131
- 'title' => __( 'Single course', 'learnpress' ),
132
- 'id' => $this->get_field_name( 'single_course_image_size' ),
133
- 'default' => array( 800, 450, 'yes' ),
134
- 'type' => 'image-size',
135
- 'class' => 'single-course-thumbnail' . ( ( $generate_course_thumbnail == 'no' ) ? ' hide-if-js' : '' )
136
- ),
137
- array(
138
- 'title' => __( 'Courses page', 'learnpress' ),
139
- 'id' => $this->get_field_name( 'course_thumbnail_image_size' ),
140
- 'default' => array( 400, 250, 'yes' ),
141
- 'type' => 'image-size',
142
- 'class' => 'archive-course-thumbnail' . ( ( $generate_course_thumbnail == 'no' ) ? ' hide-if-js' : '' )
143
- ),
144
- array(
145
- 'title' => __( 'Single course permalink', 'learnpress' ),
146
- 'type' => 'title'
147
- ),
148
- array(
149
- 'title' => __( 'Single course permalink', 'learnpress' ),
150
- 'type' => 'course-permalink',
151
- 'default' => ''
152
- )/*,
153
- array(
154
- 'title' => __( 'Auto navigation item', 'learnpress' ),
155
- 'type' => 'auto_nav_course_item',
156
- 'default' => 'yes',
157
- 'type' => 'checkbox',
158
- 'desc' => __( 'Navigate to next item after user complete', 'learnpress' )
159
- )*/
160
- )
161
- );
162
- }
163
- }
164
-
165
return new LP_Settings_Courses();
1
+ <?php
2
+
3
+ /**
4
+ * Class LP_Settings_Courses
5
+ */
6
+ class LP_Settings_Courses extends LP_Settings_Base {
7
+ public function __construct() {
8
+ $this->id = 'courses';
9
+ $this->text = __( 'Courses', 'learnpress' );
10
+
11
+ parent::__construct();
12
+ }
13
+
14
+ public function _get_sections() {
15
+ $sections = array(
16
+ 'general' => array(
17
+ 'id' => 'general',
18
+ 'title' => __( 'General', 'learnpress' )
19
+ )
20
+ );
21
+ return $sections = apply_filters( 'learn_press_settings_sections_' . $this->id, $sections );
22
+ }
23
+
24
+ public function save() {
25
+ parent::save();
26
+ $course_permalink = $_POST['learn_press_course_base'];
27
+ update_option( 'learn_press_course_base_type', $course_permalink );
28
+ if ( $course_permalink == 'custom' ) {
29
+ $course_permalink = trim( $_POST['course_permalink_structure'], '/' );
30
+
31
+ if ( '%course_category%' == $course_permalink ) {
32
+ $course_permalink = _x( 'courses', 'slug', 'learnpress' ) . '/' . $course_permalink;
33
+ }
34
+
35
+ $course_permalink = '/' . $course_permalink;
36
+ } elseif ( empty( $course_permalink ) ) {
37
+ $course_permalink = false;
38
+ }
39
+
40
+ $course_base = untrailingslashit( $course_permalink );
41
+
42
+ update_option( 'learn_press_course_base', $course_base );
43
+
44
+ $courses_page_id = learn_press_get_page_id( 'courses' );
45
+ $courses_permalink = ( $courses_page_id > 0 && get_post( $courses_page_id ) ) ? get_page_uri( $courses_page_id ) : _x( 'courses', 'default-slug', 'learnpress' );
46
+
47
+ if ( $courses_page_id && trim( $course_base, '/' ) === $courses_permalink ) {
48
+ update_option( 'learn_press_use_verbose_page_rules', 'yes' );
49
+ } else {
50
+ delete_option( 'learn_press_use_verbose_page_rules' );
51
+ }
52
+ }
53
+
54
+ public function output() {
55
+ $view = learn_press_get_admin_view( 'settings/courses.php' );
56
+ require_once $view;
57
+ }
58
+
59
+ public function get_settings() {
60
+
61
+ $generate_course_thumbnail = get_option( 'learn_press_generate_course_thumbnail' ) ? get_option( 'learn_press_generate_course_thumbnail' ) : 'no';
62
+
63
+ return apply_filters(
64
+ 'learn_press_courses_settings',
65
+ array(
66
+ array(
67
+ 'title' => __( 'Courses Page', 'learnpress' ),
68
+ 'id' => $this->get_field_name( 'courses_page_id' ),
69
+ 'default' => '',
70
+ 'type' => 'pages-dropdown'
71
+ ),
72
+ array(
73
+ 'title' => __( 'Course category base', 'learnpress' ),
74
+ 'id' => $this->get_field_name( 'course_category_base' ),
75
+ 'default' => 'course-category',
76
+ 'type' => 'text'
77
+ ),
78
+ array(
79
+ 'title' => __( 'Course tag base', 'learnpress' ),
80
+ 'id' => $this->get_field_name( 'course_tag_base' ),
81
+ 'default' => 'course-tag',
82
+ 'type' => 'text'
83
+ ),
84
+ array(
85
+ 'title' => __( 'Review course before publish', 'learnpress' ),
86
+ 'desc' => __( 'The course needs to be reviewed by admin before it can be published.', 'learnpress' ),
87
+ 'id' => $this->get_field_name( 'required_review' ),
88
+ 'default' => 'yes',
89
+ 'type' => 'checkbox'
90
+ ),
91
+ array(
92
+ 'title' => __( 'Enable edit published course', 'learnpress' ),
93
+ 'desc' => __( 'Allow instructors to edit the course that are published without review.<br /> If this option is disabled, the course status will be changed to Pending Review when the instructor update course.', 'learnpress' ),
94
+ 'id' => $this->get_field_name( 'enable_edit_published' ),
95
+ 'default' => 'yes',
96
+ 'type' => 'checkbox'
97
+ ),
98
+ array(
99
+ 'title' => __( 'Show list of question in quiz', 'learnpress' ),
100
+ 'desc' => __( 'Show/Hide list questions in quiz.', 'learnpress' ),
101
+ 'id' => $this->get_field_name( 'disable_question_in_quiz' ),
102
+ 'default' => 'yes',
103
+ 'type' => 'checkbox'
104
+ ),
105
+ array(
106
+ 'title' => __( 'Archive', 'learnpress' ),
107
+ 'type' => 'title'
108
+ ),
109
+ array(
110
+ 'title' => __( 'Courses limit', 'learnpress' ),
111
+ 'desc' => __( 'Number of courses displayed per page.', 'learnpress' ),
112
+ 'id' => $this->get_field_name( 'archive_course_limit' ),
113
+ 'default' => '10',
114
+ 'type' => 'number',
115
+ 'custom_attributes' => array(
116
+ 'min' => '1'
117
+ )
118
+ ),
119
+ array(
120
+ 'title' => __( 'Course thumbnail', 'learnpress' ),
121
+ 'type' => 'title'
122
+ ),
123
+ array(
124
+ 'title' => __( 'Extra thumbnail', 'learnpress' ),
125
+ 'id' => $this->get_field_name( 'generate_course_thumbnail' ),
126
+ 'default' => 'yes',
127
+ 'type' => 'checkbox',
128
+ 'desc' => __( 'Turn on/off courses extra thumbnail', 'learnpress' ),
129
+ ),
130
+ array(
131
+ 'title' => __( 'Single course', 'learnpress' ),
132
+ 'id' => $this->get_field_name( 'single_course_image_size' ),
133
+ 'default' => array( 800, 450, 'yes' ),
134
+ 'type' => 'image-size',
135
+ 'class' => 'single-course-thumbnail' . ( ( $generate_course_thumbnail == 'no' ) ? ' hide-if-js' : '' )
136
+ ),
137
+ array(
138
+ 'title' => __( 'Courses page', 'learnpress' ),
139
+ 'id' => $this->get_field_name( 'course_thumbnail_image_size' ),
140
+ 'default' => array( 400, 250, 'yes' ),
141
+ 'type' => 'image-size',
142
+ 'class' => 'archive-course-thumbnail' . ( ( $generate_course_thumbnail == 'no' ) ? ' hide-if-js' : '' )
143
+ ),
144
+ array(
145
+ 'title' => __( 'Single course permalink', 'learnpress' ),
146
+ 'type' => 'title'
147
+ ),
148
+ array(
149
+ 'title' => __( 'Single course permalink', 'learnpress' ),
150
+ 'type' => 'course-permalink',
151
+ 'default' => ''
152
+ ),
153
+ array(
154
+ 'title' => __( 'Course item slug', 'learnpress' ),
155
+ 'type' => 'title'
156
+ ),
157
+ array(
158
+ 'title' => __( 'Lesson', 'learnpress' ),
159
+ 'type' => 'text',
160
+ 'id' => $this->get_field_name( 'lesson_slug' ),
161
+ 'desc' => __( sprintf( '%s/course/sample-course/<code>lessons</code>/sample-lesson/', home_url() ), 'learnpress' ),
162
+ 'default' => 'lessons'
163
+ ),
164
+ array(
165
+ 'title' => __( 'Quiz', 'learnpress' ),
166
+ 'type' => 'text',
167
+ 'id' => $this->get_field_name( 'quiz_slug' ),
168
+ 'desc' => __( sprintf( '%s/course/sample-course/<code>quizzes</code>/sample-lesson/', home_url() ), 'learnpress' ),
169
+ 'default' => 'quizzes'
170
+ )
171
+ )
172
+ );
173
+ }
174
+ }
175
+
176
return new LP_Settings_Courses();
inc/admin/views/settings/emails/email-template.php CHANGED
@@ -72,8 +72,10 @@ $email_format = $settings->get( 'emails_' . $this->id . '.email_format', 'plain_
72
</div>
73
74
<?php if ( !$has_local_file ): ?>
75
- <?php if ( $this->support_variables ): ?>
76
- <p><strong><?php esc_html_e( 'Click on variables to add it into email content', 'learnpress' ); ?></strong></p>
77
<ol class="learn-press-email-variables<?php echo $template_type == 'html' ? ' has-editor' : ''; ?>" data-target="<?php echo esc_attr( 'learn_press_emails_' . $this->id . '_' . $template_type ); ?>">
78
<?php foreach ( $this->support_variables as $variable ): ?>
79
<li data-variable="<?php echo esc_attr( $variable ); ?>">
72
</div>
73
74
<?php if ( !$has_local_file ): ?>
75
+ <?php if ( $this->get_variables_support() ): ?>
76
+ <p>
77
+ <strong><?php esc_html_e( 'Click on variables to add it into email content', 'learnpress' ); ?></strong>
78
+ </p>
79
<ol class="learn-press-email-variables<?php echo $template_type == 'html' ? ' has-editor' : ''; ?>" data-target="<?php echo esc_attr( 'learn_press_emails_' . $this->id . '_' . $template_type ); ?>">
80
<?php foreach ( $this->support_variables as $variable ): ?>
81
<li data-variable="<?php echo esc_attr( $variable ); ?>">
inc/class-lp-emails.php CHANGED
@@ -138,10 +138,8 @@ class LP_Emails {
138
if ( !$user = learn_press_get_user( $user_id ) ) {
139
return;
140
}
141
- if ( $user->is_admin() ) {
142
- $mail = $this->emails['LP_Email_Finished_Course'];
143
- $mail->trigger( $course_id, $user->id, $result );
144
- }
145
}
146
147
/**
138
if ( !$user = learn_press_get_user( $user_id ) ) {
139
return;
140
}
141
+ $mail = $this->emails['LP_Email_Finished_Course'];
142
+ $mail->trigger( $course_id, $user->id, $result );
143
}
144
145
/**
inc/class-lp-page-controller.php CHANGED
@@ -73,7 +73,7 @@ class LP_Page_Controller {
73
}*/
74
75
public function template_loader( $template ) {
76
- global $wp_query, $post;
77
$file = '';
78
$find = array();
79
$theme_template = learn_press_template_path();
@@ -85,6 +85,19 @@ class LP_Page_Controller {
85
if ( is_post_type_archive( 'lp_course' ) ) {
86
if ( ( $page_id = learn_press_get_page_id( 'courses' ) ) && ( empty( $wp_query->queried_object_id ) || !empty( $wp_query->queried_object_id ) && $page_id != $wp_query->queried_object_id ) ) {
87
$redirect = trailingslashit( learn_press_get_page_link( 'courses' ) );
88
// Prevent loop redirect
89
if ( $page_id != get_option( 'page_on_front' ) && !learn_press_is_current_url( $redirect ) ) {
90
wp_redirect( $redirect );
@@ -127,6 +140,7 @@ class LP_Page_Controller {
127
$file = 'archive-course.php';
128
$find[] = $file;
129
$find[] = "{$theme_template}/{$file}";
130
} else {
131
if ( learn_press_is_course() ) {
132
$file = 'single-course.php';
@@ -241,6 +255,7 @@ class LP_Page_Controller {
241
$wp_query->is_singular = false;
242
$wp_query->is_posts_page = false;
243
$wp_query->is_post_type_archive = false;
244
}
245
return $template;
246
}
@@ -255,6 +270,7 @@ class LP_Page_Controller {
255
if ( LP_COURSE_CPT != get_post_type() ) {
256
return $content;
257
}
258
remove_filter( 'the_content', array( $this, 'single_content' ), $this->_filter_content_priority );
259
add_filter( 'the_content', 'wpautop' );
260
ob_start();
@@ -286,12 +302,12 @@ class LP_Page_Controller {
286
287
$this->queried_object = !empty( $q->queried_object_id ) ? $q->queried_object : false;
288
289
/**
290
* If is single course content
291
*/
292
if ( $q->get( 'post_type' ) == 'lp_course' && is_single() ) {
293
global $post;
294
-
295
/**
296
* Added in LP 2.0.5 to fix issue in some cases course become 404
297
* including case course link is valid but it also get 404 if
@@ -388,9 +404,6 @@ class LP_Page_Controller {
388
389
$q->set( 'post_type', 'lp_course' );
390
$q->set( 'page_id', '' );
391
- if ( isset( $q->query['paged'] ) ) {
392
- $q->set( 'paged', $q->query['paged'] );
393
- }
394
395
global $wp_post_types;
396
@@ -413,6 +426,10 @@ class LP_Page_Controller {
413
$q->set( 'posts_per_page', $limit );
414
}
415
416
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 10 );
417
418
return $q;
73
}*/
74
75
public function template_loader( $template ) {
76
+ global $wp_query, $post, $wp_rewrite;
77
$file = '';
78
$find = array();
79
$theme_template = learn_press_template_path();
85
if ( is_post_type_archive( 'lp_course' ) ) {
86
if ( ( $page_id = learn_press_get_page_id( 'courses' ) ) && ( empty( $wp_query->queried_object_id ) || !empty( $wp_query->queried_object_id ) && $page_id != $wp_query->queried_object_id ) ) {
87
$redirect = trailingslashit( learn_press_get_page_link( 'courses' ) );
88
+
89
+ if ( !empty( $wp_query->query['paged'] ) ) {
90
+ if ( $wp_rewrite->using_permalinks() ) {
91
+ $redirect = $redirect . 'page/' . $wp_query->query['paged'];
92
+ } else {
93
+ $redirect = add_query_arg( 'paged', $wp_query->query['paged'], $redirect );
94
+ }
95
+ }
96
+ if ( $_GET ) {
97
+ foreach ( $_GET as $k => $v ) {
98
+ $redirect = add_query_arg( $k, urlencode( $v ), $redirect );
99
+ }
100
+ }
101
// Prevent loop redirect
102
if ( $page_id != get_option( 'page_on_front' ) && !learn_press_is_current_url( $redirect ) ) {
103
wp_redirect( $redirect );
140
$file = 'archive-course.php';
141
$find[] = $file;
142
$find[] = "{$theme_template}/{$file}";
143
+
144
} else {
145
if ( learn_press_is_course() ) {
146
$file = 'single-course.php';
255
$wp_query->is_singular = false;
256
$wp_query->is_posts_page = false;
257
$wp_query->is_post_type_archive = false;
258
+
259
}
260
return $template;
261
}
270
if ( LP_COURSE_CPT != get_post_type() ) {
271
return $content;
272
}
273
+
274
remove_filter( 'the_content', array( $this, 'single_content' ), $this->_filter_content_priority );
275
add_filter( 'the_content', 'wpautop' );
276
ob_start();
302
303
$this->queried_object = !empty( $q->queried_object_id ) ? $q->queried_object : false;
304
305
+ global $wp, $wp_rewrite;
306
/**
307
* If is single course content
308
*/
309
if ( $q->get( 'post_type' ) == 'lp_course' && is_single() ) {
310
global $post;
311
/**
312
* Added in LP 2.0.5 to fix issue in some cases course become 404
313
* including case course link is valid but it also get 404 if
404
405
$q->set( 'post_type', 'lp_course' );
406
$q->set( 'page_id', '' );
407
408
global $wp_post_types;
409
426
$q->set( 'posts_per_page', $limit );
427
}
428
429
+ if ( isset( $q->query['page'] ) ) {
430
+ $q->set( 'paged', $q->query['page'] );
431
+ }
432
+
433
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 10 );
434
435
return $q;
inc/class-lp-query.php CHANGED
@@ -1,482 +1,507 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Query
5
- */
6
-
7
- defined( 'ABSPATH' ) || exit;
8
-
9
- class LP_Query {
10
- /**
11
- * @var array
12
- */
13
- public $query_vars = array();
14
-
15
- /**
16
- * LP_Query constructor.
17
- */
18
- public function __construct() {
19
- add_action( 'init', array( $this, 'add_rewrite_tags' ), 1000, 0 );
20
- add_action( 'init', array( $this, 'add_rewrite_rules' ), 1000, 0 );
21
- add_action( 'parse_query', array( $this, 'parse_request' ), 1000, 1 );
22
- /**
23
- * Add searching post by taxonomies
24
- */
25
- add_action( 'pre_get_posts', array( $this, 'query_taxonomy' ) );
26
- }
27
-
28
- /**
29
- * Parses request params and controls page
30
- *
31
- * @param WP_Query $q
32
- *
33
- * @return mixed
34
- */
35
- public function parse_request( $q ) {
36
- if ( did_action( 'learn_press_parse_query' ) ) {
37
- return $q;
38
- }
39
- $user = learn_press_get_current_user();
40
- $request = $this->get_request();
41
- if ( !$request || is_admin() ) {
42
- return $q;
43
- }
44
- remove_filter( 'do_parse_request', array( $this, 'get_current_quiz_question' ), 1010, 3 );
45
- $course_type = 'lp_course';
46
- $post_types = get_post_types( '', 'objects' );
47
-
48
- if ( empty( $post_types[$course_type] ) ) {
49
- return;
50
- }
51
- /********************/
52
- if ( empty( $q->query_vars[LP_COURSE_CPT] ) ) {
53
- return;
54
- }
55
- $this->query_vars['course'] = $q->query_vars[LP_COURSE_CPT];
56
- $course_id = learn_press_setup_course_data( $this->query_vars['course'] );
57
- $quiz_name = '';
58
- $question_name = '';
59
- $lesson_name = '';
60
- if ( !empty( $q->query_vars['quiz'] ) ) {
61
- $quiz_name = $this->query_vars['quiz'] = $q->query_vars['quiz'];
62
- $this->query_vars['item_type'] = LP_QUIZ_CPT;
63
- if ( !empty( $q->query_vars['question'] ) ) {
64
- $question_name = $this->query_vars['question'] = $q->query_vars['question'];
65
- }
66
- } elseif ( !empty( $q->query_vars['lesson'] ) ) {
67
- $lesson_name = $this->query_vars['lesson'] = $q->query_vars['lesson'];
68
- $this->query_vars['item_type'] = LP_LESSON_CPT;
69
- }
70
- if ( $quiz_name && $question_name ) {
71
- if ( $quiz = learn_press_get_post_by_name( $quiz_name, LP_QUIZ_CPT ) ) {
72
- if ( $user->has_quiz_status( 'completed', $quiz->ID, $course_id ) ) {
73
- //remove question name from uri
74
- $course = learn_press_get_course( $course_id );
75
- $redirect = $course->get_item_link( $quiz->ID );// get_site_url() . '/' . dirname( $request_match );
76
- wp_redirect( $redirect );
77
- exit();
78
- }
79
- if ( $question = learn_press_get_post_by_name( $question_name, 'lp_question' ) ) {
80
- global $wpdb;
81
- $query = $wpdb->prepare( "
82
- SELECT MAX(user_item_id)
83
- FROM {$wpdb->prefix}learnpress_user_items
84
- WHERE user_id = %d AND item_id = %d AND item_type = %s and status <> %s
85
- ", learn_press_get_current_user_id(), $quiz->ID, 'lp_quiz', 'completed' );
86
- if ( $history_id = $wpdb->get_var( $query ) ) {
87
- learn_press_update_user_item_meta( $history_id, 'current_question', $question->ID );
88
- }
89
- }
90
- }
91
- }
92
- $this->query_vars['course_id'] = $course_id;
93
- do_action_ref_array( 'learn_press_parse_query', array( &$this ) );
94
-
95
- return $q;
96
- /************************/
97
- $slug = preg_replace( '!^/!', '', $post_types[$course_type]->rewrite['slug'] );
98
-
99
- $match = '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')?/([^/]*)?/?([^/]*)?';
100
-
101
- $request_match = $request;
102
- $course_id = 0;
103
- if ( !empty( $q->query_vars['post_type'] ) && $q->query_vars['post_type'] == LP_COURSE_CPT ) {
104
- if ( !empty( $q->query_vars[LP_COURSE_CPT] ) ) {
105
- $this->query_vars['course'] = $q->query_vars[LP_COURSE_CPT];
106
- $course_id = learn_press_setup_course_data( $this->query_vars['course'] );
107
- }
108
- if ( !empty( $q->query_vars['quiz'] ) ) {
109
- $this->query_vars['quiz'] = $q->query_vars['quiz'];
110
- $this->query_vars['item_type'] = LP_QUIZ_CPT;
111
- } elseif ( !empty( $q->query_vars['lesson'] ) ) {
112
- $this->query_vars['lesson'] = $q->query_vars['lesson'];
113
- $this->query_vars['item_type'] = LP_LESSON_CPT;
114
- }
115
- }
116
-
117
- /**
118
- * Match request URI with quiz permalink
119
- */
120
- if ( preg_match( "#^$match#", $request_match, $matches ) || preg_match( "#^$match#", urldecode( $request_match ), $matches ) ) {
121
-
122
- // If request URI is a quiz permalink
123
- if ( !empty( $matches[3] ) ) {
124
- if ( !$post = learn_press_get_post_by_name( $matches[3], 'lp_quiz', true ) ) {
125
- return $q;
126
- }
127
- // If request URI does not contains a question
128
- // Try to get current question of current user and put it into URI
129
- if ( empty( $matches[4] ) ) {
130
- if ( $user->has_quiz_status( 'started', $post->ID, $course_id ) && $question_id = $user->get_current_quiz_question( $post->ID, $course_id ) ) {
131
- $this->query_vars['question'] = $q->query_vars['question'] = get_post_field( 'post_name', $question_id );
132
- }
133
- } else {
134
- // If user is viewing a question then update current question for user
135
- $question = learn_press_get_post_by_name( $matches[4], 'lp_question' );
136
- /**
137
- * If user has completed a quiz but they are accessing to a question inside quiz,
138
- * redirect them back to quiz to show results of that quiz instead
139
- */
140
- if ( $user->has_quiz_status( 'completed', $post->ID, $course_id ) ) {
141
- //remove question name from uri
142
- $redirect = get_site_url() . '/' . dirname( $request_match );
143
- wp_redirect( $redirect );
144
- exit();
145
- }
146
- if ( $question ) {
147
- global $wpdb;
148
- $query = $wpdb->prepare( "
149
- SELECT MAX(user_item_id)
150
- FROM {$wpdb->prefix}learnpress_user_items
151
- WHERE user_id = %d AND item_id = %d AND item_type = %s and status <> %s
152
- ", learn_press_get_current_user_id(), $post->ID, 'lp_quiz', 'completed' );
153
- if ( $history_id = $wpdb->get_var( $query ) ) {
154
- learn_press_update_user_item_meta( $history_id, 'current_question', $question->ID );
155
- }
156
- }
157
- }
158
- }
159
- }
160
- $this->query_vars['course_id'] = $course_id;
161
- do_action_ref_array( 'learn_press_parse_query', array( &$this ) );
162
- return $q;
163
- }
164
-
165
- /**
166
- * This function is cloned from wp core function
167
- *
168
- * @see WP()->parse_request()
169
- *
170
- * @return string
171
- */
172
- public function get_request() {
173
- global $wp_rewrite;
174
- $pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
175
- list( $pathinfo ) = explode( '?', $pathinfo );
176
- $pathinfo = str_replace( "%", "%25", $pathinfo );
177
-
178
- list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
179
- $self = $_SERVER['PHP_SELF'];
180
- $home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
181
- $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );
182
-
183
- // Trim path info from the end and the leading home path from the
184
- // front. For path info requests, this leaves us with the requesting
185
- // filename, if any. For 404 requests, this leaves us with the
186
- // requested permalink.
187
- $req_uri = str_replace( $pathinfo, '', $req_uri );
188
- $req_uri = trim( $req_uri, '/' );
189
- $req_uri = preg_replace( $home_path_regex, '', $req_uri );
190
- $req_uri = trim( $req_uri, '/' );
191
- $pathinfo = trim( $pathinfo, '/' );
192
- $pathinfo = preg_replace( $home_path_regex, '', $pathinfo );
193
- $pathinfo = trim( $pathinfo, '/' );
194
- $self = trim( $self, '/' );
195
- $self = preg_replace( $home_path_regex, '', $self );
196
- $self = trim( $self, '/' );
197
-
198
- // The requested permalink is in $pathinfo for path info requests and
199
- // $req_uri for other requests.
200
- if ( !empty( $pathinfo ) && !preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) {
201
- $request = $pathinfo;
202
- } else {
203
- // If the request uri is the index, blank it out so that we don't try to match it against a rule.
204
- if ( $req_uri == $wp_rewrite->index )
205
- $req_uri = '';
206
- $request = $req_uri;
207
- }
208
- return $request;
209
- }
210
-
211
- /**
212
- * Add custom rewrite tags
213
- */
214
- function add_rewrite_tags() {
215
- add_rewrite_tag( '%lesson%', '([^&]+)' );
216
- add_rewrite_tag( '%quiz%', '([^&]+)' );
217
- add_rewrite_tag( '%question%', '([^&]+)' );
218
- add_rewrite_tag( '%user%', '([^/]*)' );
219
- add_rewrite_tag( '%course-query-string%', '(.*)' );
220
- do_action( 'learn_press_add_rewrite_tags' );
221
- }
222
-
223
- /**
224
- * Add more custom rewrite rules
225
- */
226
- function add_rewrite_rules() {
227
-
228
- $rewrite_prefix = get_option( 'learn_press_permalink_structure' );
229
- // lesson
230
- $course_type = 'lp_course';
231
- $post_types = get_post_types( '', 'objects' );
232
- $slug = preg_replace( '!^/!', '', $post_types[$course_type]->rewrite['slug'] );
233
- $has_category = false;
234
- if ( preg_match( '!(%?course_category%?)!', $slug ) ) {
235
- $slug = preg_replace( '!(%?course_category%?)!', '(.+?)/([^/]+)', $slug );
236
- $has_category = true;
237
- }
238
- $current_url = learn_press_get_current_url();
239
- $query_string = str_replace( trailingslashit( get_site_url() ), '', $current_url );
240
-
241
- if ( $has_category ) {
242
- add_rewrite_rule(
243
- '^' . $slug . '(?:/' . $post_types['lp_lesson']->rewrite['slug'] . '/([^/]+))/?#x27;,
244
- 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&lesson=$matches[3]',
245
- 'top'
246
- );
247
- add_rewrite_rule(
248
- '^' . $slug . '(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+)/?([^/]+)?)/?#x27;,
249
- 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&quiz=$matches[3]&question=$matches[4]',
250
- 'top'
251
- );
252
- } else {
253
- add_rewrite_rule(
254
- '^' . $slug . '/([^/]+)(?:/' . $post_types['lp_lesson']->rewrite['slug'] . '/([^/]+))/?#x27;,
255
- 'index.php?' . $course_type . '=$matches[1]&lesson=$matches[2]',
256
- 'top'
257
- );
258
- add_rewrite_rule(
259
- '^' . $slug . '/([^/]+)(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+)/?([^/]+)?)/?#x27;,
260
- 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[2]&question=$matches[3]',
261
- 'top'
262
- );
263
- }
264
-
265
- if ( $profile_id = learn_press_get_page_id( 'profile' ) ) {
266
- add_rewrite_rule(
267
- '^' . $rewrite_prefix . get_post_field( 'post_name', $profile_id ) . '/([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?',
268
- 'index.php?page_id=' . $profile_id . '&user=$matches[1]&view=$matches[2]&id=$matches[3]&paged=$matches[4]',
269
- 'top'
270
- );
271
- }
272
- do_action( 'learn_press_add_rewrite_rules' );
273
- return;
274
-
275
- /**
276
- * Lesson permalink without category
277
- */
278
- /*add_rewrite_rule(
279
- '^' . $slug . '/([^/]*)/(' . $post_types['lp_lesson']->rewrite['slug'] . ')/([^/]+)/?#x27;,
280
- 'index.php?' . $course_type . '=$matches[1]&lesson=$matches[3]',
281
- 'top'
282
- );*/
283
-
284
- /**
285
- * Quiz permalink with category inside
286
- */
287
- add_rewrite_rule(
288
- '^course/(.+?)/([^/]+)(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+))/?#x27;,
289
- 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&quiz=$matches[3]',
290
- 'top'
291
- );
292
-
293
- /**
294
- * Lesson permalink without category
295
- */
296
- add_rewrite_rule(
297
- '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')/([^/]+)/?#x27;,
298
- 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[3]',
299
- 'top'
300
- );
301
-
302
-
303
- /*add_rewrite_rule(
304
- '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')?/([^/]*)?/?([^/]*)?',
305
- 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[3]&question=$matches[4]',
306
- 'top'
307
- );*/
308
-
309
-
310
- }
311
-
312
- /**
313
- * @param $query
314
- *
315
- * @return array
316
- */
317
- function parse_course_request( $query ) {
318
- $return = array();
319
- if ( !empty( $query ) ) {
320
- $segments = explode( '/', $query );
321
- $segments = array_filter( $segments );
322
- if ( $segments ) {
323
- $ids = array();
324
- $names = array();
325
- foreach ( $segments as $segment ) {
326
- if ( preg_match( '/^([0-9]+)/', $segment ) ) {
327
- $post_args = explode( '-', $segment, 2 );
328
- $ids[] = absint( $post_args[0] );
329
- $names[] = $post_args[1];
330
- }
331
- }
332
-
333
- if ( sizeof( $ids ) ) {
334
- global $wpdb;
335
- $ids_format = array_fill( 0, sizeof( $ids ), '%d' );
336
- $names_format = array_fill( 0, sizeof( $names ), '%s' );
337
-
338
- $query = $wpdb->prepare( "
339
- SELECT ID, post_name, post_type
340
- FROM {$wpdb->posts}
341
- WHERE ID IN(" . join( ',', $ids_format ) . ")
342
- AND post_name IN(" . join( ',', $names_format ) . ")
343
- ORDER BY FIELD(ID, " . join( ',', $ids_format ) . ")
344
- ", array_merge( $ids, $names, $ids ) );
345
- if ( $items = $wpdb->get_results( $query ) ) {
346
- $support_types = learn_press_course_get_support_item_types();
347
- foreach ( $items as $item ) {
348
- if ( array_key_exists( $item->post_type, $support_types ) ) {
349
- $return[] = $item;
350
- }
351
- }
352
- }
353
- }
354
- }
355
- }
356
- return $return;
357
- }
358
-
359
- /**
360
- * This function parse query vars and put into request
361
- */
362
- function parse_query_vars_to_request() {
363
- global $wp_query, $wp;
364
- if ( isset( $wp_query->query['user'] ) ) {
365
- /*if ( !get_option( 'permalink_structure' ) ) {
366
- $wp_query->query_vars['user'] = !empty( $_REQUEST['user'] ) ? $_REQUEST['user'] : null;
367
- $wp_query->query_vars['tab'] = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : null;
368
- $wp_query->query_vars['order_id'] = !empty( $_REQUEST['order_id'] ) ? $_REQUEST['order_id'] : null;
369
- $wp_query->query['user'] = !empty( $_REQUEST['user'] ) ? $_REQUEST['user'] : null;
370
- $wp_query->query['tab'] = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : null;
371
- $wp_query->query['order_id'] = !empty( $_REQUEST['order_id'] ) ? $_REQUEST['order_id'] : null;
372
- } else {
373
- list( $username, $tab, $id ) = explode( '/', $wp_query->query['user'] );
374
- $wp_query->query_vars['user'] = $username;
375
- $wp_query->query_vars['tab'] = $tab;
376
- $wp_query->query_vars['order_id'] = $id;
377
- $wp_query->query['user'] = $username;
378
- $wp_query->query['tab'] = $tab;
379
- $wp_query->query['order_id'] = $id;
380
- }*/
381
- }
382
- global $wpdb;
383
- // if lesson name is passed, find it's ID and put into request
384
- /*if ( !empty( $wp_query->query_vars['lesson'] ) ) {
385
- if ( $lesson_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s", $wp_query->query_vars['lesson'], LP_LESSON_CPT ) ) ) {
386
- $_REQUEST['lesson'] = $lesson_id;
387
- $_GET['lesson'] = $lesson_id;
388
- $_POST['lesson'] = $lesson_id;
389
- }
390
- }*/
391
- // if question name is passed, find it's ID and put into request
392
- /*if ( !empty( $wp_query->query_vars['question'] ) ) {
393
- if ( $question_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s", $wp_query->query_vars['question'], LP_QUESTION_CPT ) ) ) {
394
- $_REQUEST['question'] = $question_id;
395
- $_GET['question'] = $question_id;
396
- $_POST['question'] = $question_id;
397
- }
398
- }*/
399
-
400
- }
401
-
402
- /**
403
- * Get current course user accessing
404
- *
405
- * @param string $return
406
- *
407
- * @return bool|false|int|LP_Course|mixed
408
- */
409
- public function get_course( $return = 'id' ) {
410
- $course = false;
411
- if ( learn_press_is_course() ) {
412
- $course = get_the_ID();
413
- }
414
- if ( $course && $return == 'object' ) {
415
- $course = learn_press_get_course( $course );
416
- }
417
- return $course;
418
- }
419
-
420
- public function get_course_item( $return = 'id' ) {
421
- $course = $this->get_course( 'object' );
422
- $user = learn_press_get_current_user();
423
- $item = isset( $item ) ? $item : LP()->global['course-item'];
424
- if ( $item && $return == 'object' ) {
425
- $item = LP_Course::get_item( $item );
426
- }
427
- return $item;
428
- }
429
-
430
-
431
- public function query_taxonomy( $q ) {
432
- // We only want to affect the main query
433
- if ( !$q->is_main_query() ) {
434
- return;
435
- }
436
- if ( is_search() ) {
437
- add_filter( 'posts_where', array( $this, 'add_tax_search' ) );
438
- add_filter( 'posts_join', array( $this, 'join_term' ) );
439
- add_filter( 'posts_groupby', array( $this, 'tax_groupby' ) );
440
- }
441
- }
442
-
443
- public function join_term( $join ) {
444
- global $wp_query, $wpdb;
445
-
446
- if ( !empty( $wp_query->query_vars['s'] ) && !is_admin() ) {
447
- if ( !preg_match( '/' . $wpdb->term_relationships . '/', $join ) ) {
448
- $join .= "LEFT JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id ";
449
- }
450
- $join .= "LEFT JOIN $wpdb->term_taxonomy ON $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id ";
451
- $join .= "LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ";
452
- }
453
-
454
- return $join;
455
- }
456
-
457
- public function add_tax_search( $where ) {
458
- global $wp_query, $wpdb;
459
-
460
- if ( !empty( $wp_query->query_vars['s'] ) && !is_admin() ) {
461
- $escaped_s = esc_sql( $wp_query->query_vars['s'] );
462
- $where .= "OR $wpdb->terms.name LIKE '%{$escaped_s}%'";
463
- }
464
-
465
- return $where;
466
- }
467
-
468
- public function tax_groupby( $groupby ) {
469
- global $wpdb;
470
- $groupby = "{$wpdb->posts}.ID";
471
-
472
- $this->remove_query_tax();
473
-
474
- return $groupby;
475
- }
476
-
477
- public function remove_query_tax() {
478
- remove_filter( 'posts_where', 'learn_press_add_tax_search' );
479
- remove_filter( 'posts_join', 'learn_press_join_term' );
480
- remove_filter( 'posts_groupby', 'learn_press_tax_groupby' );
481
- }
482
}
1
+ <?php
2
+
3
+ /**
4
+ * Class LP_Query
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class LP_Query {
10
+ /**
11
+ * @var array
12
+ */
13
+ public $query_vars = array();
14
+
15
+ /**
16
+ * LP_Query constructor.
17
+ */
18
+ public function __construct() {
19
+ add_action( 'init', array( $this, 'add_rewrite_tags' ), 1000, 0 );
20
+ add_action( 'init', array( $this, 'add_rewrite_rules' ), 1000, 0 );
21
+ add_action( 'parse_query', array( $this, 'parse_request' ), 1000, 1 );
22
+ /**
23
+ * Add searching post by taxonomies
24
+ */
25
+ add_action( 'pre_get_posts', array( $this, 'query_taxonomy' ) );
26
+ }
27
+
28
+ /**
29
+ * Parses request params and controls page
30
+ *
31
+ * @param WP_Query $q
32
+ *
33
+ * @return mixed
34
+ */
35
+ public function parse_request( $q ) {
36
+ if ( did_action( 'learn_press_parse_query' ) ) {
37
+ return $q;
38
+ }
39
+ $user = learn_press_get_current_user();
40
+ $request = $this->get_request();
41
+ if ( !$request || is_admin() ) {
42
+ return $q;
43
+ }
44
+ remove_filter( 'do_parse_request', array( $this, 'get_current_quiz_question' ), 1010, 3 );
45
+ $course_type = 'lp_course';
46
+ $post_types = get_post_types( '', 'objects' );
47
+
48
+ if ( empty( $post_types[$course_type] ) ) {
49
+ return;
50
+ }
51
+ /********************/
52
+ if ( empty( $q->query_vars[LP_COURSE_CPT] ) ) {
53
+ return;
54
+ }
55
+ $this->query_vars['course'] = $q->query_vars[LP_COURSE_CPT];
56
+ $course_id = learn_press_setup_course_data( $this->query_vars['course'] );
57
+ $quiz_name = '';
58
+ $question_name = '';
59
+ $lesson_name = '';
60
+ if ( !empty( $q->query_vars['quiz'] ) ) {
61
+ $quiz_name = $this->query_vars['quiz'] = $q->query_vars['quiz'];
62
+ $this->query_vars['item_type'] = LP_QUIZ_CPT;
63
+ if ( !empty( $q->query_vars['question'] ) ) {
64
+ $question_name = $this->query_vars['question'] = $q->query_vars['question'];
65
+ }
66
+ } elseif ( !empty( $q->query_vars['lesson'] ) ) {
67
+ $lesson_name = $this->query_vars['lesson'] = $q->query_vars['lesson'];
68
+ $this->query_vars['item_type'] = LP_LESSON_CPT;
69
+ }
70
+ if ( $quiz_name && $question_name ) {
71
+ if ( $quiz = learn_press_get_post_by_name( $quiz_name, LP_QUIZ_CPT ) ) {
72
+ if ( $user->has_quiz_status( 'completed', $quiz->ID, $course_id ) ) {
73
+ //remove question name from uri
74
+ $course = learn_press_get_course( $course_id );
75
+ $redirect = $course->get_item_link( $quiz->ID );// get_site_url() . '/' . dirname( $request_match );
76
+ wp_redirect( $redirect );
77
+ exit();
78
+ }
79
+ if ( $question = learn_press_get_post_by_name( $question_name, 'lp_question' ) ) {
80
+ global $wpdb;
81
+ $query = $wpdb->prepare( "
82
+ SELECT MAX(user_item_id)
83
+ FROM {$wpdb->prefix}learnpress_user_items
84
+ WHERE user_id = %d AND item_id = %d AND item_type = %s and status <> %s
85
+ ", learn_press_get_current_user_id(), $quiz->ID, 'lp_quiz', 'completed' );
86
+ if ( $history_id = $wpdb->get_var( $query ) ) {
87
+ learn_press_update_user_item_meta( $history_id, 'current_question', $question->ID );
88
+ }
89
+ }
90
+ }
91
+ }
92
+ $this->query_vars['course_id'] = $course_id;
93
+ do_action_ref_array( 'learn_press_parse_query', array( &$this ) );
94
+
95
+ return $q;
96
+ /************************/
97
+ $slug = preg_replace( '!^/!', '', $post_types[$course_type]->rewrite['slug'] );
98
+
99
+ $match = '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')?/([^/]*)?/?([^/]*)?';
100
+
101
+ $request_match = $request;
102
+ $course_id = 0;
103
+ if ( !empty( $q->query_vars['post_type'] ) && $q->query_vars['post_type'] == LP_COURSE_CPT ) {
104
+ if ( !empty( $q->query_vars[LP_COURSE_CPT] ) ) {
105
+ $this->query_vars['course'] = $q->query_vars[LP_COURSE_CPT];
106
+ $course_id = learn_press_setup_course_data( $this->query_vars['course'] );
107
+ }
108
+ if ( !empty( $q->query_vars['quiz'] ) ) {
109
+ $this->query_vars['quiz'] = $q->query_vars['quiz'];
110
+ $this->query_vars['item_type'] = LP_QUIZ_CPT;
111
+ } elseif ( !empty( $q->query_vars['lesson'] ) ) {
112
+ $this->query_vars['lesson'] = $q->query_vars['lesson'];
113
+ $this->query_vars['item_type'] = LP_LESSON_CPT;
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Match request URI with quiz permalink
119
+ */
120
+ if ( preg_match( "#^$match#", $request_match, $matches ) || preg_match( "#^$match#", urldecode( $request_match ), $matches ) ) {
121
+
122
+ // If request URI is a quiz permalink
123
+ if ( !empty( $matches[3] ) ) {
124
+ if ( !$post = learn_press_get_post_by_name( $matches[3], 'lp_quiz', true ) ) {
125
+ return $q;
126
+ }
127
+ // If request URI does not contains a question
128
+ // Try to get current question of current user and put it into URI
129
+ if ( empty( $matches[4] ) ) {
130
+ if ( $user->has_quiz_status( 'started', $post->ID, $course_id ) && $question_id = $user->get_current_quiz_question( $post->ID, $course_id ) ) {
131
+ $this->query_vars['question'] = $q->query_vars['question'] = get_post_field( 'post_name', $question_id );
132
+ }
133
+ } else {
134
+ // If user is viewing a question then update current question for user
135
+ $question = learn_press_get_post_by_name( $matches[4], 'lp_question' );
136
+ /**
137
+ * If user has completed a quiz but they are accessing to a question inside quiz,
138
+ * redirect them back to quiz to show results of that quiz instead
139
+ */
140
+ if ( $user->has_quiz_status( 'completed', $post->ID, $course_id ) ) {
141
+ //remove question name from uri
142
+ $redirect = get_site_url() . '/' . dirname( $request_match );
143
+ wp_redirect( $redirect );
144
+ exit();
145
+ }
146
+ if ( $question ) {
147
+ global $wpdb;
148
+ $query = $wpdb->prepare( "
149
+ SELECT MAX(user_item_id)
150
+ FROM {$wpdb->prefix}learnpress_user_items
151
+ WHERE user_id = %d AND item_id = %d AND item_type = %s and status <> %s
152
+ ", learn_press_get_current_user_id(), $post->ID, 'lp_quiz', 'completed' );
153
+ if ( $history_id = $wpdb->get_var( $query ) ) {
154
+ learn_press_update_user_item_meta( $history_id, 'current_question', $question->ID );
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ $this->query_vars['course_id'] = $course_id;
161
+ do_action_ref_array( 'learn_press_parse_query', array( &$this ) );
162
+ return $q;
163
+ }
164
+
165
+ /**
166
+ * This function is cloned from wp core function
167
+ *
168
+ * @see WP()->parse_request()
169
+ *
170
+ * @return string
171
+ */
172
+ public function get_request() {
173
+ global $wp_rewrite;
174
+ $pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
175
+ list( $pathinfo ) = explode( '?', $pathinfo );
176
+ $pathinfo = str_replace( "%", "%25", $pathinfo );
177
+
178
+ list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
179
+ $self = $_SERVER['PHP_SELF'];
180
+ $home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
181
+ $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );
182
+
183
+ // Trim path info from the end and the leading home path from the
184
+ // front. For path info requests, this leaves us with the requesting
185
+ // filename, if any. For 404 requests, this leaves us with the
186
+ // requested permalink.
187
+ $req_uri = str_replace( $pathinfo, '', $req_uri );
188
+ $req_uri = trim( $req_uri, '/' );
189
+ $req_uri = preg_replace( $home_path_regex, '', $req_uri );
190
+ $req_uri = trim( $req_uri, '/' );
191
+ $pathinfo = trim( $pathinfo, '/' );
192
+ $pathinfo = preg_replace( $home_path_regex, '', $pathinfo );
193
+ $pathinfo = trim( $pathinfo, '/' );
194
+ $self = trim( $self, '/' );
195
+ $self = preg_replace( $home_path_regex, '', $self );
196
+ $self = trim( $self, '/' );
197
+
198
+ // The requested permalink is in $pathinfo for path info requests and
199
+ // $req_uri for other requests.
200
+ if ( !empty( $pathinfo ) && !preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) {
201
+ $request = $pathinfo;
202
+ } else {
203
+ // If the request uri is the index, blank it out so that we don't try to match it against a rule.
204
+ if ( $req_uri == $wp_rewrite->index )
205
+ $req_uri = '';
206
+ $request = $req_uri;
207
+ }
208
+ return $request;
209
+ }
210
+
211
+ /**
212
+ * Add custom rewrite tags
213
+ */
214
+ function add_rewrite_tags() {
215
+ add_rewrite_tag( '%lesson%', '([^&]+)' );
216
+ add_rewrite_tag( '%quiz%', '([^&]+)' );
217
+ add_rewrite_tag( '%question%', '([^&]+)' );
218
+ add_rewrite_tag( '%user%', '([^/]*)' );
219
+ add_rewrite_tag( '%course-query-string%', '(.*)' );
220
+ do_action( 'learn_press_add_rewrite_tags' );
221
+ }
222
+
223
+ /**
224
+ * Add more custom rewrite rules
225
+ */
226
+ function add_rewrite_rules() {
227
+
228
+ $rewrite_prefix = get_option( 'learn_press_permalink_structure' );
229
+ // lesson
230
+ $course_type = 'lp_course';
231
+ $post_types = get_post_types( '', 'objects' );
232
+ $slug = preg_replace( '!^/!', '', $post_types[$course_type]->rewrite['slug'] );
233
+ $has_category = false;
234
+ if ( preg_match( '!(%?course_category%?)!', $slug ) ) {
235
+ $slug = preg_replace( '!(%?course_category%?)!', '(.+?)/([^/]+)', $slug );
236
+ $has_category = true;
237
+ }
238
+ $current_url = learn_press_get_current_url();
239
+ $query_string = str_replace( trailingslashit( get_site_url() ), '', $current_url );
240
+
241
+ if ( $has_category ) {
242
+ add_rewrite_rule(
243
+ '^' . $slug . '(?:/' . $post_types['lp_lesson']->rewrite['slug'] . '/([^/]+))/?#x27;,
244
+ 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&lesson=$matches[3]',
245
+ 'top'
246
+ );
247
+ add_rewrite_rule(
248
+ '^' . $slug . '(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+)/?([^/]+)?)/?#x27;,
249
+ 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&quiz=$matches[3]&question=$matches[4]',
250
+ 'top'
251
+ );
252
+ } else {
253
+
254
+ $custom_slug_lesson= sanitize_title_with_dashes( LP()->settings->get( 'lesson_slug' ) );
255
+ $custom_slug_quiz = sanitize_title_with_dashes( LP()->settings->get( 'quiz_slug' ) );
256
+
257
+ if ( !empty( $custom_slug_lesson ) ) {
258
+ $post_types['lp_lesson']->rewrite['slug'] = $custom_slug_lesson;
259
+ }
260
+ if ( !empty( $custom_slug_quiz ) ) {
261
+ $post_types['lp_quiz']->rewrite['slug'] = $custom_slug_quiz;
262
+ }
263
+
264
+ add_rewrite_rule(
265
+ '^' . $slug . '/([^/]+)(?:/' . $post_types['lp_lesson']->rewrite['slug'] . '/([^/]+))/?#x27;,
266
+ 'index.php?' . $course_type . '=$matches[1]&lesson=$matches[2]',
267
+ 'top'
268
+ );
269
+ add_rewrite_rule(
270
+ '^' . $slug . '/([^/]+)(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+)/?([^/]+)?)/?#x27;,
271
+ 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[2]&question=$matches[3]',
272
+ 'top'
273
+ );
274
+ }
275
+
276
+ if ( $profile_id = learn_press_get_page_id( 'profile' ) ) {
277
+ add_rewrite_rule(
278
+ '^' . $rewrite_prefix . get_post_field( 'post_name', $profile_id ) . '/([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?',
279
+ 'index.php?page_id=' . $profile_id . '&user=$matches[1]&view=$matches[2]&id=$matches[3]&paged=$matches[4]',
280
+ 'top'
281
+ );
282
+ }
283
+
284
+ if ( $course_page_id = learn_press_get_page_id( 'courses' ) ) {
285
+ add_rewrite_rule(
286
+ '^' . $rewrite_prefix . get_post_field( 'post_name', $course_page_id ) . '/page/([0-9]{1,})/?#x27;,
287
+ 'index.php?pagename=' . get_post_field( 'post_name', $course_page_id ) . '&page=$matches[1]',
288
+ 'top'
289
+ );
290
+ /**
291
+ add_rewrite_rule(
292
+ '^' . $rewrite_prefix . get_post_field( 'post_name', $course_page_id ) . '/page/([0-9]{1,})/?#x27;,
293
+ 'index.php?page_id=' . $course_page_id . '&paged=$matches[1]',
294
+ 'top'
295
+ );*/
296
+ }
297
+ do_action( 'learn_press_add_rewrite_rules' );
298
+ return;
299
+
300
+ /**
301
+ * Lesson permalink without category
302
+ */
303
+ /*add_rewrite_rule(
304
+ '^' . $slug . '/([^/]*)/(' . $post_types['lp_lesson']->rewrite['slug'] . ')/([^/]+)/?#x27;,
305
+ 'index.php?' . $course_type . '=$matches[1]&lesson=$matches[3]',
306
+ 'top'
307
+ );*/
308
+
309
+ /**
310
+ * Quiz permalink with category inside
311
+ */
312
+ add_rewrite_rule(
313
+ '^course/(.+?)/([^/]+)(?:/' . $post_types['lp_quiz']->rewrite['slug'] . '/([^/]+))/?#x27;,
314
+ 'index.php?' . $course_type . '=$matches[2]&course_category=$matches[1]&quiz=$matches[3]',
315
+ 'top'
316
+ );
317
+
318
+ /**
319
+ * Lesson permalink without category
320
+ */
321
+ add_rewrite_rule(
322
+ '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')/([^/]+)/?#x27;,
323
+ 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[3]',
324
+ 'top'
325
+ );
326
+
327
+
328
+ /*add_rewrite_rule(
329
+ '^' . $slug . '/([^/]*)/(' . $post_types['lp_quiz']->rewrite['slug'] . ')?/([^/]*)?/?([^/]*)?',
330
+ 'index.php?' . $course_type . '=$matches[1]&quiz=$matches[3]&question=$matches[4]',
331
+ 'top'
332
+ );*/
333
+
334
+
335
+ }
336
+
337
+ /**
338
+ * @param $query
339
+ *
340
+ * @return array
341
+ */
342
+ function parse_course_request( $query ) {
343
+ $return = array();
344
+ if ( !empty( $query ) ) {
345
+ $segments = explode( '/', $query );
346
+ $segments = array_filter( $segments );
347
+ if ( $segments ) {
348
+ $ids = array();
349
+ $names = array();
350
+ foreach ( $segments as $segment ) {
351
+ if ( preg_match( '/^([0-9]+)/', $segment ) ) {
352
+ $post_args = explode( '-', $segment, 2 );
353
+ $ids[] = absint( $post_args[0] );
354
+ $names[] = $post_args[1];
355
+ }
356
+ }
357
+
358
+ if ( sizeof( $ids ) ) {
359
+ global $wpdb;
360
+ $ids_format = array_fill( 0, sizeof( $ids ), '%d' );
361
+ $names_format = array_fill( 0, sizeof( $names ), '%s' );
362
+
363
+ $query = $wpdb->prepare( "
364
+ SELECT ID, post_name, post_type
365
+ FROM {$wpdb->posts}
366
+ WHERE ID IN(" . join( ',', $ids_format ) . ")
367
+ AND post_name IN(" . join( ',', $names_format ) . ")
368
+ ORDER BY FIELD(ID, " . join( ',', $ids_format ) . ")
369
+ ", array_merge( $ids, $names, $ids ) );
370
+ if ( $items = $wpdb->get_results( $query ) ) {
371
+ $support_types = learn_press_course_get_support_item_types();
372
+ foreach ( $items as $item ) {
373
+ if ( array_key_exists( $item->post_type, $support_types ) ) {
374
+ $return[] = $item;
375
+ }
376
+ }
377
+ }
378
+ }
379
+ }
380
+ }
381
+ return $return;
382
+ }
383
+
384
+ /**
385
+ * This function parse query vars and put into request
386
+ */
387
+ function parse_query_vars_to_request() {
388
+ global $wp_query, $wp;
389
+ if ( isset( $wp_query->query['user'] ) ) {
390
+ /*if ( !get_option( 'permalink_structure' ) ) {
391
+ $wp_query->query_vars['user'] = !empty( $_REQUEST['user'] ) ? $_REQUEST['user'] : null;
392
+ $wp_query->query_vars['tab'] = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : null;
393
+ $wp_query->query_vars['order_id'] = !empty( $_REQUEST['order_id'] ) ? $_REQUEST['order_id'] : null;
394
+ $wp_query->query['user'] = !empty( $_REQUEST['user'] ) ? $_REQUEST['user'] : null;
395
+ $wp_query->query['tab'] = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : null;
396
+ $wp_query->query['order_id'] = !empty( $_REQUEST['order_id'] ) ? $_REQUEST['order_id'] : null;
397
+ } else {
398
+ list( $username, $tab, $id ) = explode( '/', $wp_query->query['user'] );
399
+ $wp_query->query_vars['user'] = $username;
400
+ $wp_query->query_vars['tab'] = $tab;
401
+ $wp_query->query_vars['order_id'] = $id;
402
+ $wp_query->query['user'] = $username;
403
+ $wp_query->query['tab'] = $tab;
404
+ $wp_query->query['order_id'] = $id;
405
+ }*/
406
+ }
407
+ global $wpdb;
408
+ // if lesson name is passed, find it's ID and put into request
409
+ /*if ( !empty( $wp_query->query_vars['lesson'] ) ) {
410
+ if ( $lesson_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s", $wp_query->query_vars['lesson'], LP_LESSON_CPT ) ) ) {
411
+ $_REQUEST['lesson'] = $lesson_id;
412
+ $_GET['lesson'] = $lesson_id;
413
+ $_POST['lesson'] = $lesson_id;
414
+ }
415
+ }*/
416
+ // if question name is passed, find it's ID and put into request
417
+ /*if ( !empty( $wp_query->query_vars['question'] ) ) {
418
+ if ( $question_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s", $wp_query->query_vars['question'], LP_QUESTION_CPT ) ) ) {
419
+ $_REQUEST['question'] = $question_id;
420
+ $_GET['question'] = $question_id;
421
+ $_POST['question'] = $question_id;
422
+ }
423
+ }*/
424
+
425
+ }
426
+
427
+ /**
428
+ * Get current course user accessing
429
+ *
430
+ * @param string $return
431
+ *
432
+ * @return bool|false|int|LP_Course|mixed
433
+ */
434
+ public function get_course( $return = 'id' ) {
435
+ $course = false;
436
+ if ( learn_press_is_course() ) {
437
+ $course = get_the_ID();
438
+ }
439
+ if ( $course && $return == 'object' ) {
440
+ $course = learn_press_get_course( $course );
441
+ }
442
+ return $course;
443
+ }
444
+
445
+ public function get_course_item( $return = 'id' ) {
446
+ $course = $this->get_course( 'object' );
447
+ $user = learn_press_get_current_user();
448
+ $item = isset( $item ) ? $item : LP()->global['course-item'];
449
+ if ( $item && $return == 'object' ) {
450
+ $item = LP_Course::get_item( $item );
451
+ }
452
+ return $item;
453
+ }
454
+
455
+
456
+ public function query_taxonomy( $q ) {
457
+ // We only want to affect the main query
458
+ if ( !$q->is_main_query() ) {
459
+ return;
460
+ }
461
+ if ( is_search() ) {
462
+ add_filter( 'posts_where', array( $this, 'add_tax_search' ) );
463
+ add_filter( 'posts_join', array( $this, 'join_term' ) );
464
+ add_filter( 'posts_groupby', array( $this, 'tax_groupby' ) );
465
+ }
466
+ }
467
+
468
+ public function join_term( $join ) {
469
+ global $wp_query, $wpdb;
470
+
471
+ if ( !empty( $wp_query->query_vars['s'] ) && !is_admin() ) {
472
+ if ( !preg_match( '/' . $wpdb->term_relationships . '/', $join ) ) {
473
+ $join .= "LEFT JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id ";
474
+ }
475
+ $join .= "LEFT JOIN $wpdb->term_taxonomy ON $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id ";
476
+ $join .= "LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ";
477
+ }
478
+
479
+ return $join;
480
+ }
481
+
482
+ public function add_tax_search( $where ) {
483
+ global $wp_query, $wpdb;
484
+
485
+ if ( !empty( $wp_query->query_vars['s'] ) && !is_admin() ) {
486
+ $escaped_s = esc_sql( $wp_query->query_vars['s'] );
487
+ $where .= "OR $wpdb->terms.name LIKE '%{$escaped_s}%'";
488
+ }
489
+
490
+ return $where;
491
+ }
492
+
493
+ public function tax_groupby( $groupby ) {
494
+ global $wpdb;
495
+ $groupby = "{$wpdb->posts}.ID";
496
+
497
+ $this->remove_query_tax();
498
+
499
+ return $groupby;
500
+ }
501
+
502
+ public function remove_query_tax() {
503
+ remove_filter( 'posts_where', 'learn_press_add_tax_search' );
504
+ remove_filter( 'posts_join', 'learn_press_join_term' );
505
+ remove_filter( 'posts_groupby', 'learn_press_tax_groupby' );
506
+ }
507
}
inc/course/abstract-lp-course.php CHANGED
@@ -1,1514 +1,1528 @@
1
- <?php
2
-
3
- defined( 'ABSPATH' ) || exit();
4
-
5
- /**
6
- * Class LP_Abstract_Course
7
- */
8
- abstract class LP_Abstract_Course {
9
- /**
10
- * The course (post) ID.
11
- *
12
- * @var int
13
- */
14
- public $id = 0;
15
-
16
- /**
17
- * $post Stores post data
18
- *
19
- * @var $post WP_Post
20
- */
21
- public $post = null;
22
-
23
- /**
24
- *
25
- * @var string
26
- */
27
- public $course_type = null;
28
-
29
- /**
30
- * Course curriculum
31
- *
32
- * @var array
33
- */
34
- protected static $_curriculum = array();
35
-
36
- /**
37
- * @var null
38
- */
39
- protected $_count_users = null;
40
-
41
- /**
42
- * @var null
43
- */
44
- protected $_students_list = null;
45
-
46
- /**
47
- * @var array
48
- */
49
- protected static $_lessons = array();
50
-
51
- /**
52
- * Constructor gets the post object and sets the ID for the loaded course.
53
- *
54
- * @param int|LP_Course|object $course Course ID, post object, or course object
55
- * @param int $user
56
- */
57
- public function __construct( $course, $user = 0 ) {
58
- if ( is_numeric( $course ) ) {
59
- $this->id = absint( $course );
60
- $this->post = get_post( $this->id );
61
- } elseif ( $course instanceof LP_Course ) {
62
- $this->id = absint( $course->id );
63
- $this->post = $course->post;
64
- } elseif ( isset( $course->ID ) ) {
65
- $this->id = absint( $course->ID );
66
- $this->post = get_post( $course->ID );
67
- }
68
- if ( empty( self::$_lessons[$this->id] ) ) {
69
- self::$_lessons[$this->id] = array();
70
- }
71
- if ( $user ) {
72
- $this->init_for_user( $user );
73
- }
74
- }
75
-
76
- public function init_for_user() {
77
-
78
- }
79
-
80
- /**
81
- * __isset function.
82
- *
83
- * @param mixed $key
84
- *
85
- * @return bool
86
- */
87
- public function __isset( $key ) {
88
- return metadata_exists( 'post', $this->id, '_' . $key );
89
- }
90
-
91
- /**
92
- * __get function.
93
- *
94
- * @param string $key
95
- *
96
- * @return mixed
97
- */
98
- public function __get( $key ) {
99
- if ( strcasecmp( $key, 'ID' ) == 0 ) {
100
- $key = strtolower( $key );
101
- }
102
- if ( empty( $this->{$key} ) ) {
103
- $value = false;
104
- switch ( $key ) {
105
- case 'current_item':
106
- if ( !empty( LP()->global['course-item'] ) ) {
107
- $value = LP()->global['course-item'];
108
- }
109
-
110
- break;
111
- case 'current_lesson':
112
- $lesson_id = ( ( $lesson_id = learn_press_get_request( "lesson_id" ) ) && $this->has( 'item', $lesson_id ) ) ? $lesson_id : null;
113
- if ( $lesson_id ) {
114
- $value = LP_Lesson::get_lesson( $lesson_id );
115
- }
116
- break;
117
- case 'permalink':
118
- $value = get_the_permalink( $this->id );
119
- break;
120
- case 'duration':
121
- $value = get_post_meta( $this->id, '_lp_' . $key, true );
122
- $duration = learn_press_get_course_duration_support();
123
- $duration_keys = array_keys( $duration );
124
- if ( !preg_match_all( '!([0-9]+)\s(' . join( '|', $duration_keys ) . ')!', $value, $matches ) ) {
125
- $a1 = absint( $value );
126
- $a2 = end( $duration_keys );
127
- $value = $a1 . ' ' . $a2;
128
- update_post_meta( $this->id, '_lp_' . $key, $value );
129
- }
130
- break;
131
- default: // default is get course meta key
132
- if ( func_num_args() > 1 ) {
133
- $single = func_get_arg( 1 );
134
- if ( $single !== false && $single !== true ) {
135
- $single = true;
136
- }
137
- } else {
138
- $single = true;
139
- }
140
- $value = get_post_meta( $this->id, '_lp_' . $key, $single );
141
- if ( ( $key == 'price' || $key == 'total' ) && get_post_meta( $this->id, '_lp_payment', true ) != 'yes' ) {
142
- $value = 0;
143
- }
144
-
145
- }
146
- if ( !empty( $value ) ) {
147
- $this->$key = $value;
148
- }
149
- }
150
- return !empty( $this->$key ) ? $this->$key : null;
151
- }
152
-
153
- /**
154
- * Get course thumbnail, return placeholder if it does not exists
155
- *
156
- * @param string $size
157
- * @param array $attr
158
- *
159
- * @return mixed|null|void
160
- */
161
- public function get_image( $size = 'course_thumbnail', $attr = array() ) {
162
- $attr = wp_parse_args(
163
- $attr,
164
- array(
165
- 'alt' => $this->get_title()
166
- )
167
- );
168
- $image = false;
169
- if ( has_post_thumbnail( $this->id ) ) {
170
- $image = get_the_post_thumbnail( $this->id, $size, $attr );
171
- } elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
172
- $image = get_the_post_thumbnail( $parent_id, $size, $attr );
173
- }
174
- if ( !$image ) {
175
- if ( 'course_thumbnail' == $size ) {
176
- $image = LP()->image( 'placeholder-400x250' );
177
- } else {
178
- $image = LP()->image( 'placeholder-800x450' );
179
- }
180
- $image = sprintf( '<img src="%s" %s />', $image, '' );
181
- }
182
- return apply_filters( 'learn_press_course_image', $image, $this->id, $size, $attr );
183
- }
184
-
185
- public function get_permalink() {
186
- return $this->permalink;
187
- }
188
-
189
- public function is_visible() {
190
- return true;
191
- }
192
-
193
- public function get_request_item( $field = 'id' ) {
194
- $return = LP()->global['course-item'];
195
- if ( !empty( $_REQUEST['course-item'] ) ) {
196
- $type = $_REQUEST['course-item'];
197
- if ( $field == 'type' ) {
198
- $return = $type;
199
- } elseif ( $field == 'id' ) {
200
- $return = !empty( $_REQUEST[$type . '_id'] ) ? $_REQUEST[$type . '_id'] : 0;
201
- } elseif ( $field == 'name' ) {
202
- $return = !empty( $_REQUEST[$type] ) ? $_REQUEST[$type] : false;
203
- }
204
- }
205
- return $return;
206
- }
207
-
208
- /**
209
- * Get the course's post data.
210
- *
211
- * @return object
212
- */
213
- public function get_course_data() {
214
- return $this->post;
215
- }
216
-
217
- /**
218
- *
219
- * @return mixed
220
- */
221
- public function is_enrollable() {
222
- $enrollable = true;
223
-
224
- // Products must exist of course
225
- if ( !$this->exists() ) {
226
- $enrollable = false;
227
- // Check the product is published
228
- } elseif ( $this->post->post_status !== 'publish' && !current_user_can( 'edit_post', $this->id ) ) {
229
- $enrollable = false;
230
- }
231
-
232
- return apply_filters( 'learn_press_is_enrollable', $enrollable, $this );
233
- }
234
-
235
- /**
236
- * Course is exists if the post is not empty
237
- *
238
- * @return bool
239
- */
240
- public function exists() {
241
- return empty( $this->post ) ? false : true;
242
- }
243
-
244
- /**
245
- * The course is require enrollment or not
246
- *
247
- * @return bool
248
- */
249
- public function is_require_enrollment() {
250
- return $this->is_required_enroll();
251
- }
252
-
253
- /**
254
- * Check if this course is required to enroll
255
- *
256
- * @param mixed
257
- *
258
- * @return bool
259
- */
260
- public function is_required_enroll() {
261
-
262
- if ( func_get_args() ) {
263
- $required = $this->required_enroll == func_get_arg( 0 );
264
- } else {
265
- $required = $this->required_enroll !== 'no';
266
- }
267
- $required = $required || ( $this->payment == 'yes' );
268
-
269
- return apply_filters( 'learn_press_course_required_enroll', $required, $this );
270
- }
271
-
272
- private function _get_posts_by_id( $ids ) {
273
- global $wpdb;
274
- settype( $ids, 'array' );
275
- $posts = $wpdb->get_results( "
276
- SELECT *
277
- FROM {$wpdb->posts}
278
- WHERE ID IN(" . join( ',', $ids ) . ")
279
- " );
280
- return $posts;
281
- }
282
-
283
- public function get_title() {
284
- return apply_filters( 'learn_press_course_title', $this->post ? $this->post->post_title : '', $this );
285
- }
286
-
287
- public function get_description() {
288
- return apply_filters( 'the_content', $this->post->post_content );
289
- }
290
-
291
- /**
292
- * Get all curriculum of this course
293
- *
294
- * @param int $section_id
295
- * @param bool $force
296
- *
297
- * @return mixed
298
- */
299
- public function get_curriculum( $section_id = 0, $force = false ) {
300
- if ( !$this->id ) {
301
- return false;
302
- }
303
- if ( false ) {
304
- $curriculum = LP_Cache::get_course_curriculum( false, array() );
305
-
306
- if ( !array_key_exists( $this->id, $curriculum ) || $force ) {
307
- global $wpdb;
308
-
309
- $curriculum[$this->id] = array();
310
- $query = $wpdb->prepare( "
311
- SELECT cc.*
312
- FROM {$wpdb->posts} p
313
- INNER JOIN {$wpdb->learnpress_sections} cc ON p.ID = cc.section_course_id
314
- WHERE p.ID = %d
315
- ORDER BY `section_order` ASC
316
- ", $this->id );
317
- if ( $rows = $wpdb->get_results( $query, OBJECT_K ) ) {
318
- $section_ids = array_keys( $rows );
319
- $how_many = count( $section_ids );
320
- $placeholders = array_fill( 0, $how_many, '%d' );
321
- $in = implode( ', ', $placeholders );
322
-
323
- $query = $wpdb->prepare( "
324
- SELECT si.*, p.*
325
- FROM {$wpdb->posts} p
326
- INNER JOIN {$wpdb->prefix}learnpress_section_items si ON si.item_id = p.ID
327
- INNER JOIN {$wpdb->prefix}learnpress_sections s ON s.section_id = si.section_id
328
- WHERE s.section_id IN( $in )
329
- ORDER BY s.section_order, si.item_order ASC
330
- ", $section_ids );
331
- $section_items = $wpdb->get_results( $query );
332
- $post_ids = array();
333
- foreach ( $rows as $row ) {
334
- $section = $row;
335
- $section->items = array();
336
- if ( $section_items ) {
337
- $count = 0;
338
- foreach ( $section_items as $item ) {
339
- if ( $item->section_id == $row->section_id ) {
340
- $section->items[] = $item;
341
- /**
342
- * Add item to 'posts' cache group
343
- */
344
- $item_post = wp_cache_get( $item->ID, 'posts' );
345
- if ( !$item_post ) {
346
- wp_cache_add( $item->ID, $item, 'posts' );
347
- }
348
- $post_ids[] = $item->ID;
349
- $count ++;
350
- } else {
351
- if ( $count ) break;
352
- }
353
- }
354
- }
355
- $curriculum[$this->id][$section->section_id] = $section;
356
- }
357
- // update all meta data into cache
358
- update_meta_cache( 'post', $post_ids );
359
- //SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN
360
- }
361
- }
362
- LP_Cache::set_course_curriculum( $curriculum );
363
- $return = false;
364
- if ( $section_id ) {
365
- if ( !empty( $curriculum[$this->id][$section_id] ) ) {
366
- $return = $curriculum[$this->id][$section_id];
367
- }
368
- } else {
369
- $return = $curriculum[$this->id];
370
- }
371
- } // end if(false)
372
- else {
373
- $curriculum = _learn_press_get_course_curriculum( $this->id, $force );
374
- $return = false;
375
- if ( $section_id ) {
376
- if ( !empty( $curriculum[$section_id] ) ) {
377
- $return = $curriculum[$section_id];
378
- }
379
- } else {
380
- $return = $curriculum;
381
- }
382
- }
383
- return apply_filters( 'learn_press_course_curriculum', $return, $this->id, $section_id );
384
- }
385
-
386
- /**
387
- * Count the total of students has enrolled course
388
- *
389
- * @param string (null|append|swaps)
390
- *
391
- * @return mixed
392
- */
393
- public function count_users_enrolled( $count_db = '' ) {
394
-
395
- // Get students enrolled from settings of the course that owns course want to show
396
- // So, if this value is set that means the result is fake ... :)
397
- $enrolled = $this->students;
398
-
399
-
400
- // But, if it is not set then we count the real value from DB
401
- if ( $count_db ) {
402
- $real_enrolled = $this->get_users_enrolled();
403
- if ( $count_db == 'append' ) {
404
- $enrolled += $real_enrolled;
405
- } elseif ( $count_db == 'swaps' && $real_enrolled ) {
406
- $enrolled = $real_enrolled;
407
- }
408
- }
409
- return apply_filters( 'learn_press_count_users_enrolled', $enrolled, $this );
410
- }
411
-
412
- /**
413
- * Count the real users has enrolled
414
- *
415
- * @param bool $force
416
- *
417
- * @return int
418
- */
419
- public function get_users_enrolled( $force = false ) {
420
-
421
- global $wpdb;
422
- if ( $this->_count_users === null || $force ) {
423
- $query = $wpdb->prepare( "
424
- SELECT count(o.ID)
425
- FROM {$wpdb->posts} o
426
- INNER JOIN {$wpdb->learnpress_order_items} oi ON oi.order_id = o.ID
427
- INNER JOIN {$wpdb->learnpress_order_itemmeta} oim ON oim.learnpress_order_item_id = oi.order_item_id
428
- AND oim.meta_key = %s AND oim.meta_value = %d
429
- WHERE o.post_status = %s
430
- ", '_course_id', $this->id, 'lp-completed' );
431
- $this->_count_users = $wpdb->get_var( $query );
432
- }
433
- return $this->_count_users;
434
- }
435
-
436
- /**
437
- * Output html for students enrolled counter
438
- *
439
- * @param int Optional - user ID
440
- *
441
- * @return string
442
- */
443
- public function get_students_html( $user_id = null ) {
444
- $output = '';
445
- if ( $count = $this->count_users_enrolled( 'append' ) ):
446
- $course_info = $this->get_course_info( $user_id );
447
- if ( $course_info['status'] ):
448
- if ( $count == 1 ):
449
- $output .= __( 'You enrolled', 'learnpress' );
450
- else:
451
- $output .= sprintf( _nx( 'You and one student enrolled', 'You and <span class="course-students-number">%1$s</span> students enrolled', intval( $count - 1 ), '', 'learnpress' ), $count - 1 );
452
- endif;
453
- $output = apply_filters( 'learn_press_students_enrolled_html', $output, $this );
454
- else:
455
- $output = sprintf( _nx( 'One student enrolled', '<span class="course-students-number">%1$s</span> students enrolled', $count, '', 'learnpress' ), $count );
456
- $output = apply_filters( 'learn_press_one_student_enrolled_html', $output, $this );
457
- endif;
458
- else:
459
- $output = apply_filters( 'learn_press_no_student_enrolled_html', __( 'No student enrolled', 'learnpress' ), $this );
460
- endif;
461
- return $output;
462
- }
463
-
464
- public function get_instructor() {
465
- $user_data = get_userdata( $this->post->post_author );
466
- $author_name = '';
467
- if ( $user_data ) {
468
- $author_name = $user_data->display_name;
469
- }
470
- return apply_filters( 'learn_press_course_instructor', $author_name, $this->id );
471
- }
472
-
473
- public function get_instructor_html() {
474
- $instructor = $this->get_instructor();
475
- $html = sprintf(
476
- '<a href="%s">%s</a>',
477
- learn_press_user_profile_link( $this->post->post_author ),
478
- $instructor
479
- );
480
- return apply_filters( 'learn_press_course_instructor_html', $html, $this->post->post_author, $this->id );
481
- }
482
-
483
- public function get_course_info( $user_id = null ) {
484
- if ( !$user_id ) {
485
- $user_id = get_current_user_id();
486
- }
487
- $user = learn_press_get_user( $user_id );
488
- return $user->get_course_info( $this->id );
489
- }
490
-
491
- /**
492
- * Check if a course is FREE or need to pay or enroll
493
- *
494
- * @return bool
495
- */
496
- public function is_free() {
497
- $is_free = ( 'no' == $this->payment || ( 0 >= $this->get_price() ) );
498
- return apply_filters( 'learn_press_is_free_course', $is_free, $this );
499
- }
500
-
501
- /**
502
- * Get the origin price of course
503
- * @return mixed
504
- */
505
- public function get_origin_price() {
506
- $price = $this->price;
507
- if ( !$price || 'yes' != $this->payment ) {
508
- $price = 0;
509
- } else {
510
- $price = floatval( $price );
511
- }
512
- return $price;
513
- }
514
-
515
- /**
516
- * Get the sale price of course
517
- * @return mixed
518
- */
519
- public function get_sale_price() {
520
- $res = null;
521
- $sale_price = get_post_meta( $this->id, '_lp_sale_price', true );
522
- if ( 'yes' == $this->payment && is_numeric( $sale_price ) ) {
523
- $sale_price = floatval( $sale_price );
524
- $start_date = get_post_meta( $this->id, '_lp_sale_start', true );
525
- $end_date = get_post_meta( $this->id, '_lp_sale_end', true );
526
- $now = current_time( 'timestamp' );
527
- $end = strtotime( $end_date );
528
- $start = strtotime( $start_date );
529
- if ( ( $now >= $start || !$start_date ) && ( $now <= $end || !$end_date ) && $sale_price ) {
530
- $res = $sale_price;
531
- }
532
- }
533
- return $res;
534
- }
535
-
536
- /**
537
- * Get the price of course
538
- *
539
- * @return mixed
540
- */
541
- public function get_price() {
542
- $price = $this->price;
543
- if ( !$price || 'yes' != $this->payment ) {
544
- $price = 0;
545
- } else {
546
- $price = floatval( $price );
547
- $sale_price = $this->get_sale_price();
548
- if ( is_numeric( $sale_price ) ) {
549
- $price = $sale_price;
550
- }
551
- }
552
- return apply_filters( 'learn_press_course_price', $price, $this );
553
- }
554
-
555
- /**
556
- * Get the price of course with html
557
- *
558
- * @return mixed
559
- */
560
- public function get_price_html() {
561
-
562
- if ( $this->is_free() ) {
563
- $price_html = apply_filters( 'learn_press_course_price_html_free', __( 'Free', 'learnpress' ), $this );
564
- } else {
565
- $price = $this->get_price();
566
- $price = learn_press_format_price( $price, true );
567
- $price_html = apply_filters( 'learn_press_course_price_html', $price, $this );
568
- }
569
- return $price_html;
570
- }
571
-
572
-
573
- /**
574
- * Get the price of course with html
575
- *
576
- * @return mixed
577
- */
578
- public function get_origin_price_html() {
579
- $origin_price_html = '';
580
- if ( !$this->is_free() ) {
581
- $origin_price = $this->get_origin_price();
582
- $origin_price = learn_press_format_price( $origin_price, true );
583
- $origin_price_html = apply_filters( 'learn_press_course_origin_price_html', $origin_price, $this );
584
- }
585
- return $origin_price_html;
586
- }
587
-
588
- /**
589
- * @param $limit int limit of records
590
- * @param $force boolean force to query database
591
- *
592
- * @return array list enrolled students
593
- */
594
- public function get_students_list( $force = false, $limit = - 1 ) {
595
- if ( !$this->exists() ) return null;
596
-
597
- global $wpdb;
598
- if ( $limit < 0 ) $limit = PHP_INT_MAX;
599
-
600
- if ( $this->_students_list === null || $force ) {
601
- $query = $wpdb->prepare( "
602
- SELECT DISTINCT u.*
603
- FROM {$wpdb->users} u
604
- INNER JOIN {$wpdb->prefix}learnpress_user_items ui ON ui.user_id = u.ID
605
- WHERE ui.item_id = %d
606
- AND ui.item_type = %s
607
- LIMIT %d
608
- ", $this->id, LP_COURSE_CPT, $limit );
609
- $this->_students_list = $wpdb->get_results( $query );
610
- }
611
- return $this->_students_list;
612
-
613
- }
614
-
615
-
616
- /**
617
- * Get all quizzes in a course
618
- *
619
- * @param string
620
- *
621
- * @return array
622
- */
623
- public function get_quizzes( $field = null ) {
624
- $items = $this->get_curriculum_items(
625
- array(
626
- 'force' => false,
627
- 'group' => true,
628
- 'field' => $field
629
- )
630
- );
631
- $quizzes = !empty( $items['quizzes'] ) ? $items['quizzes'] : false;
632
- return apply_filters( 'learn_press_course_quizzes', $quizzes, $this );
633
- }
634
-
635
- /**
636
- * Get all lessons in a course
637
- *
638
- * @param mixed
639
- *
640
- * @return array
641
- */
642
- public function get_lessons( $args = null ) {
643
- $args = wp_parse_args(
644
- $args,
645
- array(
646
- 'field' => ''
647
- )
648
- );
649
- $curriculum_args = array_merge(
650
- array(
651
- 'force' => false,
652
- 'group' => true
653
- ),
654
- $args
655
- );
656
- $items = $this->get_curriculum_items( $curriculum_args );
657
- $lessons = !empty( $items['lessons'] ) ? $items['lessons'] : false;
658
- return apply_filters( 'learn_press_course_lessons', $lessons, $this );
659
- }
660
-
661
- /**
662
- * Get all items in a course
663
- *
664
- * @param array $args {
665
- * force bool Force to get curriculum items that does not care for it is already existing in memory or not
666
- * group bool Group the items returned by type of each item
667
- * field string The fields want to get
668
- * }
669
- *
670
- * @return array
671
- */
672
- public function get_curriculum_items( $args = array() ) {
673
-
674
- // default value for $args
675
- $force = false;
676
- $group = false;
677
- $field = '';
678
- $field_map = '';
679
- $field_format = '';
680
-
681
- $args = wp_parse_args(
682
- $args,
683
- array(
684
- 'force' => false,
685
- 'group' => false,
686
- 'field' => '',
687
- 'field_map' => '',
688
- 'field_format' => ''
689
- )
690
- );
691
- $lessons = array();
692
- $quizzes = array();
693
-
694
- // overwrite default values with params passed
695
- extract( $args );
696
- $items = array();
697
- if ( !$this->_curriculum_items || $force ) {
698
- $curriculum = $this->get_curriculum( null, $force );
699
- $index = 0;
700
- if ( !empty( $field ) ) {
701
- if ( is_string( $field ) ) {
702
- $field = explode( '![\s]+!', $field );
703
- }
704
- settype( $field, 'array' );
705
- } else {
706
- $field = false;
707
- }
708
- if ( !empty( $field_map ) ) {
709
- if ( is_string( $field_map ) ) {
710
- $field_map = explode( '![\s]+!', $field_map );
711
- }
712
- settype( $field_map, 'array' );
713
- } else {
714
- $field_map = false;
715
- }
716
- if ( !empty( $field_format ) ) {
717
- if ( is_string( $field_format ) ) {
718
- $field_format = explode( '![\s]+!', $field_format );
719
- }
720
- settype( $field_format, 'array' );
721
- } else {
722
- $field_format = false;
723
- }
724
- //if( is_array( $field ) ) $field = array_map( $field, 'strtolower' );
725
- if ( $curriculum ) foreach ( $curriculum as $section ) {
726
- if ( empty( $section->items ) ) continue;
727
- foreach ( $section->items as $loop_item ) {
728
- $loop_item->section_id = $section->section_id;
729
- if ( $field ) {
730
- $item = array();
731
- $item_array = (array) $loop_item;
732
- foreach ( $field as $k => $field_name ) {
733
- if ( array_key_exists( $field_name, $item_array ) ) {
734
- if ( $field_map && !empty( $field_map[$k] ) ) {
735
- $map_key = $field_map[$k];
736
- } else {
737
- $map_key = $field_name;
738
- }
739
- if ( $field_format && !empty( $field_format[$k] ) ) {
740
- if ( $field_format[$k] == '%d' ) {
741
- $item[$map_key] = strpos( '.', $item_array[$field_name] ) !== false ? floatval( $item_array[$field_name] ) : intval( $item_array[$field_name] );
742
- } elseif ( $field_format[$k] == '%s' ) {
743
- $item[$map_key] = (string) $item_array[$field_name];
744
- }
745
- } else {
746
- $item[$map_key] = $item_array[$field_name];
747
- }
748
- //break;
749
- }
750
- }
751
- if ( sizeof( $item ) == 1 ) {
752
- $item = reset( $item );
753
- }
754
- } else {
755
- $item = $loop_item;
756
- }
757
- if ( $loop_item->post_type == LP_LESSON_CPT ) {
758
- $lessons[$index] = $item;
759
- } else {
760
- $quizzes[$index] = $item;
761
- }
762
- $index ++;
763
- }
764
- }
765
- // group
766
- if ( $group ) {
767
- $items = array(
768
- 'quizzes' => $quizzes,
769
- 'lessons' => $lessons
770
- );
771
- } else {
772
- // combine lessons and quizzes as it should be in curriculum
773
- for ( $i = 0, $n = sizeof( $quizzes ) + sizeof( $lessons ); $i < $n; $i ++ ) {
774
- if ( !empty( $quizzes[$i] ) ) {
775
- $items[] = $quizzes[$i];
776
- } elseif ( !empty( $lessons[$i] ) ) {
777
- $items[] = $lessons[$i];
778
- }
779
- }
780
- }
781
- }
782
- return apply_filters( 'learn_press_get_course_items', $items, $this );
783
- }
784
-
785
- public function is_viewing( $content = '' ) {
786
-
787
- $item_type = !empty( $_REQUEST['course-item'] ) ? $_REQUEST['course-item'] : '';
788
- $viewing = apply_filters( 'learn_press_course_is_viewing', $item_type ? $item_type : 'course' );
789
- if ( $content ) {
790
- return $content == $viewing;
791
- }
792
- return $viewing;
793
- }
794
-
795
- public function is_viewing_item( $item_id = false ) {
796
- $item = LP()->global['course-item'];//$this->get_request_item();
797
- $return = false;
798
- if ( $item ) {
799
- if ( $item_id ) {
800
- $return = $item_id == $item->ID;
801
- } else {
802
- $return = $item->ID;
803
- }
804
- }
805
- return apply_filters( 'learn_press_viewing_course_item', $return, $item_id, $this->id );
806
- }
807
-
808
- public function is_current_item( $item_id ) {
809
- /*$item_type = !empty( $_REQUEST['course-item'] ) ? $_REQUEST['course-item'] : '';
810
- $view_id = 0;
811
- if ( $item_type ) {
812
- if ( !empty( $_REQUEST[$item_type . '_id'] ) ) {
813
- $view_id = $_REQUEST[$item_type . '_id'];
814
- }
815
- }*/
816
- $current_item = $this->current_item;
817
- $view_id = $current_item ? $current_item->ID : 0;
818
- return apply_filters( 'learn_press_is_current_course_item', $view_id == $item_id, $item_id, $view_id, $this->id );
819
- }
820
-
821
- /**
822
- * Check if the course has 'feature'
823
- * This function call to a function with prefix 'has'
824
- *
825
- * @param string
826
- *
827
- * @return mixed
828
- * @throws Exception
829
- */
830
- public function has( $tag ) {
831
- $args = func_get_args();
832
- unset( $args[0] );
833
- $method = 'has_' . preg_replace( '!-!', '_', $tag );
834
- $callback = array( $this, $method );
835
- if ( is_callable( $callback ) ) {
836
- return call_user_func_array( $callback, $args );
837
- } else {
838
- throw new Exception( sprintf( __( 'The function %s doesn\'t exists', 'learnpress' ), $tag ) );
839
- }
840
- }
841
-
842
- /**
843
- * @param string
844
- *
845
- * @return mixed
846
- * @throws Exception
847
- */
848
- public function is( $tag ) {
849
- $args = func_get_args();
850
- unset( $args[0] );
851
- $method = 'is_' . preg_replace( '!-!', '_', $tag );
852
- $callback = array( $this, $method );
853
- if ( is_callable( $callback ) ) {
854
- return call_user_func_array( $callback, $args );
855
- } else {
856
- throw new Exception( sprintf( __( 'The function %s doesn\'t exists', 'learnpress' ), $tag ) );
857
- }
858
- }
859
-
860
- /**
861
- * Return true if this course can be purchaseable
862
- *
863
- * @return mixed
864
- */
865
- public function is_purchasable() {
866
- // TODO: needs to check more criteria, currently only check if this course is required enrollment
867
- $is_purchasable = $this->is_required_enroll() && $this->post->post_status == 'publish';
868
- if ( $is_purchasable ) {
869
- $max_allowed = $this->max_students;
870
- if ( $max_allowed > 0 ) {
871
- $count_in_order = $this->count_in_order( array( 'completed', 'processing' ) );
872
- $is_purchasable = $is_purchasable && ( $count_in_order < $max_allowed );
873
- }
874
- }
875
- return apply_filters( 'learn_press_item_is_purchasable', $is_purchasable, $this->id );
876
- }
877
-
878
- public function count_in_order( $statuses = 'completed' ) {
879
- global $wpdb;
880
- settype( $statuses, 'array' );
881
- foreach ( $statuses as $k => $v ) {
882
- if ( !preg_match( '/^lp-/', $v ) ) {
883
- $statuses[$k] = 'lp-' . $v;
884
- }
885
- }
886
- $in_clause = join( ',', array_fill( 0, sizeof( $statuses ), '%s' ) );
887
- $query = $wpdb->prepare( "
888
- SELECT count(oim.meta_id)
889
- FROM {$wpdb->learnpress_order_itemmeta} oim
890
- INNER JOIN {$wpdb->learnpress_order_items} oi ON oi.order_item_id = oim.learnpress_order_item_id
891
- AND oim.meta_key = %s
892
- AND oim.meta_value = %d
893
- INNER JOIN {$wpdb->posts} o ON o.ID = oi.order_id
894
- WHERE o.post_type = %s
895
- AND o.post_status IN ($in_clause)
896
- ", array_merge( array( '_course_id', $this->id, 'lp_order' ), $statuses ) );
897
- return $wpdb->get_var( $query );
898
- }
899
-
900
- public function need_payment() {
901
- return $this->payment == 'yes';
902
- }
903
-
904
- public function has_item( $item_id ) {
905
- static $items = array();
906
- if ( empty( $items[$this->id] ) ) {
907
- $items[$this->id] = $this->get_curriculum_items( array( 'field' => 'ID'/*, 'force' => true */ ) );
908
- }
909
-
910
- return in_array( $item_id, (array) $items[$this->id] );
911
- }
912
-
913
- public function can_view_item( $item_id ) {
914
- switch ( get_post_type() ) {
915
- case LP_QUIZ_CPT:
916
- }
917
- }
918
-
919
- public function get_item( $thing = '' ) {
920
- $return = false;
921
- $curriculum = $this->get_curriculum_items();
922
- if ( !$curriculum ) {
923
- return $return;
924
- }
925
- if ( !$thing ) {
926
- return $return;
927
- }