Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/form-course-selector.min.js |
define ("core/form-course-selector",["core/ajax","jquery"],function(a,b){return{processResults:function processResults(a,c){var d=[],e=0,f=(b(a).data("exclude")+"").split(",");for(e=0;e<c.courses.length;e++){if(-1===f.indexOf(c.courses[e].id+"")){d.push({value:c.courses[e].id,label:c.courses[e].displayname})}}return d},transport:function transport(c,d,e,f){var g=b(c),h=g.data("requiredcapabilities");if(""!==h.trim()){h=h.split(",")}else{h=[]}var i=g.data("limittoenrolled"),j=g.data("includefrontpage"),k=g.data("onlywithcompletion"),l=null;if("undefined"==typeof d){d=""}var m={criterianame:"search",criteriavalue:d,page:0,perpage:100,requiredcapabilities:h,limittoenrolled:i,onlywithcompletion:k},n=[{methodname:"core_course_search_courses",args:m}];if(j){n.push({methodname:"core_course_get_courses",args:{options:{ids:[j]}}})}l=a.call(n);b.when.apply(b.when,l).done(function(a,b){if(b&&1==b.length){var c=b.pop(),f=""===d||-1<c.fullname.toUpperCase().indexOf(d.toUpperCase())||-1<c.shortname.toUpperCase().indexOf(d.toUpperCase());if(f){a.courses.splice(0,0,c)}}e(a)}).fail(f)}}}); //# sourceMappingURL=form-course-selector.min.js.map