You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
577 B

define(["core/ajax","jquery"],function(a,b){return{processResults:function(a,c){var d=[],e=0,f=String(b(a).data("exclude")).split(",");for(e=0;e<c.cohorts.length;e++)f.indexOf(String(c.cohorts[e].id))===-1&&d.push({value:c.cohorts[e].id,label:c.cohorts[e].name});return d},transport:function(c,d,e,f){var g=b(c),h=null;"undefined"==typeof d&&(d="");var i=g.data("contextid"),j={query:d,includes:"parents",limitfrom:0,limitnum:100,context:{contextid:i}},k=[{methodname:"core_cohort_search_cohorts",args:j}];h=a.call(k),b.when.apply(b.when,h).done(function(a){e(a)}).fail(f)}}});