芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/enrol/manual/amd/build/form-potential-user-selector.min.js
define(["jquery","core/ajax","core/templates","core/str"],function(a,b,c,d){return{processResults:function(b,c){var d=[];return a.isArray(c)?(a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d):c},transport:function(e,f,g,h){var i,j=a(e).attr("courseid"),k=a(e).attr("userfields").split(",");"undefined"==typeof j&&(j="1");var l=a(e).attr("enrolid");"undefined"==typeof l&&(l="");var m=parseInt(a(e).attr("perpage"));isNaN(m)&&(m=100),i=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:j,enrolid:l,search:f,searchanywhere:!0,page:0,perpage:m+1}}]),i[0].then(function(b){var e=[],f=0;return b.length<=m?(a.each(b,function(b,d){var f=d,g=[];a.each(k,function(a,b){"undefined"!=typeof d[b]&&""!==d[b]&&(f.hasidentity=!0,g.push(d[b]))}),f.identity=g.join(", "),e.push(c.render("enrol_manual/form-user-selector-suggestion",f))}),a.when.apply(a.when,e).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[f],f++}),g(b)})):d.get_string("toomanyuserstoshow","core",">"+m).then(function(a){g(a)})}).fail(h)}}});