mirror of
https://github.com/moodle/moodle.git
synced 2025-07-06 15:06:04 +02:00
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place. The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling the same (barely) modified ajax script. The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort" mform element at the same time. The webservice for searching for users was taken from the original ajax script.
1 line
577 B
JavaScript
1 line
577 B
JavaScript
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)}}}); |